English
Ask Your Question
0

usb stick installation cannot allways find ISO image

asked 2012-02-17 08:28:11 +0000

Achim gravatar 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 flag offensive close delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-02-23 00:21:31 +0000

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

edit flag offensive delete publish link more

Comments

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.

Achim ( 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.

Stanislav Ochotnicky ( 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?

Achim ( 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?

Achim ( 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.

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

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

Add answer

[hide preview]

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers to your questions.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.

Stats

Asked: 2012-02-17 08:28:11 +0000

Seen: 1,657 times

Last updated: Feb 23 '12