How do I make a Live, Persistent USB of CentOS 4?

General support questions including new installations
Post Reply
evilrobotdrew
Posts: 2
Joined: 2011/07/13 22:51:39

How do I make a Live, Persistent USB of CentOS 4?

Post by evilrobotdrew » 2011/07/13 23:14:09

Google and Reddit aren't being much help, perhaps you fine gentleman can be.

I'm trying to create a LiveUSB install to test the Hardware that comes back to us for testing/repair. CentOS 4.8 works with our drivers, but the problem I'm having is I can't get it to work off USB. The install works fine off the HDD, so I took a dd of it, copied it to a partition on the USB drive, pointed GRUB4dos to the correct partition, and now I'm getting mount errors.


Uncompressing Linux. . . Ok, booting the kernel.
ACPI: Unable to locate RSDP
ide2: I/O resource 0x3EE-0x3EE not free.
ide2: ports already in use, skipping probe
Red Hat nash version 4.2.1.13 starting
mkrootdev: label cent not found
mount: error 2 mounting ext2
mount: error 3 mounting none
switchroot: mount failed: 22
umount /initrd/dev failed: 2
Kernel panic - not syncing: Attempted to kill init!


Relevant fstab entry (was pointing to the label, changed to UUID while attempting to resolve this issue):[code]
# This file is edited by fstab-sync - see 'man fstab-sync' for details
UUID=134b0dba-92c3-4a72-b175-a26ec66f5e67 / ext2 defaults 1 1
#LABEL=cent / ext2 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
#LABEL=SWAP-hda2 swap swap defaults 0 0[/code]


Relevant GRUB entry:
title CentOS for Live Testing \n CentOS live system, with utilities installed for stress, ping, etc. and TOUCH WORKS!
root (hd0,2)
kernel (hd0,2)/boot/vmlinuz-2.6.9-89.EL ro root=LABEL=cent rhgb quiet
initrd (hd0,2)/boot/initrd-2.6.9-89.EL.img


fdisk -l :[code]
Disk /dev/sdb: 4007 MB, 4007624704 bytes
124 heads, 62 sectors/track, 1018 cylinders, total 7827392 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: 0x0005b6bc

Device Boot Start End Blocks Id System
/dev/sdb1 2048 1026047 512000 83 Linux
/dev/sdb2 1026048 1615871 294912 5 Extended
/dev/sdb3 1622168 7418919 2898376 83 Linux
/dev/sdb5 1028096 1212415 92160 83 Linux
/dev/sdb6 1214464 1398783 92160 83 Linux
/dev/sdb7 1400832 1615871 107520 83 Linux
[/code]
(CentOS should be /dev/sdb3)


I've tried using what SHOULD be the major/minor numbers in GRUB for the root device (0819 on my laptop), I've tried leaving the root option out out of grub entirely, using /dev/sda3, using label, and using UUID.

IMHO it looks like it's a problem with the kernel, it doesn't seem to know how to load off the USB, but I'm at a loss of how to fix it. I will probably try installing straight to the USB tonight, but I doubt that is going to work.

It's also entirely possible I'm going about this incorrectly, my main goal is to have CentOS 4.8 (haven't upgraded it to .9 yet) live on a USB drive, where I can install our drivers, use new drivers, shutdown, move to new test system, boot, install different drivers, test systems with our in-house utils, and utils downloaded from the Cent Repos, etc.

Any help is appreciated.
[Moderator edit: Added [i]code[/i] tags to preserve formatting.]

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

How do I make a Live, Persistent USB of CentOS 4?

Post by pschaff » 2011/07/15 15:29:40

Welcome to the CentOS fora. Please see the recommended reading for new users linked in my signature.

Not enough details on how you did the "dd" clone, but possible problems seem to include the filesystem label, duplicate labels/UUIDs, and lack of the proper drivers in the initrd. Doing a dd to a partition of a different size or a device of a different geometry can be problematic. As root please run "blkid | sort" with the device present and show the results.

Installing directly to the USB device should work.

The following Wiki articles may be of interest:
[url=http://wiki.centos.org/TipsAndTricks/ReinstallGRUB]How to re-install bootstrap code (GRUB)[/url]
[url=http://wiki.centos.org/TipsAndTricks/CreateNewInitrd]Creating a New Initial RAM Disk[/url]

evilrobotdrew
Posts: 2
Joined: 2011/07/13 22:51:39

Re: How do I make a Live, Persistent USB of CentOS 4?

Post by evilrobotdrew » 2011/07/18 17:25:27

Thanks for the Reply.

to answer your questions, I did the 'dd' through gparted, the UUID, label, etc were all the same. Grub wasn't having an issue, but the problem was after the initrd tried to pass off the boot process to the kernel, the kernel would flip out because it couldn't find its filesystem. Installing directly to USB fails because it doesn't read the USB as a valid HDD.

the solution was in a previous thread I found with some google-fu
"https://www.centos.org/modules/newbb/viewtopic.php?viewmode=thread&topic_id=4085&forum=27&post_id=11783"

"mkinitrd --with-usb --preload=ehci-hcd --preload=usb-storage --preload=scsi_mod --preload=sd_mod ./usbinitrd-X.X.XX-X.XXXX_LLL X.X.XX-X.XXXX_LLL

where X.X.XX.-X.XXXX_LLL is your kernel's version "

basically I loaded another live system, ran the mkintrd, and boosh, it works fine.

This Live-System has been a thorn in my side for quite a while, i'm glad it's finally working (well, 85% working, still need to write some scripts, automate some steps, make it more streamlined, etc.)

Post Reply

Return to “CentOS 4 - General Support”