FS#11437 - [initscripts] Add in scripts rc.sysinit/rc.shutdown/netfs test "-O _netdev" for mount/umount
Attached to Project:
Arch Linux
Opened by Marco (cipparello) - Wednesday, 10 September 2008, 20:21 GMT
Last edited by Thomas Bächler (brain0) - Monday, 09 November 2009, 13:56 GMT
Opened by Marco (cipparello) - Wednesday, 10 September 2008, 20:21 GMT
Last edited by Thomas Bächler (brain0) - Monday, 09 November 2009, 13:56 GMT
|
Details
Description:
as reported in mount(8)/umount(8) the option "_netdev" specifies that the device resides over the network and therefore the network connection is required to access it. Since in these days I'm building an iSCSI SAN solution I noticed, after tests to simulate various scenarios, that Archlinux isn't '_netdev aware' in particular: rc.shutdown now the script tries to umount any fs still mounted but ignores the _netdev option so, if any network device is still mounted, the process remains in freeze (since there isn't any network connection) and the only solution to continue is to hard reset the server. rc.sysinit now the script, after the checking filesystems, tries to mount any local fs (thanks to $NETFS) but again if there's in fstab an entry with '_netdev' option it is recognized as 'local fs' and the command try to mount it (I know about the option 'noauto'...). netfs now the script tries to mount/umount only remote fs but isn't aware of the fstab entries with option _netdev. I think about it more as a feature than as a bug since maybe not so many archers have these kind of problems with network device. Thanks for any response or better solutions. Marco Possible patches to add these feature are attached. |
This task depends upon
Closed by Thomas Bächler (brain0)
Monday, 09 November 2009, 13:56 GMT
Reason for closing: Implemented
Monday, 09 November 2009, 13:56 GMT
Reason for closing: Implemented
My myth front end auto mounts an NFS share from the back end server. On shutdown, it kills the network before trying to unmount the nfs share, it hangs for 30-120 seconds or so, then powers down anyways.
It would make sense to unmount the NETFS$ mounts, then kill the network before unmounting the local file systems.
I opened the FR due to the fact that the arch scripts for boot & shutdown (rc.sysinit & rc.shutdown) and the daemon script that take care to mount and unmount network filesystems (netfs) aren't aware of the case that in the fstab could be declared also network block devices with a 'not network filesystem' (for example an iSCSI or AoE block devices with ext3 filesystem).
I post a portion of my fstab where I have various network block devices declared like these:
/dev/iscsi/iqn.2008-08.site.company:servername.vg001.lvbackup1:lun0: /mnt/lvbackup1 ext3 noauto,_netdev,defaults,relatime 0 0
/dev/iscsi/iqn.2008-08.site.company:servername.vg001.lvdb1:lun0: /mnt/lvbackup1 xfs auto,_netdev,defaults 0 0
As you can see filesystems are ext3 and xfs and I've specified the '_netdev' option (see man mount) plus, the second, must be mounted automatically at startup ('auto' option).
With the patches attached the system is able to:
- rc.sysinit don't try to mount network filesystems (as now) AND network block devices because network interfaces aren't up yet
- The netfs daemon take care to mount and unmount network filesystems (as now) AND network block devices
- rc.shutdown don't try to unmount network block devices still mounted (this could be the case if something went wrong during the execution of netfs/iSCSI/AoE stop) and therefore avoid stopping the shutdown procedure.
The last script (rc.shutdown) is the only one that I modified just to avoid stopping the shutdown procedure that would require me to restart the server hardware.
I know that this feature is generally useful for server and not all the users need it but the patches don't affect anyone that don't use network block devices ('_netdev' option) therefore the initscripts behave as usual.
Thanks for any response or other solutions, I hope to be clear and may be useful to other.
bye
Attached the patch versus the actual (2009.03-2) initscripts package.
rc.shutdown_netdev.patch (0.4 KiB)
netfs_netdev.patch (0.8 KiB)
I use to export either network block devices via iSCSI (mounted on client as 'ext3'/'ext4' fs type) and network filesystems via NFSv4 / GlusterFS
(mounted on client as 'nfs'/'glusterfs' fs type).
The management by netfs/rc.sysinit/rc.shutdown scripts of the _netdev parameter (compliant with the meaning of this option as in the manual of mount)
allows to manage network block devices; about 'fuse' also I believe, as specified by Roman, that should not reside in the list NETFS.
About the 'fuse.glusterfs' specified in the patch during the stop process of netfs script that is because glusterfs on client side mounts in this way
the network fs exported by a glusterfsd server.
Hope to be clear.
bye
rc.shutdown_netdev.patch (0.3 KiB)
rc.sysinit_netdev.patch (0.7 KiB)
They don't break any existing behaviour and are safe to apply.
Here's a list of what's done without and with the patch:
1) rc.sysinit mounts all filesystems from fstab except those in NETFS (which includes fuse and fuseblk).
With the patch a filesystem that is not in NETFS list but has _netdev option in fstab won't be mounted too - this is OK.
2) rc.shutdown unmounts every filesystem except ramfs,tmpfs,sysfs,proc.
With the patch rc.shutdown does not try to unmount _netdev filesystems - which sounds good as explainedd in Description.
3) rc.d/netfs (un)mounts all partitions fstab that are of NETFS types (which includes fuse and fuseblk).
With the patch it additionally (un)mounts filesystems from fstab that have _netdev option specified.
@Marco: yes, fuse filesystems don't really belong to NETFS and rc.d/netfs, but I don't feel a strong need to create $FUSEFS and rc.d/fusefs yet (though it does not seem obvious to include netfs in DAEMONS to get your fuse systems mounted).
About 'fuse.glusterfs' its an exception since I need to umount glusterfs filesistems but during the mount action of a device I need to specify 'glusterfs' as fs type but when mounted it appears as type 'fuse.glusterfs' since
glusterfs rely on fuse on client side.
bye
@Marco - I will be applying your patches soon
Check it over please