Click to See Complete Forum and Search --> : How to switch from one linux partition to another?
Rodolfo Medina
11-28-2004, 12:29 PM
Hi.
On my 40 Gigabyte hard disk I used to have two partitions:
one (30 GB) containig Windows 98 and the other (10 GB) with Linux Mandrake 9.1.
Now I created a third partition with another 10 GB token off Windows,
and in it I installed successfully Mandrake Community 10.1.
Now, how can I switch from one to another Linux partition?
When I boot the system I can only choose to get into Mandrake 10.1
or into Windows, whereas I want the possibility to choose between Windows,
Mdk 10.1 and Mdk 9.1.
Can anybody provide help?
Thanks in advance,
Rodolfo
saikee
11-28-2004, 12:37 PM
Piece of cake
If the bootloader is Lilo then add the following two lines to /etc/lilo.conf
other=/dev/hdax
label="My Mandrake 9.1"
If your bootloader is Grub add these 3 lines to /boot/grub/menu.lst
title this is my Mandrake 9.1
root (hd0,y)
chainloader +1
x=your partition number for Mandrake 9.1 and y=x-1 as Grub counts from zero. Some version of Lilo may not need " in the label statement so follow what has been done previously.
Nearly forgot - you need to have the bootloader Mandrake 9.1root partition partition, assuming it is hda5 then the command to put the bootloadrer is
lilo -b /dev/hda5 for Lilo and
grub-install /dev/hda5 for Grub
hard candy
11-28-2004, 12:38 PM
1. Look at your boot manager's (Grub or Lilo,etc) help section for how to add a partition to the boot manager. Or some of the past threads here, there are lot's of similiar questions already posted.
2. Look at your /etc/fstab file and see how partitions are mounted at boot up. You can add the extra partition to be mounted at, say, /mnt/Mandrake-9.1 and then cruise on into it. (You have to make the directory in /mnt first).
Welcome.
Rodolfo Medina
11-30-2004, 06:51 AM
Thanks.
From within the new partition I did the following procedure
(x is the old partition device number):
1) # mkdir /mnt/linux2
2) # mount /dev/hdax /mnt/linux2
3) In the file /mnt/linux2/etc/lilo.conf I changed the line
boot=/dev/hda
into
boot=/dev/hdax
4) I got into linux2 root:
# chroot /mnt/linux2 /bin/bash
5) , and there
# lilo -v
6) I got back to the new partition root, and at the end of the file
/etc/fstab I added the line
/dev/hdax /mnt/linux2 ext3 defaults 1 2
; then at the end of the file /etc/lilo.conf I added the following:
image=/mnt/linux2/boot/vmlinuz
label="linux2"
root=/dev/hdax
initrd=/mnt/linux2/boot/initrd.img
append="acpi=ht resume=/dev/hday splash=no"
vga=788
read-only
, where 'y' in hday should be the swap partition device number.
7) # lilo -v -t
8) # lilo
Everything seems to have gone well,
now when booting I can choose if going into linux or linux2,
and the new partition has not modified the old one,
except for one thing:
in the old partition I have to reinstall the modem,
i.e. rerun the modem driver.
Why? Does anybody know?
Is the above procedure correct?
Maybe a bug in Mdk 10.1 Community (the new partition OS)?
Thanks,
Rodolfo
Parcival
11-30-2004, 09:19 AM
I'm not a LILO expert, but what you did looks right to me. After all, if it boots up correctly it must be right. :)
I don't think your modem installation question is related with the bootloader/partition question, unless you have partitions that are being shared between the two distros. However, from your description this doesn't seem to be the case, so I suggest to open the focus of your search again.
saikee
11-30-2004, 10:01 AM
I suppose the # in front of each command is just an indication of that you are in CLI as I never use it myself.
It is true that you can amend to lilo.conf as you have done to boot the Linux "directly". However I prefer chainloading as it is simpler, involving less work and also interconnectable with Grub.
Once chroot into it I would just replicate Linux2 bootloader in root partition of hdax by
lilo -b /dev/hdax
The above automatically updates the Lilo system.
Then in the New Linux I only need to add 2 lines in its lilo.conf
other=/dev/hdax
label="Liniux2"
and update the Lilo in the MBR by
lilo -b /dev/hda
You will find direct booting, calling out the exact file names of the kernel and initrd becoming a chore when changing the Linux or jumping between Grub and Lilo. Chainloading is generic and simpler. Afterall that is how a Linux boot a Windows. Lilo is fussy about the existence of the bootloader (that is why the "lilo" has to be issued for it to check it again) but Grub doesn't mind if it is empty or unbootable. Thus I have Grub already written up to boot empty partitions before I even install the Linux in them. Grub needs 3 lines instead of 2 lines to chainload a Linux.
On the subject of reinstalling the modem I second Parcival's assessment.
Rodolfo Medina
12-02-2004, 06:45 AM
I've worked out the problem (or at least I've managed to avoid it)
by using a more simple procedure,
in which the new partition is 'son' and the old one is 'parent',
whereas before it was the contrary.
0) Before 10.1 installation, I had:
/dev/hda1 -> Windows 98
/dev/hda5 -> Mdk 9.1 root
/dev/hda8 -> Mdk 9.1 home
/dev/hda6 -> linux swap
(/dev/hda7 -> Mdk 9.1 very old one, not involved in this game)
1) I created two new partitions, in which I installed Mdk 10.1:
/dev/hda9 -> Mdk 10.1 root
/dev/hda10 -> Mdk 10.1 home
. Now, when I installed Mdk 10.1 I didn't choose MBR as boot point;
I chose the second possibility (root, if I remember well).
Then, when I booted the system, I found myself in 9.1 (/dev/hda5).
Then, from there I did:
2) # mkdir /mnt/mdk10.1
3) # mount /dev/hda9 /mnt/mdk10.1
4) # emacs /etc/fstab
, and added the following line:
/dev/hda9 /mnt/mdk10.1 ext3 defaults 1 2
5) I edited the file /etc/lilo.conf: I added the following:
other=/dev/hda9
label="mdk10.1"
6) # lilo
This way, the modem problem did not arise any more.
Rodolfo