The post section of the kickstart configuration file I have been using in CentOS4 looks like this:
%post mount centosmirror:/var/www/html/ks /mnt /mnt/ks/post/post.sh > /root/post_install.log 2>&1 umount /mnt
I tried to do my first CentOS 5 kickstart installation today using an identical post section, but the post install script did not run. After instrumenting the kickstart a bit, I found that the above mount command failed with the following error message:
mount.nfs: Input/output error
Not a very helpful error message -- any clues as to what is going on? It's a little tricky and time consuming to debug kickstart problems like these, so I thought I'd ask the list and hopefully save some time. If I execute that mount command after rebooting the system, it works just fine.
Thanks, Alfred
I'll follow up my original post with some more details (no solution yet, though). The problem is that when I try to do an NFS mount during the post section of the kickstart, I get the following error:
mount.nfs: Input/output error
I modified my kickstart script to not shut down, and when the install completed, I fit Ctrl-Alt-F2 to get to the console. I typed the exact same mount command and it worked. Then I did a "chroot /mnt/ sysimage" and tried the mount command again. This time it failed with the same error and it takes almost 2 minutes for it to time out. Here are the last few lines from an strace of the mount:
11:07:07.320919 lstat64("/etc/mtab", {st_mode=S_IFREG|0644, st_size=24, ...}) = 0 11:07:07.321019 stat64("centosmirror:/local/www/html", 0xbf81ead0) = -1 ENOENT (No such file or directory) 11:07:07.321093 stat64("/sbin/mount.nfs", {st_mode=S_IFREG|S_ISUID| 0755, st_size=55012, ...}) = 0 11:07:07.321195 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID| CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7ff1928) = 4981 11:07:07.323011 wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 32}], 0, NULL) = 4981 11:08:52.343024 --- SIGCHLD (Child exited) @ 0 (0) --- 11:08:52.343135 exit_group(32) = ?
Have there been some changes to the mount command in CentOS 5 that are causing this problem? Anyone else successfully mounted an NFS share in the %post section of a kickstart script?
Alfred
I guess I'll keep following up my own posts until someone else chimes in :-). Seriously, though, had anybody else seen this problem? Has anyone successfully mounted an NFS volume from kickstart wiht CentOS 5? To recap the problem, I have the following commands in the kickstart %post section:
%post mount centosmirror:/local/www/html/ks /mnt /mnt/ks/post/post.sh > /root/post_install.log 2>&1 umount /mnt
It's pretty straight forward, and this has worked for me for years. But not anymore with CentOS 5. The mount command fails with a "mount.nfs: Input/output error" message. Here is an annotated copy of a console session after waiting for the kickstart installation to complete, and then getting to the console using "Ctrl-Alt-F2":
[1] # /usr/bin/mount centosmirror:/local/www/html /tmp # umount /tmp # ls -l /usr/bin/mount lrwxrwxrwx 1 root 0 9 Apr 10 15:41 /usr/bin/mount -> ./busybox # cp /usr/bin/busybox /mnt/sysimage/tmp [2] # /mnt/sysimage/bin/mount centosmirror:/local/www/html /tmp mount: wrong fs type, bad option, bad superblock on centosmirror:/local/www/html, missing codepage or other error In some cases useful info is found in syslog - try dmesg | tail or so
# chroot /mnt/sysimage/ [3] # /tmp/busybox mount centosmirror:/local/www/html /mnt # umount /mnt [4] # /bin/mount centosmirror:/local/www/html /mnt mount.nfs: Input/output error
[After a reboot of the newly installed CentOS 5 system]
[5] # /bin/mount centosmirror:/local/www/html /mnt
The mounts marked [1], [3], and [5] worked, but [2] and [4] didn't, even though they use the exact same binary as [5]. Note that I had to use /tmp as the mount point in steps [1] and [2], because I would have clobbered my environment if I hadn't (I learned this the hard way :-).
Conclusion: the native CentOS 5 mount command fails in a kickstart environment (with two different failure modes depending if you are chrooted or not).
I will probably work around this issue by using wget to copy all the files I need, but I still would like to figure out the root cause. Is this worth filing a bug for (either CentOS or upstream or both)?
Alfred
Alfred von Campe wrote:
I guess I'll keep following up my own posts until someone else chimes in :-). Seriously, though, had anybody else seen this problem? Has anyone successfully mounted an NFS volume from kickstart wiht CentOS 5?
Yes, both in centos 4 and 5.
I do it like this:
mount 172.20.0.1:/home /mnt/temp -o nolock,udp
nolock because the lock deamon isn't running.
Beware that you must not exclude the nfs-utils package from being installed, else it won't work.
Mogens
On Apr 26, 2007, at 2:29, Mogens Kjaer wrote:
Alfred von Campe wrote:
I guess I'll keep following up my own posts until someone else chimes in :-). Seriously, though, had anybody else seen this problem? Has anyone successfully mounted an NFS volume from kickstart wiht CentOS 5?
Yes, both in centos 4 and 5.
I do it like this:
mount 172.20.0.1:/home /mnt/temp -o nolock,udp
nolock because the lock deamon isn't running.
Thank you, thank you, thank you (or should I say tak, tak, tak)! The nolock option did the trick. It wasn't required in CentOS 4, but sure is in CentOS 5. I wonder what defaults have changed (I didn't find anything in the man pages for mount and nfs). In both cases I am accessing the same NFS server, which is a CentOS 4.4 system (soon to be a CentOS 5 system also).
Alfred