LinuxQuestions.org
Visit Jeremy's Blog.
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 07-10-2020, 09:38 AM   #16
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,392

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594

Quote:
UUID=/dev/sdb3
this will need to be a number similar to the one in the line above it.
you will at least need these usb drivers compiled into the kernel xhci ehci uhc-hcd usb-storage There maybe more try with adding these first.
 
Old 07-10-2020, 09:39 AM   #17
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
Quote:
Change your grub linux line to this
linux /boot/vmlinuz-5.5.3-lfs-9.1 root=UUID=42e174ea-46f1-4300-b5c5-870e7f9152f4
UUID wont work on kernel line unless there is a initramfs, use /dev/sdXX
 
Old 07-10-2020, 09:53 AM   #18
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,392

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
Quote:
UUID wont work on kernel line unless there is a initramfs, use /dev/sdXX
forgot about that. use
Code:
root=/dev/sdb2
Other drivers you may need uas uhci_hcd ehci_pci echi_hcd
 
Old 07-10-2020, 10:12 AM   #19
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,392

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
run blkid to find the partuuid of your lfs partition change the root=UUID=<uuid number> to root=PARTUUID=<lfs partition partuuid number>
 
Old 07-10-2020, 10:36 AM   #20
Shah404
Member
 
Registered: Jun 2020
Posts: 43

Original Poster
Rep: Reputation: Disabled
Hello Sir,
Thank you for helping me.

I changed the fstab file to
Quote:
(lfs chroot) root:/# cat /etc/fstab
# Begin /etc/fstab

UUID=42e174ea-46f1-4300-b5c5-870e7f9152f4 / ext4 defaults 1 1
UUID=42e174ea-46f1-4300-b5c5-870e7f9152f4 swap swap pri=1 0 0

proc /proc proc nosuid,noexec,nodev 0 0
sysfs /sys sysfs nosuid,noexec,nodev 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /run tmpfs defaults 0 0
devtmpfs /dev devtmpfs mode=0755,nosuid 0 0

# End /etc/fstab
blkid on my host shows
Quote:
shahrukh@shahrukh-HP-15-Notebook-PC:~$ blkid
/dev/sdb3: UUID="617d3a82-8c40-4295-a41e-288251c1dfea" TYPE="swap" PARTUUID="e0917b86-b923-694f-aa15-b508116eb460"
/dev/sda4: UUID="717167f2-63b5-4d1e-ad97-594bcc22c844" TYPE="ext4" PARTUUID="4837e416-114d-4ceb-9d88-6d1f99886096"
as my usb is sdb, sdb3 is for swap.
so i changed my grub file to
Quote:
menuentry 'unknown Linux distribution (on /dev/sdb2)' --class linux --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux->
insmod part_gpt
insmod ext2
set root='hd1,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci2,gpt2 42e174ea-46f1-4300-b5c5-870e7>
else
search --no-floppy --fs-uuid --set=root 42e174ea-46f1-4300-b5c5-870e7f9152f4
fi
linux /boot/vmlinuz-5.5.3-lfs-9.1 root=PARTUUID=e0917b86-b923-694f-aa15-b508116eb460
}
submenu 'Advanced options for unknown Linux distribution (on /dev/sdb2)' $menuentry_id_option 'osprober-gnulinux-advanced-42e174ea-46f1-4300-b5c5-870>
menuentry 'unknown Linux distribution (on /dev/sdb2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/>
insmod part_gpt
insmod ext2
set root='hd1,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci2,gpt2 42e174ea-46f1-4300-b5>
else
search --no-floppy --fs-uuid --set=root 42e174ea-46f1-4300-b5c5-870e7f9152f4
fi
linux /boot/vmlinuz-5.5.3-lfs-9.1 root=PARTUUID=e0917b86-b923-694f-aa15-b508116eb460
}
}
now i have to compile usb drivers, right?
 
Old 07-10-2020, 10:48 AM   #21
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,392

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
your fstab should look like this
Code:
# Begin /etc/fstab

UUID=42e174ea-46f1-4300-b5c5-870e7f9152f4 / ext4 defaults 1 1
UUID=617d3a82-8c40-4295-a41e-288251c1dfea swap swap pri=1 0 0

proc /proc proc nosuid,noexec,nodev 0 0
sysfs /sys sysfs nosuid,noexec,nodev 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /run tmpfs defaults 0 0
devtmpfs /dev devtmpfs mode=0755,nosuid 0 0

# End /etc/fstab
This is wrong
Code:
linux /boot/vmlinuz-5.5.3-lfs-9.1 root=PARTUUID=e0917b86-b923-694f-aa15-b508116eb460
You have the partuuid of the swap partition /dev/sdb3. It needs to be the partuuid of /dev/sdb2
 
Old 07-10-2020, 11:09 AM   #22
Shah404
Member
 
Registered: Jun 2020
Posts: 43

Original Poster
Rep: Reputation: Disabled
Thank You Sir,

PARTUUID is
Quote:
shahrukh@shahrukh-HP-15-Notebook-PC:~$ sudo blkid /dev/sdb2
/dev/sdb2: UUID="42e174ea-46f1-4300-b5c5-870e7f9152f4" TYPE="ext4" PARTUUID="2fed1596-29b9-c04d-aca2-1cc55b8e7e69"
now my grub.cfg looks like
Quote:
menuentry 'unknown Linux distribution (on /dev/sdb2)' --class linux --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-42e174ea-46f1-4300-b5c5-870e7f9152f4' {
insmod part_gpt
insmod ext2
set root='hd1,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci2,gpt2 42e174ea-46f1-4300-b5c5-870e7f9152f4
else
search --no-floppy --fs-uuid --set=root 42e174ea-46f1-4300-b5c5-870e7f9152f4
fi
linux /boot/vmlinuz-5.5.3-lfs-9.1 root=PARTUUID=2fed1596-29b9-c04d-aca2-1cc55b8e7e69
}
submenu 'Advanced options for unknown Linux distribution (on /dev/sdb2)' $menuentry_id_option 'osprober-gnulinux-advanced-42e174ea-46f1-4300-b5c5-870e7f9152f4' {
menuentry 'unknown Linux distribution (on /dev/sdb2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-5.5.3-lfs-9.1--42e174ea-46f1-4300-b5c5-870e7f9152f4' {
insmod part_gpt
insmod ext2
set root='hd1,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci2,gpt2 42e174ea-46f1-4300-b5c5-870e7f9152f4
else
search --no-floppy --fs-uuid --set=root 42e174ea-46f1-4300-b5c5-870e7f9152f4
fi
linux /boot/vmlinuz-5.5.3-lfs-9.1 root=PARTUUID=2fed1596-29b9-c04d-aca2-1cc55b8e7e69
}
}
Now i understood a bit.
Great

Is it okay now?
now the only thing left are usb drviers

Last edited by Shah404; 07-10-2020 at 11:17 AM.
 
Old 07-10-2020, 01:04 PM   #23
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
My grub.cfg would look much more simplier

set default=0
set timeout=5

insmod ext2
set root=(hd1,2)

menuentry "GNU/Linux, Linux 5.5.3-lfs-9.1" {
linux /boot/vmlinuz-5.5.3-lfs-9.1 root=/dev/sdb2 rootdelay=10 ro
}

The reason for "rootdelay" is to allow usb to be recognised

That would be all you need
 
1 members found this post helpful.
Old 07-10-2020, 01:17 PM   #24
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,392

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
I think ops lfs grub entry is a modified entry generated by the host update-grub. Changed to root=PARTUUID because of the usb changing from sdc to sdb. I had forgot about the rootdelay=10 and needs to be added to the linux line.

Last edited by colorpurple21859; 07-10-2020 at 01:18 PM.
 
Old 07-10-2020, 01:46 PM   #25
Shah404
Member
 
Registered: Jun 2020
Posts: 43

Original Poster
Rep: Reputation: Disabled
Hello
i added the rootdelay in grub.cfg
Quote:
menuentry 'unknown Linux distribution (on /dev/sdb2)' --class linux --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-42e174ea-46f1-4300-b5c5-870e7f9152f4' {
insmod part_gpt
insmod ext2
set root='hd1,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci2,gpt2 42e174ea-46f1-4300-b5c5-870e7f9152f4
else
search --no-floppy --fs-uuid --set=root 42e174ea-46f1-4300-b5c5-870e7f9152f4
fi
linux /boot/vmlinuz-5.5.3-lfs-9.1 root=PARTUUID=2fed1596-29b9-c04d-aca2-1cc55b8e7e69 rootdelay=10 ro
}
submenu 'Advanced options for unknown Linux distribution (on /dev/sdb2)' $menuentry_id_option 'osprober-gnulinux-advanced-42e174ea-46f1-4300-b5c5-870e7f9152f4' {
menuentry 'unknown Linux distribution (on /dev/sdb2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-5.5.3-lfs-9.1--42e174ea-46f1-4300-b5c5-870e7f9152f4' {
insmod part_gpt
insmod ext2
set root='hd1,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci2,gpt2 42e174ea-46f1-4300-b5c5-870e7f9152f4
else
search --no-floppy --fs-uuid --set=root 42e174ea-46f1-4300-b5c5-870e7f9152f4
fi
linux /boot/vmlinuz-5.5.3-lfs-9.1 root=PARTUUID=2fed1596-29b9-c04d-aca2-1cc55b8e7e69 rootdelay=10 ro
}
}
this is etc/fstab of lfs
Quote:
(lfs chroot) root:/# cat /etc/fstab
# Begin /etc/fstab

UUID=42e174ea-46f1-4300-b5c5-870e7f9152f4 / ext4 defaults 1 1
UUID=617d3a82-8c40-4295-a41e-288251c1dfea swap swap pri=1 0 0

proc /proc proc nosuid,noexec,nodev 0 0
sysfs /sys sysfs nosuid,noexec,nodev 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /run tmpfs defaults 0 0
devtmpfs /dev devtmpfs mode=0755,nosuid 0 0

# End /etc/fstab
It was great USB was recognised, so i dont need drivers to be compiled in kernel now?

Now there are different errors.

Click image for larger version

Name:	WhatsApp Image 2020-07-11 at 12.12.09 AM(1).jpeg
Views:	16
Size:	201.6 KB
ID:	33624

if its not visible, its showing
Quote:
failed to create symbolic link '/dev/shm'
Quote:
...swapon: cannot find the device for <<UUID>>
Quote:
Mounting root file system in read-only mode... mount: /: can't find <<UUID>>
I checked the UUID of sdb2 and sdb3, they are same as in /etc/fstab

Last edited by Shah404; 07-10-2020 at 01:52 PM.
 
Old 07-10-2020, 01:55 PM   #26
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
Blank out swap line in fstab ( not required to boot)
#UUID=617d3a82-8c40-4295-a41e-288251c1dfea swap swap pri=1 0 0.

If possible remove device sdc
make kernel line root=/dev/sdb2

will simplify matters

Last edited by spiky0011; 07-10-2020 at 01:56 PM.
 
Old 07-10-2020, 02:01 PM   #27
Shah404
Member
 
Registered: Jun 2020
Posts: 43

Original Poster
Rep: Reputation: Disabled
Sir,
You mean change
Quote:
linux /boot/vmlinuz-5.5.3-lfs-9.1 root=PARTUUID=2fed1596-29b9-c04d-aca2-1cc55b8e7e69 rootdelay=10 ro
to

Quote:
linux /boot/vmlinuz-5.5.3-lfs-9.1 root=/dev/sdb2 rootdelay=10 ro
?

And also there is no sdc device
How should i remove it?

This is from lsblk
Quote:
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 196.3G 0 part
├─sda2 8:2 0 170.5G 0 part
├─sda3 8:3 0 9.3G 0 part /boot/efi
├─sda4 8:4 0 28G 0 part /
└─sda6 8:6 0 61.2G 0 part
sdb 8:16 1 28.7G 0 disk
├─sdb1 8:17 1 100M 0 part /mnt/lfs/boot
├─sdb2 8:18 1 12G 0 part /mnt/lfs
└─sdb3 8:19 1 4G 0 part [SWAP]
sr0 11:0 1 1024M 0 rom
 
Old 07-10-2020, 02:08 PM   #28
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
Hang on sdb1 is that where the kernel is???? "├─sdb1 8:17 1 100M 0 part /mnt/lfs/boot"
and comment out swap in fstab
 
Old 07-10-2020, 02:19 PM   #29
Shah404
Member
 
Registered: Jun 2020
Posts: 43

Original Poster
Rep: Reputation: Disabled
i used these commands while mounting my usb
sudo mount -v -t /dev/sdb2 $LFS
sudo mount -v -t /dev/sdb1 $LFS/boot
sudo /sbin/swapon -v /dev/sdb3

so main system is on sdb2, right?

also i commented out swap line .

and rebooted. now the swap error was gone.

but this error was still there
Quote:
Mounting root file system in read-only mode... mount: /: can't find <<UUID>>
kernel should be here right?
Quote:
(lfs chroot) root:/boot# ls
grub lost+found

Last edited by Shah404; 07-10-2020 at 02:21 PM.
 
Old 07-10-2020, 02:27 PM   #30
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
ok your looking for the kernel in the wrong place, It's in /dev/sdb1
so you grub.cfg is wrong

set root=(hd1,1)

linux /vmlinuz-5.5.3-lfs-9.1 root=/dev/sdb2 rootdelay=10 ro

the reason "boot" is removed from kernel line is because it is only /dev/sdb1 and not /dev/sdb2/boot

just to confirm mount /dev/sdb2 /mnt ls /mnt/boot
and if you want you can check sdb1 the same way "umount /dev/sdb2" 1st
 
  


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 Version 9.1, 8.4.3. Setting Up the GRUB Configuration Shah404 Linux From Scratch 6 07-06-2020 01:21 AM
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM
[SOLVED] Which version of book to use for BLFS??? (LFS-6.7 used for building LFS) rkmv Linux From Scratch 3 02-21-2012 05:32 PM
[SOLVED] LFS 6.7 : $LFS/sources and $LFS/tools folders missing prakashsince92 Linux From Scratch 5 12-09-2010 02:26 PM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 12:55 PM

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

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