I'm currently in the process of creating a new zpool (RAIDz1) and want to copy my current pool's data over as simply as possible. I'm not worried about downtime, so during the copy process I'm fine with any services being offline. I'd appreciate any input or suggestions on how best to do this.
My planned process:
1) Create my new zpool using 4x3TB with Advanced Format drives (512k logical sectors, 4096k physical) and using /dev/disk/by-id names:
2) Set compression on the pool - worthwhile even if the majority of my data is MKV movies?
EDIT: Switching to lz4 compression instead of the default lzjb
3) Set SMB and NFS sharing on the pool - sharing all downstream filesystems is desired
4) Now create my filesystems for media files, user data, and virtual machines that will inherit the above set properties:
EDIT: Instead of creating the filesystem, just take a snapshot. Filesystem will be imported in the next step anyway
5) Finally, send my ZFS data from my old pool to my new pool.
EDIT: Added in an "mbuffer" during the large media filesystem transfer. The 1G cache seems to help performance a little bit. However, the newpool can write data just about as fast as I can send it. But, I do see the cache filling up at times with what I assume are smaller files or ones that are being compressed on writing to the newpool:
EDIT: 6) After the large media snapshot move, I'll take another snapshot and do an incremental send/receive to update anything that's changed in the ~8 hours it takes to move the snapshot over:
7) Once the data transfer(s) are complete, I would just need to update my services/applications to point to the new pool? Or, could I do a ZFS rename function after unmounting/destroying my old pool and removing the drives?
EDIT: Plan to switch this to just swapping mountpoints between pools.
8) Now I just restart my services and all is good to go!
If it makes a difference, I'm running Ubuntu 12.04.
My planned process:
1) Create my new zpool using 4x3TB with Advanced Format drives (512k logical sectors, 4096k physical) and using /dev/disk/by-id names:
Code:
sudo zpool create -o ashift=12 newpool raidz1 ata-TOSHIBA_SN1 ata-TOSHIBA-SN2 ata-TOSHIBA-SN3 ata-TOSHIBA-SN4
2) Set compression on the pool - worthwhile even if the majority of my data is MKV movies?
EDIT: Switching to lz4 compression instead of the default lzjb
Code:
zfs set compression=on newpool
[B]EDIT: [/B]zfs set compression=lz4 newpool
3) Set SMB and NFS sharing on the pool - sharing all downstream filesystems is desired
Code:
zfs set sharesmb=on newpool
zfs set sharenfs=on newpool
4) Now create my filesystems for media files, user data, and virtual machines that will inherit the above set properties:
EDIT: Instead of creating the filesystem, just take a snapshot. Filesystem will be imported in the next step anyway
Code:
zfs snapshot oldpool/media@snap1
zfs snapshot oldpool/usr@snap1
zfs snapshot oldpool/vm@snap1
[B]EDIT - For a recursive snapshot: [/B]zfs snapshot -r oldpool/user@snap1
5) Finally, send my ZFS data from my old pool to my new pool.
EDIT: Added in an "mbuffer" during the large media filesystem transfer. The 1G cache seems to help performance a little bit. However, the newpool can write data just about as fast as I can send it. But, I do see the cache filling up at times with what I assume are smaller files or ones that are being compressed on writing to the newpool:
Code:
zfs send oldpool/media@snap1 | zfs receive newpool/media
[B]EDIT: [/B]zfs send -v oldpool/media@snap1 | mbuffer -s 128k -m 1G -o - | zfs receive -v newpool/media
zfs send oldpool/usr@snap1 | zfs receive newpool/usr
[B]EDIT: [/B]zfs send -R oldpool/usr@snap1 | zfs receive -e newpool
zfs send oldpool/vm@snap1 | zfs receive newpool/vm
EDIT: 6) After the large media snapshot move, I'll take another snapshot and do an incremental send/receive to update anything that's changed in the ~8 hours it takes to move the snapshot over:
Code:
Stopping services: service sabnzbdplus stop, service couchpotato stop, service sickbeard stop, service smbd stop
zfs unmount oldpool/media
zfs snapshot oldpool/media@snap2
zfs send -i oldpool/media@snap1 oldpool/media@snap2 | zfs receive newpool/media
7) Once the data transfer(s) are complete, I would just need to update my services/applications to point to the new pool? Or, could I do a ZFS rename function after unmounting/destroying my old pool and removing the drives?
EDIT: Plan to switch this to just swapping mountpoints between pools.
Code:
zpool destroy -f oldpool
zpool export newpool
zpool import newpool oldpool
[B]EDIT: [/B] Changing mountpoints instead of export/import and then delete the snapshots....
zfs set mountpoint=/poolToRemove oldpool
zfs set mountpoint=/oldpool newpool
zfs destroy -r oldpool@snap1
zfs destroy -r oldpool@snap2
Verify all snapshots are deleted: zfs list -r -t snapshot -o name,creation oldpool
8) Now I just restart my services and all is good to go!
If it makes a difference, I'm running Ubuntu 12.04.
Last edited: