Operating System - HP-UX
1827249 Members
2834 Online
109716 Solutions
New Discussion

How can I correctly export my cdrom?

 
SOLVED
Go to solution
xujun
Advisor

How can I correctly export my cdrom?


I want to use cdrom by nfs on client.When I insert first cdrom on server named as machine1,and do mount /cdrom command , then on client,I can use mount machine1:/cdrom /cdrom command ,but when I want to use another cdrom , firstly use command umount /cdrom on server, then insert another cdrom ,do command mount /cdrom again, now if I directly run mount machine1:/cdrom /cdrom on client machine2, a wrong message "access denied" displays,
so I should stop the nfsd ,then start nfsd again,
it is so troublesome, could you tell me other good idea?
5 REPLIES 5
Tom Geudens
Honored Contributor
Solution

Re: How can I correctly export my cdrom?

Hi,
On your server in /etc/exports there should be the following entry :
/cdrom -ro

- Mount cdrom on the server
- exportfs -a
- Mount cdrom on the client
- Use cdrom on the client
- Unmount cdrom on the client
- Umount cdrom on the server

If you follow these steps every time (although they seem childish and are probably not all necessary) you shouldn't run into problems. I would definitely not kill nfs-daemons.

Hope this helps,
Tom Geudens
A life ? Cool ! Where can I download one of those from ?
xujun
Advisor

Re: How can I correctly export my cdrom?

Thanks a lot,I know now.Every time when I change one cdrom on server, I should also use command exportfs -a, but why I should I use this command?
There is always a entry of /cdrom in export list of server, whatever if the command used or not?
Tom Geudens
Honored Contributor

Re: How can I correctly export my cdrom?

Hi,
exportfs -a exports everything that is in /etc/exports. No, /cdrom is - as far as I know - not "default". If it is not in /etc/exports it is not available for other servers.
I tried to be as complete as I could in my list, but I still forgot a line :-). To be completely correct it should be (after putting /cdrom -ro in /etc/exports) :

- Mount cdrom on the server
- exportfs -a
- Mount cdrom on the client
- Use cdrom on the client
- Unmount cdrom on the client
- exportfs -u /cdrom on the server
- Umount cdrom on the server

I always follow lists like this (even if I know a quicker way) to avoid problems. If you have to do pfs-mounts (for Oracle CD's) following the list (which differs from the above one) becomes mandatory.

Hope this helps,
Tom Geudens


A life ? Cool ! Where can I download one of those from ?
Bill Hassell
Honored Contributor

Re: How can I correctly export my cdrom?

The explicit mount/export/umount sequence is required because this is a filesystem, not a raw sector-by-sector transfer. There are a lot of assumptions made (such as local filesystem caching) in order to speed things up and if the server replaces the entire filesystem with a totally different filesystem, there is no way to notify (potentially dozens or hundreds of clients) remote systems of the change.

Consider what would happen if a client had several files open and several users decided to cd into the NFS-mounted directories. By changing the CD, nothing works and potentially, the filesystem code on the client might think that the NFS-mountpoint was catastrophically corrupted. In a local hard disk filesystem, this is a reason for a system crash. Not good.

NFS appears to be somewhat transparent but in reality, there are a lot of caveats to managing remote filesystems. Be sure to export your CDROM filesystem as read-only and from the client side, mount the remote filesystem as read-only. This will minimize problems when network difficulties arise and will improve performance somewhat.


Bill Hassell, sysadmin
xujun
Advisor

Re: How can I correctly export my cdrom?

Thanks for all of you!
The solution is very clear.

xujun