您好,登錄后才能下訂單哦!
備份MBR、根分區(qū)、Boot分區(qū)
#!/bin/bash
Bak_dir=/mnt #已掛載的移動(dòng)硬盤或其他外設(shè)
Mbr=`fdisk -l |grep "Disk" |awk NR==1'{print $2}' |awk -F"/" '{print $3}'|sed s/://g`
Root=`df |awk '/\//{print $1}' |awk NR==1'{print $1}'`
Boot=`df |awk '/\/boot/{print $1}'`
### Backup MBR
dd if=/dev/$Mbr of=$Bak_dir/mbr.img bs=512 count=1
### Backup Root [/]
dd if=$Root |gzip >$Bak_dir/root.img.gz
### Backup Boot [/boot]
dd if=$Boot |gzip >$Bak_dir/boot.img.gz
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。