USB boot and MBR how-to’s
When setting up a dual-boot computer or even simply a new Windows computer:
1. Have a Linux Live CD/DVD/USB handy. It’s almost guaranteed that you will need it even if you’re only installing windows.
2. Save the MBR (“Master Boot Record”): Boot your Live linux and in the terminal type:
sudo dd if=/dev/sda of=/some/path/your-mbr-backup-file bs=512 count=1
http://www.cyberciti.biz/faq/howto-copy-mbr, the gist of it being that MBR consists of: 512 bytes total = 446 bytes (the Bootstrap loader code) + 64 bytes (Partition table) + 2 bytes (Signature).
So if you only want to copy the bootstrap loader, not overwriting the PT and signature you will need to adjust the bs param of the dd command to copy just 446 bytes, not the entire 512 byte block.
3. BIOS – Disable UEFI boot or you won’t be able to dual-boot.
4. Install Windows first. Why? Coz it’s dumb (AND evil!). If you put anything on the MBR the windows installer will not work, telling you that there is no drive found, that you need to load drivers for the drive, etc. In reality it simply didn’t find it’s beloved MBR in the firs sector, the drive is fine.
Should this somehow happen – use your your-mbr-backup-file which you create earlier to restore the MBR:
sudo dd of=/dev/sda if=/some/path/your-mbr-backup-file bs=512 count=1
Creating a bootable USB from an ISO which contains a boot image is as simple as:
sudo dd if=xubuntu-14.04.3-desktop-amd64.iso of=/dev/sdb bs=8M
5. If after installing Windows you have problems with the HDD in the Linux installer, e.g. installer or gparted sees the disk as one big empty space, even though there is at least 2 NTFS partitions… or complains about presence of both MBR and GPT:
$ gdisk /dev/sda
If gdisk asks about presence of both MBR and GPT and which one to use select MBR. Then type ‘x’ to enter the ‘experts’ menu. Then ‘z’ to zap the GPT data. On the next 2 prompts confirm destruction of GPT (‘y’), do not wipe out MBR (‘n’)
-
Categories
- Android Development
- Bash
- C programming
- dpkg/apt-get
- drupal
- Emacs
- Git
- Java
- Linux administration
- Linux device drivers
- Linux Gaming
- Linux kernel
- Linux Networking
- Linux on Windows
- Linux printing
- Linux sound and ALSA
- Package Managers
- Programming
- RPM
- Shell and environment
- Tips and tricks
- Uncategorized
- VirtualBox
- Virtualization
- web development
- wine
- WMaker
- Wordpress Tips
- X Window System
- XFCE
-
Articles
- August 2020
- August 2019
- May 2019
- July 2017
- February 2017
- January 2017
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- June 2016
- April 2016
- March 2016
- December 2015
- November 2015
- September 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- October 2014
- February 2014
- January 2014
- November 2013
- October 2013
- June 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- October 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- September 2011
- August 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
-
Meta
Cloud
audio bash boot compile C programming cups drupal emacs etc Fedora git grep how to httpd init kernel libc linux linux partition localtime login make mount mp3 mysql networking oracle package managers password phpMyAdmin programming rpm shell sql vbox version control system virtual box vm web server wordpress www xargs xfce xwin yum