ms-sys (1) - Linux Manuals

ms-sys: write Microsoft boot block

NAME

ms-sys - write Microsoft boot block

SYNOPSIS

ms-sys [options] [device]

DESCRIPTION

ms-sys is for writing Microsoft compatible boot records.

OPTIONS

A summary of options is included below.
-1, --fat12
Write a FAT12 floppy boot record to device.
-2, --fat32nt
Write a FAT32 partition NT boot record to device.
-3, --fat32
Write a FAT32 partition DOS (Win9x) boot record to device.
-4, --fat32free
Write a FAT32 partition FreeDOS boot record to device.
-5, --fat16free
Write a FAT16 partition FreeDOS boot record to device.
-6, --fat16
Write a FAT16 partition DOS (Win9x) boot record to device.
-n, --ntfs
Write a NTFS partition Windows 7 boot record to device. This functionality should be considered experimental and probably is of no practical use.
-l, --wipelabel
Reset partition disk label in boot record.
-p, --partition
Write partition info (hidden sectors, heads and drive id) to boot record. This might be needed on some partitions depending on which program was used to create the file system.
-H <n>, --heads <n>
Set number of heads written with -p switch.
-7, --mbr7
Write a Windows 7 master boot record to device. Does not change Windows Disk Signature (bytes 01b8-01bd). This MBR will boot certain partition types beyond cylinder 1024 using LBA addressing.
-i, --mbrvista
Write a Windows Vista master boot record to device. Does not change Windows Disk Signature (bytes 01b8-01bd). This MBR will boot certain partition types beyond cylinder 1024 using LBA addressing.
-m, --mbr
Write a Windows 2000/XP/2003 master boot record to device. Does not change Windows Disk Signature (bytes 01b8-01bd). This MBR will boot certain partition types beyond cylinder 1024 using LBA addressing.
-9, --mbr95b
Write a Windows 95B/98/98SE/ME master boot record to device. Does not change Windows Disk Signature (bytes 01b8-01bd) or boot drive and time (bytes 00da-00df). This MBR will boot FAT-LBA partition types 0c and 0e beyond cylinder 1024 using LBA addressing.
-d, --mbrdos
Write a DOS/Windows NT master boot record to device. Does not change Windows Disk Signature (bytes 01b8-01bd). This MBR will not boot beyond cylinder 1024 as it does not support LBA addressing.
-s, --mbrsyslinux
Write a public domain syslinux master boot record to device. Does not change Windows Disk Signature (bytes 01b8-01bd). This MBR will boot any partition types beyond cylinder 1024 using LBA addressing.
-z, --mbrzero
Write an empty (zeroed, non-bootable) master boot record to device. Zeroes all bytes except the partition map and signature (bytes 01be-01ff). Similar to the empty DOS partition table that fdisk creates.
-f, --force
Force writing of boot record.
-h, --help
Show summary of options.
-v, --version
Show program version.
-w, --write
Write automatically selected boot record to device.

If ms-sys is started without any options a simple diagnosis will be done on the given device.

EXAMPLES

Please note that Windows ME is not useful for making standalone bootable floppies. However, Win9x and DOS works fine with the first two examples.

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/command.com a:

Creating a bootable 2.8 MB floppy image to 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
su
mount -o loop floppy288.img /mnt
cp msdos.sys /mnt/
cp io.sys /mnt/
cp command.com /mnt/
(it might also be a good idea to add a config.sys and autoexec.bat with CDROM support)
umount /mnt
exit
cp floppy288.img cd-files/boot.img
mkisofs -b boot.img -c boot.cat -o cdimage.iso cd-files
(burn the file cdimage.iso to a CD with cdrecord or another program)

restoring a backup of Win9x or Win ME 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 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

ENVIRONMENT

The variables LANG and LC_ALL have the usual meaning, however there are not many translations available.

BUGS

There have been reports about unbootable FAT32 partitions created with "mformat -F c:". The problem has also been reported on partitions formatted with mkdosfs and mkfs.vfat. 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. Unfortunately, when using ms-sys with Linux kernel 2.6 nor the -p switch or gnu parted might work. A simple workaround is to use ms-sys with Linux kernel 2.4. Another possible workaround is to manually set the number of heads with the switch -H. If the system has been booted by LILO, the correct number of heads can be given by "lilo -T geom".

The writing of NTFS partition boot records in ms-sys probably has no practical use. For Windows 7 it has been reported that doing "sysprep" before making an image of an NTFS partition will make the partition restored from the image bootable.

AUTHOR

This manual page was originally written by Gürkan Sengün and since edited by Henrik Carlqvist. The program ms-sys is mostly written by Henrik Carlqvist, the file CONTRIBUTORS in the source archive contains a complete list of contributors.

SEE ALSO

mformat(1) fdformat(8) mkdosfs(8) mkisofs(8) parted(8)