| |
Miscellaneous: Mounting fat paritions(last edit: 2000-11-22)
The examples used are taken from a FreeBSD 4.0 installation. The only difference with
a FreeBSD 3.4 installation is the device driver.
Using 'mount'
You have to use the option '-t msdos' if you want to mount a fat partition, BUT this actualy
executes the program '/sbin/mount_msdos' so I suggest you use it instead of mount. One of the
advantages is that you can specify allot of options with mount_msdos.
Using 'mount_msdos'
Oke for the impatient ones, this is the command:
root@host:/#mount_msdos -u nobody -g nogroup -m 777 /dev/ad2s1 /mnt/data/
This will mount the device 'ad2s1' to '/mnt/data', set the owner to 'nobody:nogroup' and the
permissions of all the files to '777'
man mount_msdos
-u uid Set the owner of the files in the file system to uid. The default
owner is the owner of the directory on which the file system is
being mounted.
-g gid Set the group of the files in the file system to gid. The default
group is the group of the directory on which the file system is
being mounted.
-m mask Specify the maximum file permissions for files in the file system.
(For example, a mask of 755 specifies that, by default, the
owner should have read, write, and execute permissions for files,
but others should only have read and execute permissions. See
chmod(1) for more information about octal file modes.) Only the
nine low-order bits of mask are used. The default mask is taken
from the directory on which the file system is being mounted.
Oke but what's the advantage above 'mount -t msdos /dev/ad2s1 /mnt/data'? Whell the latter
command will indeed mount the device in '/mnt/data' but the owner will be 'root:root' and
this user will be the only one with write access.
I have three fat partitions in my FreeBSD machine (don't ask) so I've written this shell script:
---
#!/bin/sh
if /sbin/mount_msdos -u nobody -g nogroup -m 777 /dev/ad2s1 /mnt/data/
then
echo "Data partition succesfully mounted"
else
echo "Data partition NOT succesfully mounted"
fi
if /sbin/mount_msdos -u nobody -g nogroup -m 777 /dev/ad2s3 /mnt/japware/
then
echo "Japware partition succesfully mounted"
else
echo "Japware partition NOT succesfully mounted"
fi
if /sbin/mount_msdos -u nobody -g nogroup -m 777 /dev/ad2s5 /mnt/biggie/
then
echo "Biggie partition succesfully mounted"
else
echo "Biggie partition NOT succesfully mounted"
fi
---
Click here to go back to the index.
|