ms-sys  2.8.0
About: ms-sys writes Microsoft compatible boot records.
  Fossies Dox: ms-sys-2.8.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

No Matches
ms-sys Documentation

Some Fossies usage hints in advance:

  1. To see the Doxygen generated documentation please click on one of the items in the steelblue colored "quick index" bar above or use the side panel at the left which displays a hierarchical tree-like index structure and is adjustable in width.
  2. If you want to search for something by keyword rather than browse for it you can use the client side search facility (using Javascript and DHTML) that provides live searching, i.e. the search results are presented and adapted as you type in the Search input field at the top right.
  3. Doxygen doesn't incorporate all member files but just a definable subset (basically the main project source code files that are written in a supported language). So to search and browse all member files you may visit the Fossies ms-sys-2.8.0.tar.gz contents page and use the Fossies standard member browsing features (also with source code highlighting and additionally with optional code folding).
1. General

This program is used to create Microsoft compatible boot records. It is able
to do the same as Microsoft "fdisk /mbr" to a hard disk. It is also able to
do the same as Microsoft "sys d:" to a floppy or FAT partition except that
it does not copy any system files, only the boot record is written.
Specifications of boot records is taken from

The program is useful when using Linux to restore a backup of a reference
Microsoft Windows installation.

Author of this program is Henrik Carlqvist (, it
is available for download from

2. Building from source

The program can be compiled from source on Linux, FreeBSD, OpenBSD and macOS/OS X
by following the instructions below:

Install the gettext package for native language support (PO/MO) files and the system
specific command line development tools including make/gcc/clang etc.


See the developer documentation for your distribution.

macOS/OS X:

gettext: use Homebrew or Macports package managers.
Xcode CLI Development Tools: xcode-select --install


Install package manager and update repository: pkg update
Search for and install GNU Make: pkg install gmake-[version]
Search for and install gettext: pkg install gettext-tools-[version]


Search for and install GNU Make: pkg_add gmake
Search for and install gettext: pkg_add gettext-tools-[version]

3. Installation

Step 1, unpack the archive:

tar -xzvf ms-sys*.tgz

Step 2, compile:

cd ms-sys

Step 3, become root and install

su (and give password)
make install

4. Examples

Please note that Windows ME is not useful for making standalone bootable
floppies. However, Win9x and DOS works fine with example 1 and example 3.

Example 1, creating a 1.68 MB bootable floppy:
This example assumes that you have your windows installation mounted at /dosc
and also have mtools and fdformat installed.

fdformat /dev/fd0u1680
mformat a:
ms-sys -w /dev/fd0
mcopy /dosc/io.sys a:
mcopy /dosc/msdos.sys a:
mcopy /dosc/ a:

Example 2, restoring a backup to a fresh hard disk:

Step 1, use GNU parted to create your FAT32 partition and file system:

parted (then create partition and file system)

Step 2, write the MBR:

ms-sys -w /dev/hda

Step 3, write the FAT32 partition boot record:

ms-sys -w /dev/hda1

Step 3b, write partition info and drive id to partition:

ms-sys -p /dev/hda1

This step might be needed depending on which program was used to format the
partition. If the program was formatted with gnu parted this step could be
skipped. It is also possible to combine this flag with the previous step
like this: ms-sys -wp /dev/hda1

Step 4, mount your new filesystem:

mount /dev/hda1 /mnt

Step 5, read your backup

cd /mnt; tar -xzvf /path/to/my_windows_backup_file.tgz

Example 3, creating a bootable 2.8 MB floppy image for use with an el-torito
bootable CD:

dd if=/dev/zero of=floppy288.img bs=1024 count=2880
/sbin/mkdosfs floppy288.img
ms-sys -1 -f floppy288.img
mount -o loop floppy288.img /mnt
cp msdos.sys /mnt/
cp io.sys /mnt/
cp /mnt/
(it might also be a good idea to add a config.sys and autoexec.bat with
 CDROM support)
umount /mnt
cp floppy288.img cd-files/eltorito.img
mkisofs -b eltorito.img -c -o cdimage.iso cd-files
(burn the file cdimage.iso to a CD with cdrecord or another program)

5. Documentation

There is a man-page for ms-sys, and you will get some help by typing:

ms-sys --help

6. Known problems

There have been reports about unbootable FAT32 partitions created with
"mformat -F c:". One workaround is to use gnu parted to create the
partition instead. Since version 1.1.3 ms-sys has the switch -p which
is supposed to fix this problem. The problem has also been reported on
partitions formatted with mkdosfs and mkfs.vfat.

There have been yet another problem reported about the -p switch and gnu
parted together with Linux kernel 2.6. The problem is that kernel 2.6 might
report a geometry incompatible with other operating systems. There is a
detailed description of the problem at
As a workaround for this ms-sys now has the switch -H to manually set the
number of heads. The next problem is to find out what value for number of
heads to give. If the system was booted by LILO this can be shown by
"lilo -T geom".

There have been reports about problems when compiling against uClibc. More
problem reports or suggestions of fixes are welcome!

Writing Windows 7 NTFS boot records with ms-sys is probably not useful if
the intention is to get a bootable partition.