Virtualbox is version 6.1
On the guest I add a new hard drive, copy the partition table over then the device name changes on rpool?!
Code: Select all
root@zen:~# zpool status -L rpool
pool: rpool
state: ONLINE
scan: scrub repaired 0B in 0 days 00:01:50 with 0 errors on Sun Oct 8 00:25:51 2023
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
sda7 ONLINE 0 0 0
errors: No known data errors
root@zen:~# lsblk | grep sd
sda 8:0 0 250G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
├─sda2 8:2 0 1K 0 part
├─sda5 8:5 0 2G 0 part [SWAP]
├─sda6 8:6 0 2G 0 part
└─sda7 8:7 0 245.5G 0 part
sdb 8:16 0 250G 0 disk
root@zen:~# sfdisk -d /dev/sda | sfdisk --force /dev/sdb
Checking that no-one is using this disk right now ... OK
Disk /dev/sdb: 250 GiB, 268435456000 bytes, 524288000 sectors
Disk model: VBOX HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Created a new DOS disklabel with disk identifier 0xc2aba028.
/dev/sdb1: Created a new partition 1 of type 'W95 FAT32' and of size 512 MiB.
/dev/sdb2: Created a new partition 2 of type 'Extended' and of size 249.5 GiB.
/dev/sdb3: Created a new partition 5 of type 'Linux swap / Solaris' and of size 2 GiB.
/dev/sdb6: Created a new partition 6 of type 'FreeBSD' and of size 2 GiB.
/dev/sdb7: Created a new partition 7 of type 'FreeBSD' and of size 245.5 GiB.
/dev/sdb8: Done.
New situation:
Disklabel type: dos
Disk identifier: 0xc2aba028
Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 1050623 1048576 512M b W95 FAT32
/dev/sdb2 1052670 524285951 523233282 249.5G 5 Extended
/dev/sdb5 1054720 5249023 4194304 2G 82 Linux swap / Solaris
/dev/sdb6 5251072 9445375 4194304 2G a5 FreeBSD
/dev/sdb7 9447424 524285951 514838528 245.5G a5 FreeBSD
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
root@zen:~# zpool status -L rpool
pool: rpool
state: ONLINE
scan: scrub repaired 0B in 0 days 00:01:50 with 0 errors on Sun Oct 8 00:25:51 2023
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
sdb7 ONLINE 0 0 0
errors: No known data errors
Code: Select all
root@zen:~# zpool attach rpool /dev/sda /dev/sdb
cannot attach /dev/sdb to /dev/sda: no such device in pool
root@zen:~# zpool attach rpool /dev/sdb /dev/sda
/dev/sda is in use and contains a unknown filesystem.