creating swapfile and moving it

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

creating swapfile and moving it

Postby yuugotserved » Sun Feb 26, 2012 7:33 pm

Hi everyone. I'm new to this board and i'm a total linux noob.

I created a swapfile following this guide: http://archlinuxarm.org/support/guides/ ... g-swapfile

and it created the file in /

if i use "mv /swapfile.img /media/harddrive"

it should move it from "/" to "/media/harddrive" correct?

will the swapfile update on /media/harddrive after moving, or will it re-create a new one on its own in "/"?

Thanks!
yuugotserved
 
Posts: 15
Joined: Sun Feb 26, 2012 7:30 pm

Re: creating swapfile and moving it

Postby pepedog » Sun Feb 26, 2012 8:39 pm

Don't move it, recreate. Using that guide-
$this->bbcode_second_pass_code('', 'dd if=/dev/zero of=/media/harddrive/swapfile.img bs=1M count=512 #for a 1GB swapfile, use count=1024
mkswap /media/harddrive/swapfile.img
You can now turn the swap file on using:
swapon /media/harddrive/swapfile.img
You can also turn it off by using:
swapoff /media/harddrive/swapfile.img
Always-on Swapfile
To have your swapfile always enabled, even after a reboot, without having to manually turn it on or off, add the following line to the end of your /etc/fstab file using nano or similar:
/media/harddrive/swapfile.img none swap sw 0 0
If you're worried about editing /etc/fstab, you can add "swapon /media/harddrive/swapfile.img" to a new line in your /etc/rc.local file. The effect is the same.
...')
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: creating swapfile and moving it

Postby yuugotserved » Sun Feb 26, 2012 8:47 pm

thanks. this is what i have


$this->bbcode_second_pass_code('', '[root@alarm ~]# dd if=/dev/zero of=/media/160GBWD/swapfile.img bs=1M count=512
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 70.5487 s, 7.6 MB/s
[root@alarm ~]# mkswap /media/160GBWD/swapfile.img
Setting up swapspace version 1, size = 524284 KiB
no label, UUID=b962a82b-9b79-4714-9f3a-a749550493f5
[root@alarm ~]# swapon /media/160GBWD/swapfile.img')

when i checked 160GBWD folder, the file is 512MB, looks good?

i then removed the one in "/" with rm swapfile.img
yuugotserved
 
Posts: 15
Joined: Sun Feb 26, 2012 7:30 pm


Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 4 guests