Mapping a file system into the main tree: (U)Ms-DOS and Hpfs (OS/2) options

Next Previous Contents

## 4. (U)Ms-DOS and Hpfs (OS/2) options

## 4.1 Security features

Both Ms-DOS and OS/2 are single user operating systems. Their respective file-systems lack most of the features expected in a multiuser operating system like Linux.

For one, there is no file ownership. It means that when a DOS hard drive is mounted into the Linux file-system tree, files will be available to every user on the machine.

Keep in mind that Linux is a multiuser system. It is fairly easy to create user accounts on your system for co-workers so they can share your CPU or system resources. It would be unpleasant to find out later that everyone has access to every personal file you have in your DOS partitions.

Linux offers a neat solution to this. You can logically apply an ownership and permission flag to all files and directories on DOS partitions. No special data is written to the partitions. It is simply a presentation mode used by Linux.

Here are the options you can control

- Default user ID You can assign one owner to all files and directories in the file system. The default owner is root.
- Default group ID You can assign one group to all files and directories in the file system. The default group is root.
- Default permissions You can selectively turn on or off every one of the nine Unix style permission bits. Permissions bits are expressed as three groups or three bits each. Each group has the following layout
  - Read access
  - Write access
  - Execute access
  The groups are
  - Owner permission bits
  - Group permission bits
  - Other users (not the owner and not member of the group) permission bits.
  These bits are expressed in octal notation. A "one" indicates that the corresponding permission is off. For example a value of 007, enable full access to the owner and the group but disable all access for other users. A value of 022 provides full access to the owner, but disable writing for all other users.

## 4.2 Translation mode

Text files are stored in a slightly different format on Ms-DOS and OS/2, compared to Unix and Linux. The difference lies in the way end-of-file is identified.

Ms-DOS use a sequence of two characters, an ASCII `Carriage-return` followed by an ASCII `Line Feed`. Unix use only a single `Line Feed`.

The `Ms-DOS`, `Umsdos` and `Hpfs` file-systems share one option to make life easier when sharing file on a hard drive between Linux and Ms-DOS or OS/2

Here are the mode available:

- binary - This means no translation at all.
- auto - The translation will be activated on all files except those with a special extension. Here are the known binary extensions
  - Program code APP BIN COM DLL DRV EXE LIB OBJ OVL OVR PIF SYS
  - Common archivers ARC ARJ DEB GZ LHA LZH TAR TAZ TGZ TPZ TZ TZP Z ZIP ZOO
  - Graphics BMP GIF GL JPG PCX TIF
  - TeX DVI GF PK PXL TFM VF
- text The translation will be done on all files. This option should be used with care.

Once a translation mode is selected, it is done both at read and write times, making this nearly transparent to Linux applications.

Please note that the current trend is towards flexible utilities (editors) which can handle both formats instead of using a file system trick like this one.

Next Previous Contents