Score:0

adding a new hard drive for data under linux with zfs

gb flag

I cannot get my zpool dataset to preserve and mount after reboot

I am sure I am missing something basic, but here goes:

I have Linux (Artix) installed on /dev/sda as ext4. Note: Artix does not use systemd.

I would like to add a data drive using zfs for snapshotting and software RAID.

I am testing my setup in Virtualbox before I commit to hardware (if that matters).

So I have zfs successfully installed

Tested with:

$ zpool status

I create my first pool

# zpool create tank -o ashift-12 /dev/disk/by-id/ata-VBOX_HARDDISK_XXXX

I create some datasets

# zfs create tank/data

Scrub for good measure

# zfs scrub tank

and here is where I am not sure what to do... I think I need to add something to fstab but not sure what?

If I reboot here all is lost.

I can get it back by doing

# zpool import tank

What is the right way to get this set up to auto-mount?

Tom Yan avatar
in flag
Not familiar with ZFS, but up til what you mentioned, it doesn't sound like you are talking about (auto) mounting, but the preparation to "populate" the block device for mounting into the system. In a systemd-distro, usually this is done with udev rules and/or systemd services. (Often upstream / the distro will already have them written to cover usual scenarios, like the case of LVM. You might want to check if the OpenZFS / ZFS-on-Linux project or the downstream package maintainer / provider provides any or suggest any approach.)
in flag
What distro are you using? Does it use systemd? There are units you need to enable/start.
gb flag
@Zoredache A am actually using Artix which does not use systemd. my init system is runit
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.