[SOLVED] can't boot slackware 14.1 with USB enclosure
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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:
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
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.
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).
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.
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
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?
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
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?
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.
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.
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.
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#
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.