English

# usb stick installation cannot allways find ISO image

my usb stick uses kickstart to do an unattended installation of centos. The usb device must be declared in the syslinux.cfg file. Is there a way to avoid this? Currently my syslinux.cfg config looks like this: APPEND initrd=initrd.img ks=hd:sdc1:/ks.cfg method=hd:sdc1:/iso This tells syslinux where to find the kickstart file and the iso image to install. Its possible to place the kickstart file to the ramdisk e.g. APPEND initrd=initrd.img ks=file:/mydir/ks.cfg method=hd:sdc1:/iso but still the location of the iso image must be configured. Since the usb device can change e.g. sdb1 etc. this is not very useful. I have tried to set this parameter in the %pre section of the kickstart file harddrive --partition=sdc1 --dir=iso but this does not work. thanks in advance

edit retag close delete

Sort by » oldest newest most voted

Probably the best way is to use UUIDs instead of partition names. First you'll have to figure out UUID of the sdc1 partition (or wherever your iso is). To find this out run blkid:

\$ blkid
/dev/sdc1: SEC_TYPE="msdos" UUID="4B8F-8337" TYPE="vfat"


You'll have to note down the UUID. Then modify your kickstart to use it like this:

APPEND initrd=initrd.img ks=file:/mydir/ks.cfg method=hd:UUID=4B8F-8337:/iso


Where the UUID after hd: is the one you noted down by running blkid

more

not sure if this might work since the device name could change on different machines. When plugin the usb stick in a mchine with 2 harddiscs the usb device name is dev/sdc1 on another machien with single hard disc the device is name /dev/sdb1.

( 2012-02-23 13:52:41 +0000 )edit

Again: This does not depend on device name because it's using device UUID number which never changes unless you format the partition. The sdc1 in my examples is just so you figure out which partition blkid you want to put in there. You don't run the command in syslinux, but while seting it up.

( 2012-02-23 14:02:34 +0000 )edit

Thanks for the prompt answer. This is what I did. I plugged the usb stick in my centos machine and generated the uuid for the partition e.g /dev/sda1. The uuid was 4F46-3971. I added this as you mentioned in the syslinux.cfg file. Then I plugged the stick in another machine and tried to install centos. But still it cannot find the iso drive. Probably I misunderstand here something?

( 2012-02-23 14:11:49 +0000 )edit

or do you mean I should set the partition parameter in the kickstart file? I have tried to set this dynamically but this never worked?

( 2012-02-23 14:18:36 +0000 )edit

may be the problem is the busy box. I tried blkid on the busy box, the command is not available here.

( 2012-02-23 14:55:59 +0000 )edit

[hide preview]