LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Cannot boot slackware13, even with the slackware13 created flashdrive (https://www.linuxquestions.org/questions/slackware-14/cannot-boot-slackware13-even-with-the-slackware13-created-flashdrive-772192/)

uppman 02-11-2010 12:01 AM

Quote:

Not sure why it wouldn't run the initrd. Its even specified in the syslinux.cfg .... I'm not sure what could be wrong. Not sure what to do next, maybe start from scratch?
Did you actually see "Loading initrd..."?

Quote:

wxr-xr-x 5 aaaaa root 16K 1970-01-01 00:00 ..
-rwxr-xr-x 1 aaaaa root 4.8M 2010-02-09 17:43 64
-rwxr-xr-x 1 aaaaa root 2.1M 2010-02-08 18:46 initrd.gz
-rwxr-xr-x 1 aaaaa root 2.7M 2010-02-09 19:02 initrd64.gz
-rwxr-xr-x 1 aaaaa root 181 2010-02-09 18:07 syslinux.cfg
-rwxr-xr-x 1 aaaaa root 188 2010-02-09 18:07 syslinux.cfg~
-rwxr-xr-x 1 aaaaa root 4.8M 2010-02-07 22:57 vmlinuz
You could try to remove syslinux.cfg~ since it might interfere with syslinux.cfg. I have had similar problems with isolinux.

ljones0 02-11-2010 12:39 PM

Quote:

Originally Posted by uppman (Post 3859988)
Did you actually see "Loading initrd..."?

You could try to remove syslinux.cfg~ since it might interfere with syslinux.cfg. I have had similar problems with isolinux.

The text zips off the screen so quick its hard to read(!). So I came up with an idea (!!) I filmed the PC with the USB stick in starting up.

I didn't see it come up with loading initrd at all x.x ! I tried getting rid of syslinux.cfg~ and rerunning syslinux but it didn't seem to have any effect.

ljones

ljones0 02-12-2010 01:21 PM

Over the weekend I hope to try a whole new USB stick and start again totally from scratch. Maybe it is just some sort of weird compatibility problem?

ljones

uppman 02-12-2010 01:36 PM

Quote:

Originally Posted by bkmz222 (Post 3858731)
WHY do you need initrd? I boot my slackware just with rootdelay and directly specifiing root. i.e. in GRUB:
Code:

linux (hd1,6)/boot/vmlinuz root=/dev/sdb6 rootdelay=10

ljones, have you tried this metod? It should work in most cases with the huge kernel.
You can boot from the installation DVD and start you USB-stick from there.

/Magnus

ljones0 02-13-2010 01:48 PM

Quote:

Originally Posted by uppman (Post 3861769)
ljones, have you tried this metod? It should work in most cases with the huge kernel.
You can boot from the installation DVD and start you USB-stick from there.

/Magnus

Nope, not tried it yet. I must admit to have never even used grub, I'd have to try to find out how to use it. I wonder if it can be put on a USB Stick, maybe it works better than syslinux? (no idea!).

Speaking of syslinux and USB sticks I went right back and redid the whole thing, started from scratch, 32 bit only initrd & vmlinuz.

I tried booting the finished result on a 64 bit system.

Here's roughly what I did;

1. Do a minimal (32 bit) (only the stuff out of slackware 'a', so no 'ap','x' etc) install to hard drive (hda1). Edited /etc/fstab and changed the first line from "/dev/hda1" to "/dev/root". Note that this time around I used a real 32 bit system to do this on, before I was using qemu to try to do the same thing.

2. Tar'd everything installed (from hda1), moved the file to a clean (empty) USB stick (USB Stick partitioned with 2 partitions; sda1 as a small fat32 partition, sda2, linux).

3. Untar back to the USB stick from the tar file onto sda2.

4. Wipe hard drive, do a more thorough install and made a brief script;

Code:

#!/bin/sh

oldhome=`pwd`

cd /boot
rm -r -f /boot/initrd-tree
rm /boot/initrd.gz

mkinitrd

cd initrd-tree

rm bin/awk
rm bin/cut

cp /lib/libblkid.so.1 lib/
cp /lib/libext2fs.so.2 lib/
cp /lib/libc.so.6 lib/
cp /lib/libuuid.so.1 lib/
cp /lib/libcom_err.so.2 lib/
cp /lib/ld-linux.so.2 lib/
cp /lib/libpthread.so.0 lib/
cp /lib/libdl.so.2 lib/
cp /lib/libm.so.6 lib/

cp /usr/bin/awk bin/
cp /sbin/blkid sbin/
cp /bin/cut bin/

cd /boot

installpkg -root /boot/initrd-tree /root/files/devs-2.3.1-noarch-25.t?z

cp /root/files/init_13.0.txt /boot/initrd-tree/init

mkinitrd

cd $oldhome

Note that I had the init_13.0.txt in the /root/files dir as well as the devs package.

5. made directory syslinux on the usb stick's fat 32 partition (sda1) and copied /boot/initrd.gz into it along with the already existing /boot/vmlinuz as installed there by slackware itself.

6. Then did syslinux -s /dev/sda1

7. Unmount, remove USB stick from 32 bit system plug into 64 bit and try it out - !

I went back to a normal 32 bit vmlinuz and initrd.gz, but the result was that it still didn't find the partiton and I got dumped out to a command line. The USB stick's linux partition (sda2) this time I named "USB".

After getting dropped out to a command line I tried to look at the init_13.0.txt script to try to see if anything's amiss there.

Here's the results after typing 'set';

(Might be typos from here on as I've had to type these manually off a digital camera - !).

Code:

BOOT_IMAGE='vmlinuz'
HOME='/'
IFS='
'
OPTIND='1'
PATH='/sbin:/usr/sbin:/bin:/usr/bin'
PPID='1'
PS1='\w \$'
PS2='> '
PS4='+ '
PWD='/'
TERM='linux'
_='clear'
initrd='initrd.gz'
label="USB"

So I was looking through the init script and saw stuff, such as ....

Code:

INITRD=`cat /initrd-name`
#ROOTDEV=`cat /rootdev`
#ROOTFS=`cat /rootfs`
LUKSDEV=`cat /luksdev`
RESUMEDEV=`cat /resumedev`
WAIT=`cat /wait-for-root`
KEYMAP=`cat /keymap`

Doing these manually, e.g. cat /initrd-name produced the same result, nothing!

I see after this the script uses a variable called ARG,i.e.

Code:

# Parse command line
for ARG in `cat /proc/cmdline`; do
  case $ARG in
    rescue)
      RESCUE=1
..

echoing $ARG to the screen returned nothing. However, doing this seemed to work a little better;

Code:

for ARG in `cat /proc/cmdline`; do
 echo $ARG
done

produces

BOOT_IMAGE=vmlinuz
initrd=initrd.gz
label="USB"

And typing
Code:

echo $ARG | cut -f2 -d=
manually after this produces "USB". Complete with the quotes. I could put the `` after the -d= there, I get the same result.

But then there's a variable called LABEL_FOR_ROOT but this seems to be totally blank, nothing, empty. I don't profess to be a developer or anything but it almost looks like something could be failing in this piece:

Code:

# Parse command line
for ARG in `cat /proc/cmdline`; do
  case $ARG in
    rescue)
      RESCUE=1
    ;;
# Added by Magnus Uppman 
    label=*)
      LABEL_FOR_ROOT=`echo $ARG | cut -f2 -d=`
    ;;
    uuid=*)       
      UUID_FOR_ROOT=`echo $ARG | cut -f2 -d=`
    ;;
    install)       
      RESCUE=2
    ;;
#
    root=/dev/*)
      ROOTDEV=`echo $ARG | cut -f2 -d=`
    ;;
    rootfs=*)
      ROOTFS=`echo $ARG | cut -f2 -d=`
    ;;
    luksdev=/dev/*)
      LUKSDEV=`echo $ARG | cut -f2 -d=`
    ;;
    waitforroot=*)
      WAIT=`echo $ARG | cut -f2 -d=`
    ;;
    root=LABEL=*)
      ROOTDEV=`echo $ARG | cut -f2- -d=`
    ;;
    resume=*)
      RESUMEDEV=`echo $ARG | cut -f2 -d=`
    ;;
    0|1|2|3|4|5|6)
      RUNLEVEL=$ARG
    ;;
  esac
done

Code:

echo $LABEL_FOR_ROOT  ==>
I am not 100% sure how that works but it dosen't seem to set LABEL_FOR_ROOT at all. Not sure why though!

ljones

uppman 02-14-2010 02:06 AM

Quote:

Originally Posted by ljones0 (Post 3862723)
Nope, not tried it yet. I must admit to have never even used grub, I'd have to try to find out how to use it. I wonder if it can be put on a USB Stick, maybe it works better than syslinux? (no idea!).

It would look almost the same in syslinux.

As boot params:
vmlinuz root=/dev/sdb6 rootdelay=10

In syslinux.cfg:
kernel vmlinuz
append root=/dev/sdb6 rootdelay=10

Quote:


echoing $ARG to the screen returned nothing. However, doing this seemed to work a little better;

Code:

for ARG in `cat /proc/cmdline`; do
 echo $ARG
done

produces

BOOT_IMAGE=vmlinuz
initrd=initrd.gz
label="USB"


ARG is just a temporary variable in a for loop..

Quote:

Code:

echo $LABEL_FOR_ROOT ==>

I am not 100% sure how that works but it dosen't seem to set LABEL_FOR_ROOT at all. Not sure why though!
The variable LABEL_FOR_ROOT is local to the script and its value doesn't show in the shell.

Can you please show the output of cat /proc/partitions and /sbin/blkid?

/Magnus

ljones0 02-14-2010 07:06 AM

2 Attachment(s)
Ok here's the output of cat /proc/partitions & /sbin/blkid. Had to put them here as pictures as there's a lot to type out (running the risk of typos!). I hope they show up ok!

ljones

uppman 02-14-2010 10:27 AM

Quote:

Originally Posted by ljones0 (Post 3863274)
Ok here's the output of cat /proc/partitions & /sbin/blkid. Had to put them here as pictures as there's a lot to type out (running the risk of typos!). I hope they show up ok!

ljones

Everything looks ok. I really don't know what is wrong..

Perhaps you could try with the prebuilt initrd on the wiki?

/Magnus

ljones0 02-14-2010 04:01 PM

I tried that but it did a very similar thing, it crashed out. Also the keyboard mappings seemed to be all over the place x.x.

I wonder if there's a way of hard coding that LABEL_FOR_ROOT variable? Maybe just to test it?

Edit

In the init script there are lots of lines,such as

Code:

LABEL_FOR_ROOT=`echo $ARG | cut -f2 -d=`
UUID_FOR_ROOT=`echo $ARG | cut -f2 -d=`
etc..

I tried the following. After each one of those commands I put something like this in the script....

echo "LABEL_FOR_ROOT=" $LABEL_FOR_ROOT >> dump1
echo "UUID_FOR_ROOT=" $UUID_FOR_ROOT >> dump1

for example becomes .....

Code:

..
..
# Added by Magnus Uppman 
    label=*)
      LABEL_FOR_ROOT=`echo $ARG | cut -f2 -d=`
      echo "LABEL_FOR_ROOT=" $LABEL_FOR_ROOT >> dump1
    ;;
    uuid=*)       
      UUID_FOR_ROOT=`echo $ARG | cut -f2 -d=`
      echo "UUID_FOR_ROOT=" $UUID_FOR_ROOT >> dump1
    ;;
    install)       
      RESCUE=2
    ;;
#
..
..

after each one (I did this for all those lines not just those 2 so that the contents of those variables end up in just one file, dump1). I tried this out and got this:

Code:

LABEL_FOR_ROOT="USB"
RESCUE=
ARG= label="USB"

But no sign of ROOTDEV - ! (I did put an ECHO command in for ROOTDEV!).

Which I guess sounds right because ....

Code:

if [ "$ROOTDEV" = "" ]
 then
  echo "Didn't find the root partition! Try again or exit to a shell?"
  echo -n "(yes,Shell)->"

Thats the message I get, so ROOTDEV is empty for some weird reason!

ljones

uppman 02-15-2010 11:14 AM

Quote:

Originally Posted by ljones0 (Post 3863636)
Code:

if [ "$ROOTDEV" = "" ]
 then
  echo "Didn't find the root partition! Try again or exit to a shell?"
  echo -n "(yes,Shell)->"

Thats the message I get, so ROOTDEV is empty for some weird reason!

ljones

Have you tried "Try again?"? :)

Sometimes it takes a while for a USB-disk to get recognized by the kernel.

Otherwise I don't have a clue..You seem to have a correct value for LABEL_FOR_ROOT so no need to harcode it.

/Magnus

ljones0 02-15-2010 12:31 PM

Quote:

Originally Posted by uppman (Post 3864546)
Have you tried "Try again?"? :)

Sometimes it takes a while for a USB-disk to get recognized by the kernel.

Otherwise I don't have a clue..You seem to have a correct value for LABEL_FOR_ROOT so no need to harcode it.

/Magnus

I must say I didn't try that! I rebooted but it didn't give me a chance to reply to it ('try again'), it just sailed on through and dumped me back at a command line. So I had an alternative idea -- bump up the 10 second wait timer to 30 seconds and see what happens....

There's good news and bad news.

The good news is that it works :) !

The bad news is that I think I must possibly have the slowest USB controller in the universe - (and this is a pretty new system)!

:)

ljones

uppman 02-15-2010 01:36 PM

Quote:

Originally Posted by ljones0 (Post 3864629)
I must say I didn't try that! I rebooted but it didn't give me a chance to reply to it ('try again'), it just sailed on through and dumped me back at a command line. So I had an alternative idea -- bump up the 10 second wait timer to 30 seconds and see what happens....

There's good news and bad news.

The good news is that it works :) !

The bad news is that I think I must possibly have the slowest USB controller in the universe - (and this is a pretty new system)!

:)

ljones

Good to hear! :)

I doubt the controller is slow, more likely the USB-stick..
You can improve the speed by mounting ramdisks over /tmp and /var/tmp in /etc/fstab:

Code:

# Speed up things a bit, use primarly for systems on USB-flash
tmpfs          /tmp    tmpfs  mode=1777      0      0
tmpfs          /var/tmp        tmpfs  mode=1777      0      0

/Magnus

ljones0 02-19-2010 01:51 PM

I must give this another go :) . Though right now someone's given me their cold or flu ..... ugh x.x !

ljones

ljones0 02-28-2010 03:07 PM

Ok .... here's a very rough interim list of what I did;

Done with a normal PC and a test PC.

Slackware 13 32-bit.

USB Memory card

Hard disk

Test install

1. Boot slackware from DVD as normal

2. Make 2 partitions on the hard drive. (ext3) /dev/hda1 / dev/hda2

3. Do a completely normal install to hard drive. To test just install A
packages. Include lilo.

4. Reboot and check it works ok.

5. install a text editor
mkdir /tmp/0
mount /dev/dvd /tmp/0
cd /tmp/0/slackware/ap
installpkg jed*

6. Edit /etc/fstab
jed /etc/fstab
Change /dev/hda1 to /dev/root

7. Save, reboot and check if it all still boots ok.

8. Format second partition with mkfs.ext3 /dev/hda2

9. Mount /dev/hda2 as /tmp/0 -----> mount /dev/hda2 /tmp/0

10. Back up with this:
cd /
tar cvpzf /tmp/0/backup.tgz --exclude=/proc --exclude=/tmp/0/backup.tgz --exclude=/sys --exclude=/tmp /

11. umount /tmp/0

12 Do this:

cd /boot
mkinitrd
cd initrd-tree

rm bin/awk
rm bin/cut

cp /lib/libblkid.so.1 lib/
cp /lib/libext2fs.so.2 lib/
cp /lib/libc.so.6 lib/
cp /lib/libuuid.so.1 lib/
cp /lib/libcom_err.so.2 lib/
cp /lib/ld-linux.so.2 lib/
cp /lib/libpthread.so.0 lib/
cp /lib/libdl.so.2 lib/
cp /lib/libm.so.6 lib/

cp /usr/bin/awk bin/
cp /sbin/blkid sbin/
cp /bin/cut bin/

cd ..

mount /dev/dvd /mnt/dvd
installpkg -root /boot/initrd-tree /mnt/dvd/slackware/a/devs-2.3.1-noarch-25.*


Change delay from 10 to 30 seconds in init_13.0.txt --

..
..
echo "Waiting 10s for USB devices to settle down...."
sleep 10 <---- change to 30

Copy init_13.0.txt to somewhere on the hard drive
cp /root/init_13.0.txt /boot/initrd-tree/init


mkinitrd


13. Grab a USB stick or SD card and partition it

sda1 BOOT Primary Fat32 50MB
sda2 Primary Linux 800MB

Format and name the sda2 partition as "USB" with e2label.

14. Mount sda1 onto /tmp/0 ; mount /dev/sda1 /tmp/0

15. mkdir /tmp/0/syslinux

16. cp /boot/vmlinuz /tmp/0/syslinux

17. cp /boot/initrd.gz /tmp/0/syslinux

18. jed /tmp/0/syslinux/syslinux.cfg
----> default vmlinuz initrd=initrd.gz label="USB"

19. syslinux -s /dev/sda1

20. umount /tmp/0

21.mount sda2 on /tmp/0 ----> mount /dev/sda2 /tmp/0

22. Mount second hard drive partition on /tmp/1 ----> mkdir /tmp/1

23. mount /dev/hda2 /tmp/1

24. Decompress the tar.gz file made earlier;
tar xvpfz backup.tgz -C /tmp/0/

25. cd /tmp/0 and make the missing dirs --
mkdir proc
mkdir sys
mkdir tmp

26. umount /tmp/0,1

if they don't exist on /dev/sda2 mkdir /proc mkdir /sys mkdir /tmp

Boot off USB and try it !

ljones

ljones0 02-13-2011 06:40 PM

Just been trying this for slackware 13.1 and unfortunatly these instructions no longer work with 13.1 though I cannot tell why. All I get is .....

Code:

Kernel panic - no syncing : Attempted to kill init!
Pid: 1, comm : init Not tainted 2.6.33.4-smp #2
Call Trace:

ljones


All times are GMT -5. The time now is 12:35 AM.