 | |
04-08-2008
|
#1 (permalink)
| | Just Joined!
Join Date: Dec 2007 Location: Hyderabad
Posts: 79
| Decreasing swap partition Hi,
I have 1 GB RAM, so when I first installed FC8 I kept 2 GB swap partition following the thumb rule of giving twice the ram-size. Now, I see, more than 1 GB swap is not required, and in my case even 512 or less MB will be sufficient, as I checked my swap space has never been user to run all the process.
So, how can I decrease the swap space to something like 512 MB and give the extra space to my /home partition?
Thanks in advance.
__________________ Imran
Linux User #467555 | FC8 | Intel(R) Core(TM)2 Duo CPU 4500 @ 2.20GHz | 1 GB RAM | 80 GB SATA |
| |
04-08-2008
|
#2 (permalink)
| | Linux Engineer
Join Date: Oct 2007 Location: Bristol, UK
Posts: 1,280
| Use the PartedMagic CD, you can resize the partitions quite easily. Before you do this though check /etc/fstab to see if the disk partitions are referenced by UUID. If they are I suggest you change them to device names eg fstab on my system with mods ... Code: jonathan@jonathan-laptop:~$ sudo cat /etc/fstab
[sudo] password for jonathan:
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda9
#UUID=8377fdba-c71a-47b3-8dbe-8a382ad73546 / ext3 defaults,errors=remount-ro 0 1
/dev/sda9 / ext3 defaults,errors=remount-ro 0 1
# /dev/sda7
#UUID=c465dc06-83f3-447b-a424-9af4c5d2431a /home ext3 defaults 0 2
/dev/sda7 /home ext3 defaults 0 2
# /dev/sda1
#UUID=16D9-B5D2 /media/sda1 vfat defaults,utf8,umask=007,gid=46 0 1
/dev/sda1 /media/sda1 vfat defaults,utf8,umask=007,gid=46 0 1
# /dev/sda2
#UUID=A22AA8492AA81BF3 /media/sda2 ntfs defaults,umask=007,gid=46 0 1
/dev/sda2 /media/sda2 ntfs defaults,umask=007,gid=46 0 1
# /dev/sda4
#UUID=0D573EEE2D99D205 /media/sda4 ntfs defaults,umask=007,gid=46 0 1
/dev/sda4 /media/sda4 ntfs defaults,umask=007,gid=46 0 1
# /dev/sda6
#UUID=f920145b-c614-4559-9450-0cab86cf666a /media/sda6 ext3 defaults 0 2
/dev/sda6 /media/sda6 ext3 defaults 0 2
# /dev/sda8
#UUID=2cb45537-bb5c-42cb-8e47-d1859d47d2b3 /media/sda8 ext3 defaults 0 2
/dev/sda8 /media/sda8 ext3 defaults 0 2
# /dev/sda5
#UUID=5989366b-39b5-489e-2ed7-231c51046da2 none swap sw 0 0
/dev/sda5 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto,exec 0 0
#fusesmb /home/Mint/jonathan/Network fuse.fusesmb rw,nosuid,nodev,allow_other,max_read=32768 0 0
#
# mods to replace uuid with device names eg /dev/sda9 March 08
jonathan@jonathan-laptop:~$ |
| |
04-08-2008
|
#3 (permalink)
| | Just Joined!
Join Date: Dec 2007 Location: Hyderabad
Posts: 79
| Thank for the reply Jonathan.
I'll give it a try. But one thing I didn't properly understood is
[qoute]you change them to device names ...[/quote]
Can you kindly explain it once again.
Thanks once again.
__________________ Imran
Linux User #467555 | FC8 | Intel(R) Core(TM)2 Duo CPU 4500 @ 2.20GHz | 1 GB RAM | 80 GB SATA |
| |
04-08-2008
|
#4 (permalink)
| | Linux Engineer
Join Date: Oct 2007 Location: Bristol, UK
Posts: 1,280
| Partitions on disk can be referenced in a number of ways, for example uuid, label, device name, device id etc.
The example fstab I posted is from Linux Mint ... Mint originally created this during the install Code: # /dev/sda9
UUID=8377fdba-c71a-47b3-8dbe-8a382ad73546 / ext3 defaults,errors=remount-ro 0 1 which I replaced with this Code: # /dev/sda9
/dev/sda9 / ext3 defaults,errors=remount-ro 0 1 I have found when partitions are resized the UUID changes ... if the entries in /etc/fstab use UUID then Linux will stop working. If you post the output of Code: sudo cat /etc/fstab we can post back the updates required. |
| |
04-08-2008
|
#5 (permalink)
| | Ghost
Join Date: Jun 2006 Location: Chandigarh, INDIA
Posts: 17,325
| Fedora uses LABELs instead of UUIDs.
I would suggest you to post the contents of /etc/fstab file and output of fdisk -l command before doing anything with partitions. Code: cat /etc/fstab
su -
fdisk -l
__________________ New Users: Read This First If you woke up breathing, Congratulations! You get another chance. |
| |
04-08-2008
|
#6 (permalink)
| | Linux Engineer
Join Date: Oct 2007 Location: Bristol, UK
Posts: 1,280
| Quote:
Originally Posted by devils casper Fedora uses LABELs instead of UUIDs. | Thanks devils casper ... must have read over the FC reference.
Label should not change with resize so you should be OK without modifying fstab.
Probably worth posting output of commands devils casper indicated just to make sure before resizing.  |
| |
04-08-2008
|
#7 (permalink)
| | Just Joined!
Join Date: Dec 2007 Location: Hyderabad
Posts: 79
| here it goes:
# /etc/fstab: Code: LABEL=/ / ext3 defaults 1 1
LABEL=/home /home ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-sda8 swap swap defaults 0 0 $ fdisk -l: Code: 255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xdde8dde8
Device Boot Start End Blocks Id System
/dev/sda1 * 1 2611 20972826 7 HPFS/NTFS
/dev/sda2 2612 19456 135307462+ f W95 Ext'd (LBA)
/dev/sda5 2612 10444 62918541 7 HPFS/NTFS
/dev/sda6 10445 12823 19109286 83 Linux
/dev/sda7 12824 19197 51199123+ 83 Linux
/dev/sda8 19198 19455 2072353+ 82 Linux swap/ Solaris Thank you.
__________________ Imran
Linux User #467555 | FC8 | Intel(R) Core(TM)2 Duo CPU 4500 @ 2.20GHz | 1 GB RAM | 80 GB SATA |
| |
04-08-2008
|
#8 (permalink)
| | Ghost
Join Date: Jun 2006 Location: Chandigarh, INDIA
Posts: 17,325
| Shrink /dev/sda8 partition and assign free space to /dev/sda7. /dev/sda7 is most probably your /home partition.
Execute df -h command to check exact used/free space of each partition.
__________________ New Users: Read This First If you woke up breathing, Congratulations! You get another chance. |
| |
04-09-2008
|
#9 (permalink)
| | Just Joined!
Join Date: Dec 2007 Location: Hyderabad
Posts: 79
| Thanks devils casper,
I'll do it. I'll post if I encounter any problem.
__________________ Imran
Linux User #467555 | FC8 | Intel(R) Core(TM)2 Duo CPU 4500 @ 2.20GHz | 1 GB RAM | 80 GB SATA |
| |
04-09-2008
|
#10 (permalink)
| | Ghost
Join Date: Jun 2006 Location: Chandigarh, INDIA
Posts: 17,325
| Good Luck ! 
__________________ New Users: Read This First If you woke up breathing, Congratulations! You get another chance. |
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT. The time now is 07:16 AM. | | |