DDWRT and Swap Files

Wiki.TerraBase.info
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

### USB ###############################################################################################################################################

#

# Instead of issuing USB related commands via script, the USB services for Flash Drives, etc. are enabled via the GUI

#

#######################################################################################################################################################

### Swap File##########################################################################################################################################

#

# A "raw" swap file must be initially configured

# The following is a BusyBox command that creates a file with the size dictated by the attributes (if is the source file, of is the output file, bs are the number of bytes to read at a time, count is the number of times to repeat the cycle)

# In the following example, a 256 MB file is created

# dd if=/dev/zero of=/tmp/mnt/sda_part2/SwapFile bs=1024 count=262144

#

# To enable the OS / Router to use a swap file, the swap utilities need to be installed

# opkg install swap-utils: mkswap and swapon

#

# The following command "formats" / prepares the RAW / Blank file as a swap file with the label SwapFile

# mkswap /tmp/mnt/sda_part2/SwapFile --label SwapFile

# The swapon command recommends the following

# chmod 600 /tmp/mnt/sda_part2/SwapFile

# Activates the swap file and makes it available to the OS

swapon /tmp/mnt/sda_part2/SwapFile

# Deactivates the swap file / turns it off

# swapoff /tmp/mnt/sda_part2/SwapFile

#

# If the USB related services are installed via OPKG and controlled via the /opt/etc/init.d Directory, then there seems to be documentation that indicates the above can be controlled via the S30 USB service)

#

#######################################################################################################################################################