LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-05-2005, 01:07 PM   #1
Sabazios3
Member
 
Registered: Jan 2005
Location: Belgium
Distribution: Debian/Gentoo/Ubuntu
Posts: 32

Rep: Reputation: 15
Need help with my partitions


Hey,

For the moment I'm using a dualboot XP/debian but I would like to give Gentoo a try without losing my debian partition. I don't use XP myself (it's only installed for some friends that uses my pc sometimes) so it's not a disaster if I had to remove it.

This is what fdisk -l gives me

Code:
disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End       Blocks            Id     System
/dev/hda1   *           1          1216      9767488+    7    HPFS/NTFS
/dev/hda2            1217        2067      6835657+    83  Linux
/dev/hda3            2130        14593    100117080  f     W95 Ext'd (LBA)
/dev/hda4            2068        2129      498015        e    W95 FAT16 (LBA)
/dev/hda5            2130        2190      489919+      b    W95 FAT32
/dev/hda6            2191        2255      522081        82   Linux swap
/dev/hda7            2256        14593    99104953+  83   Linux

Partition table entries are not in disk order
But as you see it's pretty f*cked up and I don't know how I can change some things if it's possible after all.
hda1 is my win xp partition,hda2 is my "/" of debian, hda3 is extended, hda4 and hda5 I want to delete and use for my gentoo as well as a part of hda7 which is my /home partition of my debian.
As you can see are hda4 and hda5 some messed up partions of one of my earlier tries to resize my swap which was way too big but it didn't worked out as i wanted. (hda4 became a primary partition and hda5 became a logical partition that I formatted as fat32 at that moment).
I use grub as bootmanager (I installed my debian near an existing windowspartition and answered yes at a question that dealed with the mbr).
Have anyone suggestions how I could make a dual/triple boot from it without messing it up even more than I already did and how to do it?
I don't know how to handle it and don't know much about partitioning actually except it's always a little risky. Why for example can't I resize my /home partition (make it smaller so I have some free space again) or why isn't it possible to let some partitons melt together. like for example make 1 partition of hda4 and hda5 or how do I have to manage this as iI tried it befor using my knoppixcd and qtparted.

Thanks,
Sabazios

Ps: I'm sorry for my poor english so please correct the faults so I can learn that too

Last edited by Sabazios3; 04-05-2005 at 01:19 PM.
 
Old 04-05-2005, 01:23 PM   #2
Sabazios3
Member
 
Registered: Jan 2005
Location: Belgium
Distribution: Debian/Gentoo/Ubuntu
Posts: 32

Original Poster
Rep: Reputation: 15
I just found and edited in my text that it's called triple-boot when you want to use three OS's so I now am able to do some more searching myself but any help is still very wanted.

Thanks,
Sabazios
 
Old 04-05-2005, 02:52 PM   #3
enemorales
Member
 
Registered: Jul 2004
Location: Santiago, Chile
Distribution: Ubuntu
Posts: 410

Rep: Reputation: 31
Hi,

The very first thing before doing anything: BACKUP. As you pointed out, resizing partitions is very risky. That said...

I think it is a good idea to use a Knoppix CD for resizing your partitions, as they won't be mounted. Nevertheless, I wouldn't recommend to use qtparted, but "parted", the CLI application it is based on. If I understood correctly, you don't to resize your Debian root partition or your /home partition, so parted will be able to do the work.

You are already familiar with fdisk, so you shouldn't have any problems with parted. Start running "parted /dev/hda". The important commands are:

print : which gives you something very similar to fdisk -l. The main diference is that parted call the partitions "minors". For instance, in my case I get:

Code:
(parted) print                                                            
Disk geometry for /dev/ide/host0/bus0/target0/lun0/disc: 0.000-38204.578 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.031   7640.288  primary   reiserfs    
2       7640.288   8605.129  primary   linux-swap  
3       8605.129  38201.440  extended              lba
5       8605.160  32451.613  logical   ext3        
6      32451.645  38201.440  logical   ext3        boot
resize <minot> <start> <end>: You know ;-)
rm <minor>: This too.
help: Gives you this list and other commands.

So what you need to do, I think, is to remove partitions 4 and 5 and then resize the extended partition (/dev/hda3) by changing its start point. As you will be removing partition 4, you can either shrink it or expand it, depending on if you want Gentoo to be ina primary or a logical partition. After that you can create a new linux partition in the space they left.

That's all what you will need. At that point you can follow the Gentoo installation instructions starting at the point in which you already partitioned the harddisk. The only thing is that you won't need to install a boot loader, but only to change the grub menu to add the entries corresponding to Gentoo.

I have Gentoo in minor 1 and Debian in minor 6 (but installed Gentoo first). My grub menu file (/boot/grub/menu.lst) looks like:

Code:
default 1

timeout 30

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title=Gentoo 2.6.9
root (hd0,0)
kernel /boot/vmlinuz-2.6.9-gentoo-r1 root=/dev/hda1 vga=791 noresume

title=Gentoo 2.6.10
root (hd0,0)
kernel /boot/vmlinuz-2.6.10-gentoo-r6 root=/dev/hda1 vga=791

title=Debian
root (hd0,5)
kernel /boot/vmlinuz-2.4.27-2-686 root=/dev/hda4 initrd=initrd.img-2.4.27-2-686
Hope this helps you...

PS: I also hope my English is good enough, as I'm not a native English speaker
 
Old 04-05-2005, 04:53 PM   #4
Sabazios3
Member
 
Registered: Jan 2005
Location: Belgium
Distribution: Debian/Gentoo/Ubuntu
Posts: 32

Original Poster
Rep: Reputation: 15
Ok, thanks already for your reply.

So here is what I've done yet. I removed hda4 and hda5 but I'm having trouble moving hda3 (resizing it). Parted says that this partition is being used, so i think it's because knoppix uses my swap which is a logical partition of hda3.
At this moment this is how fdisk -l looks like

Quote:
isk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 1216 9767488+ 7 HPFS/NTFS
/dev/hda2 1217 2067 6835657+ 83 Linux
/dev/hda3 2130 14593 100117080 f W95 Ext'd (LBA)
/dev/hda5 2191 2255 522081 82 Linux swap
/dev/hda6 2256 14593 99104953+ 83 Linux
Will try more tomorrow. What are the advantages of gentoo on a logical or primary partition or doesn't that makes any difference?

Greets,
Sabazios
 
Old 04-06-2005, 03:31 AM   #5
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
Since hda3 is the extended partition = a partition that holds logical volumes, I don't think you can resize it.
To try to make it clearer: hda5 & hda6 resides inside hda3. An extended partition acts as a container for logical volumes, this is a way to get around BIOS limit of 4 primary partitions.
(One thing to keep in mind: Primary partitions keep their original numbers, logical volumes numbers may change - that is, as you can see your /home is now hda6 not hda7, since you deleted one partition. If you would delete hda1, hda2 and hda3 will still be hda2 and hda3.)

How much space is used in hda6 (your /home)? Maybe you can copy home-folder to hda2 temporarily, then delete hda3 and create a new extended partition. After that you create the volumes inside the extended partition.

But first of all, take some time to think about your setup. Maybe you'll want to install some other distro later on? Maybe create one /home, one extra partition for storage - then you can more easily repartition when you need to?
How do you want to handle booting?

My preferred way would be this:
1. Copy /home to hda2
2. Delete hda3
3. Create a small primary partition for /boot, 100 MB is more than enough. Make it hda3.
4. Create an extended partition using all space left. Make it hda4. (This makes it easier for you to read the partitioning layout.)
5. Create logical volumes:
hda5 swap
hda6 /home (one /home for all or one each? Your choice!)
hda7 / Gentoo
hda8 /opt or any place not used by any distro.

Install grub in hda3 - once only - then copy the kernels and initrd's to hda3. Mount it under /boot in every distro - not during installation, add it manually afterwards. Now whatever distro you run, boot configuration is always under /boot.

Now if you want to add another distro, copy contents of hda9, then delete it and create new partitions. (Of course you can try resizing, personally I never succeded with it.)
For the booting: there is one drawback with booting from a distro's root-partition (in your case hda2=Debian): If you decide to delete or replace that distro you'll loose your boot-loader.
Putting grub in one dedicated boot-partition you never need to bother about reinstalling bootloader. Just copy kernel & initrd, edit /boot/grub/grub.conf (or menu.lst).
Quote:
What are the advantages of gentoo on a logical or primary partition or doesn't that makes any difference?
That depends: With some mobos (BIOS) you can boot from a logical volume, with other not.
That's the only real difference, with /boot on dedicated partition it doesn't matter.
(Actually, there is another small difference: the four primary partitions are stored in mbr, logical volumes are not.
If you copy your mbr using 'dd' you will only copy the layout of primary partitions. You only need to think about this when you want to take a backup of your partition-table.)

Finally, for copying directories: use commandline 'cp -a' this will preserve all settings like ownership et al.
 
Old 04-06-2005, 07:11 AM   #6
Sabazios3
Member
 
Registered: Jan 2005
Location: Belgium
Distribution: Debian/Gentoo/Ubuntu
Posts: 32

Original Poster
Rep: Reputation: 15
Wow, thanks a lot pingu. I 'd like to do it the way you suggest.
So I have a disk of 120 Gb. My xp is hda1 and is 9.3 GB, hda2 is my "/" of debian and is 6,4GB, I would create a hda3 /boot of about 100mb (it's enough or better a little bigger?) then an extended hda4 with hda5 as /swap (about 512mb) hda6 for my /home (debian) and hda7 (gentoo -I don't know yet which partitions it needs I guess a "/" and a "/home" and the swap I can use from hda4 and /boot from hda3).
Than a hda8 or hda9 (depends on what gentoo needs)for my data, music, and all the other things. I think this is the way you meant too or is there something that you would do different? And how big does the /home from debian and the partitions of gentoo have to be if all my data will stay on the data-partition. Maybe will gentoo become after data because I don't know yet when i'll be able to install gentoo.
But before I can do that I have another problem, I have only 3.4 GB free space on hda2 and I don't know how big my /home is. When I use kdiskfree I see I have used 5.30GB of my hda6 (qtparted says the same) but when I see by properties on /home it says that there is only 550mb used. All my personal music and data are already removed from it so it just things that debian put there like some configs of programs but I don't see what else is on my /home so what is most likely to be right? Is there a way to be sure before trying and mess it up and I just have to copy the whole /home to hda2 and afterwards put it back on hda6 if I understand that part of your answer right?
Not that easy but an experience more for me.

I 've read this post a little too late so I already managed to resize my extended and right now my partiontable looks like this so maybe there is another solution too for me but I don't manage to free some space of my /home and it would be nice to have a /boot on a primary too so I guess pingu's way is better or is there now an easier way to reach almost the same?

Code:
fdisk -l

Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        1216     9767488+   7  HPFS/NTFS
/dev/hda2            1217        2067     6835657+  83  Linux
/dev/hda3            2068       14593   100615095    f  W95 Ext'd (LBA)
/dev/hda5            2068        2132      522081   82  Linux swap
/dev/hda6            2133       14470    99104953+  83  Linux
Thanks,
Sabazios
 
Old 04-06-2005, 09:08 AM   #7
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
1.) To get a /boot-partition: maybe you could shrink hda2 a little, 100 MB for /boot is more than enough. I have 60MB at home and I install lots of distro's. Count: a normal kernel is about 1-2 MB, initrd's can be bigger. For Fedora, my kernel+init = 6MB. With 60MB /boot-partition I can store for 10 distro's.
But I would say, if your computer does not boot from logical volume then you should definitely make sure you get a dedicated boot-partition. Even if it means reinstalling Debian - if not, you will cry later, trying to install yet another distro. Some people disagree about this, in the end it's of course your choice.

2.) That /dev/hda6 is a problem. I take it you have controlled the mounting? I mean, /dev/hda6 is actually mounted on /home? Check it easily with
# df
If /home only contains "quote": things that debian put there like some configs of programs
then you can simply delete everything - of course all your personal configurations will be lost.
But you shouldn't reformat a partition before you know exactly what's on it.
Could it be a numbering misunderstanding?
kdiskfree reports 5,5 GB, 'properties' 550 MB
'propertis' also shows you total size, is that the same as kdiskfree reports?

3.) /home
How big? Who knows? I have 2 GB, used 650MB - but this is very personal.
I suggest putting music, movies and other large stuff somewhere else, if you add another user they can all access these.
And to the question "one /home for all or one each": either way you'll have to think a bit.
One /home for all is my way, but I'm constantly thinking about it.
Pro's: everything is always in same place. I have 6 distro's on my 'puter, when the kids saves something it's easily found no matter what distro is currently running (and they won't know what distro they used when saving). Also it saves some space, and some configurations are needed only once, but...:
Con's: The configuration-files for applications, WM/desktop settings often have the same name no matter which version.
Loading IceWM 1.0 with config-file for 1.2 simply did not work.
I have had some trouble with WM's/DesktopEnv but only once with some application. What I have done is I move the config's somewhere else and create a symlink. With kde I first change default location of some dir's: kde-control-center->System Administration -> Paths
so they all reside in .kde<versionnr>
Then I copy everything under /home/<username>/.kde to /home/<username>/.kde<versionnr>
And I have in rc.local:
Code:
rm /home/pingu/.kde
ln -s /home/pingu/.kde33 /home/pingu/.kde
So: Keeping one /home for every distro is safer, less initial-config to do and you don't accidentally trash your configurations. But it will give you other headaches, and having one /home for all only requires extra config once - when a new distro is installed.
You have to make your own choice. If you go for separate homes, make symlinks for often used directories like Documents.
 
Old 04-06-2005, 11:26 AM   #8
Sabazios3
Member
 
Registered: Jan 2005
Location: Belgium
Distribution: Debian/Gentoo/Ubuntu
Posts: 32

Original Poster
Rep: Reputation: 15
Thanks again for your reply,

Code:
Debian:/home/david# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda2              6728312   3392504   2994028  54% /
tmpfs                   258208         0    258208   0% /dev/shm
/dev/hda6             97548140    612052  91980844   1% /home
none                     10240       728      9512   8% /dev
/dev/hda1              9767484   5440180   4327304  56% /media/win
So hda6 is mounted but as I can see here I think it will only be about 550mb and not 5.50Gb. So normally I should be able to copy it on hda2 but I'm not sure about the command. Is it
Code:
cp -a /home /dev/hda2/
or should I make myself a dir on hda2 where I copy it in or doesn't that makes a difference? Sorry I'm quite new to linux and still learning very much so I'll probably ask some stupid questions but I rather ask a stupid question than mess it up. Properties doesn't show the total size here so can't compare those things.
I'll create a seperated /home for eacht distro, as I think that will be the easiest solution and create a /boot also because I"ll probably try some more distro's later.

Thanks,
Sabazios
 
Old 04-06-2005, 11:59 AM   #9
Sabazios3
Member
 
Registered: Jan 2005
Location: Belgium
Distribution: Debian/Gentoo/Ubuntu
Posts: 32

Original Poster
Rep: Reputation: 15
Hmm, just thinking because I don't know how big my /home needs to be in both debian and gentoo that I"ll probably just resize the "/" partition of my debian to 15 Gb (in stead of 6.7GB) and make for gentoo also a / from 20 GB are something and no seperated /homes at all as I"ll store all the other data and music on a separated partition so maybe it's safer and easier to do it this way. Will this be enough and how do I have to copy /home on hda2 and makes sure he will look there for my /home and not anymore on a separated partition. Is it as easy as change /dev/hda6 to /dev/hda2/home or something?
Lots of questions again and hopefully some answers too.

Thanks,
Sabazios
 
Old 04-07-2005, 02:07 AM   #10
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
I think you're right in keeping /home separated, especially if it's only you at the computer. How about putting the Documents on the partition where you keep your music etc, and make a symlink? That makes it a bit safer if you reinstall - you won't accidentally loose your documents.
One word of warning: symlinks has worked perfectly for me with one exception: scribus does not save in a linked directory. It creates the filename, but size=0.
In the end it all comes down to this: Never trust the computer!

Copying:
# [peterh@killbill ~]$ cp -a /home/peterh/ssk/* /home/peterh/G/
This copies the contents of directory "ssk" to /home/peterh/G/
# [peterh@killbill ~]$ cp -a /home/peterh/ssk/ /home/peterh/G/
This copies the directory "ssk" to /home/peterh/G/
You will want the last one, but you don't use the /dev/hda2 -style but the mount-point. So, to backup your /home to some other place:
Code:
cp -a /home /backup
You will now have the contents of /home in /backup/

Partitionsizes:
15-20 GB is too much in my opinion, you have so far used 4 GB for Debian.
Remember, if a partition is getting full you can always move a big directory to another partition and link it in. You have a big disk, but it depends on the future. Today I have a 60 GB master disk, 6 partitions of 3- 6GB for distro's and 2 GB /home. That's enough for me - but of course this depends on how much & how big programs you'll need.
But making that hda2 really big has the advantage you can more easily make a backup of a distro if you want to reformat later on. You probably will - it takes some time to find out what suits you best.
Quote:
/home on hda2 and makes sure he will look there for my /home and not anymore on a separated partition. Is it as easy as change /dev/hda6 to /dev/hda2/home or something?
To change the mountpoints, edit /etc/fstab
To move your /home you'll need to:
a) copy /home as described above (or use gui-tools like konqueror, but make sure all settings are kept!)
b) logout all users except root.
c) unmount /home, edit /etc/fstab and remove the line with "/dev/hda6 /home ......"
d) copy your /backup to /home
Don't forget to check that hda6 is not mounted before last step!

Now there is one more thing to think about: uid & gid
A user is identified to the system by a unique user-id, a user always has one group it belongs to (at least).
The numbering and default group differs between distro's. That means: create your users manually, to make sure they have the same uid & gid in any distro.
There are GUI-tools, or use commandline:
Code:
[root@killbill ~]# groupadd -g 501 peterh 
[root@killbill ~]# useradd -g 501 -u 501 peterh
[root@killbill ~]#passwd peterh
You might have to add this user to some other groups, an easy way to find out what the distro sets as default is to create a temporary user during installation. Then check the file /etc/group to see what groups your users should belong to.

The first time you do all this it might seem troublesome, it will probably take some time. But you'll soon get used to it, and building correctly from the beginnign saves you a lot of hazzle later on - believe me, I know...
 
Old 04-07-2005, 04:19 AM   #11
Sabazios3
Member
 
Registered: Jan 2005
Location: Belgium
Distribution: Debian/Gentoo/Ubuntu
Posts: 32

Original Poster
Rep: Reputation: 15
Thanks for your help and patience,

So I have done a part of the job now and till now it worked out well. So right now my fdisk -l looks like:

Code:
Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        1216     9767488+   7  HPFS/NTFS
/dev/hda2            1217        2067     6835657+  83  Linux
/dev/hda3            2068        2080      104422+  83  Linux
/dev/hda4            2081       14593   100510672+   f  W95 Ext'd (LBA)
/dev/hda5            2081        2211     1052226   82  Linux swap
/dev/hda6            2212        2994     6289416   83  Linux
So did'nt change anything on hda1 and hda2 (tried to resize it a little but it didn't work) and have deleted all the others. Created /boot on hda3 (of 100mb ext2), 1GB swap on hda5 and 6GB /home for my debian on hda6. Didn't create yet the other partitions because I'm still not sure how big they have to be but I'll have a seperated home and root for my gentoo too and then also a /data for all my documents,music etc.
So the copying of my home went well, but I still need to copy my kernel,initrd and grub to hda3 and edit my fstab for it in debian after I've done that, but must /boot be bootable and how can i make it bootable if it necessary. I guess it doesn't have to been bootable but I'm not sure.

Thanks,
Sabazios
 
Old 04-07-2005, 08:10 AM   #12
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
Only copy kernel and initrd to hda3 - grub has to be installed, you can't just copy it.
I never installed grub manually, but there's lots of docs around.
And this might seem strange, but you don't have to add /dev/hda3 to fstab. That's mostly for your own convenience, always knowing where the boot-stuff is.

hda3 has to be bootable or active.
With fdisk you use 'a' = toggle active partition
Observe 'toggle' - you need to activate hda3 and deactivate hda1.
fdisk happily lets you mark more than one partition active, this will confuse your poor BIOS and computer hangs...
 
Old 04-07-2005, 10:58 AM   #13
Sabazios3
Member
 
Registered: Jan 2005
Location: Belgium
Distribution: Debian/Gentoo/Ubuntu
Posts: 32

Original Poster
Rep: Reputation: 15
Thanks again,

But I'm confused now. I 've been reading a lot this afternoon but I don't get it anymore.
Right now my grub is installed on my mbr, I installed debian after windows and let it install grub on my mbr which I think is a little part(ition) before or in windows (don't know it exactly). So far so good?
But I want /boot to take over this and so I've to install grub on /boot and copy kernel images and initrd's on it and make /boot bootable and make hda1 unbootable. Still good? It's not a problem that this is on hda3 and not on hda1?
If this is still ok do I have to show debian where he has to boot from? So do I have to

Code:
 
mv /boot /boot.old
mkdir /boot
mount /dev/hda3 /boot
mv /boot.old/* /boot
rm -r /boot.old
or something like this to let debian now where he has to find boot from?
And when I'm installing gentoo I just must config my grub for it after I installed it, no need to mount it or make a mountpoint?
Sorry I asked a lot of you and still do but it's all new for me and very difficult too. So I can't say thank you enough for your patience.

Greets,
Sabazios
 
Old 04-08-2005, 02:47 AM   #14
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
I know this is an area that's difficult to understand, just keep on asking - I'm glad if I can help.
I'll try to clearify a bit:
The booting of the computer is handled by BIOS and bootloader together. The partition table is searched for a valid, active partition and control is turned over to the bootloader on that partition. At this stage BIOS is still needed to find partitions which means that the kernel has to reside on a partition that BIOS can boot from.
Then grub starts the OS, kernel is loaded into memory where I believe it stays resident.
It does not matter to the OS where the /boot is, the kernel in it isn't used directly by the OS.
I am guessing a bit now, I don't really know exactly what's going on - but I know you can boot from hda3 and run the distro without having hda3 mounted at all.

Then why did I say "mount /dev/hda3 on /boot" ?
This is for your convenience only. The distro doesn't care.
When you have several distro's on your computer and want to check/change anything that has with booting to do, it's good to know where the boot-stuff is. Always having hda3 mounted on /boot means you never need to think about it.
BUT! Don't mount /boot during an installation, do that manually directly after installation. This is so you don't loose your boot-setup, also you can easily check what extra parameters the specific distro wants.
Directly after installing, often you can do this without rebooting just change console:
#df (to find out where / is, let's say it's on /mnt)
# mkdir /a3
# mount /dev/hda3 /a3
-- Now copy the kernel and initrd from /mnt/boot/ to /a3/
# cat /mnt/boot/grub/menu.lst
-- This will show you what parameters you shall put in your menu.lst.
Next step is optional, I find it easier to know what kernel is used by what distro:
# cd /a3
Now create links like vmlinuz-gentoo pointing to the correct kernel.
Finally edit /a3/grub/menu.lst and add the new distro.
Don't edit /mnt/etc/fstab, I have found that some distro's don't keep that change. Do that after first original boot.

One thing you must consider, I had actually forgotten (see, it's good to take things slowly and thorougly!)
With grub in mbr, you always boot from mbr! Grub takes over, active partition is neglected!
This means when all is done you must remove grub from mbr, you can do that by uninstalling grub or boot from a DOS or Windows boot-disk, execute fdisk /mbr.
If installation of bootloader on hda3 is incorrect you will not be able to boot.
Make sure you have a boot-disk for your Linux, or just install a new distro and this time use /dev/hda3 for /boot during installation.

Now when I installed Debian (3.0?) I was asked if I wanted to add something like a "Debian mbr". I said yes to that, now I have a very nice feature:
At bootup, a short second before "loading Grub" comes up, a line with 'MBR' is shown at the bottom.
If I press <shift> (I think?) I get a menu like
MBR 13FA
Pressing 3 boots from hda3, pressing A extends the chices to all partitions possible
MBR 1234F
You have Debian, but I don't know if this can be installed afterwards?
I think I'm going to find out - this is very handy!

Maybe you should check whether your computer boots from logical volumes - if so you do not need to copy anything to hda3, just point to it.

There is lots more to discuss, but I think I'll stop for now.

Maybe only one more thing, but be careful - use this incorrect and you might loose all data on disk!
You can make a copy of your mbr, to easily get it back:
#dd if=/dev/hda of=mymbr bs=1 count=512
--Now make sure you know where mymbr is located! Then to put it back:
# dd if=mymbr of=/dev/hda bs=1 count=512
-- I'm not sure whether 'bs' and 'count' is needed, I always use them.
This command copies entire mbr including partition table. To copy mbr without partition-table use 'count=440' I am not completely sure 440 is the correct number! I can't experiment right now, will check it later.
As I said, be careful!
Before doing this, print out the partition table using fdisk, You must know partition number, starting and ending cyl, partition type.
Then you can create a new partition table with fdisk should anything go wrong.
My advice is, take a copy of mbr, but don't replace it until you're sure you know what you are doing!
 
Old 04-08-2005, 08:02 AM   #15
Sabazios3
Member
 
Registered: Jan 2005
Location: Belgium
Distribution: Debian/Gentoo/Ubuntu
Posts: 32

Original Poster
Rep: Reputation: 15
Ok thanks again for your help and advice.

I already made a bootfloppy of grub when I started with this because I know it's very risky.
Probably I will before I install gentoo with my windowscd overwrite the mbr again so grub isn't there anymore and then install gentoo and say he can put his grub on hda3 /boot. Copy the kernel and initrd's on hda3 and edit grub so he can use the grub that my gentoo installed. Hopefully that works and otherwise I'll do a completely reïnstall somewhere in July and starting from the beginning without windows on my pc because it seems that it causes a lot of difficulties even when I don't use it. I"ll read some more doc's about the whole mbr-thing, because I still don't get it. So thanks a lot and maybe I"ll use this thread again in a couple of days but for now it seems wise if I"ll just read a lot till I have a bigger knowledge of this and not just try this because I need my pc now and can't affort it to have to reinstall everything.

You have been a great help pingu so thanks a lot and keep up the great work,
Sabazios
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/proc/partitions showing wrong partitions netstv Linux - General 1 07-10-2006 01:11 PM
How many partitions should I use? fishybawb Slackware - Installation 4 07-23-2004 02:53 AM
Create software RAID partitions first, then create filesystem partitions on top of th stefanlasiewski Linux - Software 1 04-28-2004 04:12 PM
Partitions twinkers Linux - General 26 08-24-2003 10:51 AM
How many partitions dark_light Linux - General 7 05-08-2002 04:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration