LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Booting LFS from Hard Drive ?? (https://www.linuxquestions.org/questions/linux-from-scratch-13/booting-lfs-from-hard-drive-894626/)

mbzadegan 07-30-2011 07:03 AM

Booting LFS from Hard Drive ??
 
Hi anybody ,

i copied my LFS live cd files to (hd0,1) and set boot config to these :

kernel /lfs/boot/isolinux/linux
append initrd=/lfs/boot/isolinux/initramfs_data.cpio.gz

while i booted , my kernel and initrd loaded TRUE but the file root.ext2 didn't load and my shell command will

sh-3.2#

How can i load root.ext2 manually while booting ?

kasl33 07-31-2011 02:04 AM

I'm not exactly sure what you are trying to accomplish here other than mounting hard disks. In this case, if you are able to log in, then do this:

Code:

blkid
Once you see what your disk is recognized as (for each partition), then do this:

(Replace ext with whatever your filesystem is; ext4, vfat, ntfs, ntfs-3g, etc)
(Replace sda# with whatever yours is; sdb, hda, hdb, and the number with whatever partition yours is; sda1, sda3, sda7, etc)

Code:

# For root partition:
mount -t ext3 /dev/sda2 /

# For home partition
mount -t ext3 /dev/sda3 /home

# For swap
swapon /dev/sda1


mbzadegan 07-31-2011 04:57 AM

in my state i can run only 103 commands without any blkid or ...
because root.ext2 was not loaded and only my linux kernel and initrd was loaded .

my quastion is , how can i loaded root.ext2 with my kernel & initrd while booting ?

Tnx 4 your hints .

mbzadegan 08-01-2011 05:38 AM

BOOT LFS from HDD ??
 
Dear forumers ;

when i set my isolinux config to :

kernel /lfs/boot/isolinux/linux
append initrd=/lfs/boot/isolinux/initramfs_data.cpio.gz

my system stoped at these texts :

The problem may be caused by the fact that ISA IDE and SCSI adapters are
no longer attempted to be autodetected. If you use such hardware, load the
proper driver manually with the "modprobe" command and exit from this shell.
For old IDE controllers, the correct module name is "ide-generic", or, if
you want to use the new libata-based driver, "pata-legacy". To avoid this
message next time you boot this CD, use a kernel command line like this:
linux load=ide-generic

This problem can be also caused by a slow SCSI controller or USB/FireWire
CD-ROM that needs more time to be detected. If you see any kernel messages
below, this is the case. In this case, it is sufficient to type "exit",
and the CD will continue the boot process. To avoid this message next
ime you boot this CD, use a kernel command line like this:
linux rootdelay=20

Dropping you to a shell.


I think that my system search for root.ext2 on cdrom and when it didn't find it , it drop to shell sh-3.2#
I think that i must point kernel to find root.ext2 on my hdd .

Can Anybody help me to append my root.ext2 that is on my hdd and don't in the CDROM ?
in other words HOW could i boot LFS from my Hard disk Drive ??

mbzadegan 08-03-2011 02:12 AM

Dear forumers , I'm Waiting for your guides ...

druuna 08-03-2011 03:20 AM

Hi,

Too my knowledge you cannot copy the LFS liveCD to your hard-disk and boot it. It is a liveCD and not installable. I've been working with and following LFS for years and I never read an article/post that mentions how to do this.

Hope this helps.

mbzadegan 08-03-2011 05:09 AM

Tnx 4 your hints but in this page http://www.scribd.com/doc/55511186/I...D-to-Hard-disk describe it .
I tried it but in section 13 of that page i could not mount root.ext2 to rootfs folder !??

druuna 08-03-2011 08:30 AM

Hi,

I have to retract my previous words: The article your url points to does work after making some changes (It has a few typo's and an error).

- The article mentions isoLinux/Linux, which should be /isolinux/linux (no capitals). This typo/error shows up a few times.

- I'm not sure which grub version the article is based on, but I had to explicitly set the rw option when using grub 1.98.

This addition to my existing grub.cfg is what worked for me:
Code:

menuentry "LFS livecd from HD test" {
        set root='(hd0,3)'
        linux  /boot/linux root=/dev/sda3 rw
        initrd  /boot/initramfs_data.cpio.gz
}

I tested using /dev/sda3.

If I look at your first post I do see an error:
Code:

kernel /lfs/boot/isolinux/linux
append initrd=/lfs/boot/isolinux/initramfs_data.cpio.gz

That should be:
Code:

kernel /boot/isolinux/linux
append initrd=/boot/isolinux/initramfs_data.cpio.gz

Hope this helps.

BTW: Thanks for the recently created article!

mbzadegan 08-04-2011 03:45 AM

Dear druuna ,

Tnx 4 your hints and i'm so glad that anyone could boot LFS from HDD .
my grub.cfg is :


menuentry 'LFS livecd from HD test' {
set root='(hd0,4)'
linux /boot/isolinux/linux root=/dev/sda4 rw
initrd /boot/isolinux/initramfs_data.cpio.gz
}


menuentry 'Backtrack 5 Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set e1788ac9-960b-4495-beae-c855ae00a2eb
linux /boot/vmlinuz-2.6.38 root=UUID=e1788ac9-960b-4495-beae-c855ae00a2eb ro text splash nomodeset vga=791
initrd /boot/initrd.img-2.6.38
}


But when i selected LFS , my screen was locked on black color and my PC hanged !!

druuna 08-04-2011 06:05 AM

Hi,

Code:

menuentry 'LFS livecd from HD test' {
    set root='(hd0,4)'
    linux /boot/isolinux/linux root=/dev/sda4 rw
    initrd /boot/isolinux/initramfs_data.cpio.gz
}

Although I don't know for sure where you placed the linux and initramfs files, I do believe the bold red part is incorrect.

If you followed the instructions from the article those 2 files reside in /boot and not /boot/isolinux. Check if they are at that location and if so change your grub menu entry to:
Code:

menuentry 'LFS livecd from HD test' {
    set root='(hd0,4)'
    linux  /boot/linux  root=/dev/sda4 rw
    initrd /boot/initramfs_data.cpio.gz
}

Hope this helps.

mbzadegan 08-04-2011 09:03 AM

Hi,

In my LFS Live CD image from ftp://66.135.59.49/LFS-LiveCD/lfsliv...-6.3-r2160.iso the 2 files [ linux + initramfs ] are in the isolinux folder but if you want i can move these files to boot folder .
i think that my grub scripts still has an error ,
TNX alot for your suggestions .

druuna 08-04-2011 09:32 AM

Hi again,

I wonder if you fully understand what is being done, 'cause you are looking in the wrong place.

/mnt/lfs-hd holds the copied bootable LFS liveCD files (including the linux and initramfs files in /mnt/lfs-hd/boot). Have a look at stpes 10 and 11, those clearly copy those 2 files to /mnt/lfs-hd/boot/.

After you finished all the 18 steps you can savely remove the /mnt/rootfs, /mnt/iso directories and the lfslivecd-x86-6.3-r2160.iso file. These will not be used to boot.

To create a grub menu entry you need to strip the /mnt/lfs-hd part, that part is only created as a temporary mount point. Assuming you used /dev/sda4 the following should work (same as in my previous post [#10]):
Code:

menuentry 'LFS livecd from HD test' {
    set root='(hd0,4)'
    linux  /boot/linux  root=/dev/sda4 rw
    initrd /boot/initramfs_data.cpio.gz
}

Hope this helps.

mbzadegan 08-04-2011 04:53 PM

OK , i think that i must repeat my cenario .

ONLY , i copy my LFS-LiveCD iso files to my (hd0,4) .
When i booted from (hd0,4) i can boots from my LFS kernel & initrd but at the end of my boot process these message was appeared :

The problem may be caused by the fact that ISA IDE and SCSI adapters are
no longer attempted to be autodetected. If you use such hardware, load the
proper driver manually with the "modprobe" command and exit from this shell.
For old IDE controllers, the correct module name is "ide-generic", or, if
you want to use the new libata-based driver, "pata-legacy". To avoid this
message next time you boot this CD, use a kernel command line like this:
linux load=ide-generic

This problem can be also caused by a slow SCSI controller or USB/FireWire
CD-ROM that needs more time to be detected. If you see any kernel messages
below, this is the case. In this case, it is sufficient to type "exit",
and the CD will continue the boot process. To avoid this message next
ime you boot this CD, use a kernel command line like this:
linux rootdelay=20

Dropping you to a shell.

sh-3.2#



there is not any mnt or ... folder and only my folders is :

.root , bin , dev , etc , lib , proc , root , sbin , sys

this error occur when root.ext2 did not load .

TNX alot 4 your friendly help

druuna 08-05-2011 02:20 AM

Hi,

The above shown problem is exactly the same as the one in post #4 and that was with the wrong grub entries (the lfs and isolinux parts are still present).

What is shown before the The problem may be caused by the fact that..... message? That might give us a clue, please post the +/- 5 lines before the message.

To be honest, the actions shown in the article are very straight forward. Are you sure you followed them to the letter? If you did decide to start again from step one, did you remove/delete all the old stuff before starting again?

One other question: Is your hardware (very) new or (very) old?

Hope this helps.

mbzadegan 08-05-2011 07:06 AM

Dear druuna ,

while i connected cdrom [ vs LFS_Livecd ] to my PC And reboot from (hd0,4) , My LFS boots correctly and without any fail messages .( With isolinux or grub boots correct )
It means that my LFS [ on (hd0,4) ] search for root.ext2 on the CDROM !!
And that message [ post #13 ] is in the init of initramfs while find_cd() part gets an error .

Also , we must point kernel to append root.ext2 on the hd0,4 and not on CDROM .
I hope that i could describe my problem correctly .
ok , this error message shown before of post #13 message :

hdc: ATAPI 4X CD-ROM drive, 512kB Cache, (U)DMA
Uniform CD-ROM driver Revision: 3.20

LFS LiveCD could not find its device, perhaps due to unsupported or
undetected hardware, Please fix this problem and exit shell.

The problem may be caused by the fact ...
.........................................



My PC is intel core 2 due 3Ghz

Tnx alot

druuna 08-05-2011 02:32 PM

Hi,

I partially understand the above and I do have a question: What did you use to start with (step 1 from the article: 1. Boot from an existing Linux distro or any live-cd)?

I'm asking because I'm not sure if steps 15, 16 and 17 mentioned in the article will work when using a (LFS) liveCD.

I just created a blog entry about all this, you might want to have a look.

Hope this helps.

mbzadegan 08-05-2011 11:05 PM

Dear druuna ,

I used BackTrack ( ubuntu base ) for step 1 and you guessed correct for steps 15,16,17 .
I appreciate you because of your excellent blog entry because i saw a helpful texts about LFS by hard booting .
I'm downloading your suggest blog iso and then will boot from it and test it , Maybe solved my problem .

TNX alot...

druuna 08-06-2011 07:53 AM

You're welcome :)

frieza 08-06-2011 11:06 AM

just a question, why are you copying the lfs live cd to the hard drive? the point of the lfs live cd isn't to be an installable system, but rather to provide a platform to bootstrap an lfs installation, that is:

1) partition/format hard drive
2) mount hard drive
3) build temporary system
4) chroot into temporary system
5) build/install actual system
6) build/install kernel/boot loader
7) reboot, customize, build/install any additional software (BLFS)

the LFS live cd really only has enough just to do that, nothing more, nothing less.

if building an lfs system isn't what you're after wouldn't a binary based minimum distribution be a better solution?

mbzadegan 08-07-2011 06:40 AM

Dear druuna :

when i booted from LFS_livecd and follow your blog steps while i run bellow command i get an ERROR :

mount -o ro,loop lfslivecd-x86-6.3-r2145-nosrc.iso /mnt/LFS.cd2hd/iso

ERROR :
mount: unknown filesystem type 'iso'


and then i added -t iso9660 but still have ERROR :


ERROR :
mount: wrong fs type

druuna 08-07-2011 07:31 AM

Hi,

What linux distro are you using to do these steps? I tried the procedure using lfs (6.8) and just now tried it using Debian (6.0.2) and both work.

Does your kernel have iso9660 support? (cat /proc/filesystems and check if iso9660 is present)

One other thing that comes to mind: Is your lfs image corrupt? Run the following command: md5sum lfslivecd-x86-6.3-r2145-nosrc.iso the output created should be: 763faec4c00647a41b3987fc371e3821 (LFS liveCD md5 sums). If the output differs: You have a corrupt image, re-dwonload it.

Hope this helps.

druuna 08-07-2011 08:01 AM

Hi again,

I just noticed the following (overlooked that in my previous reply):

Quote:

Originally Posted by mbzadegan (Post 4435870)
when i booted from LFS_livecd and follow your blog steps while i run bellow command i get an ERROR :

As stated multiple times in my blog article and in post #16: The procedure will _not_ work when you use a liveCD as host.

Hope this helps.

BTW: I do hope you understood what was said in post #6 and #19. To quote frieza
Quote:

.. the point of the lfs live cd isn't to be an installable system, but rather to provide a platform to bootstrap an lfs installation ..
I assume you have a (good) reason to want to "install" the LFS liveCD onto a HD, but that isn't clear from your posts.

mbzadegan 08-08-2011 12:29 AM

Dear druuna ,

I booted from your lfslivecd-x86-6.3-r2145-nosrc.iso and its MD5 is TRUE .
I did't want to install LFS on my Hard AT ALL , My project goal is to set LFS on a PXE server that my LAN clients could booted from Lan boot rom and load LFS .
Also , if i can load LFS ( [ kernel+initramfs+root.ext2 ] on my hard partition ) , i solved my problem .

because the solve of PXE server depend on hard disk booting of LFS .

Anyways , I'm so glad if you have an idea to solve my goal ( Boot from PXE ) .
Thanks so much .

druuna 08-08-2011 06:12 AM

Hi,
Quote:

Originally Posted by mbzadegan (Post 4436463)
I did't want to install LFS on my Hard AT ALL , My project goal is to set LFS on a PXE server that my LAN clients could booted from Lan boot rom and load LFS .

Anyways , I'm so glad if you have an idea to solve my goal ( Boot from PXE )

This is a different problem then the one I understood when looking at your thread title and posts you made thus far. My PXE knowledge is basic at best and therefore I cannot help you with that.

My feeling says that what you want to do is not possible. You cannot install LFS using the LFS liveCD. It, the LFS liveCD, is meant to be a perfect platform to build(!) LFS. I'm not sure if this is possible when the liveCD resides on your PXE machine. But like I said before, that is a feeling, not based on facts!

I hope for you that someone else sees this thread and proves me wrong!


All times are GMT -5. The time now is 08:47 PM.