2012-03-23-partition-backup-without-correct-partition-table

2012-03-23-partition-backup-without-correct-partition-table

Created Thursday 28 June 2012

partition backup without correct partition table Posted on March 23, 2012 by Thomas| Comments Off

The real reason about PCBSD backup fail is identify incorrect bsd table from kernel. We use disktype and losetup to build a loop device and use partclone.ufs backup it. We are plain to fix this issue later…

我們之前測試過 FreeBSD9, PCBSD9 目前預設是 UFS SU+J 的 partition, Partclone 都有支援,前提是 kernel 讀的到 “磁區”。

用 Clonezilla testing version (1.2.12-33) 可以備份還原 FreeBSD9。 但是一樣的版本無法處理PCBSD,主要是: [ 3.785024] sda: sda1 [ 3.785026] sda1: bsd:bad subpartition – ignored [ 3.785027] sda5 sda6 sda7 > 所以無法辨識。

目前找到以用disktype /dev/sda | grep from Partition 1: 19.99 GiB (21466948608 bytes, 41927634 sectors from 2016) Partition a: 1.953 GiB (2097152000 bytes, 4096000 sectors from 0) Partition b: 1.953 GiB (2097152000 bytes, 4096000 sectors from 4096000 Partition c: 19.99 GiB (21466948608 bytes, 41927634 sectors from 0) Partition d: 2 GiB (2147483648 bytes, 4194304 sectors from 8192000) Partition e: 14.09 GiB (15125160960 bytes, 29541330 sectors from 12386304)

一般bsd disk layout: a 是 / (sda1), b 是 swap (sda5), c 是整顆硬碟 (sda); 之後是使用者自行新增的partition. d 是 /usr (sda6), e /var (sda7)…以此類推

然後用 losetup -r -o \$((8192000*512)) –sizelimit \$((29541330*512)) /dev/loop1 /dev/sda1 (\< --注意是sda1..) 製作出一個loop磁區讓partclone備份 partclone.ufs -d -c -s /dev/loop1 -o-

下禮拜如果有時間應該要修正 partprobe or kernel 的 CONFIG_BSD_DISKLABEL=y 讓 kernel 可以支援PCBSD...

Comments