View previous topic :: View next topic |
Author |
Message |
tnt Veteran
Joined: 27 Feb 2004 Posts: 1222
|
Posted: Fri Nov 22, 2013 1:12 pm Post subject: ZFS on Linux - right way to upgrade to newer version |
|
|
hello.
right now, I'm using sys-fs/zfs-0.6.2-r2 on my storage system and sys-fs/zfs-0.6.2-r3 become available. root/boot are on ext4.
what should be the right procedure to upgrade to newer zfs version?
1. stop all services (there are many) using zfs pool
2. export pool
3. stop /etc/init.d/zfs service (which will probably unload old modules)
4. check if zfs modules are unloaded and if not unload them manually
5. emerge -u zfs
6. start /etc/init.d/zfs
7. import pool ???
8. start all services needing zfs
do I miss some step here or am I wrong in any other way?
should procedure be similar or even the same with more major upgrade, like from 0.6.2 to 0.6.3 once it becomes available?
thx. _________________ gentoo user |
|
Back to top |
|
|
peje Tux's lil' helper
Joined: 11 Jan 2003 Posts: 100
|
Posted: Fri Nov 22, 2013 5:14 pm Post subject: |
|
|
Normaly I just emerged the newer version and rebootet..
cu Peje |
|
Back to top |
|
|
tnt Veteran
Joined: 27 Feb 2004 Posts: 1222
|
Posted: Sat Nov 23, 2013 1:43 am Post subject: |
|
|
so, the recipe should be:
1. upgrade the packages
2. cross your fingers
3. reboot
?
_________________ gentoo user |
|
Back to top |
|
|
peje Tux's lil' helper
Joined: 11 Jan 2003 Posts: 100
|
Posted: Sat Nov 23, 2013 9:10 am Post subject: |
|
|
Yep that is my receipt (it would be wise to take a snapshot..)
cu Peje |
|
Back to top |
|
|
ryao Retired Dev
Joined: 27 Feb 2012 Posts: 132
|
Posted: Mon Nov 25, 2013 1:56 pm Post subject: |
|
|
All of the ways stated here will work fine when dealing with revision bumps. Since I received a request to make an official comment on the proper way to update, hereere is a generic procedure for doing updates:
- Snapshot your rootfs. This is not strictly necessary, but it is a good practice.
- Emerge the updates
- If ZFS is loaded by your initramfs, rebuild the initramfs.
- Reload the kernel module. If your rootfs is on ZFS, this involves a reboot. Otherwise, you can just stop everything using ZFS datasets, export your pools, modprobe -r zfs, modprobe zfs, import your pools and restart your services.
It is basically what people here already here. Since my rootfs is on ZFS, here are the exact commands that I run on my system:
- zfs destroy rpool/ROOT/gentoo@install
- zfs snapshot rpool/ROOT/gentoo@install
- genkernel ': genkernel all --no-clean --no-mountboot --makeopts=-j12 --zfs --bootloader=grub2 --callback='emerge @module-rebuild'
- kexec -l /boot/kernel-genkernel-x86_64-3.12.0 --initrd=/boot/initramfs-genkernel-x86_64-3.12.0 --append='root=ZFS=rpool/ROOT/gentoo'
- /etc/init.d/xdm stop
- kexec -e
Note that this latter procedure is specific to my system in a few key ways:
- I am using the Nvidia X11 driver, which is able to reinitialize the graphics hardware if X11 is killed before kexec -e is called. Nvidia tells me that this is not supported, but I found that it works (on my system anyway). Nouveau was able to reintialize the graphics hardware regardless before Linux 3.7, but this broke in Linux 3.7. I don't know about other graphics drivers.
- Using kexec in this way is similar to a sudden power loss followed by regaining power. Therefore, this can really mess up most non-ZFS filesystems, including those used in virtual machines. I do not use any non-ZFS filesystems on my system and my virtual machine guests use either ZFS or virtfs, so I can get away with this.
- My rootfs contains both / and /boot. Therefore, a rollback will properly rollback everything that changed.
With that said, the /dev/zfs ioctl API is not stable, so there can be problems when the userland tools and kernel modules are mismatched. This only happens between upstream tags and it is perfectly safe to mix and match ebuild revisions. However, I recommend always running the latest kernel and userland tools that I tag because they contain important fixes. The procedures that I outlined above should both be fine for dealing with /dev/zfs ioctl API changes. |
|
Back to top |
|
|
tnt Veteran
Joined: 27 Feb 2004 Posts: 1222
|
|
Back to top |
|
|
|