LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-31-2007, 07:14 PM   #1
imurch01
LQ Newbie
 
Registered: Jan 2005
Location: Adelaide, Australia
Distribution: FC6
Posts: 8

Rep: Reputation: 0
Which partition?


Hi,

I am trying to tidy up & re-arrange the partitions on my HDD, but I seem to have conflicting information about which partition has my Linux system on it. Can anyone tell me/give me any clues from he info below?

Output from parted

Disk /dev/hdc: 40.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 32.3kB 41.1MB 41.1MB primary fat16
2 41.1MB 8431MB 8390MB primary ext3 boot
3 8431MB 8538MB 107MB primary ext3
4 8538MB 40.0GB 31.5GB extended lba
5 8538MB 18.9GB 10.4GB logical ext3

This suggests partition 2 is my system partition, yes?
And that is support by grub.conf ....

default=0
timeout=10
splashimage=(hd0,2)/grub/splash.xpm.gz
title Fedora Core (2.6.19-1.2895.fc6)
root (hd0,2)
kernel /vmlinuz-2.6.19-1.2895.fc6 ro root=LABEL=/ rhgb acpi=on
initrd /initrd-2.6.19-1.2895.fc6.img

But my recollection is that it was on partition 5, which is supported by df:

[imurch01@imurch01 ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hdc5 9.6G 6.4G 2.8G 70% /
/dev/hdc3 99M 17M 77M 18% /boot
none 251M 0 251M 0% /dev/shm
/dev/hdc2 7.6G 6.0G 1.3G 83% /home

And if you look at the sizes, hdc5 is definitely the 5th entry from the parted output. I am thoroughly confused

Any help will be much appreciated.
 
Old 05-31-2007, 07:22 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
It looks from the df output like partition 2 is your /home partition, partition 3 is a small boot partition (just kernels and grub) and partition 5 is the / partition. Partition 1 looks like some sort of disk diagnostic partition that came with your drive.
 
Old 05-31-2007, 07:39 PM   #3
imurch01
LQ Newbie
 
Registered: Jan 2005
Location: Adelaide, Australia
Distribution: FC6
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks. I agree, but if I want to install an alternate system configuration on partition 2 (currently /home), what do I put in my grub.conf? I would have put root (hd0,2) but that's what's already there for my normal configuration.

Hang on, I have done a bit more reading, and I might be able to explain it ...

Firstly, Grub counts partitions from zero, so (hd0,2) is the 3rd partition, not the 2nd, and it doesn't count extended partitions, so by that count, partition 5 is (hd0,3), but possibly it doesn't count its own partition, which would make (hd0,2) partition 5, so everything would make sense. I'll just reboot and use the Grub command line to confirm all of that.

Sorry for the long-winded answer to my own question - I just hate it when I find a forum question that is exactly what I want to know and then there's no answer, so just trying to fill in the blanks!
 
Old 06-01-2007, 11:32 AM   #4
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Quote:
Originally Posted by imurch01
... and it doesn't count extended partitions, so by that count, partition 5 is (hd0,3), but possibly it doesn't count its own partition, which would make (hd0,2) partition 5, so everything would make sense. I'll just reboot and use the Grub command line to confirm all of that.
I don't think that's right. I think partition 5 is still hd(0,4).

Also, in grub speak, "root" does not mean root of your filesystem. It means "path to /boot directory". Most distros by default make one / partition that contains /boot, so then it just happens that "root" is the same as /. And yes, grub will count it's own partition.

As to installing something else on your /home partition, I need a bit more information. If you're planning on installing something over the /home partition, you need to first mount it as something else and copy it to your / partition (/dev/hdc5) under the /home directory and then modify /etc/fstab, otherwise you'll have an unbootable system (I think) since you won't have any user files.

Secondly, whenever I install a new OS/distro on a machine with linux already on it, I just let the installer put the bootloader (grub or lilo) into the / partition NOT the MBR. Then all you have to do is add a small section to your original grub config file to chainload the second distro's bootloader. It keeps them completely separate and is therefore easier for me to maintain.

http://www.justlinux.com/forum/showthread.php?p=837905
 
Old 06-03-2007, 06:57 AM   #5
imurch01
LQ Newbie
 
Registered: Jan 2005
Location: Adelaide, Australia
Distribution: FC6
Posts: 8

Original Poster
Rep: Reputation: 0
Yeah, thanks for that, you're right. I've got it all figured it out now, and sorted out the way I want it.

I just had a few things wrong in my head. I thought that /boot just had grub in it and that the kernel was in the system filesystem, whereas grub itself (as opposed to the configuration) is (in my case) in the MBR, and it then runs the kernel from /boot, which in turn loads the system filesystem according to the arguments it is given in my grub.conf. So in editing my grub.conf I kept the root (hd0,2) but in the next line changed the root=LABEL=/ to root=/dev/hdc2.

I didn't actually want to put a different system on /dev/hdc2 anyway, I just wanted to combine my system and data files into a single filesystem, and the most convenient way to do it that I could think of was to backup the /home files, then copy the system onto /dev/hdc2, boot from that (lack of /home is not unbootable, its just you only want to use it as root or preferably in single user mode), delete the other partitions and then extend the /dev/hdc2 partition and restore the user data. That all went off without a hitch, and now I have everything arranged that way I want it, so thanks for the help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Partition Problems: Bad primary partition 1: logical partitions overlap rovitotv Slackware 6 01-08-2006 06:55 PM
Copy files from partition to partition too slow, SATA hard disk.What should I do£¿ Ryanlee SUSE / openSUSE 20 10-31-2005 07:30 AM
Deleted ntfs partition - added linux partition in its place - corrupt! eklhad Linux From Scratch 2 06-28-2005 01:31 AM
Total partition size - User partition size is not equals to Free partition size navaneethanj Linux - General 5 06-14-2004 12:55 PM
Newbie Installing Debian3 on m68k w/250M Partition Needs help creating swap partition AppleMac Linux - Newbie 2 11-01-2002 08:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:16 PM.

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