Jump to content
Forums in Read-Only Mode - Please use Reddit ×
  • 0

ZFS Mountpoints


erikr

Question

Hi,

I have been using btrfs on my rootfs for quite a while and one of the ways I am using it is that I always do upgrades in a snapshot of root and when upgrade is done I use that as new root. In btrfs this is very simple.

I have my root in /mnt/btrfs/root

I make the snapshot as /mnt/btrfs/root-upgrade, I chroot into this an perform the upgrade.

When I am done I simple rename the dirs;

mv root root-fallback

mv root-upgrade root

Nothing is changes on my system and as mount with -o subvol=root applies to the subvolume named root at the specific point in time when mount runs I will simply enter the upgraded system.

 

Question is; can I do something similar in zfs?

Is there a way to make zfs use another name or mountpoint next time I boot but not directly?

 

Regards,

Erik

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Supported boot parameters

  • rollback=<on|yes|1> Do a rollback of specified snapshot.
  • zfs_debug=<on|yes|1> Debug the initrd script
  • zfs_force=<on|yes|1> Force importing the pool. Should not be necessary.
  • zfs=<off|no|0> Don't try to import ANY pool, mount ANY filesystem or even load the module.
  • rpool=<pool> Use this pool for root pool.
  • bootfs=<pool>/<dataset> Use this dataset for root filesystem.
  • root=<pool>/<dataset> Use this dataset for root filesystem.
  • root=ZFS=<pool>/<dataset> Use this dataset for root filesystem.
  • root=zfs:<pool>/<dataset> Use this dataset for root filesystem.
  • root=zfs:AUTO Try to detect both pool and rootfs

In all these cases, <dataset> could also be <dataset>@<snapshot>.

Booting from snapshot:

Enter the snapshot for the root= parameter like in this example:

linux   /ROOT/funtoo-1@/boot/vmlinuz root=ZFS=rpool/ROOT/funtoo-1@some_snapshot ro boot=zfs $bootfs quiet

This will clone the snapshot rpool/ROOT/funtoo-1@some_snapshot into the filesystem rpool/ROOT/funtoo-1_some_snapshot and use that as root filesystem. The original filesystem and snapshot is left alone in this case.

 

Link to comment
Share on other sites

  • 0

A bite late but thanx! New server (the one with ECC) installed, just booted into ZFS for the first time using this post. It solves quite a few hesitations I used to have :)

 

Boot args I use is;

root=ZFS=rootpool/funtoo/root ro boot=zfs  net.ifnames=0

 

I prefer not to import all pools at boot time, if the pool contains an exported FS it must be imported  after networking and nsf is started or it fails to share correctly (or rather; this used to be a problem). As of now this is only the server. Pools is to created tomorrow, 8TB is to moved to backup before it is restored into a new 4*4TB disk that most likely will be a 5 or 6 *4TB disk with raidz2.

 

 

 

 

 

 

Link to comment
Share on other sites

×
×
  • Create New...