一、準備工作:
1、原安裝U盤擴容:armbian-tf 命令或者用windows下DiskGenius-Pro工具,保證有足夠備份系統(tǒng)的空間,并保證正常啟動。
2、機頂盒內(nèi)裝的armbian(eMMC)正常啟動,root賬戶登入,輸入命令:
cd /boot ----進入boot目錄
ls ----查看boot目錄下文件,應該有 boot.scr
mv boot.scr boot.scr.bak ----將boot.scr改名為boot.scr.bak,重啟時機器不能從eMMC啟動了。
此時不要重啟,不要關機?。。?!
二、備份機頂盒內(nèi)部系統(tǒng)
插上擴容的原安裝U盤,reboot ,機器從U盤啟動。
root賬戶登入,輸入命令:fdisk -l
屏幕顯示:
《第一段》
root@armbian:~# fdisk -l
Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
《第二段》
Disk /dev/ram1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
《第三段》
Disk /dev/ram2: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
《第四段》
Disk /dev/ram3: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
《第五段》
Disk /dev/mmcblk2: 7.22 GiB, 7755268096 bytes, 15147008 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
《第六段》
Device Boot Start End Sectors Size Id Type
/dev/mmcblk2p1 239616 761855 522240 255M c W95 FAT32 (LBA)
/dev/mmcblk2p2 763904 15147007 14383104 6.9G 83 Linux
《第七段》
Disk /dev/mmcblk2boot0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
《第八段》
Disk /dev/mmcblk2boot1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
《第九段》
Disk /dev/sda: 3.73 GiB, 4009754624 bytes, 7831552 sectors
Disk model: USB Flash Disk
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x2a96ab5a
《第十段》
Device Boot Start End Sectors Size Id Type
/dev/sda1 8192 530431 522240 255M c W95 FAT32 (LBA)
/dev/sda2 532480 7831551 7299072 3.5G 83 Linux
《第十一段》
Disk /dev/zram0: 974.37 MiB, 1021698048 bytes, 249438 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
《第十二段》
Disk /dev/zram1: 50 MiB, 52428800 bytes, 12800 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
------------------------------------------------------------------------------------
看看第六段:
Device Boot Start End Sectors Size Id Type
/dev/mmcblk2p1 239616 761855 522240 255M c W95 FAT32 (LBA)
/dev/mmcblk2p2 763904 15147007 14383104 6.9G 83 Linux
這就是機頂盒的cMMC,“/dev/mmcblk2p1”是boot分區(qū),而下面《第十段》的 “/dev/sda1”是U盤的boot分區(qū)。
1、root@armbian:~# sudo mkdir /mnt/usb ----在mnt目錄下新建名為usb的目錄
2、root@armbian:~# mount /dev/mmcblk2p1 /mnt/usb ----將mmcblk2p1掛載到usb
3、root@armbian:~# cd /mnt/usb ----進入usb目錄
4、root@armbian:~# /mnt/usb# ls ----查看usb目錄下的文件,應該有前面修改的boot.scr.bak
5、root@armbian:~# /mnt/usb# mv boot.scr.bak boot.scr ----再將boot.scr.bak改回boot.scr
root@armbian:~# ls ----再查看一下是不是改過來了
6、root@armbian:~# cd / ----返回根目錄
7、root@armbian:~# umount /mnt/usb ----卸載已掛載的boot分區(qū)
三、備份命令:armbian-ddbr
1、root@armbian:~# armbian-ddbr
選擇b,開始備份,可能需要7-8分鐘。
2、poweroff 關機。
3、拔出U盤,備份在U盤里面。保存好,便于以后恢復。
|