Help answer threads with 0 replies.
Go Back > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.


  Search this Thread
Old 03-05-2008, 10:43 PM   #1
LQ Newbie
Registered: Mar 2008
Posts: 5

Rep: Reputation: 0
Cannot mount cdrom in kickstart post-install

I am trying to mount the cdrom in the post section of a kickstart install (on Red Hat 5), but I get the error message :

Block device required

I am doing this from the --nochroot section of the ks like so, but it refuses to mount the device. However, if I later login as root(post reboot), I am able to complete these steps correctly. So its definitely something to do with being in the post section of the kicstart, and not related to me pointing to the incorrect /dev/.. location.
Any ideas???
Oh and I have configured selinux to --permissive. (Does this affect the cdrom mounting? should I disable it?)

-----------ks snippet-------------------------
%post --nochroot
# mount the cdrom
# If no symlink for /dev/cdrom, find the cd-rom device and make one
(cddev="`dmesg | grep '^[sh]d.:' | grep -i cd | head -1 | cut -d: -f1`"

mkdir -p /mnt/cdrom
mount -t iso9660 -o ro /mnt/cdrom /dev/$cddev

# copy over the customized installer
echo "Copying $INSTALLER.gz from the CDROM."
cp /mnt/cdrom/$INSTALLER.gz /tmp
umount -f /mnt/cdrom

gunzip /tmp/$INSTALLER.gz

# run the installer
chmod 755 /tmp/$INSTALLER
echo "Running the $PRODUCTNAME installer."
/tmp/$INSTALLER -i silent

# unmount cdrom & remove the installer
rmdir /mnt/cdrom
rm -f /tmp/$INSTALLER) 2>&1 | tee /post-install.log | tee /dev/console
Old 03-06-2008, 10:10 PM   #2
LQ Newbie
Registered: Mar 2008
Posts: 1

Rep: Reputation: 0

I'm having the EXACT same issue....and am trying to do the very same thing, copy the final build scripts, etc. off of cdrom. I've determined, as you have that in a --nochroot environment, the cdrom is NOT mounted:

Here is what we have mounted
Filesystem 1K-blocks Used Available Use% Mounted on
/dev 127812 0 127812 0% /dev
/tmp/loop0 83264 83264 0 100% /mnt/runtime
/dev/System/root 6094400 1288952 4490876 23% /mnt/sysimage
/dev/System/tmp 4062912 139396 3713804 4% /mnt/sysimage/tmp
/dev/System/csm 507748 18768 462766 4% /mnt/sysimage/csm
/tmp/sda1 124427 11727 106276 10% /mnt/sysimage/boot
/dev 127812 0 127812 0% /mnt/sysimage/dev

Not only that, but the shell environment seems limited. All this works of course when I execute the very same ks.cfg from a network build (difference of course is I specify network vice cdrom)

Are you trying to mount an ISO to a virtual cdrom device as well?

Any luck?

Old 03-10-2008, 01:53 PM   #3
LQ Newbie
Registered: Mar 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Talking Found a fix.

dakotak1d, it turns out the issue is with the anaconda code itself. It ejects the CD before it runs the post section of the ks file.

I followed the directions here and my customized cd is working like a charm. Go ahead and switch the order of the "methodcomplete" and "dopostaction" calls, recompile to get a new stage2.img, replace it in your distrib, and you should be fine.
Old 05-20-2009, 11:37 AM   #4
LQ Newbie
Registered: May 2009
Posts: 3

Rep: Reputation: 0
mounting cdrom in post section

Hmm! you wont have real root by now!
Therefore you cant make a dir on /mnt

Try this:
mkdir /tmp/one
# mount -t iso9660 /tmp/cdrom /tmp/one

then refer to it with:

cp /tmp/one/postinstall(or whatever)

good luck


block, cdrom, device, kickstart, mount

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kickstart %post install from a USB Key Joust Linux - Newbie 2 07-28-2009 09:00 PM
FC6 kickstart doesn't post install pete@cosc. Fedora - Installation 2 01-15-2007 09:54 PM
Kickstart installation. Access to cdrom in %post mrcash Fedora - Installation 2 07-21-2005 12:29 PM
rh9 kickstart post install help stockcowboy Linux - Newbie 1 12-05-2003 12:45 PM
Kickstart Post-install tasks TheRealDeal Linux - General 0 09-03-2003 02:13 AM > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 09:54 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration