You are not logged in.

#1 2008-10-01 19:01:28

ido
Member
Registered: 2007-09-15
Posts: 28

Question about partitioning

Hello,

I'm about to buy a new computer with a 640GB (yey big_smile) hard drive. I would like to install Windows XP for my mother and maybe another distro (*bsd, ubuntu etc) just to test with (in addition to Arch of course). I know you can only have four Primary Partitions and that only they can be bootable.

I plan to create an Extended Partition which will include /var and /home. Arch's root (/) will have its own Primary Partition which will be bootable, same goes for Windows XP. This leaves me with one more Primary Partition which I'll be using for distro testing.

Is this feasible?

One more question - performace wise. Where would you advise me to mount each of the file systems?

Thanks in advance, Ido.

EDIT - Windows XP partition has to be bootable, right?

Last edited by ido (2008-10-01 19:09:22)

Offline

#2 2008-10-01 19:30:05

ERIC H
Member
From: NY
Registered: 2008-09-23
Posts: 14

Re: Question about partitioning

I think you need to think about what you want to use as your bootloader first of all. I, personally, have XP installed on the only primary partition on my measly 20gb laptop, as well as 3 distros. I use grub as my bootloader and always wrote to MBR because I had no desire to use the XP bootloader. You can still set XP to boot by default after timeout if you like.

There are many more experienced users that can explain to you better but from one experimenting user to another I haven't had any problems with setting things up the way I have, even using Paragon's partitioning tool in Windows to make space for my Arch distro (gparted, qtparted, and gparted live cd would always hang in linux, no matter the version). Of course, I had inode errors on reboot but just following the instructions with e2fsck on 2 partitions made everything ok.

Offline

#3 2008-10-01 19:37:28

ido
Member
Registered: 2007-09-15
Posts: 28

Re: Question about partitioning

I'll be using grub as my bootloader.

Offline

#4 2008-10-02 17:57:00

ido
Member
Registered: 2007-09-15
Posts: 28

Re: Question about partitioning

bump neutral

Offline

#5 2008-10-02 18:24:22

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: Question about partitioning

What you describe is feasible, as far as the Linux side goes. I know how to dual-boot with Mac OSX but not with Windows. I gather from what you're saying that you're planning to have 3 Linux partitions each able to be /, with a /boot directory on each of them. You can do that. But if I understand things properly, everytime you install the bootloader you'll be telling it "use the configuration specified in this /boot/grub/menu.lst file." So you'll have to make sure that the menu.lst files on each of your Linux partitions stay in synch.

I think it's cleaner to go for a setup where you don't need to do that. Many people just have a single separate /boot partition, and they tell the bootloader to use the menu.lst file on that partition, and then depending on which kernel you choose to boot with, the appropriate / partition will be loaded. (Do you understand what I'm saying?) I believe that this way, only the /boot partition needs to be bootable.

You can have each of your installations (Arch, Ubuntu, whatever else) mount that /boot partition in your /etc/fstab.

The tricky bit is making sure that the different installs don't overwrite each other's files on the /boot partition. I've done some funky stuff with symlinking and remounting to make Ubuntu play nice with Arch. But I'm sure there's an easier way. I've seen it recommended to have a two-stage boot process, where the grub configuration you install to boot first then chooses to load a second grub, using Arch's menu.lst file, or Ubuntu's, or so on. That way, you don't mix any of the /boot files from the different installs. (You just keep them in /boot directories on the main Arch, Ubuntu, etc partition.) This is probably discussed in the wiki: search for Grub.

Offline

#6 2008-10-02 18:36:21

SkonesMickLoud
Arch Linux f@h Team Member
From: The D of C
Registered: 2008-09-20
Posts: 178

Re: Question about partitioning

ido wrote:

I know you can only have four Primary Partitions and that only they can be bootable.

XP has to be in a Primary partition, but Linux plays nice with being booted from an Extended partition.

Offline

#7 2008-10-02 21:53:55

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: Question about partitioning

Well now, my own 2c-worth on this subject is as follows:

partitioning:
#1, ext2, 500 megs (can be a lot less, but hey - you've got a 600-gig drive to play with
#2, vfat/ntfs, 30 gigs, windoze-xp
#3, swap, 2x memory (max 2 gig for 32 bits, if you plan on running 64-bit, set off 2x memory)
#4, extended - remainder
#5, 20 gigs, linux distro #1
#6, 20 gigs, linux distro #2
...
#n, xfs or ext3 (least common denominator), remainder of disk, use as common area for _all_ distros

Use a live-cd (grml is great) to do the partitioning
Make sure you install windows-xp first since it will hose the mbr
when you install the linux distros, _only_ refer to the / partition (partition #5 for your first distro),
we want to keep it all neat, so all OS-related stuff in the one partition!
Tell the distro to install grub _on the first sector of the root partition_ (yes, 'root', not 'boot')

boot from the live-cd again (let's say you have just installed arch), and do as follows:
zsh# mkdir /mnt/boot /mnt/sda5
zsh# mount /dev/sda1 /mnt/boot
zsh# mount /dev/sda5 /mnt/sda5
zsh# mkdir /mnt/boot/archlinux
zsh# cp /mnt/sda5/boot/*26* /mnt/boot/archlinux
zsh# grub-install --root-directory=/mnt /dev/sda
zsh# vi /mnt/boot/grub/menu.lst
# - start of menu.lst -
default 0
timeout 10
title archlinux
  root (hd0,0)
  kernel /archlinux/vmlinuz26 ro root=/dev/sda5
  initrd /archlinux/kernel26.img
title windoze expee
  rootnoverify (hd0,1)
  makeactive
  chainloader +1
# - end of menu.lst -

zsh# umount /mnt/boot /mnt/sda5
zsh# reboot

And that's all :-)
You have a failsafe boot partition that never gets mounted - or you only mount it whenever there has been a kernel update.
Any updates will go ok because it will be done to the local /boot directory, ie /dev/sda5/boot, and you just mount /dev/sda1 and copy from /dev/sda5/boot.
What I personally do is that I put the following line in my /etc/fstab
/dev/sda1  /mnt/boot  ext2  defaults,noauto  0 0

Also - of course - you want your 'common' area, say this is /dev/sda12, then the entry for fstab becomes:
/dev/sda12  /common  xfs  defaults  0 0

If you need any distribution-specific stuff, even 'home' if you like ...
then 'mkdir /common/archlinux' and in /etc/rc.local
test -d /common/archlinux && mount --bind /common/archlinux /mydisk  (only your imagination will stop you)

Then you follow the same pattern for other distributions - I have the following in my boot partition:
/mnt/boot/archlinux/i686
/mnt/boot/archlinux/x86_64
/mnt/boot/centos-4/i386
/mnt/boot/centos-5/x86_64
/mnt/boot/slackware
/mnt/boot/frugalware/x86_64

- and it all works like a treat!!

Offline

#8 2008-10-02 22:22:54

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: Question about partitioning

Oh yeah - if you allready have windows on the sucker, then there's a couple of extra steps ...
1) boot from live cd (can recommend 'grml')
2) this requires an external usb-drive - must have some 15 gigs capacity
3) plug in the external usb-drive - it will be /dev/sdb1 (your windoze stuff probably comes on _2_ partitions, where the first one is 'recovery')
4) mkdir /mnt/sda2 /mnt/sdb1
5) mount /dev/sda2 /mnt/sda2
6) mount /dev/sdb1 /mnt/sdb1
7) cd /mnt/sda2; tar cvf /mnt/sdb1/windows-xp.tar
8) umount /mnt/sdb1 /mnt/sda2

Now you can partition as outlined above
When it comes to rolling back windows-xp, unfortuneately you do need a xp-cdrom (beg, steal or borrow), you only want it for formatting partition #2 - as soon as it starts copying files you can stop it (power-off) - ie you do not need any product code or other stuff that micro$oft is so fond of

Now - you have a formatted (ntfs or vfat) partition, so you just roll it all back again ...
1) reboot from live cd
2) mkdir /mnt/sda2 /mnt/sdb1
3) mount -t ntfs-3g /dev/sda2 /mnt/sda2  (note 'ntfs-3g' if ntfs, 'vfat' otherwise)
4) mount /dev/sdb1 /mnt/sdb1
5) cd /mnt/sda2; tar xvf /mnt/sdb1/windows-xp.tar

- and you're good to go (might have to edit 'boot.ini' if you are using a different partition than what xp was on originally)

Offline

#9 2008-10-02 22:34:27

SkonesMickLoud
Arch Linux f@h Team Member
From: The D of C
Registered: 2008-09-20
Posts: 178

Re: Question about partitioning

perbh wrote:

When it comes to rolling back windows-xp, unfortuneately you do need a xp-cdrom (beg, steal or borrow), you only want it for formatting partition #2

A GParted LiveCD can easily make vfat and NTFS.

Offline

#10 2008-10-03 02:17:44

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: Question about partitioning

I like perbh's scheme. The advantages over the two options I described are:

1. no distro threatens to write over another distro's /boot/* files.
2. you don't have to chain multiple bootloaders, you can just have one grub config that will let you make a single choice of what OS/distro to load.

The downside is that, whenever you have a kernel upgrade on any of your distros, it won't be available until you manually copy it over from your [distro-root/]boot directory to your real boot partition (/dev/sda1 in perbh's example). You may have to do more than that: Ubuntu changes the names of its kernels with every upgrade. They have a script that will automatically update the /boot/grub/menu.lst file, but with a scheme like this one, you'd have to manually merge those changes into the menu.lst file on your boot partition.

So, it's some extra work, but I agree it's not a bad solution.

If you want less maintenance, it probably is best to go with a chainloaded configuration like (I think) is described in the wiki. The basic idea would be much like perbh's proposal, except the ONLY thing that the stuff on your boot partition would do is load up enough of the system to give you a grub menu, and then transfer control over to a second grub, which might be from your Arch partition, or your Ubuntu partition, or whatever. Then each distro can just manage its own grub, without you needing to do extra maintenance.

Offline

#11 2008-10-03 12:32:17

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: Question about partitioning

>>SkonesMickLoud:
>>A GParted LiveCD can easily make vfat and NTFS.

Yes - but not a bootable one - which is what you need since the ntloader is being invoked (by chaining from grub).
Been there - done that - and I don't know how many times I tried to roll back a xp without success, until I formatted with a 'proper' xp.
Check 'mkfs.vfat' or 'mkfs.ntfs' - and you will see that they will not make a bootable fs.
It's no problem for a 'user' partition though - if you just want read/write access, then any linux mkfs will do the needfull.

Offline

#12 2008-10-03 12:48:56

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: Question about partitioning

while on the subject 'of that other OS' ...
I was trying to do the the same with Vista as I do with XP, but it just didn't work.
Appearantly you have to 'shrink' Vista (while in Vista itself) - which is a bummer 'cuz it doesn't like to give up too much. I was left with 300 gigs (out of 600) after shrinking as much as possible - greedy sucker!!
In this case (recovery was partition #1 and vista partition #2) - I made my /mnt/boot (or boot partition) as partition #3 and made it the active one - and that's where I installed my 'common' grub.
I can live with it (though it's not my choice), but every so often - whenever vista decodes to update itself, it resets the boot-flag to partition #2 and I have to take out my trusty 'grml' again and change it!! :-(

Does anyone have a better suggestion for peaceful coexistence?
I'd love to be able to save my xp or vista or whatever as a tar-file somewhere and then just roll it back whenever needed - best recovery that _I_ can think of.

Offline

#13 2008-10-03 21:10:44

ido
Member
Registered: 2007-09-15
Posts: 28

Re: Question about partitioning

Thank you all very much for all your help! smile

I just found out about Virtualbox and it seems like a really great solution for my problem. Instead of installing Windows XP and another test-distro on different partitions I can simply create two VM image files in Arch.

Offline

Board footer

Powered by FluxBB