Swap,fstab

Discussion in 'Asuswrt-Merlin' started by Fab30, Jan 21, 2013.

  1. Fab30

    Fab30 Regular Contributor

    Joined:
    Jul 13, 2012
    Messages:
    57
    Hi, please, how can i configure autostart swap file on SD card?
    is on /dev/sdb1. THX
     
  2. joegreat

    joegreat Senior Member

    Joined:
    Jan 9, 2013
    Messages:
    481
    Location:
    Vienna, Austria
    How to setup a swap partition?

    Hi,

    First: SDcard for swap is not a good idea - search the forum why this is so! :confused:

    Secound: As your router has a kind of Linux installed you can use the standard Linux commands for the job!
    You need to partition your USB device with fdisk command to have a swap partition, then you can use swapon command to enable the swap.

    With Merlin's firmware you can enable it automatically via user-script (e.g. pre-mount wloud be a good place).

    So: Some searching in the forum and Google will give you all you need!
    And: You will learn real(!) Linux. :)

    With kind regards
    Joe :cool:
     
  3. brusyev

    brusyev Occasional Visitor

    Joined:
    Jul 17, 2013
    Messages:
    28
    I am in the same boat where my router constantly runs out of resources when I sync files to my drive attached to RTN66U. I also have a class 10 sd card installed inside the router. I searched the forum and did not find any posts to why it is bad to use it as swap...I tried to implement pre-mount scipt and was not able to get it to work....I do have my SD card formated as ext2...
     
    Last edited: Jul 12, 2014
  4. lwizard

    lwizard Regular Contributor

    Joined:
    Jan 27, 2014
    Messages:
    86
    Generally it's a bed idea because flash memories have a limited RW life. So a SWAP partition on them makes their life much shorter.
    But if the memory is cheap I think you could consider giving a try (but I don't know whether a read failure on SWAP could bring a crash in linux or not).

    Also if you set a swap partition in linux you must avoid formatting it. Another option is to format it and use a swap file.
     

Share This Page