Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reacquainting Myself With Linux
#1
...
Reply
#2

Welcome back! :)

 

I'm not too familiar with using NTLDR to boot GRUB; I know much more about doing it the other way around. It is reasonably easy to reinstall GRUB these days if a Windows install wipes it out, provided you just keep a live distro handy. I don't do it all the time, but I have on several occasions reinstalled Windows in a multi-boot setup environment, then booted a live CD to reinstate GRUB afterwards.

 

If you do go down the NTLDR->GRUB route, (again, not something I've done or am familiar with!), I do know you can install GRUB to a specified location from within the Ubuntu installer. I haven't checked it with the latest version, but it always has been there at one of the last few screens of the installer.

 

As for the sizes of your partitions, I'd imagine 500 MB to 1 GB should be plenty for /boot, swap is usually recommended to be about 1.5x as large as your RAM, so 6 GB?

 

To try and answer some of your other questions too -- you can have a single swap partition. In my experience, multiple distros can 'share' the same swap space (obviously not at the same time, but that isn't an issue!).

 

As far as sharing /boot, GRUB has changed signficantly in the last few years -- there is now a new GRUB 2 version that some distros are using, which is quite different to the old GRUB (see this blog post I made). That might affect your plans, but again, sharing /boot between different systems isn't something I'm too familiar with either. I do have a super-duper ridiculous multi-boot setup, but each OS lives in its own partition, and I have one OS which acts as the GRUB 'master' -- its configuration file contains the GRUB commands to boot the kernels for other OSs (those kernels and initrds being stored on the relevant partition for that OS).

Reply
#3
...
Reply
#4

Quote:Would you mind explaining your master OS GRUB setup a bit further? This sounds similar to what I am trying to accomplish. Are you speaking of the GRUB located in your MBR? I think I need to do some more research on GRUB itself and how it works. Does your system have one instance of GRUB on it that boot all of your other OSes?
 

Sure. I'll explain my setup. I'll warn you -- it is ridiculously complicated! :P

 

I have two drives -- a primary/master 160 GB and a primary/slave 120 GB.

 

160 GB master drive -- /dev/sda:

 

/dev/sda1 -- primary partition, NTFS, 35 GB, for Windows Vista C: drive.

/dev/sda2 -- extended partition, containing:

/dev/sda5 -- logical drive, ext3, 40 GB, for Linux Mint 9 / filesystem.

/dev/sda6 -- logical drive, ext3, 44 GB, for Linux Mint 9 /home filesystem (allows me to upgrade/change OS in sda5 while retaining my data, unchanged, in /home)

/dev/sda7 -- logical drive, FAT32, 30 GB, a data drive for Windows, kept for historical reasons.

/dev/sda8 -- logical drive, Linux swap, 1 GB

 

(Note that the partition sizes combined might not match exactly 160 GB, I'm rounding to what they roughly are)

 

120 GB slave drive -- /dev/sdb:

 

/dev/sdb1 -- primary partition, ext3, 10 GB, for CentOS 5.5 / filesystem (a mirror/clone of my server)

/dev/sdb2 -- primary partition, ext3, 15 GB, currently for Sabayon / filesystem (used as space for any distro I want to install and play around with)

/dev/sdb3 -- extended partition, containing:

/dev/sdb5 -- logical drive, FAT32, 40 GB, for installed games in Windows

/dev/sdb6 -- logical drive, NTFS, 25 GB, an installation of Windows XP for use with Office 2003, internet etc.

/dev/sdb7 -- logical drive, FAT32, 25 GB, another installation of Windows XP for games only, not internet connected

 

GRUB(2) is handled by the 'master' Linux OS, Linux Mint. It is installed on the MBR of sda, but the configuration files are held on /dev/sda5, the Linux Mint / filesystem.

 

GRUB 2 is capable of auto-detecting other operating systems when it is configured. It automatically detects the other Linux systems and the Windows chainloader at /dev/sda1, that's the Vista partition.

 

However, it's slightly more complicated than that. There are three Linux distros to boot, and three separate installations of Windows.

 

Booting the Linux distributions

 

First of all, Linux Mint boots fine, as if it were the only OS on the system, as it 'owns' the GRUB configuration in this case. Nothing complex there.

 

Now, GRUB 2 is supposed to be able to detect other Linux systems on your computer and boot them, but it often boots them with the wrong commands. Different Linux kernels want different arguments.

 

Therefore, on Sabayon and CentOS, I manually create symlinks to the correct vmlinuz and initrd (or equivalent files) and create a static, custom entry for both operating systems, where I manually tell GRUB to give the correct commands to boot each OS. This dictates that I must manually update those symlinks each time there is a software update to the kernel, or else the old kernel will get booted. It also requires me to select these custom entries on the boot menu, not the auto-generated entries.

 

My static, custom entries look like this (/etc/grub.d/40_custom):

 



Code:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry "CentOS USEME" {
       insmod ext2
       set root='(hd1,1)'
       linux /vmlinuz ro root=/dev/hdb1
       initrd /initrd
}


menuentry "Sabayon USEME" {
       insmod ext2
       set root='(hd1,2)'
       linux /vmlinuz ro root=/dev/ram0 ramdisk=8192 real_root=/dev/sdb2 dolvm init=/linuxrc quiet splash=silent,theme:sabayon vga=791 CONSOLE=/dev/tty1 res=1920x1080
       initrd /initrd

}




 

I recognise this is very complicated, and in theory shouldn't be necessary anyway, but the auto-detection never seems to create valid boot entries for me!

 

When installing a new Linux (for example, if I replaced Sabayon), I try to make sure to disable the installation of GRUB, as it would overwrite the 'master' Linux Mint boot loader. I would then have to work out what custom command to craft into that /etc/grub.d/40_custom file.

 

If another GRUB were installed anyway by a rogue Linux installer, I'd boot from a Linux Mint live CD and repair its installation of GRUB to restore my setup, then create a custom command as normal for this new OS.

 

Booting the Windows distributions

 

The auto-detection of the Linux Mint GRUB install picks up a Windows chainloader at /dev/sda1, the Vista partition, as you'd expect. That doesn't explain how either of the XP installations can be booted, though.

 

What I did was to install Vista, then Linux Mint, then one of the XP installations, then the other XP installation. I then use the Vista installer to repair the Vista boot loader, followed by the Linux Mint Live CD to repair GRUB. Vista now can be configured to have a second chainloader to boot either XP.

 

What you end up with is that you select 'Windows' on the first GRUB bootloader when the computer comes up, then you get a second boot menu, where you select either 'Vista' or 'XP'. If you choose 'Vista', it boots. If you choose 'XP', you then get to a third boot screen where you select either 'XP with Office', or 'XP Games only'.

 

The last XP installation I did becomes the 'master' XP, which controls the boot menu options for itself and the other XP. It, however, knows nothing and cares nothing about Vista, or any of the Linux systems.

 

The final boot menu

 

The ultimate result is something like this:

 


  • GRUB starts up

  • Select Linux Mint, CentOS, Sabayon, or Windows

  • Each Linux entry boots that Linux straight away.

  • The Windows boot menu then leads to 'Vista', 'XP'

  • Choosing 'Vista' boots Vista right away.

  • Choosing XP now presents you with 'XP with Office', 'XP Games'.


 

I know this is very complicated, but it is actually possible to set up a huge-super-multi-boot configuration like this that actually works. Occasionally you have to do the odd repair, but I find it pretty easy now that I know the set up.

 

I'd be happy to help you try and get something similar set up for the OSs you want on your system. It takes partition planning, doing things in the right order, and some patience, but it is worth it. :)

Reply
#5
...
Reply
#6

Quote:I didn't know you could house Windows partitions on logical drives like that. I'm also curious why you use two separate Windows XP installs, why one for internet/office and one for gaming?
 

This machine isn't very up to date any more (3.0 GHz icky Pentium 4, 1 GB RAM). It's fine for the games I want to play on it, but I want to maximise the performance of said games on the hardware. For that reason, my 'Games' XP install has as minimal a software set up as possible -- no software running in the background if I can at all help it, no antivirus software, nothing to interfere or compete with the games. It also has the nice side effect of keeping the games' copy protection driver crap outside of my 'real' XP install.

 

Also note that in order to install Windows on a logical drive, you do have to have one Windows install in the 'proper' place -- i.e. on a primary, bootable partition. Windows has to feel happy that there is some way to get it booted. Vista's location, in this case, provides the XP installer with the peace of mind to install anywhere I want it.

 

Quote:Ah two more quick questions... 

Why ext3 instead of ext4, more stable?

 

And is there a stable way to write to ntfs partitions from Linux now (in my past experience it was all experimental but I was reading about something called ntfs-3g)?
 

I use ext3 really because I have no reason to use ext4 -- it doesn't particularly offer me any features over ext3 that I'd want. Also, CentOS 5.5 is an older, but more stable distro, and I'm not sure if it has ext4 support. I would like to always ensure that each Linux distro can read the partitions of every other Linux distro on the same system, just in case I need that access.

 

NTFS support has got a huge amount better since you were last here, yes. NTFS-3G is installed by default and should work right out of the box on the latest Ubuntu. You should be able to mount your Windows drives just by going to the Places menu and clicking them to mount. NTFS-3G support means that reading and writing NTFS partitions is reliable, stable and easy. I've not had a single problem with it over several years of using the software.

Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)