一、準(zhǔn)備工作:
1、原安裝U盤(pán)擴(kuò)容:armbian-tf 命令或者用windows下DiskGenius-Pro工具,保證有足夠備份系統(tǒng)的空間,并保證正常啟動(dòng)。
2、機(jī)頂盒內(nèi)裝的armbian(eMMC)正常啟動(dòng),root賬戶(hù)登入,輸入命令:
cd /boot ----進(jìn)入boot目錄
ls ----查看boot目錄下文件,應(yīng)該有 boot.scr
mv boot.scr boot.scr.bak ----將boot.scr改名為boot.scr.bak,重啟時(shí)機(jī)器不能從eMMC啟動(dòng)了。
此時(shí)不要重啟,不要關(guān)機(jī)?。。?!
二、備份機(jī)頂盒內(nèi)部系統(tǒng)
插上擴(kuò)容的原安裝U盤(pán),reboot ,機(jī)器從U盤(pán)啟動(dòng)。
root賬戶(hù)登入,輸入命令: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
這就是機(jī)頂盒的cMMC,“/dev/mmcblk2p1”是boot分區(qū),而下面《第十段》的 “/dev/sda1”是U盤(pán)的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 ----進(jìn)入usb目錄
4、root@armbian:~# /mnt/usb# ls ----查看usb目錄下的文件,應(yīng)該有前面修改的boot.scr.bak
5、root@armbian:~# /mnt/usb# mv boot.scr.bak boot.scr ----再將boot.scr.bak改回boot.scr
root@armbian:~# ls ----再查看一下是不是改過(guò)來(lái)了
6、root@armbian:~# cd / ----返回根目錄
7、root@armbian:~# umount /mnt/usb ----卸載已掛載的boot分區(qū)
三、備份命令:armbian-ddbr
1、root@armbian:~# armbian-ddbr
選擇b,開(kāi)始備份,可能需要7-8分鐘。
2、poweroff 關(guān)機(jī)。
3、拔出U盤(pán),備份在U盤(pán)里面。保存好,便于以后恢復(fù)。
|