This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
usb_formatting_with_swap_partition [2023/06/11 04:11] – [Final setup] hogwild | usb_formatting_with_swap_partition [2024/03/27 15:30] – [Deactivating the Swap Partition (Pre-unmount command)] -formatting hogwild | ||
---|---|---|---|
Line 3: | Line 3: | ||
A swap partition can prevent several types of insufficient RAM symptoms, such as system instability, | A swap partition can prevent several types of insufficient RAM symptoms, such as system instability, | ||
- | This example assumes you are using an ARM or MIPS build with USB support. It also assumes you already have USB support enabled. If you're not sure how to enable USB support, check the [[: | + | This example assumes you are using an ARM or MIPS build with USB support, and USB support |
For this example, we use a 16GB USB flash drive seen in the system as device **sda**. | For this example, we use a 16GB USB flash drive seen in the system as device **sda**. | ||
- | |||
===== Automatic method ===== | ===== Automatic method ===== | ||
Line 37: | Line 36: | ||
\\ | \\ | ||
+ | ===== Manual method ===== | ||
- | ===== Manual method: ===== | + | From the Web interface, disable the Automount checkbox in the [[nas-usb|USB Support]] menu. |
- | From the Web interface, disable the Automount checkbox in the [[usb_support|USB Support]] menu. | + | \\ |
[[https:// | [[https:// | ||
- | \\ \\ Then, logon via SSH or Telnet and delete any existing partitions: \\ | + | \\ \\ Then, logon via SSH or Telnet and delete any existing partitions: |
<code -> | <code -> | ||
Line 78: | Line 78: | ||
</ | </ | ||
- | | + | |
- | | + | * sda1 |
+ | * sda2 | ||
[[https:// | [[https:// | ||
Line 93: | Line 94: | ||
</ | </ | ||
- | \\ \\ | + | |
<code -> | <code -> | ||
Line 102: | Line 103: | ||
| | ||
- | You can now re-enable USB Automount on the USB and NAS menu. | + | You can now re-enable USB Automount on the [[nas-usb|USB Support]] |
\\ | \\ | ||
+ | |||
+ | |||
+ | ===== Configuring Post-mount and Pre-unmount Commands ===== | ||
+ | |||
+ | For best practice, the swap partition should be activated as swap once the USB drive/flash is mounted. Additionally, | ||
+ | |||
+ | |||
+ | ==== Activating Swap Partition (Post Mount Command) ==== | ||
+ | |||
+ | To activate the swap partition you created on the drive, enter the following into the "**Run after mounting**" | ||
\\ | \\ | ||
+ | |||
+ | <code -> | ||
+ | swapon /dev/sda2 | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | The field should look like this: | ||
+ | |||
+ | {{: | ||
+ | You may have additional commands within the field. | ||
+ | )) | ||
+ | |||
+ | |||
+ | \\ | ||
+ | |||
+ | ==== Deactivating the Swap Partition (Pre-unmount command) ==== | ||
+ | |||
+ | To configure the router to automatically deactivate the swap partition (in this case, **/// | ||
+ | |||
+ | \\ | ||
+ | |||
+ | <code -> | ||
+ | swapoff / | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | The field should appear like this: | ||
+ | |||
+ | {{: | ||
+ | Again, your form field may have additional data within it. | ||
+ | )) | ||
+ | |||
+ | In both cases, the Save button at the bottom should be checked before continuing. | ||
Line 113: | Line 159: | ||
| | ||
- | [[https:// | + | \\ [[https:// |
| | ||
- | | + | \\ [[https:// |
- | | + | |
\\ [[https:// | \\ [[https:// |