Jump to content
  • 0
Sign in to follow this  
leeflemingster

Unbootable ZFS

Question

I have a raid0 striped ZFS pool which I have been booting from with no problems, which looks like this:

# zpool status
  pool: main
 state: ONLINE
config:

        NAME        STATE     READ WRITE CKSUM
        main        ONLINE       0     0     0
          sda       ONLINE       0     0     0
          sdb       ONLINE       0     0     0

errors: No known data errors

I want to make this into a 4 drive raid10. I purchased the 3rd drive and intend to add the 4th later. I did the following:

# zpool attach main /dev/sda /dev/sdc
Make sure to wait until resilver is done before rebooting.

It looked like everything went well.

# zpool status
  pool: main
 state: ONLINE
  scan: resilvered 62.1G in 0h50m with 0 errors on Fri Sep 13 10:26:04 2019
config:

        NAME        STATE     READ WRITE CKSUM
        main        ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            sda     ONLINE       0     0     0
            sdc     ONLINE       0     0     0
          sdb       ONLINE       0     0     0

errors: No known data errors

But on the next boot I got the following:

>> Importing ZFS pool 'main' using cachefile '/etc/zfs/zpool-main.cache'
cannot import 'main': one or more devices is currently unavailable
!! Importing main failed
>> Determining root device...
cannot open 'main/funtoo/root': dataset does not exist
!! main/funtoo/root is not a filesystem
!! Could not find the root block device in ZFS=main/funtoo/root.

So I fired up an ubuntu live cd and did the following

# zpool import main -R /mnt/funtoo

Which mounted without a problem.

I tried to regenerate the cachefile using:

# zpool set cachefile=/mnt/funtoo/etc/zfs/zpool-main.cash

Which didn't help. I tried:

# zpool set cachefile=none

But that didn't do anything either. I tried to remove the drive I'd just added:

# zpool detach main /dev/sdc

The zpool looked ok;

# zpool status
  pool: main
 state: ONLINE
  scan: resilvered 62.1G in 0h50m with 0 errors on Fri Sep 13 10:26:04 2019
config:

        NAME        STATE     READ WRITE CKSUM
        main        ONLINE       0     0     0
          sda       ONLINE       0     0     0
          sdb       ONLINE       0     0     0

errors: No known data errors

But it still will not boot. What can I do next?

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Well, the correct answer as of a few days ago to your question can be found in this bug report:  https://bugs.funtoo.org/browse/FL-4772

From the comments by @drobbins:

Not going to support ZFS booting officially as it is not needed. Just use another filesystem to get the system booted, then connect to all your ZFS.

I can add a message to the wiki page to indicate this is not supported.

If you do a refresh on your browser and look at the update to a ZFS install on funtoo, you'll see the new disclaimer at the top about booting using a different file system on root.

I know this because I filed that bug report. ;^) HTH !!

 

 

 

 

 

Share this post


Link to post
Share on other sites
  • 0

From the bug report you linked to there was some talk of building the initramfs. I remembered that genkernel produced the following warning.

 

------------------------ WARNING --------------------------
 No cachefile set on ZFS pool 'main'!
 Startup times will be VERY SLOW as a result.
 To set a cachefile, run a command like this:
    zpool set cachefile=/etc/zfs/zpool-main.chache main
 ... then re-run genkernel.
-----------------------------------------------------------

 

I tried to rebuild the initramfs but that didn't help (although I might have been too quick to press the reset button after seeing the ZFS error.)

I then just deleted /etc/zfs/zpool-main.cache and /etc/zfs/zpool.cache. (The funtoo install guide uses zpool.cache and genkernel uses zpool-main.cache. I suspect you only need 1 of these).

When booting it complained about not being able to find this file but it autodetected and still booted.

 

Now to find the correct way to attach a new drive to the pool.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...