Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 36

Thread: Boot Knoppix 3.6 from USB key - How To (Success!)

  1. #11
    Junior Member registered user
    Join Date
    Aug 2004
    Location
    Pune, India
    Posts
    13

    USB Stick Mount Problem Still there

    I am booting form a CD. My HD has crashed.
    Have a Toshiba Satelite 1805-S274.
    First I did not put the stick in USB and started Knoppix Kernal 2.4.26. It shows in the fstab file 4 entries(sda1, sda2,sda3,sda4):

    #Added by Knoppix
    /dev/sda1 /mnt/sda1 auto noauto, users, exec 0, 0

    This is after plugging in the Stick in the USB port. It shows Hard Disk Partition [sda1 thru sda4] on the desktop. But if I click on anyone it gives error Could not mount.Not a valid block device.

    So subsequently

    I logged in as root and did
    #mkdir /mnt/flash
    then when I type in
    #mount /dev/sda1 /mnt/flash
    It gives error
    #Mount: /dev/sda1 is not a valid block device

    I have tried mounting /dev/sda2, /dev/sda3 and even /dev/sda5. Nothing works.

    If I tried to edit fstab file, and remove those entries.
    It doesn't allow me to save it.

    Second Try:

    I have tried first putting the stick in USB and then booting.
    Knoppix.
    It syas in the beginning USB found, managed by Hotplug. Rescanning .. [001 002]

    After the desktop comes up, It shows 4 partitions on the desktop
    Hard Disk 1 thru 4 but no sign of Stick. If I clik on any of them it says

    Step 1:
    Could not mount device
    Mount: /dev/sda1 is not a valid Block drive

    Step 2:
    Have run Utilities, Tools, USB Viewer. After a long time it shows i the left panel:
    USB OHCI Root Hub
    ... usb-storage
    If I click on usb-storage it shows all the details of the
    device including the correct size etc.
    Which means it has recognised the USB stick

    But it doesn't show it in the the 'fstab'

    Step 3:

    Now how do I mount it? What to do with these non-existing hard drives?

    By the way I am a Professor of IT and have used in the past
    SCO Xenix. But that was 10 years ago.

    Thanks a million for your patience and help.

  2. #12
    Senior Member
    Join Date
    Oct 2003
    Location
    GA
    Posts
    382
    Correct me if I'm wrong drmarathe, but I assume your USB stick is not partitioned. In that case would it not just be /dev/sda (or possibly /dev/sdb)?

  3. #13
    Junior Member registered user
    Join Date
    Aug 2004
    Location
    Pune, India
    Posts
    13

    USB Mount still problem.

    Thannks Champagnemojo but /dev/sda doiesn't seem to work. Gives me an error /dev/sda or /dev/sdb is not a block device"

    I have a Transcend Jetflash 128 MB brand new Stick for USB 2.0 and it is working fine on Windows. Also /utilitis/tools/usb view recognises it as

    Flash Disk
    Manufacturer: USB
    Serial No. 61100740FC7A4D7D
    Speed: 12 MB/s
    USB Version : 2.00
    Device Class: 00(>ifc)
    Device Subclass: 00
    Device Protocol: 00
    Max Default Endpoint size: 64
    Number of Configurations: 1
    Vendor Id: 0ea0
    Product ID: 2166
    Revision No. 2.00

    So I think it is being recognised ok.

    The question seems to be what /dev/xxx entry corresponds to this Flash Rom. I am logging in as Root shell so I don't think it is an issue of permissions.

    I need the correct value of this XXX. Any ideas.

    Thanks

  4. #14
    Senior Member
    Join Date
    Oct 2003
    Location
    GA
    Posts
    382
    It seems like it should really be /dev/sdX (and you'd think the X would be a or b). Are you sure you have all of the right kernel modules loaded?

  5. #15
    Junior Member
    Join Date
    Nov 2003
    Posts
    13

    success!

    Ok, here's what I ended up doing. Don't know if all steps are
    necessary:

    BIOS stuff

    1) Flashed the BIOS of my EPIA ME6000 to version 1.13
    2) Changed display setting in BIOS to 'LCD' to get a readable display
    3) Enabled 'boot from USB-HDD' option in BIOS

    From CD-booted KNOPPIX

    4) Ran mkfs.vfat directly on /dev/sda (no partition table)
    5) Copied KNOPPIX CD contents to /dev/sda
    6) Moved boot/isolinux/* to top level of /dev/sda
    7) Renamed isolinux.[cfg|bin] to syslinux.[cfg|bin]

    Edited linuxrc files (still in CD-booted KNOPPIX)

    8) Copied minirt24.gz to /tmp
    9) cd /tmp && mkdir 24 && gunzip minirt24.gz
    10) mount -o loop minirt24 24
    11) edited 24/linuxrc
    a) add a 4 second delay after modules are loaded
    b) force FOUND_KNOPPIX to be /dev/sda and mount that to /cdrom
    12) unmount 24 && gzip minirt24.gz
    13) Copy modified minirt24.gz back to the USB drive
    14) Repeat the whole thing with minirt26.gz

    Get USB key ready to boot (still in CD-booted KNOPPIX)

    15) Download syslinux-2.11.tar.gz
    16) Unmount /dev/sda
    17) Untar and run syslinux on /dev/sda

    Boot from USB Key

    18) Boot from USB key. (I use the USB2 cheatcode for speed).

    And that is about it. I can easily fit an entire KNOPPIX on the 1GB PQI
    iStick, which is great. More fiddling than I hoped for, but the end
    result is a no moving parts computer. I may post the exact linuxrc patch and
    more detailed instructions somewhere on the web in the future, unless I am
    too lazy.

  6. #16
    Junior Member
    Join Date
    Sep 2004
    Posts
    3
    I was wondering if you could send me your version of knoppix that has been made to fit a 512 MB usb key

  7. #17
    Junior Member registered user
    Join Date
    Jan 2004
    Posts
    15
    Making Knoppix 3.6 Bootable from a 1 GB USB Flash Memory Stick
    2004/10/28 pbs

    REQUIRED: 1 GB or more USB stick, Knoppix_V3.6-2004-08-16-EN CD or similar, and an alert mind.

    I've benefited from many suggestions on the web. In kind thanks, here is a yet more "compleat" and commented recipe.


    PREPARATION:

    Read everything through completely before beginning.

    Be awake and alert! While experimenting and learning (the hard way!), I corrupted a couple hard disk partition tables by mistyping -- sda and hda are one character apart, and subconcious habits are dominant when weary! Backups are good. If you decide to try this, the consequences are yours.

    You'll need to be root for these operations. CTRL-ALT-F1 (or F2,F3,F4) is a quick way to switch to root console access, CTRL-ALT-F5 puts you back into the GUI as knoppix rather than as root. Depending on how your hardware is assigned at boot time, the USB stick may be referenced as sda, sdb, or sdc, etc. Notice there is a difference between /dev/sda and /dev/sda1, being the entire drive as a block device or its first partition respectively.

    Backup any important files on your USB to a folder on another disk; the USB stick WILL be reformatted in the process below, and it is then very easy to copy them back afterwards.

    Backup sector 0 from the USB stick (and any other important hard drive!) somewhere safe like onto a floppy. It contains the MBR in the first 306 bytes and the partition table for the first four partitions in the remaining 206 bytes. If need be and you've goofed, you can replace this later by swapping input if= and output of= locations (don't mix them up). Five minutes now can save days of recovery later.

    dd if=/dev/sda of=/dev/fd0/myUSBMBR.bin bs=512 count=1
    dd if=/dev/hda of=/dev/fd0/myHDMBR.bin bs=512 count=1


    PROCESS:

    Partition and format the USB stick. This will wipe out your previous data! Use cfdisk to create a partition >700 Mb (not sure how much is needed), make it bootable and of type 06 for FAT16, and lastly write the configuration back to USB. The menus are easy to use.

    cfdisk /dev/sda
    ...
    mkdosfs /dev/sda1

    Download free SysLinux 2.11 (http://syslinux.zytor.com/) to get a viable MBR for the USB stick. The next commands transfer only 306 bytes rather than 512 because mbr.bin is only that long, leaving the trailing 206 partition table bytes of the sector unchanged.

    cd /Path/To/Unpacked/Syslinux2.11/
    dd if=./mbr.bin of=/dev/sda

    Use syslinux to install ldlinux.sys located at beginning of partition (it doesn't have to be redone later, and both v2.04 included with knoppix or v2.11 worked fine for me).

    ./syslinux /dev/sda1

    Now copy the boot files from the CD.

    mkdir /mnt/sda1
    mount -t vfat /dev/sda1 /mnt/sda1
    cp /cdrom/boot/isolinux/* /mnt/sda1
    cd /mnt/sda1
    mv isolinux.cfg syslinux.cfg
    rm isolinux.bin
    rm boot.cat

    Edit linuxrc inside minirt24.gz (repeat for minirt26.gz if you want)

    cp minirt*.gz /tmp
    gunzip /tmp/m*.gz
    mkdir /mnt/m24
    mkdir /mnt/m26
    mount /tmp/minirt24.gz /mnt/m24 -o loop -o rw
    mount /tmp/minirt26.gz /mnt/m26 -o loop -o rw

    Edit /mnt/m24/linuxrc and add a line midway through the file ...

    test -n "$FOUND_USB" -a -z "$NOUSB" && DEVICES="$DEVICES /dev/sd?[1-9] /dev/sd?[1-9][0-9]"

    ... as shown in the following snippet which shows the lines immediately prior and after. Find it by looking for the commented section line reading

    # Now that the right SCSI driver is (hopefully) loaded, try to find CDROM
    <snip>
    test -n "$FOUND_SCSI" -a -z "$NOSCSI" && DEVICES="$DEVICES /dev/sd?[1-9] /dev/sd?[1-9][0-9]"
    test -n "$FOUND_USB" -a -z "$NOUSB" && DEVICES="$DEVICES /dev/sd?[1-9] /dev/sd?[1-9][0-9]"
    DEVICES="$DEVICES /dev/hd?[1-9] /dev/hd?[1-9][0-9]"
    <snip>

    If you edited it somewhere else as knoppix (e.g. in the GUI), then copied it back as root,
    you may have to set linuxrc back to being root owned.

    ls -al
    chown root:root /mnt/m24/linuxrc
    ls -al

    To repeat this for /mnt/m26, you can just copy the file as both kernel 2.4 and 2.6
    linuxrc files were identical in KNXv3.6 when I compared them with diff.

    cp /mnt/mr24/linuxrc /mnt/m26

    Umount, recompress, and put back on USB stick. Minirt*.gz already has the necessary USB driver files and appropriate sleep times in it now, so there's no need to add those.

    umount /mnt/m2*
    gzip -9 /tmp/mini*
    cp /tmp/mini*.gz /mnt/sda1

    Now copy over the Knoppix directory from the cdrom. Have patience, it's big, and you're probably working at USB1.0 rather than USB2.0 speeds as that's the tested Knoppix default.

    cp -r /cdrom/knoppix /mnt/sda1

    If you like the initial webpage at startup, then copy

    cp /cdrom/index.html /mnt/sda1

    Unmount USB stick and WAIT for changes to finish writing.

    umount /dev/sda1

    Select boot from usb in your PC BIOS -- the specifics are system dependent -- and reboot.


    FINAL NOTES:

    If upon booting you want the USB stick to be writeable, you'll have to mount it again as a loop device. The USB partition containing /KNOPPIX/Knoppix file system is already mounted as read-only, and unfortunately the default desktop icon Hard Disk [sda1] refers to that. Create a new mount point /mnt/myusb to write to the drive.

    mkdir /mnt/myusb
    mount /dev/sda1 /mnt/myusb -o loop -o rw

    ALWAYS remember to unmount the new USB stick access point first to save all cached changes before quitting, or you might corrupt the stick and have to start completely over.

    umount /mnt/myusb

    Hint: if it won't unmount, close all GUI windows that display this drive, cd / to get out of /mnt/myusb in all work spaces, e.g. CTRL-ALT-F1 to F4. You may even have to "init 3", thus closing the GUI to get stuck Konqueror inodes to release (check with "ps aux"). Then try umount /mnt/myusb again. "init 5" will restart the GUI, or "init 6" will complete the shutdown.

    An alternative is to figure out how much is needed for Knoppix and it's boot files, limit the first partition size, and to create a second partition for writing user data. Starting with one partition first helps get it all working; also if everything is all in one space, if you suddenly need room on the USB from another OS or computer, you can wipe out /knoppix/knoppix, then replace it from CD later, though it may get fragmented on rewriting.


    .ISO BOOT?:

    Setting up the USB to boot from a .ISO stored on itself is less easy to do. It requires access to a number of programs in a non-ISO-encapsulated /knoppix/knoppix file system to accomplish the root transfer, and there's not enough room for both. I suppose one could add the necessary programs (and dependencies?) to minirt.gz, but it would likely take much more effort. Cool, but is it really worth it?


    LAST RITES:

    If in the process of experimenting with making the USB stick bootable, you've somehow corrupted it so badly that it cannot be mounted or reformatted under Linux or Windows, and even dd fails (yikes!) to wipe sector 0 with if=/dev/zero count=1, and feel your new stick is utterly destroyed ... don't despair. Http://www.killdisk.com has a freeware windows console utility that runs even under win2k's and winXP's direct disk access restrictions to wipe all blocks on a chosen drive to zero, with no mounting or existing format questions asked. RTFM. And triple check you've got the right drive! You can then reformat. This worked when even the HP Utility format utility got stuck.

    Or worse, suppose you've wiped out the MBR and the partition table of the wrong hard drive, thus losing the starting cluster number for each partition in spite of the precautions above. You can still possibly recover it with "gpart", which will go searching for lost partition tables -- IF you've not made any further writes to the disk: i.e. don't write any type of data, don't delete and recreate partitions with cfdisk, qtparted, or whatever else tempts you. These will rewrite the very information tables needed for recovery. Best advice now is stop, relax!, have a cup of tea, and think it through before trying anything. Don't be hasty. I had already mucked everything up beyond gpart's powers before even knowing it existed, which left me rebuilding my HD from scratch. Now you at least have a valuable headstart hint, if you've read this in time.


    POSTLUDE:

    Good luck, go forth and multiply by sharing; enjoy your bootable, full function Knoppix USB stick with lots more applications, storage, and tinier form factor than a PDA!

  8. #18
    Junior Member
    Join Date
    Nov 2004
    Posts
    1
    Quote Originally Posted by pbs
    Edit linuxrc inside minirt24.gz (repeat for minirt26.gz if you want)

    cp minirt*.gz /tmp
    gunzip /tmp/m*.gz
    mkdir /mnt/m24
    mkdir /mnt/m26
    mount /tmp/minirt24.gz /mnt/m24 -o loop -o rw
    mount /tmp/minirt26.gz /mnt/m26 -o loop -o rw

    Edit /mnt/m24/linuxrc and add a line midway through the file ...

    test -n "$FOUND_USB" -a -z "$NOUSB" && DEVICES="$DEVICES /dev/sd?[1-9] /dev/sd?[1-9][0-9]"

    ... as shown in the following snippet which shows the lines immediately prior and after. Find it by looking for the commented section line reading

    # Now that the right SCSI driver is (hopefully) loaded, try to find CDROM
    <snip>
    test -n "$FOUND_SCSI" -a -z "$NOSCSI" && DEVICES="$DEVICES /dev/sd?[1-9] /dev/sd?[1-9][0-9]"
    test -n "$FOUND_USB" -a -z "$NOUSB" && DEVICES="$DEVICES /dev/sd?[1-9] /dev/sd?[1-9][0-9]"
    DEVICES="$DEVICES /dev/hd?[1-9] /dev/hd?[1-9][0-9]"
    <snip>

    If you edited it somewhere else as knoppix (e.g. in the GUI), then copied it back as root,
    you may have to set linuxrc back to being root owned.

    ls -al
    chown root:root /mnt/m24/linuxrc
    ls -al

    To repeat this for /mnt/m26, you can just copy the file as both kernel 2.4 and 2.6
    linuxrc files were identical in KNXv3.6 when I compared them with diff.

    cp /mnt/mr24/linuxrc /mnt/m26

    Umount, recompress, and put back on USB stick. Minirt*.gz already has the necessary USB driver files and appropriate sleep times in it now, so there's no need to add those.

    umount /mnt/m2*
    gzip -9 /tmp/mini*
    cp /tmp/mini*.gz /mnt/sda1
    All tweaking with minirt2?.gz can be replaced by KNOPPIX cheatcode.
    My idea is leave minirt2?.gz as is. This allows just overrite it when new KNOPPIX version comes.

    Do add cheatcode fromhd=/dev/sda1 to command line or syslinux.cfg

  9. #19
    Junior Member registered user
    Join Date
    Jan 2004
    Posts
    15
    Quote Originally Posted by tuxlmt
    All tweaking with minirt2?.gz can be replaced by KNOPPIX cheatcode.
    My idea is leave minirt2?.gz as is. This allows just overrite it when new KNOPPIX version comes.

    Do add cheatcode fromhd=/dev/sda1 to command line or syslinux.cfg

    Thanks. That is much simpler for many purposes.

    The longer edit does provide autodetection for which drive the stick was mounted (sda1,sdb1,sdc1 ...); this can vary if there are extra slots for assorted camera memory cards or other USB sticks, which may or may not be inserted at boot time. One less thing to remember.

    Take your pick.

    pete

  10. #20
    Senior Member registered user
    Join Date
    Aug 2003
    Location
    Dublin, Ireland
    Posts
    164
    Quote Originally Posted by pbs
    .ISO BOOT?:

    Setting up the USB to boot from a .ISO stored on itself is less easy to do. It requires access to a number of programs in a non-ISO-encapsulated /knoppix/knoppix file system to accomplish the root transfer, and there's not enough room for both. I suppose one could add the necessary programs (and dependencies?) to minirt.gz, but it would likely take much more effort. Cool, but is it really worth it?
    You might want to look at this which outlines one approach to getting iso booting working. The linuxrc patch could be much simpler if you wanted (I had pretty much written a patch to linuxrc so the section to scan the $DEVICES uses an if/esle to make it check if a "fromiso" cheatcode was present and if so to hunt the drives for KNOPPIX.ISO instead of KNOPPIX/KNOPPIX and if it finds one to loop mount it as /cdrom and then check it for KNOPPIX/KNOPPIX and break if it has it.

Page 2 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. AOL & Knoppix == success!!!
    By mabhatter in forum Networking
    Replies: 1
    Last Post: 12-08-2005, 10:38 PM
  2. Replies: 31
    Last Post: 11-07-2004, 08:52 PM
  3. Anyone had success with Knoppix and Madwifi?
    By MaldiGola in forum Networking
    Replies: 0
    Last Post: 09-27-2004, 03:37 PM
  4. Knoppix success story...
    By dvessey in forum The Lounge
    Replies: 3
    Last Post: 03-03-2003, 08:27 PM
  5. Knoppix running from RAM: SUCCESS!! kind of...
    By dvessey in forum Customising & Remastering
    Replies: 14
    Last Post: 02-18-2003, 01:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Cisco GLC-GE-100FX 100BASE-FX SGMII SFP, 1310nm, 2km, LC, MMF picture

Cisco GLC-GE-100FX 100BASE-FX SGMII SFP, 1310nm, 2km, LC, MMF

$83.99



Cisco Systems NCS2K-20-SMRFS-L optical multiplexor CISCO EXCESS picture

Cisco Systems NCS2K-20-SMRFS-L optical multiplexor CISCO EXCESS

$3599.00



Cisco w/ Green Hologram DS-SFP-FC32G-SW FC 32G FC SFP+ Transceiver Module picture

Cisco w/ Green Hologram DS-SFP-FC32G-SW FC 32G FC SFP+ Transceiver Module

$85.00



Cisco Systems Nexus 7700 10 Slot Chassis Fab 3 Mod | N77-C7710-FAB-3 picture

Cisco Systems Nexus 7700 10 Slot Chassis Fab 3 Mod | N77-C7710-FAB-3

$4999.99



Cisco WS-C3850-48P-L 48-Port Gigabit 3850 PoE Switch w/ 715W+ C3850-NM-4-1G Mod picture

Cisco WS-C3850-48P-L 48-Port Gigabit 3850 PoE Switch w/ 715W+ C3850-NM-4-1G Mod

$83.00



Cisco Nexus N9K-C93180YC-EX 48-Port 1/10/25G SFP + 6 40G/100G QSFP28 Switch picture

Cisco Nexus N9K-C93180YC-EX 48-Port 1/10/25G SFP + 6 40G/100G QSFP28 Switch

$789.00



Genuine Cisco SFP-10G-SR V03 10GBASE-SR SFP+ Transceiver Module 10-2415-03  picture

Genuine Cisco SFP-10G-SR V03 10GBASE-SR SFP+ Transceiver Module 10-2415-03

$8.00



Cisco C3850-NM-2-10G 2 Port Network Exp.Module for 3850 picture

Cisco C3850-NM-2-10G 2 Port Network Exp.Module for 3850

$38.99



Cisco Catalyst 3850 WS-C3850-48U-S 48-Port UPOE Gb Switch w/ NM-2-10G (BH) picture

Cisco Catalyst 3850 WS-C3850-48U-S 48-Port UPOE Gb Switch w/ NM-2-10G (BH)

$134.96



Cisco N5K-C5010P-BF 20-Port Nexus 5010 Series 10GbE Gigabit Ethernet Switch picture

Cisco N5K-C5010P-BF 20-Port Nexus 5010 Series 10GbE Gigabit Ethernet Switch

$119.99