我转储了磁盘的分区布局,其中:
sfdisk -d /dev/sda > part_table
cat part_table
输出
label: dos
label-id: 0x0004bc49
device: /dev/sda
unit: sectors
/dev/sda1 : start= 2048, size= 131072, type=83
/dev/sda2 : start= 133120, size= 131072, type=83
/dev/sda3 : start= 264192, size= 131072, type=83
/dev/sda4 : start= 395264, size= 234045440, type=5
/dev/sda5 : start= 397312, size= 131072, type=af
/dev/sda6 : start= 530432, size= 131072, type=83
/dev/sda7 : start= 663552, size= 131072, type=83
/dev/sda8 : start= 796672, size= 131072, type=83
/dev/sda9 : start= 929792, size= 131072, type=7
有没有办法将这个分区布局导入到 ramdisk 中?
答案1
您可以使用sfdisk
输出来创建新的分区表
sfdisk /dev/ram <part_table
如果你真的很大胆(或老式),你也可以使用dd
dd if=/dev/sda of=/tmp/sda-mbr.bin bs=512 count=1
dd if=sda-mbr.bin of=/dev/ram0 bs=1 count=64 skip=446 seek=446