本帖最后由 18610905088 于 2020-3-29 22:47 编辑
http://anionix.ddns.net/WDMyCloud/WDMyCloud-Gen2/Debian/Dev/
https://www.jianshu.com/p/26b66871e841
刷debian的方法
- <pre class="line-numbers language-sh" style="box-sizing: border-box; font-size: 12px; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; margin-bottom: 20px; overflow: scroll auto; overflow-wrap: normal; word-break: break-all; overscroll-behavior-x: contain; border-radius: 4px; z-index: 0; padding: 1em 1em 1em 3.8em; line-height: 1.5; color: rgb(204, 204, 204); background: rgb(45, 45, 45); tab-size: 4; hyphens: none; position: relative; counter-reset: linenumber 0;"><code class="sh language-sh" style="box-sizing: border-box; font-size: 1em; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; border: none; vertical-align: unset; white-space: inherit; color: inherit; background: none transparent; word-spacing: normal; word-break: normal; overflow-wrap: normal; line-height: 1.5; tab-size: 4; hyphens: none; position: relative;">======= 把硬盘分成三个分区 ========
- /dev/sda1 - Swap 交换分区
- /dev/sda2 - User data 用户数据
- /dev/sda3 - Rootfs/Boot (Important for bootloader) 系统文件和启动分区
- ======= 正常步骤(用telnet刷系统) =======
- # 在控制面板的“网络”那里开启ssh访问,然后命令行访问MyCloud
- # Windows下的ssh客户端
- ssh sshd@你的MyCloud_IP
- # 在MAC终端
- ssh -oHostKeyAlgorithms=+ssh-dss sshd@你的MyCloud_IP
- # 将uImage, uRamdisk和jessie-rootfs.tar.gz放进/boot/boot里。
- # 重启MyCloud
- # 通过telnet链接MyCloud (telnet的ip和原ssh的ip不一样,可在路由器上查看)
- telnet your_device_telnet_ip
- # 使用parted命令重新分区
- # 删除分区124567留下分区3,新建1G的分区1
- parted /dev/sda
- rm 1
- rm 2
- rm 4
- rm 5
- rm 6
- rm 7
- mkpart primary 0% 1G
- # 退出parted
- q
- # 将分区1 格式化为ext4格式
- mkfs.ext4 /dev/sda1
- # 把分区3 /boot/boot里的三个文件,复制到分区1里)
- mkdir -p /mnt/root /mnt/data
- mount /dev/sda1 /mnt/data
- mount /dev/sda3 /mnt/root
- cp /mnt/root/boot/uImage /mnt/data/
- cp /mnt/root/boot/uRamdisk /mnt/data/
- cp /mnt/root/boot/jessie-rootfs.tar.gz /mnt/data/
- umount /mnt/root
- # 删除原分区3,建立新的分区2和分区3
- parted /dev/sda
- rm 3
- mkpart primary 4G 100%
- mkpart primary 1G 4G
- q
- mkfs.ext4 /dev/sda2
- mkfs.ext4 /dev/sda3
- # 把分区1里的3个文件解压并复制回分区3,
- mount /dev/sda3 /mnt/root
- tar xvf /mnt/data/jessie-rootfs.tar.gz -C /mnt/root
- mkdir -p /mnt/root/boot
- cp /mnt/data/uImage /mnt/root/boot/uImage
- cp /mnt/data/uRamdisk /mnt/root/boot/uRamdisk
- umount /mnt/root
- # 把分区1格式化成swap
- umount /mnt/data
- mkswap /dev/sda1
- # 重启完成Debian8安装
- sync
- reboot -f
- # ssh进入Debian8 初始密码是 mycloud
- ssh root@your_device_ip
- ======= 非正常步骤(救砖并刷debian8)=======
- # 把硬盘拆出来安装到另一台linux电脑上,并安装parted
- # centos下
- yum install parted
- # debian/Ubuntu下
- apt-get install parted
- # 查看硬盘及分区情况
- parted -l
- # 进入parted分区,注意/dev/sdb改成你 parted -l 看到的那个
- parted /dev/sdb
- mklabel gpt
- # 删掉所有分区
- rm 1
- rm 2
- rm 3
- rm 4
- rm 5
- rm 6
- rm 7
- # 建立大小为1G的分区1
- mkpart primary 0% 1G
- # 建立大小为剩余空间大小的的分区2
- mkpart primary 4G 100%
- # 建立大小为3G的分区3
- mkpart primary 1G 4G
- q
- # 格式化
- mkswap /dev/sdb1
- mkfs.ext4 /dev/sdb2
- mkfs.ext4 /dev/sdb3
- # 上传文件,把三个文件解压复制到分区3
- mkdir /mnt/root
- mount /dev/sdb3 /mnt/root
- mkdir /mnt/root/boot
- tar xvf jessie-rootfs.tar.gz -C /mnt/root
- cp uImage /mnt/root/boot/uImage
- cp uRamdisk /mnt/root/boot/uRamdisk
- # 重启完成Debian8安装
- sync
- reboot -f</code></pre>
复制代码
升级下内核就能升级到最新版了。
老毛子的原文:
Source of _Update_Kernel_and_os_EN.txt:
# Download latest kernel and install:
wget http://fox-exe.ru/WDMyCloud/WDMyCloud-Gen2/Debian/Dev/Debian-kernel-bin_4.15.0-rc6.tar.gz
tar xvf Debian-kernel-bin_4.15.0-rc6.tar.gz -C /
# Cleanup:
# Remove old network controller records:
rm /etc/udev/rules.d/70-persistent-net.rules
# Remove all "ipv6" records (lines of code) from /etc/network/interfaces
sed '/ipv6/d' /etc/network/interfaces -i
sed '/inet6/d' /etc/network/interfaces -i
# Reboot
sync && reboot
# Remove old kernel modules:
rm -r /lib/modules/3.10.70+
###############################
# OS upgrade (Wheezy or Jessie to latest stable release (Stretch))
# Replace apt repository:
cat << EOF > /etc/apt/sources.list
deb http://deb.debian.org/debian stable main contrib non-free
deb-src http://deb.debian.org/debian stable main contrib non-free
deb http://deb.debian.org/debian stable-updates main contrib non-free
deb-src http://deb.debian.org/debian stable-updates main contrib non-free
deb http://security.debian.org/ stable/updates main contrib non-free
deb-src http://security.debian.org/ stable/updates main contrib non-free
EOF
# Do upgrade packages/software/system:
apt update
apt upgrade
apt dist-upgrade
|
|