SWAP ACTIVATION

Asked by Pankaj Gupta

At the time of installation of UBUNTU I have accidently assigned 16GB partition to Linux Swap.
After some time I have resized by 'parted' the same partition to 1GB and remainig space assigned as FAT32 partition.
But problem starts from here that every time I boot my system, initially it shows SWAP not Active status and needs 'swapon' command.
what should I do to activate my swap permanently.
please give me suggestions.

Pankaj Gupta

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
HJMills
Solved:
Last query:
Last reply:
Revision history for this message
HJMills (hjmills) said :
#1

Hi Pankaj,

I think you need to edit your /etc/fstab file so that the swap is automatically mounted. If you open (as root) your /etc/fstab file in gedit (or kate if you are using Kubuntu) then you should be able to add a line like the one below (you will need to change the UUID part to match the UUID of your partition which I think you can find with the command "vol_id -u /dev/sda1" assuming the swap partition is /dev/sda1.

UUID=1a2840a6-5ef8-4df9-916a-f3e80da51fab none swap sw 0 0#

This should get the swap partition mounted on boot.

Good luck and let me know how you get on.

Regards,

HJMills

Revision history for this message
Pankaj Gupta (pankajhwr) said :
#2

Dear Sir,
Thanks a lot!
My Swap partition problem has solved now by the way you have suggested.
I also need your help for permanent mounting of remaining 15 GB FAT32 partition (/dev/sda7).
What should I write down in 'fstab' file?
Please suggest me.
regards,

Pankaj Gupta

Revision history for this message
HJMills (hjmills) said :
#3

Hi Pankaj,

I will answer that with a link to a very useful guide on the internet. I have linked directly to the part that is relevant to your question but the whole page is full of great Ubuntu knowledge and I am sure you will find it useful.

http://ubuntuguide.org/wiki/Ubuntu:Feisty#How_to_mount_Windows_partitions_.28FAT.29_on_boot-up.2C_and_allow_all_users_to_read.2Fwrite

Regards,

HJMills

Revision history for this message
Pankaj Gupta (pankajhwr) said :
#4

Dear Sir,
I have added this line in my 'fstab' file which I have copied from the link you have provided but unfortunately problem still persists.
"/dev/hda7 /media/disk vfat iocharset=utf8,umask=000 0 0"
Please suggest me what should I do?
regards,

Pankaj Gupta

Revision history for this message
Best HJMills (hjmills) said :
#5

Hi Pankaj,

I recommend you do not use /media/disk as Ubuntu seems to use that point for mounting hot plugged drives. Try changing the mount point to something you know Ubuntu won't try to use. If you have copied the quotes into the fstab folder then get rid of them. Also try changing the /dev/hda7 to a UUID using the command "vol_id -u /dev/hda7". Finally make sure there are no spaces at the beginning or end of the line in the fstab file and that it is on a new line.

Regards,

HJMills

Revision history for this message
Pankaj Gupta (pankajhwr) said :
#6

Dear Sir,
Thanks again.
My problem has solved now.

pankaj gupta

Revision history for this message
DarkRedman (darkredman-deactivatedaccount) said :
#7

vol_id command doesn't exist for me on Ubuntu Natty, so I would like to know what to write exactly to get the UUID of any partition ?

Revision history for this message
Jeruvy (jeruvy) said :
#8

DarkRedman,

This is an extremely old question marked solved by the OP. You would do best to create a NEW question with your issue so that you can get the most exposure to your problem.

Cheers.