Linux: ZFS pool migration – troubleshooting notes – Ubuntu mount on reboot issues
Migrating and existing ZFS pool to a new server
1. Export spool from older server
2. Attach drives
3. Type: zpool import – The drives will be listed with their drive ID’s
First major issue:
In my case I had two ID’s for the two drives that were being mirrored. I could import either one, but importing the wrong one made it so I could no longer see the correct pool. Even after a reboot the second and correct pool was unavailable to even be discovered. I exported the pool and then reconnected the drives to my original server which was Open Indiana. I then ran spool import and was able to see both ID’s I re imported the correct ID and everything was working on the original server.
Apparently I have created the same pool name under both ID’s the main issue was the first ID was version 13 and the second ID was version 28. I exported the working pool imported the non working older pool and ran “zpool upgrade datapoolname 28”. I exported the data pool again and reattached it to the new server. This resolved some strange import errors.
4. spool import 11036020738792080304 -f
I was getting “directory not empty” errors and errors stating that the pools cannot be mounted.
5. Type: zfs get mountpoint – discovered that the SOURCE showed that the mount points were imported
I decided to clean up my mount points by reassigning them
I set the root directory mount point to none since the main volumes are underneath it and I was getting directory not empty errors
6. Type: zfs set mountpoint=none datapoolname
7. Type: ifs set mountpoint=/export/data/directoryname1 datapoolname/directoryname1
8. Type: ifs set mountpoint=/export/data/directoryname1 datapoolname/directoryname2
This change the SOURCE to a LOCAL setting
9. Typed: zfs set sharesmb=on datapoolname – The pools would mount, but I would still get errors and they would not remount on a reboot.
This lead me to my final issue which became getting my zpool to mount on reboot.
After a couple of hours of reading and testing I discovered that a lot of people are having this problem with ZFS on Ubuntu.
10. I ended up modifying the end of /etc/rc.local with the following:
zfs mount -a
Now on reboot the pools are automatically loading.