# [SOLVED]Booting fail from a ZFS pool on external USB drive.

## uittie

Hi. I am installing gentoo on an external USB drive with root on ZFS. Zpool import fail because USB drive loading is slow when booting. What should I do?

The following images are errors during startup

http://uittie.com/img/fail1.jpg

http://uittie.com/img/fail2.jpgLast edited by uittie on Mon Feb 20, 2017 3:09 pm; edited 1 time in total

----------

## Roman_Gruber

there is a kernel parameter, to delay booting and give the drive time to spin up. maybe it was called rootdelay...

----------

## khayyam

uittie ...

you can pass 'rootwait', or 'rootdelay=<N>' (where '<N>' is a number in seconds).

HTH & best ... khay

----------

## uittie

Thank you  :Very Happy: 

The setting of my grub.cfg is as follows. Also, I tried rootwait, but I will not solve it.

```
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-8fd96561dce8aff0' {

   load_video

   insmod gzio

   insmod part_gpt

   insmod ext2

   set root='hd0,gpt2'

   if [ x$feature_platform_search_hint = xy ]; then

     search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ab737af2-9437-40a2-93e9-cd03a0a92287

   else

     search --no-floppy --fs-uuid --set=root ab737af2-9437-40a2-93e9-cd03a0a92287

   fi

   echo   'Loading Linux x86_64-4.9.6-gentoo-r1170219-015841 ...'

   linux   /kernel-genkernel-x86_64-4.9.6-gentoo-r1170219-015841 root=ZFS=rpool/ROOT/default ro rootdelay=90

   echo   'Loading initial ramdisk ...'

   initrd   /initramfs-genkernel-x86_64-4.9.6-gentoo-r1170219-015841

}
```

I want to lengthen the waiting time until "zpool import", but I do not know where that setting is.

The problem at the link below is similar to my problem. But it was not applicable to my environment.  :Crying or Very sad: 

https://github.com/zfsonlinux/pkg-zfs/issues/108

----------

## khayyam

 *uittie wrote:*   

> [...] I want to lengthen the waiting time until "zpool import"

 

uittie ... if 'rootwait' doesn't succeed then the issue isn't due to the disk not being available, 'rootwait' will wait indefinitely. I'm not sure genkernel supports ZFS, or what an initramfs needs to do in order to bring the zpool online, but I suspect the issue is there rather than the wait period.

best ... khay

----------

## uittie

khayymm

I think so, too. The problem is the wait time of zpool import, I think that it is not a matter of the wait time of root mount.

Thanks

----------

## uittie

I solved this problem!

When I expanded initramfs and looked at init, I noticed that the sdelay command was executed before "zfs_start_volumes".

In other words, it solved by setting kernel parameter "scandelay".

I am grateful Roman_Gruber and khayyam for helping us solve this problem.

```

menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-8fd96561dce8aff0' { 

   load_video 

   insmod gzio 

   insmod part_gpt 

   insmod ext2 

   set root='hd0,gpt2' 

   if [ x$feature_platform_search_hint = xy ]; then 

     search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ab737af2-9437-40a2-93e9-cd03a0a92287 

   else 

     search --no-floppy --fs-uuid --set=root ab737af2-9437-40a2-93e9-cd03a0a92287 

   fi 

   echo   'Loading Linux x86_64-4.9.6-gentoo-r1170219-015841 ...' 

   linux   /kernel-genkernel-x86_64-4.9.6-gentoo-r1170219-015841 root=ZFS=rpool/ROOT/default ro scandelay=5

   echo   'Loading initial ramdisk ..

   initrd   /initramfs-genkernel-x86_64-4.9.6-gentoo-r1170219-015841 

}

```

----------

## bunder

 *khayyam wrote:*   

> I'm not sure genkernel supports ZFS

 

Yes it does.  I forget if you need one of the 3.5.x.x versions though.  I use the 9999 personally.

----------

## mrbassie

 *bunder wrote:*   

>  *khayyam wrote:*   I'm not sure genkernel supports ZFS 
> 
> Yes it does.  I forget if you need one of the 3.5.x.x versions though.  I use the 9999 personally.

 

Stable genkernel supports it.

----------

