Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Forum Archive > Main Support Categories > Hardware & Laptops
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.

Hardware & Laptops
Problems with hardware & laptops not being detected or supported during or after install.

 
 
Thread Tools Display Modes
Old July 22nd, 2005   #1
matthew
Bubbleheaded Star Child
 
matthew's Avatar
 
Join Date: Apr 2005
Location: Parts Unknown
Beans: 9,507
Ubuntu Development Release
my swap partition not recognized

When I installed Hoary I didn't make a swap partition because with 1Gb of RAM I didn't think it would be necessary. Now I want one so I can try to get hibernate to work. I created a swap partition, but when I run the free command this is what it shows:
Quote:
total used free shared buffers cached
Mem: 1035992 519776 516216 0 36152 198960
-/+ buffers/cache: 284664 751328
Swap: 0 0 0
I would guess this means the partition is not formatted properly or is at least not being used. What should I do now?

More info...here's my disk partition setup:
Quote:
Size: 80 Gb Hdd, currently dual booting Ubuntu with Win XP

Partitions:
Name/type/size/mountpoint

hda1 ntfs 15.3 Gb WinXP *mounts read-only as /media/windows in ubuntu
hda2 ext3 10 Gb /
hda3 ext3 30.5 Gb /home
hda4 extended, includes hda5 & hda6
hda5 fat32 19.4 Gb /home/matt/music
hda6 linux-swap 1 Gb

hda5 and 6 used to be part of hda1's ntfs partition. As I am using XP less and less I decided to remove space from its partition and make a shared space accessible from both. Since I am now using XP for almost nothing, hda5 holds my mp3s and almost nothing else.
__________________
Forum FAQ | Forum CoC | what's a troll? | are you imposing? | GNU/Linux?
my blog | my writing

Don't ask support questions in PMs--post a thread so everyone can benefit!


matthew is offline  
Old July 22nd, 2005   #2
jasmuz
Skinny Soy Caramel Ubuntu
 
jasmuz's Avatar
 
Join Date: May 2005
Location: Santo Domingo, Dominican
Beans: 653
Ubuntu 8.04 Hardy Heron
Send a message via ICQ to jasmuz Send a message via AIM to jasmuz Send a message via MSN to jasmuz Send a message via Yahoo to jasmuz Send a message via Skype™ to jasmuz
Re: my swap partition not recognized

You must tell the machine that you have a swap partition now.

on the command line you can type swapon /dev/hda6

And make your entry into /etc/fstab, like this.

/dev/hda6 none swap sw 0 0

That does it.
jasmuz is offline  
Old July 22nd, 2005   #3
matthew
Bubbleheaded Star Child
 
matthew's Avatar
 
Join Date: Apr 2005
Location: Parts Unknown
Beans: 9,507
Ubuntu Development Release
Re: my swap partition not recognized

Thanks for the reply.

For the command - swapon /dev/hda6 - here is the output:
Quote:
swapon: /dev/hda6: Operation not permitted
I took a look and this was already in my /etc/fstab:
Quote:
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda1 /media/windows ntfs nls=utf8,umask=0222 0 0
/dev/hda2 / ext3 defaults,errors=remount-ro 0 1
/dev/hda3 /home ext3 defaults 0 2
/dev/hda5 /home/matt/music vfat iocharset=utf8,umask=000 0 3
/dev/hda6 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 ro,user,noauto 0 0
What should I check next?
__________________
Forum FAQ | Forum CoC | what's a troll? | are you imposing? | GNU/Linux?
my blog | my writing

Don't ask support questions in PMs--post a thread so everyone can benefit!



Last edited by matthew; July 22nd, 2005 at 09:10 PM.. Reason: additional info
matthew is offline  
Old July 22nd, 2005   #4
dradul
Ubuntu Extra Shot
 
Join Date: Apr 2005
Location: 2630m closer to the stars
My beans are hidden!
Re: my swap partition not recognized

Quote:
Originally Posted by matthew
Thanks for the reply.

For the command - swapon /dev/hda6 - here is the output:


I took a look and this was already in my /etc/fstab:


What should I check next?
Code:
sudo swapon /dev/hda6
does the trick. Reboot and your done.
dradul is offline  
Old July 22nd, 2005   #5
matthew
Bubbleheaded Star Child
 
matthew's Avatar
 
Join Date: Apr 2005
Location: Parts Unknown
Beans: 9,507
Ubuntu Development Release
Re: my swap partition not recognized

Nope. Here's the output. BTW, it didn't matter if I used "sudo swapon /dev/hda6" or "sudo swapon -a"

Quote:
swapon: /dev/hda6: Invalid argument
__________________
Forum FAQ | Forum CoC | what's a troll? | are you imposing? | GNU/Linux?
my blog | my writing

Don't ask support questions in PMs--post a thread so everyone can benefit!


matthew is offline  
Old July 22nd, 2005   #6
matthew
Bubbleheaded Star Child
 
matthew's Avatar
 
Join Date: Apr 2005
Location: Parts Unknown
Beans: 9,507
Ubuntu Development Release
Re: my swap partition not recognized

I found the answer!!

I couldn't turn the swap on because it had never officially been made. Here's the code:

Quote:
sudo mkswap /dev/hda6
Then I could do this and have it work:

Quote:
sudo swapon -a
To be certain I typed "free" and this is what was output:

Quote:
total used free shared buffers cached
Mem: 1035992 466208 569784 0 33588 184764
-/+ buffers/cache: 247856 788136
Swap: 1060248 0 1060248
Thanks to all who helped put me on the right track!
__________________
Forum FAQ | Forum CoC | what's a troll? | are you imposing? | GNU/Linux?
my blog | my writing

Don't ask support questions in PMs--post a thread so everyone can benefit!


matthew is offline  
Old July 29th, 2005   #7
Firetech
A Carafe of Ubuntu
 
Firetech's Avatar
 
Join Date: Mar 2005
Location: export HOME=Lund, Sweden
Beans: 130
Ubuntu 8.04 Hardy Heron
Re: my swap partition not recognized

Strange. I experienced the same thing (and the solution here solved it).
The thing that makes me confused is that I'm sure the swap partition worked earlier...
It might be the fact that I have my swap partition on LVM an that I shrinked another logical volume last night... It might also be that I tried the acpi hibernation.sh script earlier, and that didn't work (just did a "bad" shutdown...).
But as I said, the solution here ("mkswap [device]" and then "swapon -a") solved it.
__________________
Proud Ubuntu user, with Debian experience. (Ubuntu as main OS since March 2005)
Registered Linux User: #386006 (Linux Counter)
Registered Ubuntu User: #5184 (Ubuntu Counter)
Firetech is offline  
Old July 29th, 2005   #8
matthew
Bubbleheaded Star Child
 
matthew's Avatar
 
Join Date: Apr 2005
Location: Parts Unknown
Beans: 9,507
Ubuntu Development Release
Re: my swap partition not recognized

Very cool. Glad that helped you out. I would guess that the swap file was deactivated when you resized and as you discovered just needed to be reactivated.
__________________
Forum FAQ | Forum CoC | what's a troll? | are you imposing? | GNU/Linux?
my blog | my writing

Don't ask support questions in PMs--post a thread so everyone can benefit!


matthew is offline  
Old July 29th, 2005   #9
art
Quad Shot of Ubuntu
 
Join Date: Apr 2005
Beans: 430
Re: my swap partition not recognized

Hi guys
Since we are talking about swap and hibernation, let me ask a question... I have a swap 512 Mb, and since my hibernation is not working, I thought maybe it's because of swap being too small. Anyone knows how can I resize the swap partition, make it bigger?
Thanks a lot.
art is offline  
Old July 29th, 2005   #10
matthew
Bubbleheaded Star Child
 
matthew's Avatar
 
Join Date: Apr 2005
Location: Parts Unknown
Beans: 9,507
Ubuntu Development Release
Re: my swap partition not recognized

You can use the install disk to do this. Boot from it and get to the partitioner. Resize as you want and then stop the installation before it goes further. You need to do this because you cannot resize an active partition. If you don't want to do it from the installer, I believe gparted or qparted is included on the live cd and I know qparted is included on the Knoppix cd.

Your swap partition will need space next to it if you are to enlarge it. See what partitions are adjacent first and if any of them may be resized slightly to give room for the increase.

Read this for a little more detailed info.

https://wiki.ubuntu.com/forum/installation/Partitioning
__________________
Forum FAQ | Forum CoC | what's a troll? | are you imposing? | GNU/Linux?
my blog | my writing

Don't ask support questions in PMs--post a thread so everyone can benefit!



Last edited by matthew; July 29th, 2005 at 06:59 PM.. Reason: clean up
matthew is offline  
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:36 PM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry