LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 02-09-2017, 07:30 AM   #1
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Install on USB-pendrive - kernel panic


Hi,

well I am trying to install Slackware 14.2 on USB pendrive, standard installation (no live system), so
I partitioned USB, and installed base system on USB,
then installed lilo. Kernel boots properly but it panics or hangs on on 'rootwait' boot kernel option.

As I understand problem is that kernel detects USB pendrive at the very last stage of boot process. I imagined that rootwait kernel boot option solve problems but it did not. I imagined that rootwait is something like: wait to detect al possible devices, I mean wait to the very last stage of boot process, and then try to find root device (and partition).

In details, during installation /dev/sda, /dev/sr0 and /dev/sdb where computer hard drive, optical disk and usb pendrive as detected by installation kernel. Device /dev/sdb has 3 partitions : /dev/sdb1 - root,
/dev/sdb2 - /home and /dev/sdb3 - swap. So liloconfig
contains:
boot device: /dev/sdb
image = /boot/vmlinuz
root = /dev/sdb1
readonly
vmlinuz points to huge-smp kernel.

What I did wrong? Or maybe it is not possible to install Linux in that way? Or maybe I need to make initrd.gz ? Or using GRUB will solve the problem ?
 
Old 02-09-2017, 08:05 AM   #2
alekow
Member
 
Registered: Sep 2009
Distribution: Slackware
Posts: 230

Rep: Reputation: 75
There is some useful information in this thread:

http://www.linuxquestions.org/questi...how-to-919708/

Pozdrawiam
 
Old 02-09-2017, 01:29 PM   #3
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Out of curiosity (and I asked this on your previous thread without a response from you), why are you opposed to using a live system? You notice almost no difference from running a non-live system, but it is so much easier to install.

Anyway, onto your problem. My first guess is that your drives don't match up to what it was during installation. Or in other words, if your thumbdrive was initially /dev/sdb and now it is /dev/sdc, that can prevent booting.

Any time you add that thumbdrive to the computer, it could be assigned any drive designation, which can vary depending on the harddrives hooked up, any memory card readers, or other thumbdrives installed in the system.

The way around this is to use persistent naming for your /etc/lilo.conf and /etc/fstab. I personally use UUIDs when this situation arises, however, you can also use labels, disk id, or PARTUUID (there is also PARTLABEL, but that can only be used in the fstab and not in lilo.conf due to a lack of support in the kernel). Keep in mind, you will need to use an initrd if you use UUID or labels, but if you're running a generic kernel already, then that isn't a big deal (it's not that hard either way).

I wrote up a SlackWiki page on how to switch to UUIDs.
 
Old 02-11-2017, 05:05 AM   #4
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717

Original Poster
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Quote:
Originally Posted by bassmadrigal View Post
Out of curiosity (and I asked this on your previous thread without a response from you), why are you opposed to using a live system?
Sorry for non-answering but I have very limited access to internet (this is one of the reasons I choose Slackware). About live system. Well, why not? When dr Zarhkov asked Emperor Ming the Ruler of the Universe, why did he attack the Earth, answer was exactly: why not? So, my answer is why not to try make common installation on USB?
 
Old 02-11-2017, 07:28 AM   #5
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Overall, it just seems like so much additional work for little to no benefit. But, it's still up to you on how you want to run your computers. And learning can be a substantial benefit, if that's the ultimate end goal

Hopefully the other information in my previous post helps you with your problem.
 
Old 02-13-2017, 04:19 AM   #6
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717

Original Poster
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Quote:
Originally Posted by bassmadrigal View Post
Overall, it just seems like so much additional work for little to no benefit.
Actually, no. I have very old notebook, not dead but dying, for safety I need to run system from external hard drive. If I will succeed in installing on USB pendrive - then I will try to install on USB external hard drive.
 
Old 02-13-2017, 04:31 AM   #7
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717

Original Poster
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Quote:
Originally Posted by alekow View Post
There is some useful information in this thread:

http://www.linuxquestions.org/questi...how-to-919708/
I used ypur how-tos with a little of success - now kernel panics because of there is attempt to kill init process.

I've got two questions: do I need exactly the same kernels on INT and EXT systems? I did your procedure when running from Salix 14.1 (I mean system installed on inner hard drive) while EXT is Slackware 14.2. The needed kernel module for me it seems to be only usb_storage. My EXT sytem is set up on ext2 file system. I did everything as in your how-to, created initrd.gz, reinstalled lilo but still no avail. But not everything went fine - I have missed awk in my Slackware 14.2 installation (EXT!), but it seems that mkinitrd script actually requires awk. So I will install awk and try again.

Pozdrawiam
 
Old 02-13-2017, 05:52 AM   #8
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
add this to your lilo.conf
Code:
append = "rootdelay=10"
rerun lilo.

Last edited by colorpurple21859; 02-13-2017 at 05:57 AM.
 
Old 02-13-2017, 08:04 AM   #9
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by igadoter View Post
Actually, no. I have very old notebook, not dead but dying, for safety I need to run system from external hard drive. If I will succeed in installing on USB pendrive - then I will try to install on USB external hard drive.
You can use a live system on a usb harddrive as well. There's nothing that states it has to be a thumb/pen drive.

Quote:
Originally Posted by igadoter View Post
I used ypur how-tos with a little of success - now kernel panics because of there is attempt to kill init process.

I've got two questions: do I need exactly the same kernels on INT and EXT systems? I did your procedure when running from Salix 14.1 (I mean system installed on inner hard drive) while EXT is Slackware 14.2. The needed kernel module for me it seems to be only usb_storage. My EXT sytem is set up on ext2 file system. I did everything as in your how-to, created initrd.gz, reinstalled lilo but still no avail. But not everything went fine - I have missed awk in my Slackware 14.2 installation (EXT!), but it seems that mkinitrd script actually requires awk. So I will install awk and try again.

Pozdrawiam
If the rootdelay option doesn't work, then this is most likely due to a lack of persistent naming like I mentioned earlier. Check out my earlier link on how to switch your fstab and lilo.conf to UUID.

But you don't need matching kernels. But with lilo, you need to make sure you're chrooted into the root drive of the pendrive to install it to the MBR, otherwise you're running it based on the host system, and it won't update the USB bootloader. Before you chroot, you need to make sure a few items are bind mounted to the USB install. If you have it mounted under /mnt/, you'd use the following, otherwise replace /mnt/ with the mount point of your usb drive.

Code:
mount -o bind /dev /mnt/dev
mount -o bind /proc /mnt/proc
mount -o bind /sys /mnt/sys
Then you would run chroot /mnt, and then you should be able to run lilo. Apologies if you were already aware of that.
 
Old 02-14-2017, 05:45 AM   #10
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717

Original Poster
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Hello from battle front. Partially solved all issues concerning boot of the system. Drivers ehci_hcd, ohci_hcd, uhci_hcd are by default compiled as kernel modules as stated by config file for huge-smp kernel. So I have to add these to my initrd, now system starts but there is another issue: for some reasons system creates additional node device for my pendrive. Now pendrive is referred by both /dev/sdb and /dev/sdc ! Simply the only block devices I have is inner hard drive and usb-pendrive. So there should be no /dev/sdc at all. Also I got input/output errors. But at this point I am satisfied.
 
Old 02-15-2017, 03:03 PM   #11
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,471
Blog Entries: 2

Rep: Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980
solved?
 
Old 02-16-2017, 04:25 AM   #12
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717

Original Poster
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Issue I mentioned in my last post is caused by udev. Once udev is disabled there is no additional node device for usb pendrive. But it is disadvantage so I need to figure out how to tell to udev to completely ignore my usb pendrive which is hosting system.
These are my /etc/fstab
Code:
#/dev/sdb3
UUID=1a505ef1-d705-4007-9f57-fdd853daf5d9  swap     swap   defaults       0 0
#/dev/sdb1
UUID=06ab75a5-2cbe-4c3f-9c28-8baa2198e1ab  /        ext2   defaults       1 1
#/dev/sdb2
UUID=0d0a8ef1-2737-4526-8a84-f1ba85722fcd  /home    ext2   defaults       1 2
devpts                                     /dev/pts devpts gid=5,mode=620 0 0
proc                                       /proc    proc   defaults       0 0
tmpfs                                      /dev/shm tmpfs  defaults       0 0
and /etc/lilo.conf
Code:
# Custom LILO configuration file
# 
# Start LILO global section
 boot = /dev/sdb 

#compact        # faster, but won't work on all systems.

# Standard menu.
# use a boot message with the standard menu:
 message = /boot/boot_message.txt

# Append any additional kernel parameters:
append=" vt.default_utf8=0"
prompt
timeout = 300
# Normal VGA console
vga = normal
# Linux bootable partition config begins
image = /boot/vmlinuz    
  initrd =/boot/initrd.gz
  root = "UUID=06ab75a5-2cbe-4c3f-9c28-8baa2198e1ab"
  label = slack142-usb
  append = "rootdelay=30"
  read-only  # Partitions should be mounted read-only for checking
# Linux bootable partition config ends
I need to figure out how to secure usb pendrive which carries system against any automagical mounter. Usually desktops mounts usb pendrives somewhere under /run/media or /media, but this should be not allowed for this particular usb pendrive. Any help?

I am not marking this thread as solved because it is about creating functionall system on usb pendrive, not about how to boot system on usb pendrive. Still, the system I have is missing some levels of functionality.

Sorry for the above remark. I mark this post as solved because post is clearly about how to boot system on usb pendrive, not how to create functional system on usb pendrive.

Now I am working on to build secure envirnement to install and maintain such kind of installation. But is is quite different story.

Last edited by igadoter; 02-20-2017 at 03:57 AM.
 
Old 02-17-2017, 12:33 PM   #13
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,471
Blog Entries: 2

Rep: Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980
How could the OS automount/do magic. if udev is disabled?

AFAIK, blacklisting Your USB in udev would just prevent it from being detected on a accidental udev restart.

Other than that, there is no way Your (OS hosted) USB pen drive is to be detected - detection requires the event of being plugged in.
To be plugged in, one has to previously be detached, so in effect, where Your pendrive in the state /detached/, we are far cry of worrying about accidental mounts on desktop - we are long gone now already?

So no worry about hot plug events, no worry about udev (registering hot plugged devices)...

Why would there even be an pen shown in a file-manager then?
 
Old 02-20-2017, 04:09 AM   #14
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717

Original Poster
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Quote:
Originally Posted by SCerovec View Post
How could the OS automount/do magic. if udev is disabled?

AFAIK, blacklisting Your USB in udev would just prevent it from being detected on a accidental udev restart.

Other than that, there is no way Your (OS hosted) USB pen drive is to be detected - detection requires the event of being plugged in.
To be plugged in, one has to previously be detached, so in effect, where Your pendrive in the state /detached/, we are far cry of worrying about accidental mounts on desktop - we are long gone now already?

So no worry about hot plug events, no worry about udev (registering hot plugged devices)...

Why would there even be an pen shown in a file-manager then?
I think udev is bundled into initrd sytem. Log of kernel shows that udev starts with initrd and stops before exiting from initrd, then udev is again started by main init process. It is as I was thinking that blacklisting USB should secure USB against udev, but I am not sure it is enough. You didn't read my previous post. With udev enbled USB has two different nodes in /dev. I am suspecting that udev started by main init process detects by its own USB as new hot pluged device, this is why it creates addtional node for the same device.
 
Old 02-20-2017, 04:39 PM   #15
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,471
Blog Entries: 2

Rep: Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980
Post

I would recommend You explore the /etc/mkinitrd.conf file?

You are using a initrd, and there in the said file, udev can be disabled:
Code:
# mkinitrd.conf.sample
# See "man mkinitrd.conf" for details on the syntax of this file
#
#SOURCE_TREE="/boot/initrd-tree"
#CLEAR_TREE="0"
#OUTPUT_IMAGE="/boot/initrd.gz"
#KERNEL_VERSION="$(uname -r)"
#KEYMAP="us"
#MODULE_LIST="ext4"
#LUKSDEV="/dev/sda2"
#LUKSKEY="LABEL=TRAVELSTICK:/keys/alienbob.luks"
#ROOTDEV="/dev/sda1"
#ROOTFS="ext3"
#RESUMEDEV="/dev/sda2"
#RAID="0"
#LVM="0"
#UDEV="1"
#MODCONF="0"
#WAIT="1"
Above listed is the .conf.sample shipped with Slackware.

HTH?
 
  


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
Where to find Wheezy USB or Iso-Hybrid Install from USB Pendrive ? Xeratul Debian 4 12-16-2013 03:36 PM
Installing Linux on pendrive: Kernel panic frenchn00b Linux - General 5 08-10-2007 12:24 PM
USB PENDRIVE Problem with kernel 2.6.10 tandre Linux - Hardware 11 04-20-2005 10:18 PM
USB pendrive not working on kernel 2.6.8.1 (Slack 10.0) mmmm Slackware 7 02-16-2005 02:23 PM
Mandrake on Dell Latitude. Kernel Panic when trying to install on external USB drive JonBoy Linux - Newbie 5 07-20-2003 03:37 AM

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

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