LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-28-2013, 09:50 PM   #1
ssenuta
Member
 
Registered: Mar 2006
Location: NYS
Distribution: Mandriva-2006
Posts: 123

Rep: Reputation: 16
Booting btrfs usb-stick via uefi-bios.


Does anyone know how to boot a btrfs formated rootfs from a usb-stick partition (/dev/sdc2) using a uefi shell located on a
FAT-32 formated efi_sys partition (/dev/sdc1) ???

Here is my settup:
/dev/sdc1 ..efi_sys fat-32 formated partition
shellx64.efi ..uefi shell located on (fs2:/) of the efi_sys
usb.nsh ..uefi boot script located on (fs2:/) of the efi_sys
EFI ..directory
BOOT ..sub-directory
bzImage-3.9.0.efi ..kernel with UEFI & BTRFS support

/dev/sdc2 ..rootfs btrfs formated partition
(rootfs) ..a small filesystem I boot as a rescue disk

usb.nsh:
fs2:
bzImage-3.9.0.efi root=/dev/sdc2 ro selinux=0 plymouth.enable=0 raid=noautodetect single

Fstab for /dev/sdc2 rootfs:

#<device> <mnt.point> <type> <options> <dump> <pass>
/dev/sdc2 / btrfs defaults,noatune,autodefrag,noacl 0 0
#/dev/ram0 / btrfs defaults,noatune,autodefrag,noacl 0 0
/dev/pktcdvd0 /mnt/pktcdvd udf rw,noauto,noatime 0 0
/dev/sr0 /mnt/cdrw auto defaults,noauto 0 0
/dev/sdc1 /mnt/pendrive vfat defaults,noauto,noatime,flush 0 0

When I boot with the usb.nsh script,the kernel panics with:
Cannot open root device "sdc2" or unknown-block (0,0) Error 6

##############################################################################################
However, if I make a initramfs.gz of this same rootfs I can boot it as a btrfs ramdisk.
This setup looks like this:
/dev/sdc1 ..efi_sys fat-32 formated partition
shellx64.efi ..uefi shell located on (fs2:/) of the efi_sys
usb.nsh ..uefi boot script
EFI ..directory
BOOT ..sub-directory
bzImage-3.9.0.efi ..kernel with UEFI & BTRFS support
initramfs.rdz ..rootfs

/dev/sdc2 ..rootfs btrfs formated partition
(EMPTY)

usb.nsh:
fs2:
bzImage-3.9.0.efi root=/dev/ram0 rw selinux=0 plymouth.enable=0 raid=noautodetect single initrd=\EFI\BOOT\initramfs.gz

Fstab inside the initramfs.rdz:
#<device> <mnt.point> <type> <options> <dump> <pass>
#/dev/sdc2 / btrfs defaults,noatune,autodefrag,noacl 0 0
/dev/ram0 / btrfs defaults,noatune,autodefrag,noacl 0 0
/dev/pktcdvd0 /mnt/pktcdvd udf rw,noauto,noatime 0 0
/dev/sr0 /mnt/cdrw auto defaults,noauto 0 0
/dev/sdc1 /mnt/pendrive vfat defaults,noauto,noatime,flush 0 0


################################################################################################
Thanks for reading this post & I look forward to your replies.
 
Old 06-29-2013, 09:59 PM   #2
ssenuta
Member
 
Registered: Mar 2006
Location: NYS
Distribution: Mandriva-2006
Posts: 123

Original Poster
Rep: Reputation: 16
################################################################################################
SOLVED 06/29/2013
################################################################################################

I am happy to inform you that I finally figured out why I couldn't UEFI boot my BTRFS formated usb-stick partition /dev/sdc2.

The usb-storage module had to be loaded (early) by an initrd.image rootfs so my kernel could find usb device /dev/sdc2.
I also had to change my /etc/fstab btrfs mount options as the "noatime" option wasn't recognized & add an "initrd" option
to my usb.nsh boot script.

Here is my working settup:
/dev/sdc1 ..efi_sys fat-32 formated partition
shellx64.efi ..uefi shell located on (fs2:/) of the efi_sys
usb.nsh ..uefi boot script located on (fs2:/) of the efi_sys
EFI ..directory
BOOT ..sub-directory
bzImage-3.9.0.efi ..kernel with UEFI & BTRFS support
initrd.img ..created via fedora-17 command: "dracut initrd.img 3.9.0-efi"

/dev/sdc2 ..rootfs btrfs formated partition
(rootfs) ..a small filesystem I boot as a rescue disk

usb.nsh:
fs2:
cd EFI\BOOT
bzImage-3.9.0.efi root=/dev/sdc2 ro selinux=0 plymouth.enable=0 raid=noautodetect single initrd=\EFI\BOOT\initrd.image

Fstab for /dev/sdc2 rootfs:
#<device> <mnt.point> <type> <options> <dump> <pass>
/dev/sdc2 / btrfs defaults 0 0
#/dev/sdc2 / btrfs defaults,noatune,autodefrag,noacl 0 0
#/dev/ram0 / btrfs defaults,noatune,autodefrag,noacl 0 0
/dev/pktcdvd0 /mnt/pktcdvd udf rw,noauto,noatime 0 0
/dev/sr0 /mnt/cdrw auto defaults,noauto 0 0
/dev/sdc1 /mnt/pendrive vfat defaults,noauto,noatime,flush 0 0

Good luck to anyone playing around with UEFI & Btrfs. I hope this post will help others with their problems.
Also, if you don't like using an initrd to boot you can probably just build the usb_storage.ko into your kernel.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Creating UEFI A MENU For My Bootable (BIOS/UEFI) CDROM ssenuta Linux - Hardware 0 08-27-2012 09:11 PM
Issues during booting: slackware on external usb hd with btrfs saivnoba Slackware 6 05-19-2012 12:06 PM
UEFI - is there a way to boot into a 'EFI Shell' using a usb stick/CD? nicolasdiogo Linux - Hardware 7 08-24-2011 06:29 AM
How does one make an old sony BIOS use USB flash drive [stick] for booting. Les Porter Linux - Newbie 8 03-01-2011 09:19 PM
Boot from USB stick if no booting USB in Bios 1kyle SUSE / openSUSE 1 03-26-2007 12:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration