This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
usb_formatting_with_swap_partition [2024/03/27 15:21] – [Configuring Post-mount and Pre-unmount Commands] -grammar hogwild | usb_formatting_with_swap_partition [2024/10/31 23:51] (current) – [Deactivating the Swap Partition (Pre-unmount command)] hogwild | ||
---|---|---|---|
Line 26: | Line 26: | ||
(echo o; echo n; echo p; echo 2; echo ; echo +1000M; echo t; echo 82; echo n; echo p; echo 1; echo ; echo ; echo w) | fdisk $device | (echo o; echo n; echo p; echo 2; echo ; echo +1000M; echo t; echo 82; echo n; echo p; echo 1; echo ; echo ; echo w) | fdisk $device | ||
# Uncomment the preferred option here below: | # Uncomment the preferred option here below: | ||
- | # mkfs.ext2 -L usb $partion | + | # mkfs.ext2 -L usb $partition |
- | # mkfs.vfat -n usb $partion | + | # mkfs.vfat -n usb $partition |
- | mkswap -L swap $swappartion | + | mkswap -L swap $swappartition |
- | swapon | + | swapon |
- | mkdir /mnt/usb && mount /dev/sda1 /mnt/usb | + | mkdir -p /mnt/usb && mount /dev/sda1 /mnt/usb |
nvram set usb_automount=" | nvram set usb_automount=" | ||
</ | </ | ||
Line 94: | Line 94: | ||
</ | </ | ||
- | | + | \\ \\ |
+ | |||
+ | Next, mount the partitions: \\ \\ | ||
<code -> | <code -> | ||
Line 106: | Line 108: | ||
\\ | \\ | ||
+ | |||
===== Configuring Post-mount and Pre-unmount Commands ===== | ===== Configuring Post-mount and Pre-unmount Commands ===== | ||
Line 111: | Line 114: | ||
For best practice, the swap partition should be activated as swap once the USB drive/flash is mounted. Additionally, | 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) ==== | ==== Activating Swap Partition (Post Mount Command) ==== | ||
To activate the swap partition you created on the drive, enter the following into the "**Run after mounting**" | To activate the swap partition you created on the drive, enter the following into the "**Run after mounting**" | ||
+ | |||
+ | \\ | ||
<code -> | <code -> | ||
Line 120: | Line 127: | ||
</ | </ | ||
+ | \\ | ||
+ | | ||
The field should look like this: | The field should look like this: | ||
Line 125: | Line 134: | ||
You may have additional commands within the field. | You may have additional commands within the field. | ||
)) | )) | ||
+ | |||
+ | \\ | ||
+ | |||
==== Deactivating the Swap Partition (Pre-unmount command) ==== | ==== Deactivating the Swap Partition (Pre-unmount command) ==== | ||
- | To configure the router to automatically deactivate the swap partition (in this case, **/// | + | To configure the router to automatically deactivate the swap partition (in this case, **/// |
+ | |||
+ | \\ | ||
<code -> | <code -> | ||
Line 134: | Line 148: | ||
</ | </ | ||
- | The field should appear | + | \\ |
+ | \\ | ||
+ | The field should appear | ||
{{: | {{: | ||
Again, your form field may have additional data within it. | Again, your form field may have additional data within it. | ||
)) | )) | ||
+ | | ||
+ | | ||
+ | In both cases, click Save at the bottom before continuing. | ||
- | As usual, in both cases, the save button at the bottom of the form should be clicked to save your changes before continuing on. | ||
===== Final setup ===== | ===== Final setup ===== | ||
Line 146: | Line 164: | ||
| | ||
- | \\ [[https:// | + | \\ [[https:// |
| | ||
Line 154: | Line 172: | ||
| | ||
- | \\ [[https:// | + | \\ [[https:// |
\\ | \\ |