MS-SYS(1)

πŸ“¦ version 2.8.0, in nixpkgs unstable

✨ MS-SYS πŸ’… (that's the ms-sys man page, bestie)

πŸ’– NAME πŸ’–

ms-sys β€” she writes Microsoft boot blocks, no cap πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

ms-sys [options] [device]

🌸 DESCRIPTION 🌸

okay so, ms-sys is the girl who writes Microsoft-compatible boot records. that's the whole vibe. she's iconic, she's purpose-built, she does exactly what she says on the tin 🫢


⭐ OPTIONS ⭐

here's the full rundown, every single one, i'm not skipping anybody πŸ’…

  • -1, --fat12 β€” writes a FAT12 floppy boot record to device. tiny floppy energy.
  • -2, --fat32nt5 β€” writes a FAT32 partition NT5.0 (NTLDR) boot record to device.
  • -8, --fat32nt6 β€” writes a FAT32 partition NT6.0 (BOOTMGR) boot record to device.
  • -x, --exfatnt6 β€” writes an EXFAT partition NT6.0 (BOOTMGR) boot record to device.
  • -e, --fat32pe β€” writes a FAT32 partition PE boot record to device, for USB install and recovery. honestly highkey useful ✨
  • -3, --fat32 β€” writes a FAT32 partition DOS (Win9x) boot record to device.
  • -4, --fat32free β€” writes a FAT32 partition FreeDOS boot record to device.
  • -5, --fat16free β€” writes a FAT16 partition FreeDOS boot record to device.
  • -6, --fat16 β€” writes a FAT16 partition DOS (Win9x) boot record to device.
  • -n, --ntfs β€” writes an NTFS partition Windows 7 boot record to device. > heads up: this one should be considered experimental and probably is of no practical use 😭 like it's giving "why would you" energy.
  • -o, --fat16ros β€” writes a FAT16 partition ReactOS boot record to device.
  • -c, --fat32ros β€” writes a FAT32 partition ReactOS boot record to device.
  • -q, --fat32kos β€” writes a FAT32 partition KolibriOS boot record to device.
  • -l, --wipelabel β€” resets the partition disk label in the boot record. bye label πŸ‘‹
  • -p, --partition β€” writes partition info (hidden sectors, heads and drive id) to the boot record. you might need this on some partitions depending on which program was used to create the file system. iykyk 🧚
  • -H <n>, --heads <n> β€” sets the number of heads written with the -p switch.
  • -O <s>, --writeoem <s> β€” writes OEM ID string <s> to the file system.
  • -S <x>, --writewds <x> β€” writes Windows Disk Signature hexadecimal <x> to the MBR.
  • -7, --mbr7 β€” writes 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. main character MBR πŸ”₯
  • -i, --mbrvista β€” writes 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 β€” writes 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 β€” writes 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 β€” writes 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 because it does not support LBA addressing. sad but true πŸ’€
  • -s, --mbrsyslinux β€” writes a 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. she does it all πŸ’…
  • -t, --mbrgptsyslinux β€” writes a GPL syslinux GPT MBR to device. this MBR will boot from a GPT partition table.
  • -a, --mbrreactos β€” writes a ReactOS MBR to device.
  • -k, --mbrkolibrios β€” writes a KolibriOS MBR to device.
  • -r, --mbrrufus β€” writes a Rufus MBR to device.
  • -g, --mbrgrub4dos β€” writes a Grub4Dos MBR to device.
  • -b, --mbrgrub2 β€” writes a Grub 2 MBR to device.
  • -z, --mbrzero β€” writes an empty (zeroed, non-bootable) master boot record to device. zeroes all bytes except the partition map and signature id (bytes 01be-01ff). similar to the empty DOS partition table that fdisk creates. empty girlboss era πŸŽ€
  • -f, --force β€” forces writing of the boot record. she's not asking twice.
  • -h, --help β€” shows summary of options.
  • -v, --version β€” shows program version.
  • -w, --write β€” writes the automatically selected boot record to device. the "just handle it for me" option fr fr ✨

if ms-sys is started without any options, a simple diagnosis will be done on the given device. she'll just look at it and tell you what's up 🩺


πŸ“ NOTES πŸ“

  • when writing EXFAT partition info, the number of heads value is not used, and the wipelabel feature is not supported either β€” because these are not stored in the BIOS Parameter Block or anywhere in the boot sector. their associated switches will be ignored if you specify them. wasted keystrokes, bestie 😭
  • when writing NTFS partition info, the physical drive id is not used, and the wipelabel feature is not supported for the reasons stated above. the switches will be ignored.
  • the Write OEM ID feature is only supported on FAT12/16/32 filesystems. changing this value on NTFS or EXFAT volumes will result in an unmountable partition. πŸ’€ do not do this. like genuinely do not.

πŸŽ€ EXAMPLES πŸŽ€

please note: Windows ME is not useful for making standalone bootable floppies. however, Win9x and DOS work fine with the first two examples. noted. πŸ™ˆ

πŸ’Ύ creating a 1.68 MB bootable floppy

this example assumes 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. like, the usual meaning, but not the usual variety, if you catch my drift 🧚


πŸ’€ BUGS πŸ’€

okay so 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, neither the -p switch nor 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". it's giving troubleshooting arc 😭

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. so there's that 🫢


πŸ’œ 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, and the file CONTRIBUTORS in the source archive contains a complete list of contributors. legends, all of them πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯

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


and that's the whole page, bestie πŸ’– this one's dated April 17, 2020 and it comes from ms-sys (section 1 of the General Commands Manual) β€” so go forth, write your boot blocks, and remember: back up first, slay always πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from