My USB key story. (succes)

Questions about problems with your hardware. For example, if you the kernel hangs during boot because of an hardware failure or if you have a problem with a driver not working or missing.
vonloschz
Posts: 4
Joined: 04 Nov 2005, 19:05

My USB key story. (succes)

Postby vonloschz » 05 Nov 2005, 04:20

I tries several way to boot from my usbkey with SystemRescueCd and got no luck.
ATM I have Damn small linux, Feather Linux, Debian NetInstall, RIP Linux and now SystemRescueCd. Next step is BartPE.
Here is my step by step to my succes.

1 - USB Key
I ajust my usbkey to usb-zip storage format. (1024 cylinder and 32 head)
I have a 1 gig FAT16 partition on my 2 gig key.
I use the mkdiskimage script to ajust, partition and format the usb key.

Code: Select all

        Disk /dev/sdc: 2097 MB, 2097152000 bytes
        64 heads, 32 sectors/track, 2000 cylinders
        Units = cylinders of 2048 * 512 = 1048576 bytes

        Device Boot      Start         End      Blocks   Id  System
        /dev/sdc4   *           1        1024     1048560    6  FAT16


2 - Syslinux bootloader
Source : syslinux v3.11

Code: Select all

echo mtools_skip_check=1 > ~/.mtoolsrc
syslinux /dev/sdc4
You can test your syslinux by booting on your usbkey and see the syslinux logo and the ldlinux.sys at the root of your usb key.


2.1 - Syslinux.cfg

Code: Select all

label scd
kernel vmlinuz1
append initrd=initrd1 acpi=off root=/dev/ram0 init=linuxrc noscsi usbstick cdcache vga=794
label menu
kernel srcdmenu.com
cdcache is the key of this story. I remove dokeymap too.


3 - SystemRescueCd
source : v0.2.16_pre2
Copy from the isolinux dir on the CD.

Code: Select all

maps , inirtd1, keyb.tkl , srcdmenu.com , vmlinuz1
And the must important part

Code: Select all

sysrcd.dat
from the root dir of the CD to the root dir of the usb key.


4 - linuxrc hack
copy inirtd1 to /tmp then ...

Code: Select all

mv initrd1 initrd1.gz && gunzip initrd1.gz && mount -o loop initrd1 /mnt/test

Edit /mnt/tmp/linuxrc ...
ASKKEYMAP="no"

Code: Select all

findusbmount()
{
    if mount -t vfat -r /newroot/dev/scsi/host0/bus0/target0/lun0/part4 /newroot/mnt/cdrom; then
        if [ ! -e /newroot/mnt/cdrom/sysrcd.dat ]; then
            echo -e "${HILITE}---- /newroot/../part4 is not a Live-USB Stick; skipping...${NORMAL}"
            umount /newroot/mnt/cdrom
        else
            mounted=/newroot/dev/scsi/host0/bus0/target0/lun0/part4
            echo -e "${HILITE}---- USB medium found on /newroot/dev/../.part4${NORMAL}"
        fi
    fi
}
You see I change "part1" to "part4".

Repack your initrd1 and copy to your usb key.

Code: Select all

umount /mnt/test && gzip -9 initrd1 && mv initrd1.gz initrd1 && cp initrd1 /media/usb4 && umount /media/usb4
My /dev/sdc4 was mounted in /media/usb4 of course.


End
Nothing more nothing less.
And is the first time I made a guide in english.

guest

Postby guest » 06 Nov 2005, 05:18

Thanks for that, i have been pulling my hair out trying to get rescue cd installed to my multi partition usb key. Unfortunately I cant get syslinux to ever work, so i made an ext2 partition at the end of the stick and installed grub to its mbr. Works ok, with the added bonus that windows cant see it, and therefore i cant delete it when moving files around the place.

Guest

Re: My USB key story. (succes)

Postby Guest » 27 Dec 2005, 00:03

vonloschz wrote:I tries several way to boot from my usbkey with SystemRescueCd and got no luck.
ATM I have Damn small linux, Feather Linux, Debian NetInstall, RIP Linux and now SystemRescueCd. Next step is BartPE.
Here is my step by step to my succes.

1 - USB Key
I ajust my usbkey to usb-zip storage format. (1024 cylinder and 32 head)
I have a 1 gig FAT16 partition on my 2 gig key.
I use the mkdiskimage script to ajust, partition and format the usb key.

Code: Select all

        Disk /dev/sdc: 2097 MB, 2097152000 bytes
        64 heads, 32 sectors/track, 2000 cylinders
        Units = cylinders of 2048 * 512 = 1048576 bytes

        Device Boot      Start         End      Blocks   Id  System
        /dev/sdc4   *           1        1024     1048560    6  FAT16


2 - Syslinux bootloader
Source : syslinux v3.11

Code: Select all

echo mtools_skip_check=1 > ~/.mtoolsrc
syslinux /dev/sdc4
You can test your syslinux by booting on your usbkey and see the syslinux logo and the ldlinux.sys at the root of your usb key.


2.1 - Syslinux.cfg

Code: Select all

label scd
kernel vmlinuz1
append initrd=initrd1 acpi=off root=/dev/ram0 init=linuxrc noscsi usbstick cdcache vga=794
label menu
kernel srcdmenu.com
cdcache is the key of this story. I remove dokeymap too.


3 - SystemRescueCd
source : v0.2.16_pre2
Copy from the isolinux dir on the CD.

Code: Select all

maps , inirtd1, keyb.tkl , srcdmenu.com , vmlinuz1
And the must important part

Code: Select all

sysrcd.dat
from the root dir of the CD to the root dir of the usb key.


4 - linuxrc hack
copy inirtd1 to /tmp then ...

Code: Select all

mv initrd1 initrd1.gz && gunzip initrd1.gz && mount -o loop initrd1 /mnt/test

Edit /mnt/tmp/linuxrc ...
ASKKEYMAP="no"

Code: Select all

findusbmount()
{
    if mount -t vfat -r /newroot/dev/scsi/host0/bus0/target0/lun0/part4 /newroot/mnt/cdrom; then
        if [ ! -e /newroot/mnt/cdrom/sysrcd.dat ]; then
            echo -e "${HILITE}---- /newroot/../part4 is not a Live-USB Stick; skipping...${NORMAL}"
            umount /newroot/mnt/cdrom
        else
            mounted=/newroot/dev/scsi/host0/bus0/target0/lun0/part4
            echo -e "${HILITE}---- USB medium found on /newroot/dev/../.part4${NORMAL}"
        fi
    fi
}
You see I change "part1" to "part4".

Repack your initrd1 and copy to your usb key.

Code: Select all

umount /mnt/test && gzip -9 initrd1 && mv initrd1.gz initrd1 && cp initrd1 /media/usb4 && umount /media/usb4
My /dev/sdc4 was mounted in /media/usb4 of course.


End
Nothing more nothing less.
And is the first time I made a guide in english.


Return to “Hardware and drivers”

Who is online

Users browsing this forum: No registered users and 2 guests