Difference between revisions of "Booting a Linux SD card from Windows XP"

From LSDevLinux
Jump to: navigation, search
m (Booting a Linux SD card from Windows moved to Booting a Linux SD card from Windows XP: Doesn't include instructions for Vista/Windows 7)
m (Remove from Balsa category)
 
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
This page is largely obsolete. With regard to Balsa, this is now handled by scripts in the Balsa set up. You can read about it at [[Overview of Balsa on a Windows Host]]
 +
 
We (LSDev) have used this process to make a Windows based ''eee'' dual boot into Windows or Linux. This process enables the computer to boot from an SD card (or USB stick, CD, etc.), even if the computer is not normally capable of booting from that device.
 
We (LSDev) have used this process to make a Windows based ''eee'' dual boot into Windows or Linux. This process enables the computer to boot from an SD card (or USB stick, CD, etc.), even if the computer is not normally capable of booting from that device.
  
Line 9: Line 11:
 
* Download [http://download.gna.org/grub4dos/ GRUB4DOS].
 
* Download [http://download.gna.org/grub4dos/ GRUB4DOS].
 
** Look for the grub4dos-0.4.4.zip at the bottom of the page (the exact number may have changed since this was written).
 
** Look for the grub4dos-0.4.4.zip at the bottom of the page (the exact number may have changed since this was written).
* Copy the grldr file from the downloaded zip file into your C: drive.
+
* Copy the grldr file from the downloaded zip file to C:\
 
* Right-click on 'My Computer' in the start menu, then 'Properties'
 
* Right-click on 'My Computer' in the start menu, then 'Properties'
 
* Click 'Advanced' and the 'Settings' button under 'Startup and Recovery'
 
* Click 'Advanced' and the 'Settings' button under 'Startup and Recovery'
Line 19: Line 21:
 
== Install Linux start up files ==
 
== Install Linux start up files ==
  
* Make a folder called Linux in C:
+
* Make a folder called Linux in C:\
 
* Copy a kernel and an initial ramdisk into this folder
 
* Copy a kernel and an initial ramdisk into this folder
 
** You can use just about any generic kernel and initial ramdisk. Copy them from /boot in your linux distribution. The files will be called something like vmlinuz... (the kernel) and initrd... (the initial ramdisk). On Ubuntu Jaunty for example, you have:
 
** You can use just about any generic kernel and initial ramdisk. Copy them from /boot in your linux distribution. The files will be called something like vmlinuz... (the kernel) and initrd... (the initial ramdisk). On Ubuntu Jaunty for example, you have:
Line 32: Line 34:
 
  kernel /Linux/'''''kernel file name''''' root=LABEL='''''Your SD card label'''''
 
  kernel /Linux/'''''kernel file name''''' root=LABEL='''''Your SD card label'''''
 
  initrd /Linux/'''''initrd file name'''''
 
  initrd /Linux/'''''initrd file name'''''
The SD card label is the name of the partition on which your linux is installed.
+
'''''Your SD card label''''' is the name of the partition on which your linux is installed. For Balsa this is '''''BalsaRoot'''''.
 
* Save, choose 'All Files' as the type, and 'C:\menu.lst' as the name.
 
* Save, choose 'All Files' as the type, and 'C:\menu.lst' as the name.
  
Line 39: Line 41:
 
If all works well, when you start your computer from now on you will see two options. Selecting the first one, 'Windows XP', or not doing anything will cause the computer to start Windows normally. Selecting the second option, 'Linux', will start your Linux on the SD card (your card must be inserted for this to work, it will never be installed to the hard disk).
 
If all works well, when you start your computer from now on you will see two options. Selecting the first one, 'Windows XP', or not doing anything will cause the computer to start Windows normally. Selecting the second option, 'Linux', will start your Linux on the SD card (your card must be inserted for this to work, it will never be installed to the hard disk).
  
When BALSA runs on a Windows file system, it creates an empty directory called C:\balsafiles on the Windows computer. It also creates a file named C:\balsafiles.img, which contains all the user data and some configuration files of the BALSA system. You can control the size of the initial balsafiles.img by changing variables in the file /etc/default/balsa on the BALSA SD card. Instructions are inside the comments in that file. The default size of the balsafiles.img is currently 10% of the free space on the drive or 1 gigabyte, whichever is smaller.  
+
When Balsa runs on a Windows file system, it creates an empty directory called C:\balsafiles on the Windows computer. It also creates a file named C:\balsafiles.img, which contains all the user data and some configuration files of the Balsa system. You can control the size of the initial balsafiles.img by changing variables in the file /etc/default/balsa on the Balsa SD card. Instructions are inside the comments in that file. The default size of the balsafiles.img is currently 10% of the free space on the drive or 1 gigabyte, whichever is smaller.  
  
== Uninstalling BALSA from the Windows computer ==
+
== Uninstalling Balsa from the Windows computer ==
  
 
To remove the boot process, delete the files that you put on to the computer and remove the <code>C:\grldr="Linux"</code> line that you added to the boot file. You will probably want to back up the C:\balsafiles.img before you remove it from the Windows system. The C:\balsafiles directory can be deleted.
 
To remove the boot process, delete the files that you put on to the computer and remove the <code>C:\grldr="Linux"</code> line that you added to the boot file. You will probably want to back up the C:\balsafiles.img before you remove it from the Windows system. The C:\balsafiles directory can be deleted.
Line 48: Line 50:
  
 
This article needs updating with instructions on how to:
 
This article needs updating with instructions on how to:
* install grub4dos using bcdedit for Vista & Windows 7. The README_GRUB4DOS.txt has a text for a .bat script that could be appropriately modified for this.
+
* use the files you need from ''grub-install-Windows.zip'' file for Vista/7.
 
* use kexec to switch to the kernel from the installed Linux distribution.
 
* use kexec to switch to the kernel from the installed Linux distribution.
 
* re-size the balsafiles.img file if that becomes necessary.
 
* re-size the balsafiles.img file if that becomes necessary.
* install BALSA user files on a Windows drive other than C: using a BALSAFILES= parameter on the kernel line of the MENU.LST file.
+
* install Balsa user files on a Windows drive other than C: using a BALSAFILES= parameter on the kernel line of the MENU.LST file.
 +
* use the drive2id.exe program to set the ''root hd(x,y)'' line.
  
 
[[Category:Low-Power Computing]]
 
[[Category:Low-Power Computing]]

Latest revision as of 12:45, 9 January 2014

This page is largely obsolete. With regard to Balsa, this is now handled by scripts in the Balsa set up. You can read about it at Overview of Balsa on a Windows Host

We (LSDev) have used this process to make a Windows based eee dual boot into Windows or Linux. This process enables the computer to boot from an SD card (or USB stick, CD, etc.), even if the computer is not normally capable of booting from that device.

This process does not require alteration of the MBR (most dual boot processes require MBR alteration, which can render the computer unusable if done badly).

These instructions were compiled using Windows XP and Ubuntu Linux.

Install GRUB4DOS

  • Download GRUB4DOS.
    • Look for the grub4dos-0.4.4.zip at the bottom of the page (the exact number may have changed since this was written).
  • Copy the grldr file from the downloaded zip file to C:\
  • Right-click on 'My Computer' in the start menu, then 'Properties'
  • Click 'Advanced' and the 'Settings' button under 'Startup and Recovery'
  • Click 'Edit'
  • Add the following line to the end of the file
C:\grldr="Linux"
  • Save the file, and close Notepad.

Install Linux start up files

  • Make a folder called Linux in C:\
  • Copy a kernel and an initial ramdisk into this folder
    • You can use just about any generic kernel and initial ramdisk. Copy them from /boot in your linux distribution. The files will be called something like vmlinuz... (the kernel) and initrd... (the initial ramdisk). On Ubuntu Jaunty for example, you have:
/boot/vmlinuz-2.6.xx-xx-generic
/boot/initrd.img-2.6.xx-xx-generic

Tie them both together

  • Open notepad to create a new file.
  • Paste in the text below, replacing the text in italics:
root (hd0,0)
kernel /Linux/kernel file name root=LABEL=Your SD card label
initrd /Linux/initrd file name

Your SD card label is the name of the partition on which your linux is installed. For Balsa this is BalsaRoot.

  • Save, choose 'All Files' as the type, and 'C:\menu.lst' as the name.

Using the system

If all works well, when you start your computer from now on you will see two options. Selecting the first one, 'Windows XP', or not doing anything will cause the computer to start Windows normally. Selecting the second option, 'Linux', will start your Linux on the SD card (your card must be inserted for this to work, it will never be installed to the hard disk).

When Balsa runs on a Windows file system, it creates an empty directory called C:\balsafiles on the Windows computer. It also creates a file named C:\balsafiles.img, which contains all the user data and some configuration files of the Balsa system. You can control the size of the initial balsafiles.img by changing variables in the file /etc/default/balsa on the Balsa SD card. Instructions are inside the comments in that file. The default size of the balsafiles.img is currently 10% of the free space on the drive or 1 gigabyte, whichever is smaller.

Uninstalling Balsa from the Windows computer

To remove the boot process, delete the files that you put on to the computer and remove the C:\grldr="Linux" line that you added to the boot file. You will probably want to back up the C:\balsafiles.img before you remove it from the Windows system. The C:\balsafiles directory can be deleted.

To do

This article needs updating with instructions on how to:

  • use the files you need from grub-install-Windows.zip file for Vista/7.
  • use kexec to switch to the kernel from the installed Linux distribution.
  • re-size the balsafiles.img file if that becomes necessary.
  • install Balsa user files on a Windows drive other than C: using a BALSAFILES= parameter on the kernel line of the MENU.LST file.
  • use the drive2id.exe program to set the root hd(x,y) line.