2

I am new to ZFS and I am trying to know how it works. I created a pool using several disks named tank. Besides, it seems that a default dataset named after the pool was created. Nevertheless, I do not need/want this default dataset, but I would like to use only other datasets created on the default one:

# zpool status pool: tank state: ONLINE config: NAME STATE READ WRITE CKSUM tank ONLINE 0 0 0 raidz1-0 ONLINE 0 0 0 scsi-35000c5008576aa6b ONLINE 0 0 0 scsi-35000c50057cf7473 ONLINE 0 0 0 scsi-35000c50085f5f207 ONLINE 0 0 0 scsi-35000c50085c22ce3 ONLINE 0 0 0 scsi-35000c50085f5eea3 ONLINE 0 0 0 scsi-35000c5008521b903 ONLINE 0 0 0 scsi-35000c50085c13f57 ONLINE 0 0 0 scsi-35000c50057cf606f ONLINE 0 0 0 scsi-35000c50084989893 ONLINE 0 0 0 scsi-35000c5006367866f ONLINE 0 0 0 scsi-35000c50084269b7b ONLINE 0 0 0 spares scsi-35000c5008576619b AVAIL errors: No known data errors # zfs list NAME USED AVAIL REFER MOUNTPOINT tank 24.8G 17.5T 39.9K /tank tank/baculafull 24.8G 17.5T 24.8G legacy tank/baculainc 38.1K 17.5T 38.1K /srv/bacula/baculainc tank/idera 38.1K 17.5T 38.1K /srv/idera/ 

As you can see, the tank dataset is automatically mounted on /tank. As I am not going to write anything in /tank, I wonder whether it is possible to prevent automounting the root dataset. Should I change the mountpoint to legacy as I did with the tank/baculafull dataset? Is there a better way to do this?

Regards,

1

3 Answers 3

6

Whereas setting root dataset mountpoint to legacy would do the trick, I found that there are better options:

  1. Set mountpoint to none:

    zfs set mountpoint=none tank 
  2. Set canmount to off:

    zfs set canmount=off tank 

Using the second option, you can even set the mountpoint to any value, so that other datasets can inherit it, although the root dataset will not be mounted.

Check these links:

1
  • canmount=noauto is also a good choice if you want to be able to manually mount the dataset. Commented Aug 5, 2021 at 18:32
1

Yes, mounting the root dataset with legacy can be a good option here. Also see this answer.

Basically, mounting with "legacy" means ZFS will not automount, but you can mount afterwards (with fstab or manually), or choose not to.

0

If you never want to mount the pool's default ZFS filesystem:

zpool create -m none ... 

That will create the pool without any mountpoint.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.