Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Absolute BSD - The Ultimate Guide To FreeBSD (2002).pdf
Скачиваний:
25
Добавлен:
17.08.2013
Размер:
8.15 Mб
Скачать

Ext2fs

The standard Linux filesystem, ext2fs, supports many of the same features as the FreeBSD filesystem, and can be safely written to and read from without any problems. Like the NTFS mounts, ext2fs mounts are quite useful in disaster situations. If an NT or Linux Web server explodes one day, you can slam the hard drive into your working FreeBSD box and copy the data from it. While transferring a physical hard drive isn't exactly the simplest way to transfer data, if a machine is badly damaged, it might be the fastest. Use mount_ext2fs(8) to mount an ext2fs filesystem.

Mount Options and Foreign Filesystems

Rather than using special mount commands for each different filesystem, you can give the type of filesystem as an option to mount(8). To do so, specify the type of filesystem with the −t option. There's no particular advantage or disadvantage to mounting filesystems this way, but it does work.

...............................................................................................

# mount −t cd9660 /dev/acd0c /cdrom

...............................................................................................

Filesystem Permissions

The method you use to mount a filesystem, and the person who mounts it, control the permissions of the mounted filesystem. For example, both FFS and ext2fs store permissions in the filesystem, mapping them to user IDs (UIDs). Since ext2fs normally behaves much like FFS, and all the permissions information it needs is available within the filesystem, FreeBSD respects its permissions.

NTFS has its own permissions system, however. Since that system bears only coincidental resemblance to that used by UNIX, NTFS permissions are discarded when mounted on a FreeBSD system, and it's treated much like a DOS floppy or CD−ROM.

By default, only root can mount filesystems, and root owns all non−UNIX filesystems. If that's not your preference, you can use the −u and −g flags to control the user ID and group ID of the owner on a file when you're mounting MS−DOS, NTFS, or ISO−9660 filesystems. For example, if you're mounting an MS−DOS floppy for the user "cstrzelc", and want her to be able to edit the contents, you could use this command:

...............................................................................................

# mount_msdos −u cstrzelc −g cstrzelc /dev/fd0 /mnt

#

...............................................................................................

The cstrzelc user now owns the files on the floppy.

Note To let a user mount filesystems, set the sysctl vfs.usermount to 1 and be sure that the user owns the mount point.

380