1833883 Members
1746 Online
110063 Solutions
New Discussion

automount disk question

 
SOLVED
Go to solution
Achilles_2
Regular Advisor

automount disk question

Dear all,

Is it possible to automount DVDROM without any disk inside?

Alex
5 REPLIES 5
Robert-Jan Goossens
Honored Contributor

Re: automount disk question

Hi Alex,

NO

Regards,
Robert-Jan
Mohanasundaram_1
Honored Contributor

Re: automount disk question



What would it mount then? :-)
Attitude, Not aptitude, determines your altitude
Dave Olker
Neighborhood Moderator

Re: automount disk question

In certain situations it may mount the empty holding directory on the server where the DVD/ROM disk is supposed to be. Obviously this is not the desired behavior, but it could happen.

Dave


I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
Mohanasundaram_1
Honored Contributor

Re: automount disk question

Dave,

You have kindled my interest yet again. Can you share under what kind of situations the mounting might happen? What porblems might come thereafter?

Attitude, Not aptitude, determines your altitude
Dave Olker
Neighborhood Moderator
Solution

Re: automount disk question

Sure.

Let's take the example of an NFS server that wants to share a DVD drive. The administrator creates an empty directory called "/DVD" where they plan to mount a DVD-ROM disk. The administrator creates an entry in /etc/exports similar to:

/DVD -ro

Now, let's say at system boot time, when the NFS filesystems are exported, there is no DVD disk in the drive and subsequently no DVD/CDROM filesystem mounted at /DVD. The exportfs command will still share the "/DVD" directory, but it will share the empty holding directory in "/".

This empty directory can be mounted on a remote NFS client using AutoFS or a manual mount command like:

Client# mount server:/DVD /NFS_DVD

Now the client has an NFS filesystem mounted at /NFS_DVD but it will be an empty directory.

Later, when the system administrator on the NFS server decides to mount a DVD/CD at /DVD they are allowed to without incident. However, the NFS client never sees this filesystem - they still see the empty holding directory beneath the /DVD mount point.

Even if the client unmounted the empty /DVD filesystem and attempted to re-mount /DVD from the server, they wouldn't be able to:

Client# umount /NFS_DVD
Client# mount server:/DVD /NFS_DVD
Permission denied

The client was able to successfully unmount the filesystem without incident, but when they tried to re-mount the same directory from the same server they get "Permission denied".

Why?

Because /DVD has changed on the server and the server has not re-exported /DVD with the new CD/DVD filesystem mounted. The server would need to unexport the existing /DVD directory and re-export /DVD while the CD/DVD is mounted in order for the clients to be able to mount the CD/DVD:

Server# exportfs -u /DVD
Server# exportfs /DVD

Now the client can re-mount the /DVD directory via NFS and see the contents of the CD/DVD disk.

HOWEVER

Let's say the systems administrator now wants to swap the CD/DVD on the NFS server and have the client see the new contents?

If the administrator unmounts the /DVD filesystem, removes the old CD, inserts the new CD, and re-mounts the filesystem will the NFS client be able to see the new CD contents - No.

Why?

Because by removing one disk and mounting a new disk, the underlying inode of the mounted filesystem has changed. If the client has the old /DVD filesystem still mounted they would get unexpected results. If the client un-mounts the old /DVD and re-mounts the new /DVD they would get:

# umount /NFS_DVD
# mount ros87252:/DVD /NFS_DVD
Permission denied

They get "Permission denied" again. Why? Same reason as last time - the underlying filesystem has changed.

To get things to work again, the administrator needs to un-export and re-export the /DVD filesystem on the server and then the client will be able to mount the /DVD filesystem again successfully.


Bottom Line:

The server needs to export the CD/DVD filesystem after the CD/DVD is inserted into the drive

If the CD/DVD in the server's drive changes, the server needs to un-export and re-export the filesystem after the new media is installed

The client can mount the server's directory even if the server exports the filesystem before mounting the target media, but the client will get an empty holding directory

If the server then mounts and exports the appropriate media the client will need to unmount and remount the NFS filesystem to see it


I apologize for the really long post, but there are lots of different scenarios here, and therefore lots of pitfalls to avoid.

I hope this information is helpful.

Regards,

Dave



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo