On Tue, 19 Oct 1999, Neil Blakey-Milner wrote:
> On Mon 1999-10-18 (15:46), Zhihui Zhang wrote:
> > I am trying to change the mount point of a mounted filesystem (from
> > /testme to /test) with the update option (-u):
>
> That's not how -u works. From the man page:
>
> -u The -u flag indicates that the status of an already mounted file
> system should be changed. Any of the options discussed above
> (the -o option) may be changed; also a file system can be changed
> from read-only to read-write or vice versa.
>
> > # mount /dev/wd0s2e /testme
> > # mount -u /dev/wd0s2e /test
> > mount: /dev/wd0s2e on /test: specified device does not match mounted
> > device
>
> This is because, as stated above, you can only change the options of the
> mounted filesystem, not its mountpoint.
>
> > Why it does not work (I know I can umount first without using the update
> > option)? Any help is appreciated.
>
> This (umount then mount) is the way to change mountpoint names.
>
Thanks for your reply. I have just found that it is possible to change
the device name of a mounted filesystem:
# ls -al wd0s2e
brw-r----- 1 root wheel 0, 0x00030004 Oct 11 15:02 wd0s2e
# cd /dev
# mknod testnode b 0 0x00030004
# ls -al testnode
brw-r--r-- 1 root wheel 0, 0x00030004 Oct 20 09:50 testnode
# mount /dev/wd0s2e /testme
# df
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/wd0s1a 39647 22125 14351 61% /
/dev/wd0s1f 1787726 965430 679278 59% /usr
/dev/wd0s1e 19815 3459 14771 19% /var
procfs 4 4 0 100% /proc
/dev/wd0s2e 2109789 659537 1281469 34% /testme
# mount -u /dev/testnode /testme
# df
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/wd0s1a 39647 22125 14351 61% /
/dev/wd0s1f 1787726 965430 679278 59% /usr
/dev/wd0s1e 19815 3460 14770 19% /var
procfs 4 4 0 100% /proc
/dev/testnode 2109789 659537 1281469 34% /testme
I know this is not very useful. But the source code allows it to happen.
-Zhihui
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message