MBR パーティションから GPT パーティションに dump | restore を使わずにコピーする方法。
どちらもパーティション単位で dd if of すれば良い。
% gpart show ada2 ada2s1 ada3
=> 63 10485697 ada2 MBR (5.0G)
63 10485657 1 freebsd [active] (5.0G)
10485720 40 - free - (20K)
=> 0 10485657 ada2s1 BSD (5.0G)
0 16 - free - (8.0K)
16 10485641 4 freebsd-ufs (5.0G)
=> 40 16777136 ada3 GPT (8.0G)
40 16777136 1 freebsd-ufs (8.0G)
% gpart show -lp ada2 ada2s1 ada3
=> 63 10485697 ada2 MBR (5.0G)
63 10485657 ada2s1 (null) [active] (5.0G)
10485720 40 - free - (20K)
=> 0 10485657 ada2s1 BSD (5.0G)
0 16 - free - (8.0K)
16 10485641 ada2s1d (null) (5.0G)
=> 40 16777136 ada3 GPT (8.0G)
40 16777136 ada3p1 (null) (8.0G)
% sudo mount -v /dev/ada2s1d /mnt
/dev/ada2s1d on /mnt (ufs, local, writes: sync 2 async 0, reads: sync 3 async 0, fsid a1f99c5d0a3d3046)
% df /mnt
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/ada2s1d 5061568 28072 4628572 1% /mnt
% ll /mnt
total 28076
drwxrwxrwx 3 root wheel - 512 10月 9 06:04 ./
drwxr-xr-x 23 root wheel - 512 10月 8 23:22 ../
drwxrwxr-x 2 root operator - 512 10月 9 06:03 .snap/
-rwxr--r-- 1 griffon wheel - 22475540 10月 9 06:04 kabe-gami.zip*
-rwxr--r-- 1 griffon wheel - 6183181 10月 9 06:04 mikofuku_dd-dy_manual.pdf*
% sudo umount -v /mnt
/dev/ada2s1d: unmount from /mnt
% sudo dd if=/dev/ada2s1d of=/dev/ada3p1 bs=2M
2559+1 records in
2559+1 records out
5368648192 bytes transferred in 2.444914 secs (2195842973 bytes/sec)
% gpart show ada2 ada2s1 ada3
=> 63 10485697 ada2 MBR (5.0G)
63 10485657 1 freebsd [active] (5.0G)
10485720 40 - free - (20K)
=> 0 10485657 ada2s1 BSD (5.0G)
0 16 - free - (8.0K)
16 10485641 4 freebsd-ufs (5.0G)
=> 40 16777136 ada3 GPT (8.0G)
40 16777136 1 freebsd-ufs (8.0G)
% sudo mount -v /dev/ada3p1 /mnt
/dev/ada3p1 on /mnt (ufs, local, writes: sync 2 async 0, reads: sync 3 async 0, fsid a1f99c5d0a3d3046)
% df /mnt
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/ada3p1 5061568 28072 4628572 1% /mnt
% ll /mnt
total 28076
drwxrwxrwx 3 root wheel - 512 10月 9 06:04 ./
drwxr-xr-x 23 root wheel - 512 10月 8 23:22 ../
drwxrwxr-x 2 root operator - 512 10月 9 06:03 .snap/
-rwxr--r-- 1 griffon wheel - 22475540 10月 9 06:04 kabe-gami.zip*
-rwxr--r-- 1 griffon wheel - 6183181 10月 9 06:04 mikofuku_dd-dy_manual.pdf*
% sudo umount -v /mnt
/dev/ada3p1: unmount from /mnt
5GB の MBR パーティションを 8GB の GPT パーティションにコピーしたら 5GB になっちゃったので広げましょう。
パーティション情報的には大きくなってるので growfs だけで事足りる
% gpart show ada3
=> 40 16777136 ada3 GPT (8.0G)
40 16777136 1 freebsd-ufs (8.0G)
% sudo growfs -N /dev/ada3p1
super-block backups (for fsck_ffs -b #) at:
11542656, 12825152, 14107648, 15390144, 16672640
% sudo growfs /dev/ada3p1
It's strongly recommended to make a backup before growing the file system.
OK to grow filesystem on /dev/ada3p1 from 5.0GB to 8.0GB? [yes/no] yes
super-block backups (for fsck_ffs -b #) at:
11542656, 12825152, 14107648, 15390144, 16672640
% sudo mount -v /dev/ada3p1 /mnt
/dev/ada3p1 on /mnt (ufs, local, writes: sync 2 async 0, reads: sync 3 async 0, fsid a1f99c5d0a3d3046)
% df /mnt
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/ada3p1 8106676 28072 7430072 0% /mnt
% ll /mnt
total 28076
drwxrwxrwx 3 root wheel - 512 10月 9 06:04 ./
drwxr-xr-x 23 root wheel - 512 10月 8 23:22 ../
drwxrwxr-x 2 root operator - 512 10月 9 06:03 .snap/
-rwxr--r-- 1 griffon wheel - 22475540 10月 9 06:04 kabe-gami.zip*
-rwxr--r-- 1 griffon wheel - 6183181 10月 9 06:04 mikofuku_dd-dy_manual.pdf*
% sudo umount -v /mnt
/dev/ada3p1: unmount from /mnt
└ G兄
└ G兄
└ G兄
└ G兄
└ G兄
└ G兄
└ G兄
└ G兄
└ 山銀
└ G兄