PDA

View Full Version : [ubuntu] 10.10 Maverick - Default Swap Size



mathgeek2000
December 26th, 2010, 09:12 PM
I recently upgraded my laptop from 10.04, to 10.10. -- And in so doing reinstalled the OS from scratch, and letting the system pick the partition sizes.


My system:
2GB RAM
160 GB HDD
HP 6910p


Here's the question: The Installer set aside 6GB as Swap space, leaving 154GB as a / partition for everything.
I had always thought 2GB was plenty, or as a general rule twice the Physical Memory size, which would only be 4GB swap, not 6.

Can / should I reclaim some of that swap space, if so how much. -- I can using tools like GParted to resize the partitions. -- Or just leave it as is.

Unfortunately, the Ubuntu 10.10 installed did not seem to use GParted, so it was a little harder to set up initially.

dabl
December 26th, 2010, 09:48 PM
Longer term solution: Download the ISO and make a CD, or make a bootable USB stick of Parted Magic: http://partedmagic.com/doku.php?id=downloads

Use this to do your hard drive partition first, before you boot your *buntu Live or Alternate CD. Then there's no need to let *buntu try to figure out what you want. ;)

Short term fix -- GParted should let you resize the swap -- there's no need to have more than 2GB of swap on a computer that has 2GB of memory.

However, depending on where *buntu decided to put the swap partition, "resizing" might involve about 3 steps:

1. Shrink the swap partition, hopefully from the right-hand end when you're looking at the graphic in GParted.

2. Expand the partition that is to the right of the swap partition.

3. Or else, after shrinking the swap partition you might want to slide (aka "move) it in one direction or the other.

4. Then expand whichever partition has the unallocated space beside it, to fill the space.

Unsolicited advice:

If you just recently installed the OS, and don't have a lot of time invested in configuring it, here's a far better way (IMHO):

1. Use your Parted Magic Live CD to partition the hard drive. Make a 10GB partition for the OS. Make a 2GB Partition for swap. Leave the rest of the drive for user data, and give it a label like "DATA".

2. Install the entire OS onto the 10GB partition.

3. After installation, the large partition will be mounted with some useless name like /media/disk-1. In the terminal,
sudo mkdir /mnt/DATA and then
sudo umount /dev/sda3 (or whatever the device name is on yours -- be sure!) so that partition is unmounted.

4. Use gedit with "gksudo" prefix to edit the file /etc/fstab. On the line that mounts the big partition, change the mount line to match what you now have -- you can use the label, and mount it to /mnt/DATA. After you save the edited /etc/fstab, you can issue
sudo mount -a and it will be mounted. Verify with
sudo mount

5. Use
sudo chown mat:mat /mnt/DATA (use your actual user name in lieu of "mat")

6. Now you can make "DOCS", "PIX", "VIDEOS", etc. etc. directories on the DATA partition, as a user. Then use Nautilus, with split window, and link these folders into your /home/user directory.

VOILA! You now have a setup in which the OS can crash, or you can change it at will, or you can destroy the settings there, and none of that will ever touch your data. :)