LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help on partitions (https://www.linuxquestions.org/questions/linux-newbie-8/help-on-partitions-531928/)

ranban282 02-24-2007 03:08 AM

Help on partitions
 
Hi,
I have some questions on partitions.
1.I have both fc5 and fc6 installed on my computer. Do I need 2 swap partitions, or is one enough.
2. What is the purpose of a /boot partition, and how big should it be? If I have fc5 and fc6 installed, do i need 2 /boot partitons?
3. I have both fc5 and fc6 installed, how do I find out what swap partion what is using?

4. My fc5 / partition is on /dev/sda8, and my fc6 / partition in on /dev/sda12. I have a /boot partition /dev/sda10
When I run cat /proc/partitions, i get :
major minor #blocks name

8 0 156290904 sda
8 1 40957686 sda1
8 2 1 sda2
8 5 25599546 sda5
8 6 25599546 sda6
8 7 25599546 sda7
8 8 16097098 sda8
8 9 1228941 sda9
8 10 5116671 sda10
8 11 1076323 sda11
8 12 15004678 sda12

sda1 is a windows partition. sda2 seems to be some sort of a partition table. sda5, 6 and 7 are fat32 partitions. sda8 is a / partition for fc5. sda9 is a swap partiton for fc5. sda10 is a /boot partition. sda11 is a swap partition for fc6. sda12 is the / partition for fc6.

a) What does major and minor mean?
b)This is bothering me a little:
This is the output of df: (in fc6)

/dev/sda8 14534476 7267800 6516444 53% /
tmpfs 253140 0 253140 0% /dev/shm
/dev/sda5 25587024 24448000 1139024 96% /mnt/temp1
/dev/sda6 25587024 24639888 947136 97% /mnt/temp2
/dev/sda7 25587024 24966688 620336 98% /mnt/temp3
/dev/sda8 15592716 13914588 873276 95% /mnt/temp4
/dev/sda10 4956284 158784 4541668 4% /boot
->What is tmpfs?
->Why does the first line say /dev/sda8, when in reality it should be sda12?

To prove this, I mount the /dev/sda12 partition, an run df, this is what I get:

/dev/sda8 14534476 7267796 6516448 53% /
tmpfs 253140 0 253140 0% /dev/shm
/dev/sda5 25587024 24448000 1139024 96% /mnt/temp1
/dev/sda6 25587024 24639888 947136 97% /mnt/temp2
/dev/sda7 25587024 24966688 620336 98% /mnt/temp3
/dev/sda8 15592716 13914588 873276 95% /mnt/temp4
/dev/sda10 4956284 158784 4541668 4% /boot
/dev/sda12 14534476 7267796 6516448 53% /mnt/temp5

Seeing this, one can say that the first line should be /dev/sda12. Why is the output of this command wrong?

It seems that this is causing some problems. I updated a kernel using yum in fc6. And when I try to boot into the new kernel, it boots into fc5!
What's more, if /dev/sda8 (the one in line 6) is not mounted when such an installation takes place, I get kernel panic while booting into the new kernel.

So it seems to boil down to the first line of the output of the df.

Any help will be appreciated.
Thanks
Ranjai

Junior Hacker 02-24-2007 04:16 AM

A1:
You can share the same swap between as many Linux distributions as you want. In days gone past, some people would create many swap partitions when physical memory was minimal, nowadays computers have allot of physical memory, so a single swap partition double the size of the physical memory is normally more than what is needed.

A2:
You do not really need to have any more than three (or two) partitions per distribution, namely: /, /home, & swap, the boot sector would be the first sector of the / partition. The only time you need to have one distribution consisting of many more partitions would be for a server that needs extra protection, in which case /var should be separate at the least. Some people like to split things up into many partitions to make it easier to back up the OS, having /var on it's own will protect the rest of the system from being filled up by mail spam and causing a crash.
There are many backup utilities that can easily back up the entire system in one partition --> "/", which can have the whole filesystem tree except swap. When you have a multi-boot with a Windows OS, you do not need a separate /home partition for the Linux distributions as every system can access your data stored on a shared Fat32 partition. If all you have in your multi-boot is Linux systems, you can share a separate /home partition between them but not share the same user unless they are the same Linux releases from the same installation using imaging technology--> ( FC6 & FC6).

A3:
If you have KDE desktop environment, go to main menu/system/kinfocenter/partitions to see which "/dev/" is being used as the swap partition for both FC5 & FC6. In Gnome, it would probably be in a similar area.

A4: sda2 is probably not a partition table unless you have an elaborate boot manager, the partition table is normally in the MBR which is the first sector of the hard drive, and is not normally a partition. In a traditional partitioning scheme, sda1, sda2, and sda3 would be primary partitions. Sda4 would be an extended partition containing nothing. sda5 and all past that are logical partitions which are part of sda4. Some of the fat32 partitions may be dos or other Windows systems.

You must have inherited this computer to not know what the partitions contain, here is a useful thread put together by a member here at LQ that may help you figure things out:

http://www.justlinux.com/forum/showthread.php?t=147959

Junior Hacker 02-24-2007 04:31 AM

PS:

The /mnt/temp partitions are probably just that, temporary working areas similar to a swap partition, not sure why one would do something like this as one large /mnt/temp partition would do. Check in your Linux distributions in the /mnt directories to see if these are present.
Example: when editing a 4GB DVD movie, you need a temporary working area equal in size, a single layer DVD can be 4.37GB in size, a fat32 partition can only have a max. of 4GB file size, a Linux native fs. or Windows NTFS filesystem have unlimited file size. These /mnt/temp partitions can be used by a DVD editing application for edititng movies if the OS's partition does not have enough "free" space.
There is definately something funny here.

michaelk 02-24-2007 07:41 AM

sda2 is an extended partition. In a nutshell it lets one create more then 4 partitions on a hard drive (1-4 primary partitions, anything >=5 is a logical partition). A SATA hard drive is limited to 15 total partitions.

Here is a link that explains major minor device nodes.
http://www.linux-tutorial.info/modul...rial&pageid=94

Post the output of your /etc/fstab and the grub.conf files from both FC5 and FC6. Typically Fedora uses partition labels. If you had FC6 and FC% partitions mounted when you did the update yum appeared to have saved the files to the wrong directory.

In a nutshell tmpfs is a virtual filesystem i.e. it exists in RAM but it can also use swap space.

ranban282 02-24-2007 08:18 AM

This is what my fc6 /etc/grub.conf looks like:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,9)
# kernel /vmlinuz-version ro root=/dev/sda12
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,9)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.19-1.2911.fc6)
root (hd0,9)
kernel /vmlinuz-2.6.19-1.2911.fc6 ro root=LABEL=/12 rhgb quiet
initrd /initrd-2.6.19-1.2911.fc6.img
title Fedora Core (2.6.19-prep)
root (hd0,9)
kernel /vmlinuz-2.6.19-prep ro root=LABEL=/12 rhgb quiet
initrd /initrd-2.6.19-prep.img
title Fedora Core (2.6.19)
root (hd0,9)
kernel /vmlinuz-2.6.19 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.19.img
title Fedora Core (2.6.18-1.2798.fc6)
root (hd0,9)
kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.18-1.2798.fc6.img
title Other
rootnoverify (hd0,0)
chainloader +1

Here, Other refers to Windows, and that works fine. The Fedora Core (2.6.18-1.2798.fc6) also works fine. The three above it dont. FC6 works fine in most cases, so I dont need to boot into fc5 at all.

My fc6 /etc/fstab looks like this:

LABEL=/12 / ext3 defaults 1 1
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
LABEL=SWAP-sda11 swap swap defaults 0 0
LABEL=^B^D^N^^C^D<84>^V^A^L>H:v^D swap swap defaults 0 0
/dev/sda5 /mnt/temp1 vfat users,auto,gid=500,uid=500 0 0
/dev/sda6 /mnt/temp2 vfat users,auto,gid=500,uid=500 0 0
/dev/sda7 /mnt/temp3 vfat users,auto,gid=500,uid=500 0 0
/dev/sda8 /mnt/temp4 ext3 users,auto 0 0
/dev/sda10 /boot ext3 users,auto
/dev/fd0 /media/floppy1 vfat pamconsole,exec,noauto,managed 0 0
/dev/hda /media/cdrecorder1 auto pamconsole,exec,noauto,managed 0 0

My fc5 /etc/grub.conf looks like:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,9)
# kernel /boot/vmlinuz-version ro root=/dev/sda10
# initrd /boot/initrd-version.img
#boot=/dev/sda
default=3
timeout=5
splashimage=(hd0,9)/boot/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.17-prep)
root (hd0,9)
kernel /boot/vmlinuz-2.6.17-prep ro root=LABEL=/12 rhgb quiet
initrd /boot/initrd-2.6.17-prep.img
title Fedora Core (2.6.18-1.2200.fc5smp)
root (hd0,9)
kernel /boot/vmlinuz-2.6.18-1.2200.fc5smp ro root=LABEL=/12 rhgb quiet
initrd /boot/initrd-2.6.18-1.2200.fc5smp.img
title Fedora Core (2.6.17-1.2187_FC5smp)
root (hd0,9)
kernel /boot/vmlinuz-2.6.17-1.2187_FC5smp ro root=LABEL=/12 rhgb quiet
initrd /boot/initrd-2.6.17-1.2187_FC5smp.img
title Fedora Core (2.6.17)
root (hd0,9)
kernel /boot/vmlinuz-2.6.17 ro root=LABEL=/12 rhgb quiet
initrd /boot/initrd-2.6.17.img
title Fedora Core (2.6.16)
root (hd0,9)
kernel /boot/vmlinuz-2.6.16 ro root=LABEL=/12 rhgb quiet
initrd /boot/initrd-2.6.16.img
title Fedora Core (2.6.15)
root (hd0,9)
kernel /boot/vmlinuz-2.6.15 ro root=LABEL=/12 rhgb quiet
initrd /boot/initrd-2.6.15.img
title fc4
root (hd0,7)
kernel /boot/vmlinuz-2.6.14.3 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.14.3.img
title Other
rootnoverify (hd0,0)
chainloader +1

This seems to be quite outdated and useless.

The /etc/fstab contains:
LABEL=/12 / ext3 defaults 1 1
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
LABEL=SWAP-sda11 swap swap defaults 0 0
LABEL=^B^D^N^^C^D<84>^V^A^L>H:v^D swap swap defaults 0 0
/dev/sda5 /mnt/temp1 vfat users,auto,gid=500,uid=500 0 0
/dev/sda6 /mnt/temp2 vfat users,auto,gid=500,uid=500 0 0
/dev/sda7 /mnt/temp3 vfat users,auto,gid=500,uid=500 0 0
/dev/sda10 /mnt/temp4 ext3 users,auto 0 0
/dev/sda1 /mnt/temp5 ntfs users,auto,gid=500,uid=500 0 0
/dev/fd0 /media/floppy1 vfat pamconsole,exec,noauto,managed 0 0
/dev/hda /media/cdrecorder1 auto pamconsole,exec,noauto,managed 0 0



Also, how do I explicitly find out which swap partitions are being used? Or are both partitions used by default?

michaelk 02-24-2007 11:57 AM

The e2label command will show the volume labels of the partitions. Post the output of:
e2label /dev/sda8
and
e2label /dev/sda12

They should not have the same label.

I assume that your swap partition is sda11. e2label should also show this. Only the swap partitions that have an fstab entry will be utilized.

ranban282 02-24-2007 12:14 PM

e2label /dev/sda8 produces 12
e2label /dev/sda12 produces /

However, when I run e2label on /dev/sda11 I get:
e2label: Bad magic number in super-block while trying to open /dev/sda11
Couldn't find valid filesystem superblock.
Same for /dev/sda9

michaelk 02-25-2007 03:50 PM

from FC6 grub.conf and /etc/fstab files.
Quote:

kernel /vmlinuz-2.6.19-1.2911.fc6 ro root=LABEL=/12 rhgb quiet
LABEL=/12 / ext3 defaults 1 1
So it seem that /dev/sd8 partition is labeled 12 and so this is why FC6 is using it as its / partition instead of sda12.

sda11 is a swap and I assume that sda9 is too. The output of the fdisk command should show swap to confirm.
fdisk -l /dev/sda (A small L and you must be root)

ranban282 02-26-2007 10:08 AM

Thanks, everything is working now, but I still havent figured why df shows a wrong output and when I compile a kernel it puts /12 by default in /etc/grub.conf.


All times are GMT -5. The time now is 12:38 AM.