this post was submitted on 22 Aug 2024
19 points (95.2% liked)

Selfhosted

39964 readers
601 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

Hello, I have had a pool of two hard drives in a mirror pool for some time but the OS got corrupted and I reinstalled the OS. Now I am on Linux Mint and my pool does not appear any more. When I use zpool import it says no pool available to import, I have looked around online and found you can import a zpool by specifying the drives, so I used zpool import -f -d /dev/sda1 -f -d /dev/sdb1 internal I get back my pool

pool: internal state: ONLINE scan: scrub repaired 0B in 00:08:39 with 0 errors on Tue Jun 18 18:38:40 2024 config:

NAME        STATE     READ WRITE CKSUM
internal    ONLINE       0     0     0
  mirror-0  ONLINE       0     0     0
    sdb     ONLINE       0     0     0
    sda     ONLINE       0     0     0

errors: No known data errors

But I am unable to mount the pool, zfs mount internal returns

cannot mount 'internal': legacy mountpoint use mount(8) to mount this filesystem

I tried using mount but I am not having any success, saying mount: internal: can't fin in /etc/fstab.

Is there any chance to get this pool back on the computer or is it a lost cause.

Thank you for the help.

top 8 comments
sorted by: hot top controversial new old
[–] [email protected] 7 points 2 months ago* (last edited 2 months ago)

~~I guess you need to "zpool import -f" because your system has crashed before and did not shutdown properly.~~

After reading again, I understand that your pool is alive and well. It is just not mounted anywhere.

Look into /etc/fstab if you find the correct mountpoint there. Then tell it to your ZFS with "zfs set mountpoint= "

[–] [email protected] 4 points 2 months ago (1 children)

The trick for this one is mount -t zfs -o zfsutil internal /mnt/some/path

Assuming the root dataset is mountable. If you have a -o canmount=off on the dataset it will refuse to mount.

If it's -o mountpoint=legacy then you don't need -o zfsutil, but still need to provide both the source and destination paths. Otherwise you'll get the fstab error because mount can't figure out what to mount or where to mount it.

[–] [email protected] 1 points 2 months ago (1 children)

Thank you so much, where did you find this bit of information? I have been trying to solve this problem for the past week or so, but my google foo failed me on this one. Was about to give up on this one.

[–] [email protected] 2 points 2 months ago

I learned it accidentally trying to get root on an encrypted dataset working with systemd init without sd-zfs. This turns out to be how the zfs utility works internally to signal the driver "hey it's okay, I'm a ZFS utility the user isn't using mount directly", and how you deal with mounting your root dataset to the temporary /sysroot while having its mountpoint set to / while in initramfs before pivoting root.

Obviously, don't use that other than recovering your data, if you want to use this array you should figure out the mountpoints properly so ZFS does it automatically. It shouldn't break anything but it's gross, either set mointpoint=legacy and use fstab or set its mountpoint in ZFS and use zfs mount.

[–] [email protected] 1 points 2 months ago (1 children)

Maybe @[email protected] can help. I'm not in my pool right now.

[–] [email protected] 6 points 2 months ago (1 children)

For anyone with ZFS related issues I'd honestly recommend just going to Jim's site- https://discourse.practicalzfs.com/ which is invaluable. Lot more help and a trove of valuable info already exist there.

[–] [email protected] 1 points 2 months ago

Thank you will have to look into that particular forum. Though my problem has been solved for now I will definitely have more things that come up in the future and that seems like just the place for this sort of thing.

[–] [email protected] 1 points 2 months ago

It states it can't find it in /etc/fstab. So do you have it there? And does it have the correct ID?

(I don't know how zfs pools work, I'm just going of what the mount command said)