Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm having trouble trying to copy files from an nfs mounted remote machine during the the post install with kickstart. First is this possible, and if so can you see what I'm doing wrong? thanks.
My post install:
Actually the nfs mount will be permanent after the install, which is why it's in fstab and it does work.
Also a link '/downloads' is created pointing to the '/mnt/foo/downloads' dir.
My concern is that the mount is not happening during post install.
Oops, I overlooked your link for /downloads. In any event, I don't see anything wrong except for maybe the two entries for %post and %end. I'm not sure how this works out, as I've never tried it. I use post install scripts pretty frequently, but have never tried two entries. My concern is that when it hits the first %end, it stops there without actually copying the files over.
I had read that a'%post --nochroot' section was needed to copy files to the new filesystem. I had originally just used
'cp -r /downloads/thirdparty/importantFolder /opt' in the initial'%post' section but this was not working. This is very frustrating.
After some research I found that the "--nochroot" option would only be used if you wanted to copy something from the installation media(i.e., not in the local structure). However, since you've mounted the nfs directory, it would be handled as if it were a local file. So, you shouldn't need that option. Here's a snipet of a kickstart file I use on a regular basis. I've cut out some things, such as the other 50+ chkconfig entries, to save space here in the thread. But, it includes the pertinent parts.
Code:
%post
# A complete history of the post-install script should be saved
set -x
exec >/var/log/kickstart-post.log 2>&1
#Save a copy of the RPM list as we started
rpm -qa --qf "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" > /var/log/kickstart-rpm.init
# Services to start
/sbin/chkconfig amd on # Automounter
/sbin/chkconfig finger on # Finger server
# Copy locally customized files
mkdir /tmp/localfiles
# copy generic files
mount 192.XXX.XXX.XXX:/kickstart/RedHat/localfiles /tmp/localfiles
# Set up banners
cp -p /tmp/localfiles/issue /etc
cp -p /tmp/localfiles/issue.net /etc
cp -p /tmp/localfiles/nsswitch.conf /etc
cp -p /tmp/localfiles/resolv.conf /etc
I'm wondering if your issue is related to a change in network config. Perhaps the nfs mount isn't actually happening, causing the copy to fail.
After the kickstart and the machine is ready to go, is the nfs still mounted? It would help to narrow down the problem some. Try to figure out if the problem is with the mounting or the copying. My guess would be the nfs mount. I'm assuming that you have nfs configured on the remote machine, but it wouldn't hurt to double check. Honestly, I'm running out of things to try. Everything in your script should work just fine.
I can't figure out how to get any logging to work.
The links to the mounted directory work after reboot. But the mounting there is in the fstab.
So I can't tell if the mount works or not during the post install. I may try to touch a file in the nfs mount dir during the post.
Mounting:
Noticed 'mount.nfs: Input/output error' in kickstart log file.
Apparently in CentOS 5 you have to add '-o nolock,udp' to the mount command when using it in kickstart:
mount 206.xxx.xxx.xxx:/downloads /mnt/foo/downloads -o nolock,udp
Then the copy worked:
cp -r /mnt/foo/downloads/thirdparty/importantFolder /opt
Logging:
I wasn't adding '/mnt/sysimage' to my log path
%post --log=/mnt/sysimage/root/kick.log
A little confused on when to use '/mnt/sysimage' in my paths. In this case I needed it for the logging but not the copy.
It's interesting that you had to specify the "udp" option, since that is the default option I believe. In any event, I'm glad to hear that you found the problem.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.