1 |
On 10/06/2013 16:36, Tanstaafl wrote: |
2 |
> On 2013-06-10 6:38 AM, Alan McKinnon <alan.mckinnon@×××××.com> wrote: |
3 |
>> On 10/06/2013 12:34, Tanstaafl wrote: |
4 |
>>> If I remember to manually unmount the NFS mount before initiating the |
5 |
>>> reboot/shutdown, it doesn't hang. |
6 |
>>> |
7 |
>>> I'm guessing that it hangs at /var because it is the last mountpoint |
8 |
>>> defined in my /etc/fstab? |
9 |
>>> |
10 |
>>> So... any pointers on where to look for a resolution would be |
11 |
>>> appreciated. |
12 |
>>> |
13 |
>>> Resolution being, if I can manually unmount it fine, why can't the |
14 |
>>> system auto-unmount it? |
15 |
> |
16 |
>> Let's get some facts to work with |
17 |
>> |
18 |
>> can you post your fstab, |
19 |
> |
20 |
> Fyi, I don't have either of these auto-mounting in fstab, but here it is: |
21 |
> |
22 |
> # <fs> <mountpoint> <type> <opts> <dump/pass> |
23 |
> |
24 |
> # NOTE: If your BOOT partition is ReiserFS, add the notail option to |
25 |
> # opts. |
26 |
> /dev/sda1 /boot ext2 noauto,noatime 1 2 |
27 |
> /dev/sda2 none swap sw 0 0 |
28 |
> /dev/sda3 / ext3 noatime 0 1 |
29 |
> /dev/sda4 /backups ext3 noatime 0 2 |
30 |
> /dev/vg2/home /home reiserfs noatime 0 0 |
31 |
> /dev/vg2/usr /usr reiserfs noatime 0 0 |
32 |
> /dev/vg2/var /var reiserfs noatime 0 0 |
33 |
> /dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0 |
34 |
> /dev/fd0 /mnt/floppy auto noauto 0 0 |
35 |
> |
36 |
> # NOTE: The next line is critical for boot! |
37 |
> none /proc proc defaults 0 0 |
38 |
> |
39 |
> # glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for |
40 |
> # POSIX shared memory (shm_open, shm_unlink). |
41 |
> # (tmpfs is a dynamically expandable/shrinkable ramdisk, and will |
42 |
> # use almost no memory if not populated with files) |
43 |
> shm /dev/shm tmpfs nodev,nosuid,noexec 0 0 |
44 |
> |
45 |
>> rc-update show, |
46 |
> |
47 |
> # rc-update show |
48 |
> apache2 | default |
49 |
> bootmisc | boot |
50 |
> consolefont | boot |
51 |
> devfs | sysinit |
52 |
> device-mapper | boot |
53 |
> dmesg | sysinit |
54 |
> dovecot | default |
55 |
> fsck | boot |
56 |
> hostname | boot |
57 |
> hwclock | boot |
58 |
> iptables | default |
59 |
> keymaps | boot |
60 |
> killprocs | shutdown |
61 |
> local | default nonetwork |
62 |
> localmount | boot |
63 |
> lvm | boot |
64 |
> mailman | default |
65 |
> modules | boot |
66 |
> mount-ro | shutdown |
67 |
> mtab | boot |
68 |
> mysql | default |
69 |
> net.eth0 | default |
70 |
> net.lo | boot |
71 |
> netmount | default |
72 |
> ntp-client | default |
73 |
> ntpd | default |
74 |
> postfix | default |
75 |
> procfs | boot |
76 |
> root | boot |
77 |
> rpcbind | default |
78 |
> savecache | shutdown |
79 |
> sshd | default |
80 |
> swap | boot |
81 |
> swapfiles | boot |
82 |
> sysctl | boot |
83 |
> sysfs | sysinit |
84 |
> syslog-ng | default |
85 |
> termencoding | boot |
86 |
> tmpfiles.setup | boot |
87 |
> udev | sysinit |
88 |
> udev-mount | sysinit |
89 |
> udev-postmount | default |
90 |
> urandom | boot |
91 |
> vixie-cron | default |
92 |
> xinetd | default |
93 |
> |
94 |
> |
95 |
>> /etc/exports on the NFS server |
96 |
> |
97 |
> Well... there is no 'NFS Server', these are two QNAP boxes that I can |
98 |
> enable NFS on... I guess there may be a way to command-line into them to |
99 |
> check that, so if it critical to answering the question, I'll see what I |
100 |
> can do. All I know for sure is, if I manually unmount it with umount |
101 |
> /mnt/qnap-mountpoint, it unmounts immediately. |
102 |
> |
103 |
>> and the mount options used for the NFS mounts? |
104 |
> |
105 |
> The command I use to mount it is: |
106 |
> |
107 |
> mount -t nfs -o mountproto=tcp qnap1:/backups /mnt/qnap1 |
108 |
> |
109 |
> Thanks Alan, hopefully something jumps out at you... |
110 |
> |
111 |
|
112 |
I'm not familiar with QNAP but there's nothing for it in fstab, so I |
113 |
presume running the relevant app on your end magically mounts the remote |
114 |
share without consulting fstab? |
115 |
|
116 |
It all looks very much like your init system is simply not umounting the |
117 |
shares at all so when it tries to remount / ro near the end, this fails. |
118 |
|
119 |
The simplest way around this is to add nfsmount to the default runlevel. |
120 |
This will work today as it reads /etc/fstab at startup to mount stuff |
121 |
and your fstab has no nfs shares in it. |
122 |
It reads /etc/mtab at shutdown to umount stuff and your QNAP share will |
123 |
be in that file. |
124 |
|
125 |
I simulated it here and that's the result I got. But this is gentoo, and |
126 |
everything might change tomorrow so YMMV :-) |
127 |
|
128 |
You could also write a scriptlet to do the umount and put it in |
129 |
/etc/conf.d/local - see /etc/init.d/local for details |
130 |
|
131 |
|
132 |
|
133 |
-- |
134 |
Alan McKinnon |
135 |
alan.mckinnon@×××××.com |