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 12-20-2016, 01:47 AM   #1
xiongnu
Member
 
Registered: Sep 2004
Distribution: Devuan, Void
Posts: 264

Rep: Reputation: 23
can't boot slackware 14.1 with USB enclosure


hi, i have slackware 14.1 installed on a spare 2.5" laptop IDE HD connected to my desktop computer through IDE interface card.

after purchasing a USB-IDE enclosure, i pulled the HD from my desktop computer and put it in the enclosure and connect to the desktop through USB cable. however, i could no longer boot Slackware anymore, receiving "kernel panic-not syncing: VFS: unable to mount root fs" error.

after doing some search, i reconnected the HD with IDE interface card, boot it and issuing the following command to enable slackware usb boot:
Code:
cd /boot
mkinitrd -c -k 3.10.17-smp -m usb-storage:ehci-pci:ehci-platform -u -w 10 -f ext4 -r /dev/sdb4
then edit 'lilo.conf', adding 'initrd = /boot/initrd.gz', my Slackware is located on 'sda4' of the harddrive.

fdisk -l
/dev/sda1 NTFS
/dev/sda2 solaris
/dev/sda3 linux swap
/dev/sda4 linux

Now i couldn't boot SL either through USB or IDE interface, receiving errors:
Code:
mount: mounting /dev/sdb4 on /mnt failed: no such file or directory
Error:  no /sbin/init found on rootdev(or not mounted). trouble ahead.  
you can try to fix it. type 'exit' when things are done.
/bin/sh: can't access tty; job control turned off

Last edited by xiongnu; 12-20-2016 at 01:52 AM.
 
Old 12-20-2016, 03:30 AM   #2
aragorn2101
Member
 
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 567

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
Hi,

There a couple of issues I can see here. Firstly, when you plug a device to a motherboard, the device is assigned id's. As you saw, the sda's and sdb's.
Now, one simple issue here will be that when you move the HD from one machine to another, the id can be different there, depending on the number of such devices already plugged to the motherboard. Thus, when lilo is trying to boot the kernel, it sees the "root" partition simply missing. You understand that making an initrd in this case is even more problematic, since the initrd must have the root fs wired in.

Another issue can be MBR. But this problem can be worked around. If you have bootable USB or a disk already connected to the computer with LILO or GRUB, you can get a terminal inside the bootloader and type in the boot parameters, kernel, fs, etc, provided you know on which sda's or sdb's is your Slackware.

Cheers.
 
2 members found this post helpful.
Old 12-20-2016, 05:27 AM   #3
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,747

Rep: Reputation: Disabled
Assuming there is internal drive sda and your root partition is USB external sdb4 I would add delay:

Code:
/boot/vmlinuz ro root=/dev/sdb4 rootdelay=5 rootfstype=ext4
 
2 members found this post helpful.
Old 12-20-2016, 06:59 AM   #4
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
To go along with aragon2101's post, the system probably doesn't list your usb device as /dev/sda anymore. It could be /dev/sdb or even /dev/sdq, depending on what devices are on your computer (even memory card slots without cards can take a device name).

There are ways around this, but it takes a bit of work.

UUID (Universal Unique IDentifiers) is one of the ways around it. They are generated whenever you format a partition. You can use those directly in your /etc/lilo.conf, /etc/fstab, and your initrd. You can find your UUIDs using either the blkid command or viewing /dev/disk/by-uuid/ (make sure you do an ls -l on it so you can see what devices they're linked to). Then, you'd replace any instance of /dev/sda4 with "UUID=your-uuid-here" in your lilo.conf, fstab, and mkinitrd command.

For further information, you can see the wiki page I wrote on it.

In addition, elcore presented you with another thing that might help your problems. USB devices can sometimes take a bit to initialize. If the USB device hasn't fully initialized by the time lilo is set to pass control, then you will also get a failed boot. You can give it more time by adding rootdelay=$seconds to your append line in /etc/lilo.conf. You can pick the number of seconds, but a long one could cause an unnecessary increase in the boot time. Personally, if you run into issues after switching to UUIDs, I would first go with a relatively large number of seconds, probably 30 seconds or so to see if the problem is due to the USB initializing. If that works, then you can try going lower until you find the right number (I'd probably cut that in half to 15 seconds and see if that works, if that does, you can cut it in half(ish) again to 7 seconds and so on).
 
1 members found this post helpful.
Old 12-20-2016, 07:16 AM   #5
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
if you got another Linux on your main HDD now. just boot into that, then plug in your Slack External hdd, then run update-grub that should fix it.

If you are using LILO to boot it, then as said prior, you'll have to figure out what that new address to it is, then replace that in your lilo config, then update lilo.

Remember, if you got other stuff plugged into different usb ports at the same time before boot up it may change the address to your external Slackware hdd.

Last edited by BW-userx; 12-20-2016 at 07:25 AM.
 
Old 12-20-2016, 10:23 AM   #6
Paulo2
Member
 
Registered: Aug 2012
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 919

Rep: Reputation: 509Reputation: 509Reputation: 509Reputation: 509Reputation: 509Reputation: 509
Quote:
Originally Posted by xiongnu View Post
Code:
cd /boot
mkinitrd -c -k 3.10.17-smp -m usb-storage:ehci-pci:ehci-platform -u -w 10 -f ext4 -r /dev/sdb4
Maybe ext4 is missing in the modules list 'usb-storage:ehci-pci:ehci-platform:ext4'
ext4 will add another two modules if I remember correctly.
I used to boot a Slackware install from usb with a delay of five seconds, I think your -w 10 is ok.
I never used the -u option, so I don't have experience.

Quote:
Originally Posted by xiongnu View Post
then edit 'lilo.conf', adding 'initrd = /boot/initrd.gz', my Slackware is located on 'sda4' of the harddrive.

fdisk -l
/dev/sda1 NTFS
/dev/sda2 solaris
/dev/sda3 linux swap
/dev/sda4 linux

Now i couldn't boot SL either through USB or IDE interface, receiving errors:
Code:
mount: mounting /dev/sdb4 on /mnt failed: no such file or directory
Error:  no /sbin/init found on rootdev(or not mounted). trouble ahead.  
you can try to fix it. type 'exit' when things are done.
/bin/sh: can't access tty; job control turned off
Do you have two hard-disks? One internal (/dev/sda) with Slackware installed in /dev/sda4
and one usb with Slackware installed in /dev/sdb4?
 
1 members found this post helpful.
Old 12-20-2016, 10:47 AM   #7
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Looking even closer at this as well.

Code:
mount: mounting /dev/sdb4 on /mnt failed: no such file or directory
Error:  no /sbin/init found on rootdev(or not mounted). trouble ahead.  
you can try to fix it. type 'exit' when things are done.
/bin/sh: can't access tty; job control turned off
What file is telling it to mount /dev/sda4 to /mnt?

it should not even be doing that if you are now trying to boot it. Because is not that where your Slackware OS is installed on the USB port. It should be something like sdbx on the USB port that you've made it an external? What fstab has that entry in it to mount /dev/sda4 to /mnt , and why?

if you are booting it straight from the USB Port then remove it by commenting it out, for now.

It should be when booting into your external just using it for a boot drive that the system is on. Not trying to mount it to anything.

In your USB exernal SLack that fstab should now read if not using UUID something like this
Code:
 /dev/sdb4 /  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
with your swap drive: Is this a typo, or a copy paste? because of the sda for your external system (?) when external should be anything but sda.
Quote:
fdisk -l
/dev/sda1 NTFS
/dev/sda2 solaris
/dev/sda3 linux swap
/dev/sda4 linux
swap being on /dev/sda3 now that your Slack is to be on sdb4 (?), did you fix your fstab in that Install of Slack? Is it even causing that Slack to not find it now too?

Last edited by BW-userx; 12-20-2016 at 10:51 AM.
 
1 members found this post helpful.
Old 12-20-2016, 06:47 PM   #8
xiongnu
Member
 
Registered: Sep 2004
Distribution: Devuan, Void
Posts: 264

Original Poster
Rep: Reputation: 23
Quote:
Originally Posted by BW-userx View Post
if you got another Linux on your main HDD now. just boot into that, then plug in your Slack External hdd, then run update-grub that should fix it.

If you are using LILO to boot it, then as said prior, you'll have to figure out what that new address to it is, then replace that in your lilo config, then update lilo.

Remember, if you got other stuff plugged into different usb ports at the same time before boot up it may change the address to your external Slackware hdd.
thank you!
I was able to boot into voidlinux on a seperate harddrive with sl14.1 usb plugged in the same pc and ran 'update-grub'.
'update-grub' didn't detect 'slackware', instead it detects 'windows xp'. however, i was able to boot into slackware single-user shell upon rebooting the machine from the usb.

here's the output:
Code:
root@ :# fdisk -l
warning:  gpt (guid partition table) detected on 'dev/sda'! the util fdisk doesn't support gpt, use GNU parted.

Disk /dev/sda:  10.2GB
disk identifier: 0x00510051

Device Boot
/dev/sda1 *   2048  19925879  9961916  83 Linux

warning:  gpt (guid partition table) detected on 'dev/sda'! the util fdisk doesn't support gpt, use GNU parted.

Disk /dev/sdb: 80.0GB
...

Disk identifier: 0x3a393a38

Device    boot   start     end        blocks    id  systems
/dev/sdb1       63        41942879    20971408   7    hpfs/ntfs/exfat
/dev/sdb2   *   49945715   83875364    20964825  bf  solaris
/dev/sdb3       83875365   85867424    996030    82   linux swap
/dev/sdb4   *   85867425   125805014   19968795   83   linux


root@ :#  cat /etc/fstab
/dev/sda3    swap   swap  defaults  0 0
/dev/sda4    /      ext4  defaults  1 1
/dev/sda1    /mnt/win   ntfs-3g  fmask=133, dmask=022  1 0
devpts       /dev/pts   devpts   gid=5, mode=620     0 0 
proc         /proc       proc     defaults           0  0 
tmpfs        /dev/shm    tmpfs    defaults            0  0
sda is my harddrive with voidlinux, sdb is the usb drive where slackware resides (sdb4)

i wasn't able to edit /etc/fstab because system prompt says it's Read-only File system.
 
Old 12-20-2016, 07:06 PM   #9
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by xiongnu View Post
thank you!
I was able to boot into voidlinux on a seperate harddrive with sl14.1 usb plugged in the same pc and ran 'update-grub'.
'update-grub' didn't detect 'slackware', instead it detects 'windows xp'. however, i was able to boot into slackware single-user shell upon rebooting the machine from the usb.


i wasn't able to edit /etc/fstab because system prompt says it's Read-only File system.
If you can as I think you can. Jut boot into Void first, then plug in your USB Slackware,
Code:
sudo blkid
to get the actaul path to slackware.

mount your partition that root is on in slackware.
Code:
sudo mount /dev/sdxx /mnt
cd /mnt
then go into your /mnt/etc directory. then as root or sudo to edit your fstab.
or
if you get into slack single user, try
Code:
#mount -o remount, rw /
to mount it again as read write and do the same using nano or vi or vim whichever you're comfortable with, and whichever is easier for you to do. that second one I've never done before, so.


as far as with void, you can try installing grub again then update-grub, I have the same situation at times with my Void picking up Slack sometimes. that is why I kept an original copy of grub on a first install, I use it for 40_custom whenever my grub messes up.


for void Linux edit /etc/grub.d/40_custom

add this with modification to your specs to match both your /dev/sdxx path and whatever kernel Slack is using on your system, and UUID


I added this to my 40_custom and booted off of it to ensure it worked. which it did. All you have to do is plug in your data for your system.

Code:
	menuentry 'Slackware Linux (Slackware 14.2) (on /dev/sda1)' --class slackware --class gnu-linux --class gnu --class os users {
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos1'
        search --no-floppy --fs-uuid --set=root 0baa980f-bb05-444c-b174-0c8fd2492a53 --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1
 
        linux /boot/vmlinuz-huge-4.4.38 root=/dev/sda1 ro
}
MAKE sure that all of the bold text is updated with your systems actual UUID, path. /dev/sdxx and hd0, msdos1.

if you do not understand that last part. it is zero based. 0 = one 1 = two 2 = three

hd0 indicates first hard drive, msdos1 indicates the first partition on that hard drive.

grub - 2 Naming convention


To get your UUID for your external HDD. be inside of void, then
Code:
sudo blkid
copy paste it into your file.

Whence you get that situated in your 40_custom on Void Linux then update grub again and it will add it to your boot listings in grub then you will be able to use Void Grub to boot slack external without problems.

to check your grub.cfg to ensre it has been added just
Code:
 sudo cat /boot/grub/grub.cfg
you should see it on the bottom looking something like this.
Code:
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.


menuentry 'Slackware Linux (Slackware 14.2) (on /dev/sda1)' --class slackware --class gnu-linux --class gnu --class os users {
	insmod part_msdos
	insmod ext2
	set root='hd0,msdos1'
        search --no-floppy --fs-uuid --set=root 0baa980f-bb05-444c-b174-0c8fd2492a53 --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 
#--hint-baremetal=ahci0,msdos1 0baa980f-bb05-444c-b174-0c8fd2492a53
	linux /boot/vmlinuz-huge-4.4.38 root=/dev/sda1 ro
}

### END /etc/grub.d/40_custom ###

so to summarize.

fix fstab in Slack, and fix 40_custom in Void and you should be ok from there. You'll be able to boot off of Void Linux Grub, but if you want to use boot first USB HDD then lilo from Slack to boot straight into Slack well then that is something completely different.

but I am sure it can be done.

Last edited by BW-userx; 12-20-2016 at 08:49 PM.
 
1 members found this post helpful.
Old 12-20-2016, 09:48 PM   #10
xiongnu
Member
 
Registered: Sep 2004
Distribution: Devuan, Void
Posts: 264

Original Poster
Rep: Reputation: 23
Thanks a lot! Worked like a champ

I mounted the SL linux partition in Void and updated 'mnt/etc/fstab'.

Code:
/dev/sdb3        swap             swap        defaults         0   0
/dev/sdb4        /                ext4        defaults         1   1
/dev/sdb1        /mnt/win         ntfs-3g     fmask=133,dmask=022 1   0
#/dev/cdrom      /mnt/cdrom       auto        noauto,owner,ro,comment=x-gvfs-sh$
/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
Now i'm able to boot directly into Sl through USB I'll probably replace the partition names with UUID as folks suggested above.
my intention with this disk is to use it as portable OS when i travel.

appreciate everyone's help here

Code:
bash-4.2# fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sda: 10.2 GB, 10202050560 bytes
120 heads, 13 sectors/track, 12773 cylinders, total 19925880 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00510051

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    19925879     9961916   83  Linux

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3a393a38

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63    41942879    20971408+   7  HPFS/NTFS/exFAT
/dev/sdb2   *    41945715    83875364    20964825   bf  Solaris
/dev/sdb3        83875365    85867424      996030   82  Linux swap
/dev/sdb4   *    85867425   125805014    19968795   83  Linux
bash-4.2# blkid
/dev/sda1: UUID="6a95bebc-beaa-4b49-a99f-6ea23c81787f" TYPE="ext4" 
/dev/sdb1: UUID="8AA0E4F5A0E4E8A1" TYPE="ntfs" 
/dev/sdb3: UUID="6faddc5e-8660-406d-a8b1-da1124368b0e" TYPE="swap" 
/dev/sdb4: UUID="f487c8e1-a959-4cfa-8a2e-c8718660dcaf" TYPE="ext4" 
/dev/sdb5: LABEL="rpool" UUID="9443950123409513777" UUID_SUB="8757308412115109673" TYPE="zfs_member" 
bash-4.2#
 
Old 12-21-2016, 04:45 AM   #11
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,873

Rep: Reputation: 4982Reputation: 4982Reputation: 4982Reputation: 4982Reputation: 4982Reputation: 4982Reputation: 4982Reputation: 4982Reputation: 4982Reputation: 4982Reputation: 4982
Quote:
Originally Posted by Paulo2 View Post
I never used the -u option, so I don't have experience.
It used to tell mkinitrd to include udev support, but udev is required now and you get it whether you specify -u or not. You can safely leave '-u' off. It does nothing.


BTW, using LVM is another good way of abstracting device names and avoiding these sorts of issues.

Last edited by GazL; 12-21-2016 at 04:47 AM.
 
3 members found this post helpful.
Old 12-21-2016, 07:14 AM   #12
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by xiongnu View Post
my intention with this disk is to use it as portable OS when i travel.
Would you want to have a complete working Linux OS on an USB Stick instead? it will fit in your pocket better.

How to install a complete Void Linux OS on USB Stick

Last edited by BW-userx; 12-21-2016 at 07:19 AM.
 
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
[SOLVED] New Install Won't Boot Unless Drive is in USB Enclosure doctorcisco Linux Mint 2 06-04-2012 09:32 PM
[SOLVED] USB SATA HD Docking Enclosure - AHDDU100F not recognized with Slackware 12.1 mostlyharmless Slackware 1 04-04-2009 06:39 PM
USB Enclosure? vonedaddy Linux - Hardware 5 02-04-2008 02:13 PM
USB HDD Enclosure Xswitch Ubuntu 3 11-22-2006 10:47 AM
About USB enclosure satimis Linux - Hardware 4 10-07-2006 06:20 AM

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

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