RW and RO semantic and unable to umount a partition?
Javier Martín Rueda
jmrueda at diatel.upm.es
Sun Nov 9 01:58:24 PST 2008
Steve Kargl escribió:
> So, I may have done something in the category of "Don't do that!".
>
> On node n19, I export /dev/ad4s1e and combine it into a mirror
> on node n18 with n18's /dev/ad4s1e. On n18 I have /dev/mirror/data,
> and I've successfully mounted /dev/mirror/data:
>
> n18:root[32] mount /dev/mirror/data /data
>
> Now, I tried the the following:
>
> On n18, I created /etc/gg.exports
>
> n18:root[33] cat /etc/gg.exports
> 192.168.0.17 RW /dev/mirror/data
> n18:root[34] ggated -v
>
> On node n17 (yes, a third system). I do
>
> n17:root[08] ggatec create -o rw 192.168.0.18 /dev/mirror/data
>
> The above command does not create /dev/ggate0. So, I tried
>
> ggatec create -o ro 192.168.0.18 /dev/mirror/data
>
> This created the /dev/ggate0 device. Now, the interesting
> part
>
> n17:root[10] mount /dev/ggate0 /mnt
> n17:root[11] ls /mnt
> .snap/ fcurra/ kargl/
> n17:root[12] umount /mnt
> umount: unmount of /mnt failed: Operation not permitted
> n17:root[13] umount -f /mnt
> umount: unmount of /mnt failed: Operation not permitted
>
> Three questions. Why is RW not permitted? Why does umount
> fail? How the heck to I force umount or the unmounting of /mnt?
>
>
>
RW is not permitted because gmirror has already opened /dev/ad4s1e for
RW. The rule is this: you can open a geom provider (disks are also geom
providers) RW only once at a time, but you can open a geom provider RO
as many times as you want simultaneously or even combine it with one
(and only one) RW open.
I'm not 100% sure about the umount, but I imagine that, as you mounted
it read-write, when you unmount it, it attempts to update the superblock
and ggate denies the write because the device is read-only.
With regards to forcing the umount, have you tried umount -f /mnt?
Finally, even if you manage somehow to open a filesystem RW from two
different systems, don't do that. The UFS filesystem is designed so that
the disk store is managed by a single kernel, and if you modify it from
two or more different kernels at the same time, you will definitely get
corruption and panics.
More information about the freebsd-geom
mailing list