UMSDOS HOW-TO
Jacques Gelinas,
[email protected]
v1.1, 13 November 1995
_U_m_s_d_o_s is a linux file system. It provide an alternative to the _E_X_T_2
file-system. Its main goal is to achieve easier coexistence with _M_s_-
_D_O_S data by sharing the same partition. This document explain first
how to use Umsdos in different configuration, and later explain its
operation and try to provide some information letting you decide if it
is a good choice for you (see UMSDOS-WHY-TO at the end).
______________________________________________________________________
Table of Contents
1. UMSDOS: Where is it ?
1.1 History
1.2 Availability
1.3 Distribution supporting it
1.4 Home site
1.5 Technical documentation
1.6 Who wrote it
2. Umsdos as your root partition
2.1 The pseudo-root concept.
2.2 Things to know about the pseudo-root
3. Different topics about the operation of
3.1 Mount option
3.2 How to set defaults for the root
3.3 To swap or not to swap
4. How to boot a Umsdos system
4.1 Loadlin
4.2 From a floppy
4.3 LILO
4.4 How to defragment a
4.5 Advance tricks
5. Basic principle
5.1 Introduction
5.2 (EM
5.3 Directory promotion
5.4 How to promote:
5.5 Using
5.6 How to UN-promote
5.7 What about files created during a
6. Installation/UN-installation and some tricks
6.1 The pseudo-root
6.2 Preparing
6.3 Making sure
6.4 Oops releasing pseudo root ...
6.5 How to UN-install a
6.6 Moving a
6.7 About installing 50
7. Setting a
8. UMSDOS-WHY-TO
8.1 The goal of
8.2 Who needs it
8.3 Performance issue
______________________________________________________________________
11.. UUMMSSDDOOSS:: WWhheerree iiss iitt ??
11..11.. HHiissttoorryy
The _U_m_s_d_o_s project was started in 1992 and made available to the net
in January 1994 as a patch. It was included in the standard kernel
distribution in July, starting with kernel 1.1.36.
_U_m_s_d_o_s was early adopted in the _S_l_a_c_k_w_a_r_e distribution even before it
was officially included in the official kernel.
_U_m_s_d_o_s was improved starting at kernel 1.1.60. Its performance has
been dramatically enhanced, especially for writing. Since 1.1.70
(around this), it is stable again.
A major bug was solve in _L_i_n_u_x 1.2.2. This bug was causing some grief
to users since the beginning (some file were silently renamed, giving
the sad impression that they were deleted). Beware that _S_l_a_c_k_w_a_r_e 2.2
is still shipping release 1.2.1 of the kernel, so has this bug.
11..22.. AAvvaaiillaabbiilliittyy
It is available as a patch for kernel 1.0.x. It is built-in for kernel
1.2. It can be compiled in or load as a module. Beware that for now,
if you intend to load _u_m_s_d_o_s as a module, you must also use the Ms-DOS
fs as a module. This come from a limitation in the module system (some
symbols are only export when the drivers is installed as a module).
11..33.. DDiissttrriibbuuttiioonn ssuuppppoorrttiinngg iitt
So far, I think only _S_l_a_c_k_w_a_r_e does support it. I am surely wrong, so
please send me info to correct this.
11..44.. HHoommee ssiittee
The home site for _U_m_s_d_o_s is sunsite.unc.edu. Look in the directory
/pub/Linux/system/Filesystems/umsdos.
11..55.. TTeecchhnniiccaall ddooccuummeennttaattiioonn
There is quite a lot of documentation about the internal of _U_m_s_d_o_s. It
is available both in HTML and text format at the same location as the
utilities.
As far as I know, the HTML version is not available online on any web
site. You must down-load it and "UN-tar" it and read it locally.
11..66.. WWhhoo wwrroottee iitt
Jacques Gelinas
[email protected]
22.. UUmmssddooss aass yyoouurr rroooott ppaarrttiittiioonn
22..11.. TThhee ppsseeuuddoo--rroooott ccoonncceepptt..
With _U_m_s_d_o_s, _L_i_n_u_x can be installed in a standard DOS partition. _L_i_n_u_x
is then installed as a second (or third) OS in the partition. To avoid
name collision (there is maybe a bin or tmp directory in the drive C:
already), _U_m_s_d_o_s use a smart trick: The pseudo-root.
All _L_i_n_u_x files are installed in a DOS subdirectory called linux,
generally C: LINUX. The normal _L_i_n_u_x_/_U_n_i_x directory structure goes
there. So you get
+o
C:\LINUX\BIN
+o
C:\LINUX\ETC
+o
C:\LINUX\LIB
+o
C:\LINUX\ROOT
+o
C:\LINUX\SBIN
+o
C:\LINUX\TMP
+o
C:\LINUX\USR
+o
C:\LINUX\VAR
When the _U_m_s_d_o_s boot, it probes for the directory linux and then
/linux/etc. If it exist, it activates the pseudo-root mode.
Mostly, the pseudo-root mode switch the root of the partition to
C:\\LINUX giving the conventional _U_n_i_x directory layout
+o
/bin
+o
/etc
+o
/lib
+o
/root
+o
/sbin
+o
/tmp
+o
/usr
+o
/var
To this list, it adds a new one called DOS. This one is a virtual
directory.
22..22.. TThhiinnggss ttoo kknnooww aabboouutt tthhee ppsseeuuddoo--rroooott
+o This mode can only be triggered at boot time. There is no way to
activate this by a mount command.
+o This mechanism is purely a different view of a normal _U_m_s_d_o_s file-
system. This means that a partition normally used as a root
partition can be normally mounted. There won't be any pseudo-root
effect.
For example, if you boot linux with a maintenance floppy and mount
your normal root partition in /mnt, you will find all your linux
directory in /mnt/linux/bin, /mnt/linux/etc and so on.
33.. DDiiffffeerreenntt ttooppiiccss aabboouutt tthhee ooppeerraattiioonn ooff UUmmssddooss
33..11.. MMoouunntt ooppttiioonn
You can use the same mount option as for the Ms-DOS file system. The
option conv= is questionable on a _U_m_s_d_o_s system. I suggest to avoid
it. Mostly the option you may want to look at are
+o uid=
+o gid=
+o umask=
Just remember that _U_m_s_d_o_s manage non promoted directory the same way
as the _M_s_-_D_O_S file system. The option above will apply globally to all
non promoted directory. _u_i_d setup the default owner, _g_i_d setup the
default group and _u_m_a_s_k setup the default permissions.
33..22.. HHooww ttoo sseett ddeeffaauullttss ffoorr tthhee rroooott
umssetup was created to provide at run time default ownership for the
root partition. For other _U_m_s_d_o_s partition, mount option may be used
or umssetup. Storing mount option in /etc/fstab is the prefered way
for non root partition. Here is an example. Put this in
/etc/rc.d/rc.S.
/sbin/umssetup -u jack -g group -m 0755 /
33..33.. TToo sswwaapp oorr nnoott ttoo sswwaapp
Using a swap file is generally slower than a swap partition. It is
however much more flexible. You can setup a swap file in a _U_m_s_d_o_s
partition the same way you do it for any other _L_i_n_u_x file systems. For
example, to setup a 8 megabytes swap file in the root directory:
dd if=/dev/zero bs=1024k count=8 of=/swap
mkswap /swap 8192
sync
swapon /swap
Once done, you can put the following line in /etc/fstab
/swap swap swap default
And the swap file will be activated at each boot (There is generally a
"swapon -a" in /etc/rc.d/rc.S).
44.. HHooww ttoo bboooott aa UUmmssddooss ssyysstteemm
44..11.. LLooaaddlliinn
The package lodlin15.tgz available from sunsite.unc.edu in
/pub/Linux/system/Bootutils. This utility is particularly suited to
boot a _U_m_s_d_o_s system. Generally all you need to do is
Boot DOS
C:>loadlinx zimage root=D:
where zimage is a normal kernel image (compressed) simply copied
somewhere in the DOS drive. D: is the DOS drive where you have
installed _L_i_n_u_x.
44..22.. FFrroomm aa ffllooppppyy
Booting a _U_m_s_d_o_s system from a floppy is not different from booting a
_E_x_t_2 system. You need a kernel zImage file properly initialize to
locate your root _U_m_s_d_o_s partition. This is generally achieved using
the command rdev. The following sequence will initialize a zImage and
put it on a floppy.
rdev zImage /dev/hda1
rdev -R zImage 0
dd if=zImage bs=8192 of=/dev/fd0
If this looks confusing, just format a boot-able DOS floppy and put
the following component on it.
+o loadlin.exe
+o loadlinx.exe
+o zimage
and setup the autoexec.bat like this
loadlinx zimage rw root=C:
44..33.. LLIILLOO
LILO, the official _L_i_n_u_x boot loader can also be used to boot a _U_m_s_d_o_s
system. I have no experience with it though. Since 1.1.60, it should
work. Please email if you know something.
44..44.. HHooww ttoo ddeeffrraaggmmeenntt aa UUmmssddooss ppaarrttiittiioonn
It can be done using any popular DOS tool. There is nothing particular
about file produced by _U_m_s_d_o_s. And _U_m_s_d_o_s do not expect anything
particular (directory layout, directory entry sequence, etc...) from
the file system under it.
As far as I know, there is no _L_i_n_u_x tool to achieve this.
44..55.. AAddvvaannccee ttrriicckkss
_U_m_s_d_o_s rely on the --linux-.--- which rely on the _D_O_S directory. Some
users may want to experiment a bit. The utility udosctl part of the
umsdos_progs package (containing umssync and umssetup) allows basic
directory operation (listing, deletion) independently on the
--linux-.--- and the _D_O_S directory.
55.. BBaassiicc pprriinncciippllee
55..11.. IInnttrroodduuccttiioonn
_U_m_s_d_o_s map _L_i_n_u_x files directly to _M_s_-_D_O_S files. This is a one for
one translation. File content is not manipulated at all. _U_m_s_d_o_s only
works on names. For special files (links and devices for example), it
introduces special management.
For each directory, there is a file named --linux-.---.
55..22.. UUmmssddooss ccaann rreeppllaaccee tthhee MMss--DDOOSS ffiillee--ssyysstteemm..
_U_m_s_d_o_s can be thought as a general purpose superset of the _M_s_-_D_O_S file
system of linux. In fact this capability or flexibility yields much
confusion about _U_m_s_d_o_s. Here is why. Try to mount a newly formatted
_D_O_S floppy like this.
mount -t umsdos /dev/fd0 /mnt
And do this,
ls / >/mnt/LONGFILENAME
ls -l /mnt
You will get the following result
-rwxr-xr-x 1 root root 302 Apr 14 23:25 longfile
So far, it seems that the _U_m_s_d_o_s file system does not do much more (in
fact nothing at all) than the normal _M_s_-_D_O_S file system of _L_i_n_u_x.
_?_?_?
55..33.. DDiirreeccttoorryy pprroommoottiioonn
Pretty unimpressive so far. Here is the trick. Unless promoted a _D_O_S
directory will be managed the same way with _U_m_s_d_o_s than the _M_s_-_D_O_S
file-system will. _U_m_s_d_o_s use a special file in each subdirectory to
achieve the translation between the extended capabilities (long name,
ownership, etc...) of _U_m_s_d_o_s and the limitation of the _D_O_S file-
system. This file is invisible to _U_m_s_d_o_s users, but visible when you
boot _D_O_S. To avoid cluttering the _D_O_S partition with those file
(--linux-.---) uselessly, the file is now optional. If absent, _U_m_s_d_o_s
behave like _M_s_-_D_O_S.
When a directory is promoted, any subsequent operation will be done
with the full semantic normally available to _U_n_i_x and _L_i_n_u_x users. And
all subdirectory created afterward will be silently promoted.
This feature allows you to logically organize your _D_O_S partition into
_D_O_S stuff and _L_i_n_u_x stuff. It is important to understand that those
--linux-.--- file do take some place (generally 2k per directory). _D_O_S
generally use large cluster (as big as 16k for a 500meg partition), so
avoiding putting --linux-.--- everywhere can save your day.
55..44.. HHooww ttoo pprroommoottee:: //ssbbiinn//uummssssyynncc
A directory can be promoted any time using /sbin/umssync. It can be
used at any time. Promoting a directory do the following operation
+o Create a --linux-.---.
+o Establish a one to one relation between the --linux-.--- and the
current content of the directory.
/sbin/umssync maintain an existing --linux-.--- file. It does not
create it from scratch all the time. It simply add missing entries in
it (Files created during a _D_O_S session). It will also removed files
which do not exist anymore in the _D_O_S directory from the _-_-_l_i_n_u_x_-_._-_-_-.
umssync gets its name from that. It put _-_-_l_i_n_u_x_-_._-_-_- in sync with the
underlying _D_O_S directory.
55..55.. UUssiinngg //ssbbiinn//uummssssyynncc aatt bboooott ttiimmee
It is a good idea to place a call to /sbin/umssync at the end of your
/etc/rc.d/rc.S if it's not there. The following command is adequate
for most system:
/sbin/umssync -r99 -c -i+ /
The -c option prevent umssync from promoting directories. It will only
update existing --linux-.---.
This command is useful if you access _L_i_n_u_x directory during a _D_O_S
session. _L_i_n_u_x has no efficient way to tell that a directory has been
modified by _D_O_S so _U_m_s_d_o_s can't do a _u_m_s_s_y_n_c operation as needed.
55..66.. HHooww ttoo UUNN--pprroommoottee
Remove the --linux-.--- file using _D_O_S. You will be sorry.
55..77.. WWhhaatt aabboouutt ffiilleess ccrreeaatteedd dduurriinngg aa DDOOSS sseessssiioonn ??
Unless you use umssync on a directory where files have been added or
removed by _D_O_S, you will notice some problems:
+o It won't crash the system nor it won't cause major problems, only
annoyance :-)
+o Files created by _D_O_S.
+o They will be invisible in _L_i_n_u_x.
+o When trying to create a file with the same name, you will get an
error message stating that the file already exist.
+o This creates more confusion that real problem. It does not harm the
file system.
+o Files deleted by _D_O_S won't cause problem. _U_m_s_d_o_s will notice the
absence at the first access. A message will be output (and
generally written into /var/adm/syslog).
66.. IInnssttaallllaattiioonn//UUNN--iinnssttaallllaattiioonn aanndd ssoommee ttrriicckkss
The installation of a _U_m_s_d_o_s is not much different from the
installation of an ordinary (_E_x_t_2 _b_a_s_e_d) _L_i_n_u_x system.
There are two main differences.
66..11.. TThhee ppsseeuuddoo--rroooott //mmnntt//lliinnuuxx
The normal steps for an installation are
1. Setting a partition with fdisk and formatting it.
2. Mounting it as /mnt relative to our installation root disk.
3. Copy all packages into /mnt.
With _U_m_s_d_o_s, the step 1 is not required (wasn't it the goal of _U_m_s_d_o_s
not to reformat ?).
It is possible to install a _U_m_s_d_o_s system just by copying all packages
into /mnt. This will certainly work. But it will create a bunch of
subdirectories into your _D_O_S root directory (C:) and you won't like
it. This is the reason all _U_m_s_d_o_s installation use the pseudo-root.
And this is the major difference between a normal _E_x_t_2 installation
and a _U_m_s_d_o_s one: All files are copied into /mnt/linux.
66..22.. PPrreeppaarriinngg //mmnntt//lliinnuuxx
/mnt/linux is not an ordinary directory. It has to be promoted so it
will correctly handle _L_i_n_u_x long file name and special files (links,
device). The step required to setup /mnt/linux are:
1. mkdir /mnt/linux
2. umssync /mnt/linux
That's it!
66..33.. MMaakkiinngg ssuurree //mmnntt//lliinnuuxx iiss ccoorrrreeccttllyy sseettuupp
Even if the setup of /mnt/linux is pretty simple, there are many
installation package out there who get it wrong. How can ?
The biggest installation problem come from an incompatible umssync
program. _U_m_s_d_o_s has been update in linux 1.1.88 (Can't remember
exactly) and a flaw was uncovered in umssync. To avoid confusion in
the _L_i_n_u_x community, it was decided to raise the compatibility level
required for all _U_m_s_d_o_s tools. Old version of the tools were simply
rejected.
It sounds like many distribution did not update their umssync utility
on the installation disk.
There are still many distribution like this out there. The net result
is that the directory /mnt/linux is not promoted at all and will
truncate all long file name and will reject all special file.
It is possible to do a test very early during the installation to find
out if something went wrong. Thanks to the pseudo console mechanism of
_L_i_n_u_x, you can do that without leaving the installation program. Do
the following steps:
1. Press Alt-F2 (Alt key at the same time as the F2 key).
2. login as root.
3. cd /mnt/linux
If this fail, you are trying this too early. A good time to do this
is at the end of the packages selection.
4. >TOTO
5. ls -l
You should see an empty file TOTO in uppercase. If you see it in
lowercase, something went wrong. Try to do the umssync step again.
umssync can be use over and over without problem.
umssync .
If there is no error message, try the TOTO test again. If TOTO
appears fine, then all is OK. Something is strange in this
installation, but you just save it. Continue
6. Press Alt-F1 to get back to the installation screen.
If the test fail, the best fix is to get a newer installation root
disk. You can generally fix this root disk by installing a newer
version of umssync. This is not difficult but required a working _L_i_n_u_x
system. You simply have to mount the root disk floppy and replace the
offending umssync with a new one.
66..44.. OOooppss rreelleeaassiinngg ppsseeuuddoo rroooott ......
Most _U_m_s_d_o_s installation which fail, do this by printing this strange
message. This is not a bug in _U_m_s_d_o_s although the message looks
strange. Here are the known causes.
+o The most common one
The _S_l_a_c_k_w_a_r_e installation try to setup a swap file very early
during the installation. To do so, it asks you to select a
partition (dos drive), then mount it and set the swap file.
When installing a _S_l_a_c_k_w_a_r_e system, you must setup the target
partition prior to install. This normally mounts the _D_O_S partition
on /mnt, creates the /mnt/linux directory and applies umssync on
it.
This is where most problems come from. Most user just forget the
"setup target partition" step and go directly to the rest of the
installation. Since /mnt is already mounted, this mistake goes
unnotice. This means that /mnt/linux was not created properly (Not
promoted). All special files and links and long names can't be
created properly.
+o Invalid umssync utility
/mnt/linux was improperly setup-ed. Generally caused by an improper
umssync utility on the installation root disk.
+o Old bug in umsdos
There was a bug in _U_m_s_d_o_s prior to _L_i_n_u_x _1_._2_._2. The pseudo-root
mode would not activate properly if the file /etc/init was missing.
init is now located in /sbin. You can fix it by getting a newer
kernel. This is recommended because another bug was uncover and
fixed in 1.2.2.
If you can't upgrade, do this
1. Boot from you installation disk.
2. Login as root.
3. mount -t umsdos /dev/hdXX /mnt
where /dev/hdXX is your _D_O_S partition.
4. cd /mnt/linux/etc
5. ln -s ../sbin/init init
6. cd /
7. Ctrl-Alt-Del
8. Boot your _U_m_s_d_o_s normally.
Unfortunatly, the first two (Installation problems) produce a
completly unusable installation. Uninstall it (See next section) and
install again.
66..55.. HHooww ttoo UUNN--iinnssttaallll aa UUmmssddooss ssyysstteemm
One neat thing about _U_m_s_d_o_s and its pseudo-root mechanism, is that you
can UN-install it without pain. You just boot _D_O_S and recursively
delete the linux directory. That's all. _U_m_s_d_o_s requires no special
drivers in the config.sys, nor it creates anything special outside of
the linux directory.
66..66.. MMoovviinngg aa UUmmssddooss ssyysstteemm ttoo aannootthheerr DDOOSS ddrriivvee
This can be done from _L_i_n_u_x or from _D_O_S. You just have to copy
recursively the linux directory from one drive to the other. After
that you will have to adjust you boot mechanism (generally loadlin
command) and the /etc/fstab file.
_U_m_s_d_o_s can live on any _D_O_S drive. There is no need to install it on
the C: drive, nor it is important to have it on the first hard drive.
It does not matter at all.
In fact, one may decide to have several _U_m_s_d_o_s installations on
different drive just to do experiments.
66..77.. AAbboouutt iinnssttaalllliinngg 5500 UUmmssddooss ssyysstteemmss..
How about installing a bunch of _L_i_n_u_x systems in no time ?
_U_m_s_d_o_s systems are living in a _D_O_S world. You can take advantage of
this if you wish to install _L_i_n_u_x easily.
You can install and configure a _U_m_s_d_o_s system at your site. When you
are satisfied with the configuration and the different packages you
have selected, you can boot _D_O_S and copy the complete linux directory
to your _D_O_S file server. Then you go to other _D_O_S station and simply
copy the files on the network drive to the local drive. That's it.
Only adjust the boot script (_L_o_a_d_l_i_n_x) and go.
With minimal adjustment (Host name, IP number), anyone will be able to
install a _L_i_n_u_x system in a matter of minute.
Interest readers may note that installing _L_i_n_u_x systems by copying
running system also works for any other _L_i_n_u_x systems, including _E_x_t_2
based one.
One beauty of _L_i_n_u_x is that there is no hidden files which have to be
install by magic installation program.
77.. SSeettttiinngg aa LLiinnuuxx sseeccttiioonn iinn aa DDOOSS ppaarrttiittiioonn
_U_m_s_d_o_s has some use even for _E_x_t_2 (Native _L_i_n_u_x file-system) users.
One common scenario is this:
+o _L_i_n_u_x being your _O_S of choice, the _L_i_n_u_x partition start to fill
and fill and fill.
+o Your _D_O_S partition is collecting dust, being half empty.
+o You are suddenly out of space in the _E_x_t_2 partition.
+o You are still not sure you want to get rid of _D_O_S.
_U_m_s_d_o_s may save the day here. You can setup a _L_i_n_u_x directory in the
_D_O_S partition and use it without restriction for _L_i_n_u_x usage. For
example, say you want to setup a new directory named "extra" in your
C: drive. And you want this directory to behave as a normal _L_i_n_u_x
directory. Do this (assuming that C: is /dev/hda1).
mkdir /c
/sbin/mount -t umsdos /dev/hda1 /c
mkdir /c/extra
umssync /c/extra
You must be root to do this.
By setting up /etc/fstab like this, you will always have access to the
/c/extra directory.
88.. UUMMSSDDOOSS--WWHHYY--TTOO
Explaining how to operate or install a _U_m_s_d_o_s system is not enough.
Most people are seeking some advises about using _U_m_s_d_o_s or not.
88..11.. TThhee ggooaall ooff UUmmssddooss
The goal of _U_m_s_d_o_s was to ease the installation of _L_i_n_u_x. An other
goal was to ease its UN-installation. The idea here was to promote
the spreading of _L_i_n_u_x. Installing a new OS on a system is always
troublesome. _O_S_/_2 for one will happily pollute your C: root with a
bunch of new directories. If you are clever like me, it will also
erase your config.sys and autoexec.bat files :-(
The pseudo-root feature of _U_m_s_d_o_s avoid this unwanted invasion. _L_i_n_u_x
can be UN-install without side effect.
88..22.. WWhhoo nneeeeddss iitt
If you have a small hard drive, _U_m_s_d_o_s will allow you to share disk
space between _D_O_S and _L_i_n_u_x. A disk below 300 megs is in my opinion a
small disk. This opinion is based on the size of the different package
available today. One popular word processor may eat as much as 70
megabytes if you select all features.
If you have a larger drive, you may consider having a dedicated _L_i_n_u_x
partition running the _E_x_t_2 file-system. _E_x_t_2 use a smaller cluster
size that _D_O_S (1k in fact) so installing many small files will eat
less space than in a _U_m_s_d_o_s partition.
88..33.. PPeerrffoorrmmaannccee iissssuuee
The following point apply to _U_m_s_d_o_s compared with _E_x_t_2.
+o Directory management is faster on _E_x_t_2. This come from the overhead
of the double directory structure of _U_m_s_d_o_s.
+o File access (reading and writing) is probably faster on _U_m_s_d_o_s than
_E_x_t_2. This come from the simplicity of the _F_A_T file-system used by
_D_O_S.
Beware that this simplicity come with a cost:
+o A maximum of around 65,000 files or clusters per partitions. This
also means that a 500 megabytes partition will use cluster 16k
large. In other word, a file containing a single byte will use 16k
of disk storage.
+o Everything is controlled by the FAT located at the beginning of the
hard drive. The _D_O_S file-system is probably more fragile because of
this.
+o No provision to avoid fragmentation of files. A _U_m_s_d_o_s system will
generally be used as a single user workstation. In this case, this
does not matter much. As a multi-user engine, files will get
spread-ed all around the drive, lowering file access performance.
+o Symbolic links are stored in normal file. If you intend to have a
lot of them, you will find that _U_m_s_d_o_s use quite a lot of disk
space compared to _E_x_t_2.