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 [2021/08/16 22:33] – [Manual method:] hogwild | usb_formatting_with_swap_partition [2023/07/14 18:30] – [Final setup] -fix broken Overview link hogwild | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== USB formatting with swap partition ====== | ====== USB formatting with swap partition ====== | ||
- | It is highly advisable to make some form of permanent storage available to FreshTomato. | + | 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, and USB support is already enabled. If you're not sure how to enable USB support, check the [[nas-usb|USB Support]] page. | ||
+ | |||
+ | For this example, we use a 16GB USB flash drive seen in the system as device **sda**. | ||
- | Assuming you are using either an ARM build or a MIPS build with USB support, it is assumed you have already have USB support enabled. If you're not sure how to enable USB support, check the [[: | ||
- | For this example I'm using a 16GB USB 3.0 USB flash drive which is seen in the system as device **sda**. | ||
===== Automatic method ===== | ===== Automatic method ===== | ||
- | This assumes your drive device | + | This assumes your drive' |
- | The **echo 1000M** statement below defines the size of the swap partition (in MB). You may want to adjust that, according to your needs. | + | The **echo 1000M** statement below defines the size of the swap partition (in MB). You may adjust that according to your needs. |
+ | |||
+ | \\ | ||
Then enter: | Then enter: | ||
- | < | ||
+ | \\ | ||
+ | |||
+ | <code -> | ||
device=/ | device=/ | ||
partition=$device' | partition=$device' | ||
+ | swappartition=$device' | ||
nvram set usb_automount=" | nvram set usb_automount=" | ||
(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 | ||
- | mkfs.ext2 -L USB $partion | + | # Uncomment the preferred option here below: |
- | mkswap | + | # mkfs.ext2 -L usb $partion |
- | swapon | + | # mkfs.vfat -n usb $partion |
- | mkdir /mnt/sda1 && mount /dev/sda1 /mnt/sda1 | + | mkswap |
+ | swapon | ||
+ | mkdir /mnt/usb && mount /dev/sda1 /mnt/usb | ||
nvram set usb_automount=" | nvram set usb_automount=" | ||
- | |||
</ | </ | ||
- | ===== Manual method: ===== | + | \\ |
- | From the Web interface, disable the Automount checkbox in the [[usb_support|USB Support]] menu. | ||
- | [[https:// | + | ===== Manual method ===== |
+ | |||
+ | From the Web interface, disable the Automount checkbox in the [[nas-usb|USB Support]] menu. | ||
\\ | \\ | ||
- | Then, logon via SSH or Telnet and delete any existing partitions: | + | |
+ | [[https:// | ||
+ | |||
+ | \\ \\ Then, logon via SSH or Telnet and delete any existing partitions: | ||
<code -> | <code -> | ||
Line 68: | Line 80: | ||
</ | </ | ||
- | \\ | + | |
- | \\ | + | |
- | At this point you should have two unformatted partitions on your USB flash drive: | + | |
- | \\ | + | * sda1 |
- | sda1 ~14GB (fs-type ext2/3/4)\\ sda2 ~1GB (fs-type swap) | + | * sda2 |
[[https:// | [[https:// | ||
- | Now, let' | + | \\ |
+ | |||
+ | | ||
<code -> | <code -> | ||
Line 84: | Line 96: | ||
</ | </ | ||
- | Now, mount the partitions | + | |
<code -> | <code -> | ||
Line 91: | 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]] | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||
===== Final setup ===== | ===== Final setup ===== | ||
- | The USB flash drive is now formatted. Your USB and NAS page settings should look like this: | + | |
- | [[https:// | + | \\ [[https:// |
- | Under Attached Devices, you should see something similar to this: | + | |
- | [[https:// | + | \\ [[https:// |
- | To verify the swap partition | + | |
- | [[https:// | + | |
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||