Site Tools


usb_formatting_with_swap_partition

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
usb_formatting_with_swap_partition [2023/07/14 18:29] – [Manual method] -fix broken USB Support links hogwildusb_formatting_with_swap_partition [2024/03/27 15:31] – [Activating Swap Partition (Post Mount Command)] -formatting hogwild
Line 6: Line 6:
  
 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 36: Line 35:
  
  \\  \\
- 
  
 ===== Manual method ===== ===== Manual method =====
Line 96: Line 94:
 </code> </code>
  
- \\   \\  Now, mount the partitions: \\ \\+ \\  Next, mount the partitions: \\ \\
  
 <code -> <code ->
Line 108: Line 106:
  
  \\  \\
 +
 +
 +===== 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, it's best to deactivate swap partitions before unmounting them. It is quite simple to configure both the post-mount and pre-unmount commands. The methods for both are as follows:
 +
  
  \\  \\
 +
 +==== Activating Swap Partition (Post Mount Command) ====
 +
 +To activate the swap partition you created on the drive, enter the following into the "**Run after mounting**" form field:
 +
 + \\
 +
 +<code ->
 +swapon /dev/sda2
 +</code>
 +
 + \\
 +
 +The field should look like this:
 +
 +{{:pasted:20240327-054257.png?nolink&nocache}}((
 +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, **///dev/sda2//**) , the "**Run before unmounting**" field needs to be populated with the following:
 +
 + \\
 +
 +<code ->
 +swapoff /dev/sda2 
 +</code>
 +
 + \\
 +
 +The field should appear like this:
 +
 +{{:pasted:20240327-060929.png?nolink}}((
 +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 122: Line 167:
 \\ [[https://wiki.freshtomato.org/lib/exe/detail.php?id=usb_formatting_with_swap_partition&media=2741fc91e0778274bec4230fe9e3e686.png|{{:2741fc91e0778274bec4230fe9e3e686.png?813}}]] \\ [[https://wiki.freshtomato.org/lib/exe/detail.php?id=usb_formatting_with_swap_partition&media=2741fc91e0778274bec4230fe9e3e686.png|{{:2741fc91e0778274bec4230fe9e3e686.png?813}}]]
  
- \\   \\ To verify the swap partition works properly, check the [[:overview|Overview]] menu. You should see details related to swap space:+ \\   \\ To verify the swap partition works properly, check the [[status-overview|Overview]] menu. You should see details related to swap space:
  
  \\ [[https://wiki.freshtomato.org/lib/exe/detail.php?id=usb_formatting_with_swap_partition&media=dbae47af7a43e0a02c8637092a2edd2b.png|{{:dbae47af7a43e0a02c8637092a2edd2b.png}}]]  \\ [[https://wiki.freshtomato.org/lib/exe/detail.php?id=usb_formatting_with_swap_partition&media=dbae47af7a43e0a02c8637092a2edd2b.png|{{:dbae47af7a43e0a02c8637092a2edd2b.png}}]]
usb_formatting_with_swap_partition.txt · Last modified: 2024/03/27 15:32 by hogwild