LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 10-27-2012, 09:07 AM   #1
Alessandro.Valentini
LQ Newbie
 
Registered: Oct 2012
Location: Trento, Italy
Distribution: Linux Mint
Posts: 4

Rep: Reputation: Disabled
LFS 7.1 installation on USB


Hi all, this is my first post on this forum but I've found a lot of useful answer here in this days.

I'm tryng to create a small LFS installation on a usb drive as base for my degree project.
I've successfully installed LFS on a virtual machine and transferred it to my usb pendrive using rsync.
It boots, but my grub.cfg is this:
Quote:
# Begin /boot/grub/grub.cfg

set default=0

set timeout=5

insmod ext3

set root=(hd0,1)

menuentry 'GNU/Linux, with Linux 3.2.6-lfs-7.1'
{
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root b0705ec1-d02f-41d9-8bbd-8caf1cd02d70
linux /boot/vmlinuz-3.2.6-lfs-7.1 rootdelay=20 root=/dev/sdb1 ro
}
I will use UUID (or label) only to boot on any machine, to do that I have to create an initrd file or build all needed modules in the kernel (right?), but which are the needed modules?
Looking at some tutorial seems that I have all I need, but my LFS gives a kernel panic if I remove /dev/sdb1.

I'm using Linux From Scratch 7.1 with kernel 3.2.6


Thank you all in advance and sorry for my english.
 
Old 10-27-2012, 07:10 PM   #2
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Are you installing from usb or to the usb drive?
You set boot to hd0,1 which would be sda but you set root to sdb1

Correction you set root to (hd,1) then /boot/vmlinuzxxxxxroot sdb1

Last edited by EDDY1; 10-27-2012 at 07:14 PM.
 
Old 10-28-2012, 06:19 AM   #3
Alessandro.Valentini
LQ Newbie
 
Registered: Oct 2012
Location: Trento, Italy
Distribution: Linux Mint
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by EDDY1 View Post
Are you installing from usb or to the usb drive?
You set boot to hd0,1 which would be sda but you set root to sdb1

Correction you set root to (hd,1) then /boot/vmlinuzxxxxxroot sdb1
I have LFS already installed on my pendrive, and it works but I want a booloader able to run my installation on any computer without modify menuentry.

"set root=(hd0,1)" outside the menuentry is a remains of LFS default bootloader, thank you for the advice I removed it.

However seems that " set root='...' " inside menuentry has no effect on grub: I've done several trials and I can boot with "hd0,1" "hd1,1" "hd0,msdos1" "hd1,msdos1" and no "set root= ..." and all times my LFS starts.
Probably is overrided by the option " --set=root <UUID> "

Now I use a menu entry like this:
Quote:
menuentry 'GNU/Linux, with Linux 3.2.6-lfs-7.1'
{
search --no-floppy --fs-uuid --set=root b0705ec1-d02f-41d9-8bbd-8caf1cd02d70
linux /boot/vmlinuz-3.2.6-lfs-7.1 rootdelay=20 root=/dev/sdb1 ro
}
but I think that I cannot boot on a pc with two hdd, because my pendrive becomes sdc device.
 
Old 10-28-2012, 06:22 AM   #4
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Hi

The pc would have to be set to boot from usb 1st not harddrive 1st
 
Old 10-28-2012, 07:11 AM   #5
Alessandro.Valentini
LQ Newbie
 
Registered: Oct 2012
Location: Trento, Italy
Distribution: Linux Mint
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by spiky0011 View Post
Hi

The pc would have to be set to boot from usb 1st not harddrive 1st
The boot in bios order is CD -> USB -> HDD and it works.

My problem is that in device order the USB in placed after HDDs, I even changend the boot order in USB -> CD -> HDD but the pendrive still remain /dev/sdb.
I don't know if this is a standard or not, but means that grub cannot recognize the boot partition on some machines.

I know that I can simply change the menuentry from grub pressing 'e', but is not the optimal solution, so I'm looking to use UUID or label instead of /dev/sdXY. Even a workaround is a good solution.
 
Old 10-28-2012, 07:19 AM   #6
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Mine is set the same as you but it is permenantly connected to machine so no problem.
What would happen if you added extra menuentry allowing for different options maybe add an entry root=/dev/sdc1 /dev/sdd1 just thinking out loud
 
Old 10-28-2012, 07:43 AM   #7
Alessandro.Valentini
LQ Newbie
 
Registered: Oct 2012
Location: Trento, Italy
Distribution: Linux Mint
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by spiky0011 View Post
What would happen if you added extra menuentry allowing for different options maybe add an entry root=/dev/sdc1 /dev/sdd1 just thinking out loud
Could be a solution, but not the most elegant. Is mine plan C

My ideas is to create a menuentry like this:
Quote:
menuentry 'GNU/Linux, with Linux 3.2.6-lfs-7.1'
{
search --no-floppy --fs-uuid --set=root b0705ec1-d02f-41d9-8bbd-8caf1cd02d70
linux /boot/vmlinuz-3.2.6-lfs-7.1 rootdelay=20 root=b0705ec1-d02f-41d9-8bbd-8caf1cd02d70 ro
}
To do that I need to compile some modules into the kernel, but I'm not able to find a list of them.
Should be file system modules, USB mass storage, USB UHCI, USB OHCI and some scsi modules, but are yet built in a default recent linux kernel.

Another solution is to create a initrd image, and I have found this tutorial, but in LFS you shouldn't need an initrd, so this is plan B.

Edit:
another question: the configuration loaded by menuconfig is standard for a kernel version or is generated using machine information or host system information?
I'm not shure, but I think that the default configs loaded for linux 3.2.6 in VM and in my physical system are a bit different.

Last edited by Alessandro.Valentini; 10-28-2012 at 08:01 AM.
 
Old 10-28-2012, 12:23 PM   #8
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Quote:
The boot in bios order is CD -> USB -> HDD and it works.

My problem is that in device order the USB in placed after HDDs, I even changend the boot order in USB -> CD -> HDD but the pendrive still remain /dev/sdb.
A flash drive is usually recognized as hdd in bios
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] LFS 6.7 : $LFS/sources and $LFS/tools folders missing prakashsince92 Linux From Scratch 5 12-09-2010 02:26 PM
LFS 6.3 - binutils 2.17 installation seb_01630 Linux From Scratch 5 07-31-2008 06:52 AM
LFS-Installation Patches? mischka Linux From Scratch 2 08-27-2006 01:50 PM
reboot during lfs installation? ruben22 Linux From Scratch 3 12-14-2005 06:35 PM
LFS v6-installation of glibc; need help kartheekpn Linux From Scratch 31 04-26-2005 04:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 05:11 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