is it possible to have the swap area on a MMC card and hibernate?

Asked by smurf

I have an eeepc 701 4G running Ubuntu 9.04.

In order to sve space on the internal SSD disk (sda) I moved the swap area to the external SDHC card (SDB).
No problem to do that, the system is working and use the swap, but I can' t hibernate. I suppose that the system umount the external drive before to flush the memory on the swap.
Ther is any trick or workaround to use the hibernate function even if the swap area is on the external drive?

Question information

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

I suppose you have your MMC card listed in fstab as swap?

Revision history for this message
Tom (tom6) said :
#2

The external SDHC would normally store data when the machine was switched off? I also take it the linux-swap area is plenty larger than ram, remembering that some of the ram is likely to have been fenced off for use by the graphics card?

Revision history for this message
smurf (luca-dgh) said :
#3

yes, of course. The MMC card is fully working. I use it continuosly.
I created a swap area of 612 MB on my MMC card (I have 512 MB of RAM) and in the fstab I mount it, like this:

# /etc/fstab: static file system information.
#
# Use 'vol_id --uuid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# / was on /dev/sda1
UUID=02b6884c-e1a2-4673-b395-e5c3f29f8a4e / ext3 relatime,errors=remount-ro 0 1
# swap was on /dev/sdb2
UUID=3185c834-2cd6-4a10-b4ac-db52b01f1b4b none swap sw 0 0

Revision history for this message
midnightflash (midnightflash) said :
#4

Ubuntu on EeePCs are able to do so if the swap is correctly working on MMC.

Greetings.

(But a full boot should be much faster... especially as the MMC is quite slow.)

Revision history for this message
Tom (tom6) said :
#5

Lol, yes that is a good point. Hibernate leaves the machine in a much more vulnerable state and while it's quite fast to initially boot up it takes ages to go into hibernate mode in the first place. In tests i've done it actually takes more power to go into hibernate and start up than a complete shutdown and fresh bootup - but i measured it by drain on the boats batteries and i guess most testers don't see the bigger picture view i get when i'm on the boat as they probably use mains electrickery ;) Still any portable device needs to be able to use hibernate just in case.

Revision history for this message
midnightflash (midnightflash) said :
#6

Yea... it is offered by the system an should work at least.

But on my EeePC 901 (an only SSD one too) I only use the standby as it only uses so few power in that deep-sleep that it can stay there for about a week. In debt for this it takes also about 10 seconds to wake up from this. It's kind of how hibernate should be.

And I still waste over 2,5 Gig on that Swap that is (except for tests) never used. ;-)

Greetings

Revision history for this message
smurf (luca-dgh) said :
#7

Well, actually I never tried the hibernate function, exactly because I don' t have space on the internal disk fir a 600 MB swap area. As I have and 8 GB class 2 SDHC card I wanted to test it, just to discover if is a usable function or not.
As well I' d like to have all the functions working on my EeePc (because a friend of mine, using other operating system...., says that Ubuntu is not able to bla bla bla).

So, back to us, midnightflash says that Ubuntu is able to do this, but even if the swap is currently working

             total used free shared buffers cached
Mem: 503736 264156 239580 0 11148 100816
-/+ buffers/cache: 152192 351544
Swap: 626524 0 626524

when I try to hibernate it says that swap is not present:

[ 122.180084] sd 1:0:0:0: [sda] Starting disk
[ 122.618567] pci 0000:00:02.0: restoring config space at offset 0x1 (was 0x900007, writing 0x900003)
[ 122.618587] pci 0000:00:02.0: setting latency timer to 64
[ 122.620396] PM: writing image.
[ 122.620412] PM: Cannot find swap device, try swapon -a.
[ 122.677342] Restarting tasks ... done.

Revision history for this message
Tom (tom6) said :
#8

You really can't help what these Windows Fanboys say, just ignore them. Sometimes it's worth listening to how exactly wrong they are and then just laugh at them behind their back. If they really want to be locked into a desperately slow and bloated system with huge security and anti-virus problems and get caught up in high cost but low performance software (or dodgy pirated (malware?)) then just let them. It's up to them, enjoy your machine with all it's multi-tasking, faster speeds and less 'routine' maintenance. How often do you virus scan in linux? lol
https://help.ubuntu.com/community/Antivirus

Revision history for this message
midnightflash (midnightflash) said :
#9

I made a bug-report from your informations:

https://bugs.launchpad.net/ubuntu/+bug/396570

Feel free to subscribe that one.

Revision history for this message
smurf (luca-dgh) said :
#10

ok midnightflash, thank you.
I subscribed, let see what happen.