Mapping a file system into the main tree Introduction 11.. PPuurrppoossee At this point, we are trying to logically connect a file-system (local partition or server volume) in the directory tree. It can be anywhere, It is not uncommon to get the following situation +o You have a large directory, say /home/jack which is getting bigger and bigger. +o You are out of disk space. +o You buy a second hard drive, create a single partition on it (/dev/hdb1 for example). +o You rename /home/jack to /home/jack.backup +o You map /dev/hdb1 to /home/jack. +o You copy /home/jack.backup to /home/jack. After that, you may delete /home/jack.backup. You get the same logical file layout, but have now some space on the first drive and a lot of space for /home/jack to grow on the second drive. 22.. TTaasskk To achieve the connection, you have to +o Select a hard drive partition. +o Identify the type of file-system. _E_x_t_2 for _L_i_n_u_x and _U_m_s_d_o_s for DOS drive. +o Pick a mount point. It can be any directory or subdirectory. 33.. GGeenneerraall ooppttiioonnss The general option are not needed most of the time. They allow for increase flexibility and security. +o Read-only It is possible to protect a partition from writing. Even the superuser won't be able to write there. This is seldom use on normal hard drive partition though. +o user mountable This option is generally used with the following one. It is useful for removable media. It allows any one to activate the connection at any time. Normally, only root (the superuser) can establish a mount. +o Not mount at boot time Especially useful for removable media. It prevent the system from trying to establish a mount (and fail) at boot time. +o No program allowed to execute It is a security feature, especially useful for removable media. If you set the user mountable option on a removable media, it allows any user to come and install a set of files specially setup to give him full access to your system (administrator privilege). +o No special device file support This is a security feature. Special device are generally created with proper access rights in the /dev directory. They may be created in other place too with the mknod command. This feature prevent mounting a media with special device created with relaxed security. Such devices would defeat all security on the system. +o No setuid programs allowed Again a security feature. It is a compromise between full access and the above option (No execution allowed). By setting this option, the system will deny privileged program their special rights. A privileged program is one that switch the user to another identity while it is running (generally root), allowing this user to do special tasks only the supervisor can do. +o User quota enabled This flag tells the kernel to enable quota accounting on the file system. Quota accounting maintain for each user in real time the amount of disk space used and the amount of files and directories they own. Limits may be imposed on some users. This is controlled filesystem per filesystem. The files quota.user is created in the root of the file system (Linuxconf will create it for you if you activate this feature). The utility quotacheck is run to initialise the files with the current state of the filesystems. The kernel from now on will silently update this per user accounting. This is useful to prevent a single user from filling the disk... +o Group quota enabled This is the same feature, but operating group wise. The group quotas hold the sum of the quota of all file member of the group. A file quota.group is created when this feature is enabled and the utility quotacheck is used to initialise the file. While a user may be under personnal quota limit, the quota of his group may be over limit. The user will be prevented from creating new files and/or growing them. 44.. ((UU))MMssddooss aanndd HHppffss (( OOss//22 )) ooppttiioonnss 44..11.. SSeeccuurriittyy ffeeaattuurreess Both _M_s_-_D_O_S and _O_s_/_2 are single user operating system. Their respective file-systems lack most of the features expect from a multiuser operating system like _L_i_n_u_x. For one, there is no file ownership. It would mean that when a _D_o_s hard drive is mount into the _L_i_n_u_x file-system tree, files would be available to any user on the machine. Keep in mind that _L_i_n_u_x is a multiuser system. It is fairly easy to create user accounts for co-workers on your machine so they can share your CPU or system resources. It would not be nice to find out later that everyone have access to every personal file you have in your _D_o_s partitions. _L_i_n_u_x offer a neat solution to this. You can logically apply an ownership and permission flag to all files and directories in a _D_o_s partitions. No special data is written to the partitions. It is simply a presentation mode used by _L_i_n_u_x. Here are the options you can control +o Default user ID You can assign one owner for every files and directories in the file-system. The default owner is root. +o Default group ID You can assign one group for every files and directories in the file-systems. The default group is root. +o Default permissions You can turn on or off selectively every one of the nine _U_n_i_x style permission bits. Permissions bits are expressed as three groups or three bits each. Each group has the following layout +o Read access +o Write access +o Execution access The groups are +o Owner permission bits +o Group permission bits +o Other users (not the owner and not member of the group) permission bits. 44..22.. TTrraannssllaattiioonn mmooddee Text file are stored in a slightly different format on _M_s_-_D_O_S and _O_s_/_2, compared to _U_n_i_x and _L_i_n_u_x. The difference lie in the way end- of-file are identified. _M_s_-_D_O_S use a sequence of two characters, an ASCII Carriage-return followed by an ASCII Line Feed. _U_n_i_x use only a single Line Feed. The msdos, umsdos and hpfs file-systems share one option to make life easier when sharing file on a hard drive between _L_i_n_u_x and _M_s_-_D_O_S or _O_S_/_2 Here are the mode available: +o binary This means no translation at all. +o auto The translation will be activated on all file except on some file with a special extension. Here are the known binary extensions +o Program code APP BIN COM DLL DRV EXE LIB OBJ OVL OVR PIF SYS +o Common archivers ARC ARJ DEB GZ LHA LZH TAR TAZ TGZ TPZ TZ TZP Z ZIP ZOO +o Graphics BMP GIF GL JPG PCX TIF +o TeX DVI GF PK PXL TFM VF +o text The translation will be done on all file. This option should be used with care. Once a translation mode is selected, it is done both at read and write time, making this almost transparent to _L_i_n_u_x application. Please note that the current trend is toward flexible utilities (editors) which can handle both format instead of using a file-system trick like this one. 55.. OOtthheerr ooppttiioonnss New file-systems and file-systems features do appear once in a while. These file-systems may have options unknown to _L_i_n_u_x_c_o_n_f. To cope with this, there is an extra option line. Normally file-system option are a bunch of keyword/value pair, separated by a comma. opt1=val,opt2=none,opt3,opt4=2 66.. CCoommmmeenntt You can write anything you want there, maybe some explanation about the option combination you have selected.