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
usb_formatting_with_swap_partition [2023/07/14 18:30] – [Final setup] -fix broken Overview link hogwildusb_formatting_with_swap_partition [2024/03/27 15:32] (current) – [Deactivating the Swap Partition (Pre-unmount command)] -condense 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, click the Save button at the bottom before continuing.
  
  
usb_formatting_with_swap_partition.1689355825.txt.gz · Last modified: 2023/07/14 18:30 by hogwild