まずはパーティションの確認。
% fdisk -l /dev/sda Disk /dev/sda: 40.0 GB, 40007761920 bytes 255 heads, 63 sectors/track, 4864 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xcccdcccd Device Boot Start End Blocks Id System /dev/sda1 * 1 1912 15354328+ 7 HPFS/NTFS Partition 1 does not end on cylinder boundary. /dev/sda2 1913 3187 10241436 7 HPFS/NTFS Partition 2 does not end on cylinder boundary. /dev/sda3 3188 4224 8329702+ 5 Extended /dev/sda4 4225 4864 5133240 b W95 FAT32 Partition 4 does not end on cylinder boundary. /dev/sda5 * 3188 4174 7928046 83 Linux /dev/sda6 4175 4224 401593+ 82 Linux swap / Solaris
あらかじめrootになった状態で以下のように入力。これでpartimageが走る。-dと-bがないといろいろ聞かれる。すべてのパーティションで同じことをやる。下は/dev/sda4の例。
% partimage -b -d -z1 save /dev/sda4 /mnt/****************/sda4.img.gz ┌───────────────────────┤ save partition to image file ├───────────────────────┐ │ Partition to save:.........../dev/sda4 │ │ Size of the Partition:.......4.90 GiB = 5256437760 bytes │ │ Current image file:........../mnt/***************2/sda4.img.gz.001 │ │ Image file size:.............730.93 MiB │ │ Available space for image:...509.95 GiB = 547552493568 bytes │ │ Detected file system:........fat32 │ │ Compression level:...........gzip │ │ │ │ │ │ Time elapsed:................19m:48sec │ │ Estimated time remaining:....12m:46sec │ │ Speed:.......................140.45 MiB/min │ │ Data copied:.................2.72 GiB / 4.47 GiB │ │ │ │ │ │ │ │ │ │ │ │ 60% 60 % │ │ │ └──────────────────────────────────────────────────────────────────────────────┘ copying used data blocks [* to cancel, CtrlS to pause, CtrlQ to resume]
sfdiskでパーティションテーブルをダンプする。
% sfdisk -d /dev/sda # partition table of /dev/sda unit: sectors /dev/sda1 : start= 63, size= 30708657, Id= 7, bootable /dev/sda2 : start= 30716280, size= 20482872, Id= 7 /dev/sda3 : start= 51199155, size= 16659405, Id= 5 /dev/sda4 : start= 67873680, size= 10266480, Id= b /dev/sda5 : start= 51199218, size= 15856092, Id=83, bootable /dev/sda6 : start= 67055373, size= 803187, Id=82 % sfdisk -d /dev/sda > /mnt/****************/sda.sfdisk
ddでMBRをバックアップ。
% dd if=/dev/sda of=/mnt/****************/mbr.dd bs=512 count=1 1+0 records in 1+0 records out 512 bytes (512 B) copied, 0.00198265 s, 258 kB/s