LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Red Hat Enterprise Linux Server release 5.5 (Tikanga) - swap (https://www.linuxquestions.org/questions/linux-software-2/red-hat-enterprise-linux-server-release-5-5-tikanga-swap-898894/)

dhranraj.chilla 08-23-2011 02:00 AM

Red Hat Enterprise Linux Server release 5.5 (Tikanga) - swap
 
We have installed "Red hat Enterprise Linux 5.5" and while installation we have choosen "create custom layout" partition and created the blow partition:

Filesystem Size Used Avail Use% Mounted on
/dev/sda7 768M 558M 171M 77% /
/dev/sda8 105G 56G 44G 57% /u01
/dev/sda6 3.8G 161M 3.5G 5% /var
/dev/sda5 4.8G 3.3G 1.3G 72% /usr
/dev/sda3 5.7G 696M 4.7G 13% /tmp
/dev/sda2 12G 158M 11G 2% /swap
/dev/sda1 965M 24M 892M 3% /boot

Installation has been successfully completed.

But while checking the swap space in the system after installtion it showing nothing

# cat /proc/swaps

But we have created the 12GB /swap file

Please help me to active this swap space in the system.

syg00 08-23-2011 02:09 AM

Interesting. Let's see the output from these (parted may need root on RHEL)
Code:

cat /etc/fstab
parted -l


dhranraj.chilla 08-23-2011 02:11 AM

[root@nfs-prod-db ~]# cat /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/u01 /u01 ext3 defaults 1 2
LABEL=/var /var ext3 defaults 1 2
LABEL=/usr /usr ext3 defaults 1 2
LABEL=/tmp /tmp ext3 defaults 1 2
LABEL=/swap /swap ext3 defaults 1 2
LABEL=/boot /boot 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
192.168.1.144:/NFSPRODDB1 /u02 nfs defaults 0 0
[root@nfs-prod-db ~]# parted -l

Model: IBM ServeRAID-MR10k (scsi)
Disk /dev/sda: 146GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 32.3kB 1045MB 1045MB primary ext3 boot
2 1045MB 13.6GB 12.6GB primary ext3
3 13.6GB 19.9GB 6284MB primary ext3
4 19.9GB 146GB 126GB extended
5 19.9GB 25.1GB 5239MB logical ext3
6 25.1GB 29.3GB 4187MB logical ext3
7 29.3GB 30.2GB 831MB logical ext3
8 30.2GB 146GB 116GB logical ext3


Error: Unable to open /dev/md0 - unrecognised disk label.

[root@nfs-prod-db ~]#

scottro11 08-23-2011 03:30 AM

Note
Code:

LABEL=/swap /swap ext3 defaults 1 2
It looks as if your /swap partition is formatted as ext3 rather than swap.

For example, from my /etc/fstab
Code:

/dev/sdc2              swap                    swap    defaults        0 0
So, I think you want to take that swap partition, and reformat it as swap. (You should be able to use gparted for that without taking the machine offline).

dhranraj.chilla 08-23-2011 03:40 AM

Great and thanks you...
this is new machine installations and could you pleas help the steps how to reformat it as swap? Please help me. Thanks

scottro11 08-23-2011 04:43 AM

As, judging from your post, you seem a bit unfamiliar with partitioning, I would recommend you install gparted. Using that, you can then select partition /sda2 and choose to reformat it as swap. After that, I think it should work. To be honest, I haven't done this in awhile, so there may be additional steps that I'm overlooking. (Also, I'm not really familiar with the GUI tools--I just recommend them because they should be easier for you.)

After doing that, you might want to run


mkswap /dev/sda2

swapon /dev/sda2


Just be very sure that you haven't accidentally put anything in /dev/sda2 because this will wipe out anything in it.

dhranraj.chilla 08-23-2011 07:11 AM

Thank you so much for your quick help and appreicate you... Thanks

scottro11 08-23-2011 07:30 AM

You're quite welcome. Also, you might want to first unmount /dev/sda2, to avoid any problems.


umount /dev/sda2


before running gparted.


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