Partitions

Using openSUSE 11.4, 64-bit.

The “df -h” command shows:

Filesystem Size Used Avail Use% Mounted on
rootfs 20G 8.7G 11G 47% /
devtmpfs 3.0G 232K 3.0G 1% /dev
tmpfs 3.0G 2.8M 3.0G 1% /dev/shm
/dev/sda2 20G 8.7G 11G 47% /
/dev/sda3 437G 586M 436G 1% /home

This means that my HD has two partitions only, correct? Therefore, If I wanted to install another Linux distribution and have a dual-boot system, I could install such distribution in /dev/sda1 and /dev/sda4, right?

No. Swap partitions and non-Linux partitions don’t show up in this mount table. The correct way is

fdisk -l /dev/sda

Also you can have logical partitions so you are not limited to 4.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

To maybe add to what ken yap said, it’s also very possible that a system
can have many more partitions that are not mounted by the current OS so
they won’t show up. By default this doesn’t happen a ton since the system
tries to give access to everything, but it’s still allowed. Either way,
fdisk is the best way I know of to find out about hard drive partitions
easily/quickly from the command line.

Good luck.

On 05/16/2011 09:06 PM, ken yap wrote:
>
> No. Swap partitions and non-Linux partitions don’t show up in this mount
> table. The correct way is
>
> fdisk -l /dev/sda
>
> Also you can have logical partitions so you are not limited to 4.
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJN0ewzAAoJEF+XTK08PnB52coP/1P/MDu/7kE+rbjpvvY7HS5z
FwmQPZcy/iFV6YMBO35wELFyC0LT7tG93RPII/f7On3mCqsooaeKKhn7iNpp4iFa
bUugNQ9lzyTTEYqJSTob31p7KjGnshHP1NqXAeS82z5NOYFtI3l/C3OfbUTE5sZL
IDVv6JSq6RVN5Z0zFlFGZG7N6bR0KYath01srNXMXFiOkexrzwwMKUtsDXiwRsjo
yjYN8aLclT1aspnUS1+vF5xxiDKAHRs9vrxthtMqUuP4EKWJvZGGLpd8ExUAb5v0
wlgfg8XAP3eQLS/PadMdSS/BCyR6FgjCsX2yZyEKkRtUjoJw88xIUCtHAYM9tj/2
oVlruEzPFqz5XVAfeu6LbENGilys4BAUW73mwhuQ55B9QFk+NVeLH7bQ1EKKmKXA
08TtunkIsQ31Vmng0Tw+r2+uVDY1tBopcoz4SlpxSRplva9kUthWXpfP9qNndb4X
Bgd/5h2LBbfjEqkDkkosogQ7LVtSvm5La3lAECZ9z3EkCBKRKGHODqVu43GaPhfv
RYElW2q8o6Kn5r+MXTHbEfwzdBIWcxLrYxI80hp2yh4cXHj1T6sQRPZ6RYBv6LkV
GkioPdqPXy68ZABLt5ayPAAIbMx0R25S3PVtSqMISRVO+clXcClL1ZTwyR08ovnn
VI9xP2rB8IgW/wDw4kj0
=+/68
-----END PGP SIGNATURE-----

To maybe add to what @ab said in addition to what @ken_yap said, it’s also possible that a system can have many more partitions that are not included in the extended partition but in BSD disklabels, in which case, they would not appear in fdisk -l output but in sfdisk -l or by querying udev with such scripts like the halinfo](http://forums.opensuse.org/english/other-forums/development/programming-scripting/451949-displaying-partitions-infos-hal-daemon-2.html#post2309300) script (which originally queried the hal daemon but can query udev as well). Ok, just kidding (but true). :wink:

To the OP: read SDB:Basics of partitions, filesystems, mount points - openSUSE.

And read

man dh

to see that df -h it only shows the filling grade of mounted file systems.

And read

man mount

to see that mount does give a list of mounted file systems.

And read

man fstab

to see that* fstab -l *gives you a list of partitions of the attached disks (mass storage devices).

And then decide which tool is the best to answer what you want to know from your system.

To add a word about dh, you should actually use **dh -hl ** to display your computer’s mounted local filesystems only. Without the option -l, it outputs nfs mounted filesystems as well (in case there are some), which might not be what you want.

On 2011-05-17 13:36, please try again wrote:
>
> To add a word about dh, you should actually use *dh -hl * to display
> your computer’s mounted local filesystems only.

dh? I don’t even have dh. What is it?


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

Sorry, not dh!. It is df (got confused by ‘man dh’ in Henk’s post) :wink:
dh is ‘debhelper command sequencer’.

Sorry, it should of course have been

man df

I sincerely hope not everybody wil follow me in this error. Well at least Carlos sees it.

In any case, I hope the OP reads the docs and makes up his mind about what information he wants to get. It isn’t not very usefull to give him a lot of usefull options when we do not know what he wants.

Thanks everybody for your guidance.

What I really want to achieve is installing a second Linux distribution on my HD and create a dual-boot system using GRUB. I think what I need to do in order to achieve this goal is to re-size the existing partitions and create new ones (primary, extended, logical, whatever…). I will need to figure out what to create and what to re-size.

I don’t think that the installer for the second distribution (I am thinking of installing Slackware just to see what it is all about) will give me any help in this respect, so I am preparing the ground for a successful install. I have also been trying to find a comprehensive guide on how to install Slackware and create a dual-boot system with openSUSE already installed.

That makes it a lot more clear. I think reading the link I gave above about partitioning will help you in getting an idea what this is all about. Also when you want more advice do please ask, but add an fdisk -l listing thus everybody can have the same idea about what you have as you.

On 2011-05-17 15:06, please try again wrote:
>
> Sorry, not dh!. It is df (got confused by ‘man dh’ in Henk’s post)
> :wink:

Ah! You got me baffled.

> dh is ‘debhelper command sequencer’.

Not part of the distro :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

This is the output of “fdisk -l”:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa9af3f5e

Device Boot Start End Blocks Id System
/dev/sda1 2048 4208639 2103296 82 Linux swap / Solaris
/dev/sda2 * 4208640 46153727 20972544 83 Linux
/dev/sda3 46153728 976773119 465309696 83 Linux

And this is the output of “df -h”:

Filesystem Size Used Avail Use% Mounted on
rootfs 20G 8.7G 11G 47% /
devtmpfs 3.0G 232K 3.0G 1% /dev
tmpfs 3.0G 2.7M 3.0G 1% /dev/shm
/dev/sda2 20G 8.7G 11G 47% /
/dev/sda3 437G 591M 436G 1% /home

Right now, my Swap file is approx. 2.0 GB, Root is 20 GB and, /home is 437 GB. Correct?

If so, I am thinking about making Swap 6 GB, Root 40 GB (since it is already 47% used!), and /home 200 GB.
The rest would be left for the second Linux distribution (Slackware) partitions: 40 GB for Root (/dev/sda5) and 200 GB for /home (/dev/sda6).

Do I make half sense?

On 2011-05-18 04:36, tb75252 wrote:

> The rest would be left for the second Linux distribution (Slackware)
> partitions: 40 GB for Root (/dev/sda5) and 200 GB for /home

No new home. Share it, with another user. Wast of disk space.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

Nothing bad would happen to all the openSUSE things residing in /home if I decide to uninstall Slackware?

PLease please. Didn’t you notice that we post computer text here between CODE tags for readability. Now all the good things about your fdisk listing are twisted around:Posting in Code Tags - A Guide

On 2011-05-18 06:06, tb75252 wrote:

> Nothing bad would happen to all the openSUSE things residing in /home
> if I decide to uninstall Slackware?

Depends on how you uninstall things. There is no un-install program, as far
as I know. It is you, manually, who reformats the partitions, so it is up
to you to not format home.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

Sorry about that! Here are the details again.

For “fdisk -l”

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa9af3f5e

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     4208639     2103296   82  Linux swap / Solaris
/dev/sda2   *     4208640    46153727    20972544   83  Linux
/dev/sda3        46153728   976773119   465309696   83  Linux

And for “df -h”:

Filesystem            Size  Used Avail Use% Mounted on
rootfs                 20G  8.7G   11G  47% /
devtmpfs              3.0G  232K  3.0G   1% /dev
tmpfs                 3.0G  2.8M  3.0G   1% /dev/shm
/dev/sda2              20G  8.7G   11G  47% /
/dev/sda3             437G  592M  436G   1% /home

Right now, my Swap file is approx. 2.0 GB, Root is 20 GB and, /home is 437 GB. Correct?

If so, I am thinking about making Swap 6 GB, Root 40 GB (since it is already 47% used!), and /home 200 GB.
The rest would be left for the second Linux distribution (Slackware) partitions: 40 GB for Root (/dev/sda5) and 200 GB for /home (/dev/sda6).

Does it make sense?

PS: I do not want to share /home because of the different filesystems!

Thanks for this, I can realy read this :slight_smile:

As I understand it you just want to contemplate a little about your planned setup. Thus I will just say a few things that came to my mind.

. I am to lazy to go back in this thread to see if you told what the systems memory size is, but I do not see the need to increase Swap to this incredible amount of 6 GB. For small memory systems, you need about twice the memory size, But for say a 2 GB system about the same size is OK. Only thing is when go for Hibernating, the the Swap must be able to accomodate your memory (but it will be compressed, thus even then the same size is OK).

. Your root partition is “only” for 50% used. I have also about 20 GB and it is filled for about 30%. As long as there is only installed software there, you have allready a lot installed, will that realy grow that much? But when you have a lot of other stuff like web pages, databases, etc. there, you should try to separate that from the root partition in it’s own partition (or in /home with symbolic links to it). Better separate systems files from the rest. And then you know what is growing.

. And yes, when you want a complete separate Slackware (that is with shared Swap), you need an extended partition (sda4) and the sda5 and sda6 as per your own suggestion.

HTH and feel free to ask for clarifiction.

On 2011-05-19 15:06, hcvv wrote:
> But for say a 2 GB system about the same size is
> OK. Only thing is when go for Hibernating, the the Swap must be able to
> accomodate your memory (but it will be compressed, thus even then the
> same size is OK).

Just a detail - fastidious mode on :slight_smile:

You have to consider the free swap for that calculation, not the size of
swap. If ram is 2, swap is 2, but there is 1 used, hibernate will
(probably) fail.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)