I've been trying to decide on a naming convention for my drives in my zroot setup for FreeBSD/ZFS. I've finally settled on a device labeling convention, however I'd like to spare myself the nasty business of re-installing if I could. I was wondering if it were possible to re-label my devices in my zpool.
Currently I have the following:
I want to re-label the gpt/h1slot00-* devices, of which there are:
I'd like the convention headX-slotXX so my results should be:
and
Generally speaking, given I'm using ZFS for my root, I think I can do this (albeit dangerously) while I'm online. I should be able to:
After that, performing a
And finally, what about the boot partitions? Do I just re-label them? I don't see any evidence that they're mounted or in operation. Is this normal?
Thanks for the help
Currently I have the following:
Code:
root@head1:/root # zpool status -v
pool: zroot
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
zroot ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
gpt/h1slot00-root ONLINE 0 0 0
gpt/h1slot01-root ONLINE 0 0 0
errors: No known data errors
I want to re-label the gpt/h1slot00-* devices, of which there are:
Code:
h1slot00-boot
h1slot00-root
h1slot00-swap
h1slot01-boot
h1slot01-root
h1slot01-swap
I'd like the convention headX-slotXX so my results should be:
Code:
head1-slot00-boot
head1-slot00-root
head1-slot00-swap
head1-slot01-boot
head1-slot01-root
head1-slot01-swap
and
Code:
root@head1:/root # zpool status -v
pool: zroot
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
zroot ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
gpt/head1-slot00-root ONLINE 0 0 0
gpt/head1-slot01-root ONLINE 0 0 0
errors: No known data errors
Generally speaking, given I'm using ZFS for my root, I think I can do this (albeit dangerously) while I'm online. I should be able to:
- offline the device:
zpool offline zroot gpt/h1slot00-root
- relabel the partition (which in my case is 1 for boot; 2 for swap, and 3 for the root):
gpart modify -i 3 -l head1-slot00-root daX
- replace the device:
zpool replace zroot /dev/gpt/h1slot00-root /dev/gpt/head1-slot00-root
- Wait for resilvering... and then repeat on the other device.
After that, performing a
swapoff -a
for the h1slot0X-swap removal should allow me to re-label those... and then modify /etc/fstab with the new names, and swapon -a
to restore them.And finally, what about the boot partitions? Do I just re-label them? I don't see any evidence that they're mounted or in operation. Is this normal?
Thanks for the help