LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-04-2016, 05:34 PM   #16
aaazen
Member
 
Registered: Dec 2009
Posts: 357

Rep: Reputation: Disabled

Quote:
Originally Posted by comet.berkeley View Post
To run syslinux the script needs to do something like this:

1) mount --bind /dev /mnt/dev
2) chroot /mnt
3) syslinx ..

wish list: If only syslinux had a -r option like lilo...
I was able to run syslinux from the /mnt directory while in the busybox environment, but
I had to mount the /proc filesystem first:

1) mount --bind /dev /mnt/dev
2) chroot /mnt
3) /bin/mount -t proc proc /proc
3) /usr/bin/syslinux -s /dev/$STICK

The mount /proc and syslinux commands probably need to be put into a temporary script on the /mnt disk and then executed from the chroot command.

Update: 2016 20:15 UTC

After much running around in circles and wild goose chasing, I now find that this patch to the setup.80.make-bootdisk script fixes the problem:
Code:
--- setup.80.make-bootdisk.orig	2013-10-05 19:29:33.000000000 -0700
+++ setup.80.make-bootdisk	2016-06-05 12:37:29.215977085 -0700
@@ -11,15 +11,15 @@
 if [ ! -d $TMP ]; then
   mkdir -p $TMP
 fi
-if [ -z "$T_PX" ]; then
-  T_PX=/
-else
-  T_PX="$1"
-fi
-if [ -z "$2" ]; then
+T_PX=$(pwd)
+if [ "$T_PX" =  "/" ]; then
   ROOT_DEVICE=$(mount | head -n 1 | cut -f 1 -d ' ')
+elif [ "$T_PX" =  "/mnt" ]; then
+  ROOT_DEVICE=$(mount | grep ' on /mnt '| head -n 1 | cut -f 1 -d ' ')
 else
-  ROOT_DEVICE="$2"
+    dialog --title "INTERNAL ERROR CREATING USB BOOT STICK" --msgbox \
+    "Error, the current directory ($ROOT_DEVICE) is neither / nor /mnt" 6 60
+    exit
 fi
 
 while [ 0 ]; do # the bootdisk menu loop
@@ -205,7 +205,7 @@
   umount /dev/$STICK
   rm -r $TMP/bootdisk
   # Make the device bootable:
-  syslinux -s /dev/$STICK 1> /dev/null 2> /dev/null
+  syslinux -s -i /dev/$STICK 1> $RDIR 2> $RDIR
   if [ "$T_PX" = "/" ]; then
     dialog --title "USB BOOT STICK CREATED" --msgbox \
     "The USB boot stick has been successfully created on device /dev/$STICK." 6 60

Last edited by aaazen; 06-05-2016 at 03:15 PM. Reason: problem is simply in the setup.80.make-bootdisk script
 
Old 06-04-2016, 06:50 PM   #17
tuubaaku
Member
 
Registered: Oct 2004
Distribution: Slackware, Mint
Posts: 122

Original Poster
Rep: Reputation: 16
Some updates:
1. I ran a checksum on /boot/vmlinuz-huge-smp-3.10.17-smp and the vmlinuz on the usb boot disk, and they match.
2. I tried using the rootwait option, and it still got stuck waiting for root.
3. fstab contents:
Quote:
/dev/myvg/swap swap swap defaults 0 0
/dev/myvg/root / ext4 defaults 1 1
#/dev/cdrom /mnt/cdrom auto noauto,owner,ro,comment=x-gvfs-show 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
 
Old 06-04-2016, 11:52 PM   #18
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1.2 on Lenovo Thinkpad W520
Posts: 8,958

Rep: Reputation: Disabled
The script /var/log/setup/setup.80.make-bootdisk writes in syslinux.cfg (lines #135 and #138):
Code:
root=$ROOT_DEVICE
As you run it with no argument, ROOT_DEVICE is set this way (line #20):
Code:
ROOT_DEVICE=$(mount | head -n 1 | cut -f 1 -d ' ')
This translates to "the first field of the first line of the output of the mount command", which is the root partition.

In my case for instance as I have in fstab:
Code:
/dev/sdb3       /                ext4        rw,suid,dev,exec,auto,nouser,async,noatime,nodiratime   1 1
the value of ROOT_DEVICE is /dev/sdb3. So far, so good.

But in your case, I assume that this value is /dev/myvg/root. As we have no initrd in the boot stick the device /dev/myvg/root is unknown hence the kernel panic.

This is stated in README_LVM.TXT:
Quote:
... be aware that having your root filesystem on a Logical Volume requires an initial ramdisk (initrd).
Incidentally I would have written the line #20 this way:
Code:
ROOT_DEVICE=$(mount|sed -n "1s/ .*//p")
but there is more than one way to skin a cat

Quote:
Originally Posted by Emerson View Post
Please do not talk unless you know what you are talking about.
You may follow your advice.

Last edited by Didier Spaier; 06-04-2016 at 11:55 PM.
 
Old 06-05-2016, 06:32 AM   #19
tuubaaku
Member
 
Registered: Oct 2004
Distribution: Slackware, Mint
Posts: 122

Original Poster
Rep: Reputation: 16
OK, I tried it with my generic kernel & initrd file - just copied them onto the boot disk, and added this to the syslinux.cfg file:
Quote:
label generic
kernel vmlinuzgen
append root=/dev/mapper/myvg-root vga=normal initrd=initrd.gz ro
Booted off the disk, typed in "generic" at the prompt, and it worked great!

So, it looks like the answer is: a boot disk does not work by default if you're using LVM. You have to add the initrd to the boot disk for it to work. Fortunately, that's pretty easy to do.

Thanks everyone for taking the time to reply. I'll mark this as solved.

Note: it'd be cool to have a message or something from the boot disk creation script that tells you that you have to add an initrd...
 
Old 06-05-2016, 07:54 AM   #20
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 14.2 + Multilib
Posts: 1,483

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
tuubaaku --

Just being curious and I don't have a slackware lvm volume handy to play with ...

When I run the following `file` command on my plain-ole root partition, I see:

Code:
# file --no-dereference --special-files /dev/sda3

/dev/sda3: Linux rev 1.0 ext4 filesystem data, UUID=e1781832-5e18-46a6-832f-17b7ca96c075 (needs journal recovery) (extents) (large files) (huge files)
What do you see if you run:

Code:
# file --no-dereference --special-files /dev/mapper/myvg-root
And I wonder if that output ( ? or maybe there's a better way to do it ? ) could detect root-on-lvm and act accordingly to throw the warning ( or even 'do the right thing' ) in /var/log/setup/setup.80.make-bootdisk ?

Or maybe the fact that your lvm root partition is on '/dev/mapper/' is all the hints needed ?

-- kjh

p.s. We've got quite a few CentOS 6.x machines out in the world and I see this ( not much help ):

Code:
# file --no-dereference --special-files /dev/mapper/vg_01-lv_root
/dev/mapper/vg_01-lv_root: symbolic link to `../dm-0'

# file --no-dereference --special-files /dev/dm-0
/dev/dm-0: Linux rev 1.0 ext4 filesystem data (needs journal recovery) (extents) (large files) (huge files)
 
Old 06-05-2016, 12:04 PM   #21
tuubaaku
Member
 
Registered: Oct 2004
Distribution: Slackware, Mint
Posts: 122

Original Poster
Rep: Reputation: 16
Here's the output:
Quote:
# file --no-dereference --special-files /dev/mapper/myvg-root
/dev/mapper/myvg-root: symbolic link to `../dm-1'
# file --no-dereference --special-files /dev/dm-1
/dev/dm-1: x86 boot sector
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
installing slackware on usb-stick with kernel panic rasidrasid Slackware - Installation 4 01-24-2014 07:31 AM
use alternate kernel from USB stick boot prompt nickboarder27 Slackware 2 05-14-2010 08:09 PM
How to find which drivers - configure kernel to boot off a USB stick without initrd Couling Linux - General 4 10-30-2009 09:04 PM
Kernel Panic with USB stick as >only< linux partition(s) shinobi_dude Linux - Newbie 3 04-18-2007 09:10 AM
usb boot not working ! kernel panic mandrakemikael Feather 12 01-31-2005 10:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:35 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration