Results 1 to 8 of 8

Thread: How can I mount a ZFS formatted drive with Ubuntu 24.04 LIVE

  1. #1
    Join Date
    May 2007
    Location
    Sainte-Therese, QC, CA
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    How can I mount a ZFS formatted drive with Ubuntu 24.04 LIVE

    I have a ZFS-formatted drive from another linux distro. I'm trying to access the files inside, but I'm using Ubuntu 24.04 from a USB key as a LIVE version - uninstalled.

    Can anybody explain how I would be able to get the packages running in this context so I can read the contents of the ZFS disk? I've scoured the web for this and nothing seems to exist on the subject. I need to be able to get the files off the disk onto another system on my local LAN.
    Last edited by couzin2000; May 3rd, 2024 at 03:08 AM. Reason: Added info
    Couzin2000
    Sainte-Thérèse | Quebec | Canada

  2. #2
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: How can I mount a ZFS formatted drive with Ubuntu 24.04 LIVE

    First you need to teach the Live Image Environment how to speak ZFS
    Code:
    sudo su -
    apt install -y zfsutils-linux
    Then find out what ZFS pools can be imported
    Code:
    zpool export -a
    zpool import
    Doing that command will list all pools that are not already imported. Lets say the pool you wanted to use was MyPool. Then to import it
    Code:
    zpool import -f -N -R /mnt MyPool
    Repeat that for any other pools that you want to mount...

    Then list the dataset structure
    Code:
    zfs list
    Let's say your recognise the base dataset structure as something like
    Code:
    zfs list
    MyPool/DATA/ubuntu_2404
    Then you would do
    Code:
    zfs mount MyPool/DATA/ubuntu_2404
    zfs mount -a
    You should now be able to access any files within that pool's filesystem, under the /mnt folder.

    Note thatthose instructions are just to access the files, not to repiar an OS within that, which would then take chrooting into that filesystem.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  3. #3
    Join Date
    May 2007
    Location
    Sainte-Therese, QC, CA
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: How can I mount a ZFS formatted drive with Ubuntu 24.04 LIVE

    I've installed a persistent 24.04 on a USB drive. and installed zfsutils-linux.
    Problem is, looks like the pool cannot be seen. Ubuntu is not mounting the drive by default, and if I run gparted I can see the drive and the volume but gparted cannot read that volume. Since the volume was created on a different computer altogether, I'm not sure the system is actually importing whatever volume is on that disk. Any ideas as to what I can do to make the USB install see it?
    Couzin2000
    Sainte-Thérèse | Quebec | Canada

  4. #4
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: How can I mount a ZFS formatted drive with Ubuntu 24.04 LIVE

    You have installed zfsutils-linux persistently, so I will skip that part from now on. In many things I do with ZFS, all it's utils are at root level, so I often start out by doing
    Code:
    sudo su -
    instead of having to preface everything with sudo.

    ZFS is like LVM2... They are both Volume Managers. You load the drivers for them, and they see their relatable structures. With 'them' you mount the respective storage containers, not the filesytems of a partition. So yes, GParted see's the partition that a ZFS pool or LVM PV is on, but does not understand a ZFS filesystem with a ZFS pool > ZFS filesystem dataset, or for that matter an LVM PV > VG > LV. Both as Volume Managers, and can span across many partitions and disks.

    So... when, in the above instructions, you do (as root):
    Code:
    zpool import
    Does it see anything?

    If not, then what does say when you do (as root)
    Code:
    zdb
    Note, that the commands I gave you temporarily mount the pool under the /mnt folder. If you wanted to mount it elsewhere permanently, and you have made the folder tags where you want it to mount to... Tell me, and I will suggest the commands for that.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  5. #5
    Join Date
    May 2007
    Location
    Sainte-Therese, QC, CA
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: How can I mount a ZFS formatted drive with Ubuntu 24.04 LIVE

    STUPENDOUS.
    Looks as though these commands are valid cross-platform.
    I was trying to list the volume but I was from the wrong disk (long story but I was looking at my parity drive).
    I had installed Ubuntu and ZFS on the key, looks like everything was working, but reading the wrong drive wasn't helping at all.
    I rebooted and installed OpenZFS on my Windows 10 machine. Turns out, when I connected the right drive, I was able to import the pool and mount it. I currently have access to my contents.

    I cannot thank you enough for your step by step guide. I really appreciate this!
    Couzin2000
    Sainte-Thérèse | Quebec | Canada

  6. #6
    #&thj^% is offline I Ubuntu, Therefore, I Am
    Join Date
    Aug 2016
    Beans
    Hidden!

    Re: How can I mount a ZFS formatted drive with Ubuntu 24.04 LIVE

    MAFoElffen is a keeper for sure.

    If this is solved could you please mark it as SOLVED to help others as well.
    Enjoy

  7. #7
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: How can I mount a ZFS formatted drive with Ubuntu 24.04 LIVE

    Glad it all worked out.

    Yes. ZFS is it's own animal, thankfully. Very powerful. Very robust, flexible and adaptable.

    If you ever have any question on or about ZFS, do not be hesitant to ask 1fallen or I.

    We both tend to try to stretch it to it's limits, just to see what is possible, and how to fix it when we do blow it up. LOL. That seems to entertain both of us figuring that out.

    Also keep this link handy: https://github.com/Mafoelffen1/OpenZFS-Ubuntu-Admin

    I tend to try to document things I know, to document it, on how to do things ZFS. That is the place I choose to document ZFS diagnostics and repairs... That way I can just post the link to the answer instead of having to retype it all over, and over again. LOL. I'm getting on in years. This stuff needs to live on past me. It's just the right thing to do.
    Last edited by MAFoElffen; May 6th, 2024 at 11:58 PM.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  8. #8
    Join Date
    Jun 2019
    Beans
    36
    Distro
    Ubuntu 24.04 Noble Numbat

    Re: How can I mount a ZFS formatted drive with Ubuntu 24.04 LIVE

    Quote Originally Posted by MAFoElffen View Post
    First you need to teach the Live Image Environment how to speak ZFS
    Code:
    sudo su -
    apt install -y zfsutils-linux
    Then find out what ZFS pools can be imported
    Code:
    zpool export -a
    zpool import
    Doing that command will list all pools that are not already imported. Lets say the pool you wanted to use was MyPool. Then to import it
    Code:
    zpool import -f -N -R /mnt MyPool
    Repeat that for any other pools that you want to mount...

    Then list the dataset structure
    Code:
    zfs list
    Let's say your recognise the base dataset structure as something like
    Code:
    zfs list
    MyPool/DATA/ubuntu_2404
    Then you would do
    Code:
    zfs mount MyPool/DATA/ubuntu_2404
    zfs mount -a
    You should now be able to access any files within that pool's filesystem, under the /mnt folder.

    Note that those instructions are just to access the files, not to repiar an OS within that, which would then take chrooting into that filesystem.
    I just want to give a shout-out to you, and thank you for this post.

    I just had a computer meltdown and the contents of the drive was in a ZFS pool.

    Considering this was my first experience attempting to retrieve data from a ZFS pool, I was going in blind.

    This thread proved vital to me successfully retrieving all of the data from the pool.

    I honestly can't thank you enough!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •