I have a lab where I would like to install Fedora Core 3. Unfortunately, my only resources are that desire, a laptop running RedHat 9 and a friend who has the FC3 CDs, but can't let me have them for an extended period. No blank CDs or a CD burner, though I do have a bootable system rescue CD that I use to ghost with partimage. I live in the desert, so all the floppy drives are buggered even if I did have any floppies.
So, this is the process I used to copy the CDs and then install without having the CDs and bootstrapping without using any of RedHat's media.
So I started by heading over to my friend's office. I wanted to retain the possibility of creating CDs in the future, so I didn't want to mount them and copy the data off. Doing so would lose the el torito boot image and if I remade the ISO9660 (ECMA 119) filesystem it wouldn't be bootable.
Because the CDs are a single data track, I don't have to be
especially careful in copying them. This is good because normally
I would use readcd
which will correctly handle
multisession CDs, but I discovered I don't have
readcd
on my laptop. Fortunately, for a simple copy
like this, I could use the more basic method of:
# dd if=/dev/cdrom of=FC3-i386-discI.iso
This almost worked. There was something funky in how my friend
had burned the CDs and instead of terminating normally, I got some
read errors and the process died. I ran the md5sum
s
and they weren't right, but then I noticed that the files were all
too big. So I ran:
# dd if=FC3-i386-disc1.iso of=FC3-i386-disc1.new.iso bs=1K count=631824
I got the file sizes off of one of the FTP sites. The truncated files then summed correctly.
The basic idea is to do a HTTP install. To do this, I need the files out of the iso images. A simple way would be to mount them on the loopback and copy their contents out. The disadvantage to this is that it will double to storage space required, so instead I decided to do a bunch of symlinks. I wrote a little shell script to handle setting the stuff up:
#!/bin/bash DESTDIR=os ISOPATTERN=FC3-i386-disc\$i.iso PROGPATH="${0%/*}" pushd "$PROGPATH" > /dev/null WORKDIR="$(pwd)" [ -d "$DESTDIR" ] || mkdir -vp "$DESTDIR" for i in $(seq 1 4); do ISO=$(eval echo "$ISOPATTERN") DIR="disc-$i" [ -e "$ISO" ] || (echo "Missing ISO: $ISO" && exit 1) [ -d "$DIR" ] || mkdir -vp "$DIR" mount | grep "$WORKDIR/$ISO on $WORKDIR/$DIR" > /dev/null || sudo mount -o loop "$ISO" "$DIR" || exit 1 for dir in $(find "$DIR" -type d); do [ "$dir" == "$DIR" ] && continue NEWDIR="$DESTDIR/${dir#$DIR/}" [ -d "$NEWDIR" ] || mkdir -vp "$NEWDIR" done for file in $(find "$DIR" -type f); do PROGPATH="${file%/*}" RELPATH=$(echo $PROGPATH | sed -e "s/[^/]\+/../g") NEWFILE="$DESTDIR/${file#$DIR/}" [ -e "$NEWFILE" ] || ln -sv "$RELPATH/$file" "$NEWFILE" done echo "Mounted and symlinked: $ISO" done popd > /dev/null
This mounts the iso images matching ISOPATTERN
on
the loopback and creates a directory structure under
DESTDIR
which has symlinks back to all the files. It
preserves the iso images, but allows up to access the contents as
though they were a unified repository.
Now comes a slightly trickier part. How to actually do the install. The systems currently have an XP install that I want to leave intact. As I mentioned before I don't have any of RedHat's media to boot from, so I need some method for loading the install program using either XP or my system rescue CD. This process is not to difficult (and I strongly suspect there is an easier method than I used).
After booting I from the CD, I created the partition I am going to want to install to. This is, of course, specific to my system and entering these commands directly could hose your hard drive, so don't. The italicized bits are things specific to my configuration, so be sure to change them before using them.
# fdisk /dev/hda << EOF n p 2 +10000M t 2 83 w EOF # mke2fs -j /dev/hda2 # mount /dev/hda2 /mnt/temp1/ # scp -r dys@192.168.99.250:/usr/share/isos/fc3-heidelberg/os/images/pxeboot /mnt/temp1/boot # cp -a /boot/grub /mnt/temp1/boot/ # cat << EOF > /mnt/temp1/boot/grub/grub.conf title FC3 Install root (hd0,1) kernel /boot/vmlinuz root=/dev/hda2 initrd /boot/initrd.img EOF # grub << EOF root (hd0,1) setup (hd0) quit EOF # reboot
After rebooting I pull out the CD and it starts with the fedora
install. I did an install, choose the HTTP install and used
http://192.168.99.250/isos/fc3-heidelberg/os/
as my source.
That's it. The install ran without any problems. If you try this and have any problems, let me know.
On systems running SELinux, you may have problems serving the files from the ISOs mounted on the loopback. One simple fix if your system is local is just to turn off SELinux for a bit with the setenforce 0
command.