Putting a kickstart file onto USB flash drive

view full story

http://forums.fedoraforum.org – Here is a way to prepare a USB flash drive to save your kickstart file to it, and then read the kickstart file from the USB drive during a new Fedora installation. A USB flash drive is recognised by the Linux kernel as just another hard drive. This is how I set up my USB flash drive to use it to store my kickstart file on. You will need a working Linux system to set up the USB drive. If not already installed, Install Gparted GUI partitioner with: [root] # yum install gparted Code: [root]# yum info gparted Loaded plugins: refresh-packagekit Installed Packages                Name      : gparted Arch      : i386 Version    : 0.4.8 Release    : 1.fc10 Size      : 1.3 M Repo      : updates Summary    : Gnome Partition Editor URL        : http://gparted.sourceforge.net License    : GPLv2+ Description: GParted stands for Gnome Partition Editor and is a graphical frontend           : to libparted. Among other features it supports creating, resizing,           : moving and copying of partitions. Also several (optional) filesystem           : tools provide support for filesystems not included in libparted.           : These optional packages will be detected at runtime and don't require           : a rebuild of GParted Place the USB drive into a USB port and then start Gparted. If the machine has only 1 hard drive, called /dev/sda, then the USB drive should show in Gparted as /dev/sdb. The USB partition has to be formatted as FAT or ext2. I've created a primary partition, and formatted it as ext2. The full partition name is /dev/sdb1, as it's the first partition on the USB drive. To name the partition I used the following command: [root]# e2label /dev/sdb1 KickstartFiles Using the e2label command like this, without specifying a label name returns the current partition label: [root]# e2label /dev/sdb1 KickstartFiles Having given the USB drive partition a name, if you press CTRL-R in GParted, it will rescan the drives, and pickup the label name you have assigned to the USB ext2 partition. The next thing to do is to copy a kickstart file to the USB /dev/sdb1 partition. Note: When you insert the USB drive into the USB port, it may be automounted by HAL - the hardware abstraction layer. I have experienced problems with copying files to an automounted USB drive. Messages like network errors when writing to /dev/sdb1 ... Using the df -h command will tell you what drives are currently mounted. [root]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 20G 7.5G 12G 41% / tmpfs 1009M 0 1009M 0% /dev/shm /dev/sda5 12G 2.8G 8.5G 25% /downloads /dev/sda6 5.0G 757M 4.0G 16% /usr/local /dev/sda7 3.0G 198M 2.7G 7% /var/lib/databases /dev/sda8 3.0G 241M 2.6G 9% /srv /dev/sda9 3.0G 1.3G 1.6G 44% /home /dev/sda10 3.0G 748M 2.1G 27% /backup /dev/sda11 1012M 41M 920M 5% /var/log /dev/sda12 2.5G 68M 2.3G 3% /tmp /dev/sdb1 487M 2.3M 459M 1% /media/KickstartFiles So to work round this if the USB drive is automounted, unmount it with: [root]# umount -v /media/KickstartFiles /dev/sdb1 umounted and then create a mountpoint at /media/usb-drive and mount it again manually with: [root]# mount -v -t ext2 -L KickstartFiles /media/usb-drive /dev/sdb1 on /media/usb-drive type ext2 (rw) Now you can copy your kickstart file safely to the USB drive. Doing a fresh Fedora installation using the kickstart file on USB drive. Having set up the USB drive and copied the kickstart file to the drive, you can now use it to do a fresh Fedora installation. At the linux boot splash screen - welcome to Fedora 12! Select 'Install or upgrade an existing system'. (Note: kickstart files only work when doing a fresh installation - not when upgrading an existing system.) Press TAB key (not Return), and edit the boot command to add: linux ks=hd:<device-name>/<path> In this example the <device-name> is sdb1 and for the <path> we will use a kickstart file called F12-default.ks So the command translates to: linux ks=hd:sdb1/F12-default.ks Anaconda, the installer program will now look for the kickstart file called F12-default.ks, in the root directory of the USB drive, So that's how to do a kickstart installation using a USB flash drive! You can now edit your kickstart file on USB drive until it's exactly the way you want it, without having to remaster the Fedora DVD with every change of the kickstart file. :D Attached Images USB-drive-parts.jpg (37.1 KB) (HowTos)