You are not logged in.

#1 2008-07-31 15:32:46

entropic_existence
Member
Registered: 2008-05-20
Posts: 14

Swap Partitioning and multiple disks

Ok so I have been setting up a workstation with Arch Linux that has a total of 16GB of RAM and, because it will run very memory intensive applications we actually require a large swap partition. Because this may eventually get upgraded to even more RAM we decided to go with a 50 GB swap partition.

I also have two drives in the machine, the primary 500GB HDD and a smaller 250 GB HDD that we wanted to use for a /backup partition as well as swap space and so I set up the disks as follows:

sda (500 GB):

/    (30 GB Primary Partition)
/home (435 GB Primary Partition)
/usr/local  (2 GB Primary Partition)

sdb (250 GB)

50 GB Primary swap partition
/backup (~200 GB Primary Partition)

Now when I am in gparted or cfdisk that is how these partitions show up. If I do a df I see

sda1, sda2, sda3, and sdb2 but instead of seeing what woul;d be sdb1 as a large swap I see an 8 GB swap listed as being mounted on /dev/shm (which I think is normal).

After reading this:

http://lissot.net/partition/partition-04.html

I think the problem is that I don't have a swap partition set on my 500 GB drive. It seems like any bootable drive needs a swap partition on it. Although my system boots fine and I haven't had any problems running it yet I do need to get this swap partition straightened out otherwise the machine will have issues when it is fully operational and running heavy jobs.

IS this the problem? And if so would the best way to fix it be to use parted to shrink my /home partition by a few GB and make a small swap partition on that drive at the end of the drive space? Right now it is laid out as:

|---------------- / ----------------| |---- /usr/local ----| |------------------------------------------ /home ------------------------------------------|

Suggestions, ideas?

Thanks

Offline

#2 2008-07-31 23:18:59

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Swap Partitioning and multiple disks

What does the output from `free -m` show you as the amount of Swap?

/dev/shm isn't swap - it's a device for Shared Memory:
http://www.cyberciti.biz/tips/what-is-d … usage.html

Offline

#3 2008-08-01 00:20:27

entropic_existence
Member
Registered: 2008-05-20
Posts: 14

Re: Swap Partitioning and multiple disks

The output from free -m is:

<code>
             total       used       free     shared    buffers     cached
Mem:         16018      15372        645          0         91      14600
-/+ buffers/cache:        679      15338
Swap:        47685          0      47685
</code>

For comparison here is the output from my laptop (also Arch Linux):

<code>
             total       used       free     shared    buffers     cached
Mem:          2025        614       1411          0         12        232
-/+ buffers/cache:        370       1655
Swap:         1019          0       1019
</code>

It has an ~ 1GB swap partition but it's df also shows something at /dev/shm:

<code>
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              12G  7.6G  3.4G  70% /
none                 1013M     0 1013M   0% /dev/shm
/dev/sda3              78G   28G   47G  37% /data
</code>

In gparted on my laptop /dev/sda2 is the swap partition with size: 1019 MB

Going by free -m on the workstation it looks like it is seeing the ~50 GB swap partition and it is mounted in /etc/fstab so perhaps I have nothing to worry about? Is it actually necessary that your bootable disk has a swap partition on it? Both disks (sda and sdb) actually have at least one partition flagged as bootable but sda (which has / and /home on it) didn't have a swap partition on that disk.

Thanks for all the help.

Offline

#4 2008-08-01 07:28:01

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Swap Partitioning and multiple disks

Everything seems to be in order captain smile

You don't need a swap partition on *any* disk, boot disk or not, if you don't want swap partitions (but they're always a good idea).

/dev/shm is completely unrelated to swap; they're both associated with RAM, but not with each other.

Offline

#5 2008-08-01 14:01:49

entropic_existence
Member
Registered: 2008-05-20
Posts: 14

Re: Swap Partitioning and multiple disks

Gotcha, so the long and short of it is that the swap partition doesn't show up on df then. Glad to know everything is fine.

Thanks!

Offline

Board footer

Powered by FluxBB