Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:guide-user:storage:usb-drives [2019/01/31 14:19] – replace LEDE with OpenWrt stokito | docs:guide-user:storage:usb-drives [2022/04/10 09:15] – hdparm rc.local autostart ivanmara | ||
|---|---|---|---|
| Line 25: | Line 25: | ||
| - Start by refreshing the list of available software packages:< | - Start by refreshing the list of available software packages:< | ||
| - The typical OpenWrt package already has core USB device drivers installed (if your device has USB ports at all), but might not yet have an USB storage device driver installed. Install this storage driver first (if it is already installed, the following command will just say "is already installed": | - The typical OpenWrt package already has core USB device drivers installed (if your device has USB ports at all), but might not yet have an USB storage device driver installed. Install this storage driver first (if it is already installed, the following command will just say "is already installed": | ||
| + | - Some USB storage devices may require the UAS driver: < | ||
| - To check, if the whole USB driver chain is working correctly, install the optional **usbutils** package:< | - To check, if the whole USB driver chain is working correctly, install the optional **usbutils** package:< | ||
| - Now connect your USB disk/stick and list your connected devices with a command from these **usbutils**: | - Now connect your USB disk/stick and list your connected devices with a command from these **usbutils**: | ||
| Line 32: | Line 33: | ||
| |__ Port 1: Dev 5, If 0, Class=Mass Storage, Driver=usb-storage, | |__ Port 1: Dev 5, If 0, Class=Mass Storage, Driver=usb-storage, | ||
| </ | </ | ||
| - | * " | + | * " |
| - | * Lines with " | + | * Lines with " |
| - | In step 3, verify that the output prints no error and has at least one output line for **root_hub** and **Mass Storage** and that each **Driver=** lists a driver name. If not, then refer to [[docs: | + | In step 5, verify that the output prints no error and has at least one output line for **root_hub** and **Mass Storage** and that each **Driver=** lists a driver name. If not, then refer to [[docs: |
| ===== Verify that the OS recognizes the attached disk and partitions ===== | ===== Verify that the OS recognizes the attached disk and partitions ===== | ||
| Line 44: | Line 45: | ||
| - This should now show a list of block devices known to the OS< | - This should now show a list of block devices known to the OS< | ||
| brw------- | brw------- | ||
| - | - Install the **block** tool to get more info about existing partitions< | + | - Install the **block** tool to get more info about existing partitions< |
| - Run the **block** tool:< | - Run the **block** tool:< | ||
| Line 73: | Line 74: | ||
| opkg install kmod-fs-ext4 | opkg install kmod-fs-ext4 | ||
| mkfs.ext4 / | mkfs.ext4 / | ||
| + | * For USB drives formatted as NTFS see [[docs: | ||
| * For SSD drives and thumb drives, | * For SSD drives and thumb drives, | ||
| opkg install kmod-fs-f2fs | opkg install kmod-fs-f2fs | ||
| Line 81: | Line 83: | ||
| Automount ensures that the external disk partition is automatically made available for usage when booting the OpenWrt device | Automount ensures that the external disk partition is automatically made available for usage when booting the OpenWrt device | ||
| - | - Generate a config entry for the fstab file:< | + | - Generate a config entry for the fstab file:< |
| - | - Now enable automount on that config entry:< | + | - Now enable automount on that config entry:< |
| - | uci commit</ | + | uci commit |
| - Optionally enable autocheck of the file system each time the OpenWrt device powers up:< | - Optionally enable autocheck of the file system each time the OpenWrt device powers up:< | ||
| - | uci commit</ | + | uci commit |
| - Reboot your OpenWrt device (to verify that automount works) | - Reboot your OpenWrt device (to verify that automount works) | ||
| - After the reboot, check your results: Run < | - After the reboot, check your results: Run < | ||
| Line 97: | Line 99: | ||
| fstab.@mount[0].target='/ | fstab.@mount[0].target='/ | ||
| fstab.@mount[0].uuid=' | fstab.@mount[0].uuid=' | ||
| - | fstab.@mount[0].enabled=' | + | fstab.@mount[0].enabled=' |
| + | - Check the " | ||
| - Note the " | - Note the " | ||
| - Run the following command, to verify that the disk is properly mounted at this path< | - Run the following command, to verify that the disk is properly mounted at this path< | ||
| /dev/sda1: UUID=" | /dev/sda1: UUID=" | ||
| - | - Your external storage is now ready for further usage | + | - Your external storage is now ready for further usage:< |
| - | + | service fstab boot</ | |
| ===== Optional: Idle spindown timeout on disks for NAS usage ===== | ===== Optional: Idle spindown timeout on disks for NAS usage ===== | ||
| Optional step for hard disks. | Optional step for hard disks. | ||
| Line 130: | Line 132: | ||
| Of course you can always change the timeout or disable auto-spindown again later on. Depending on your harddisk, the value may be active until the next reset or permanently stored on the harddisk. | Of course you can always change the timeout or disable auto-spindown again later on. Depending on your harddisk, the value may be active until the next reset or permanently stored on the harddisk. | ||
| - | The harddisk firmware itself manages the spindown timeout, not a OpenWrt service. | + | The harddisk firmware itself manages the spindown timeout, not a OpenWrt service. |
| + | <code bash> | ||
| + | # set timeout to put the drive into idle (low-power) mode | ||
| + | / | ||
| + | |||
| + | exit 0 | ||
| + | </ | ||
| Line 141: | Line 150: | ||
| </ | </ | ||
| To configure it, use the " | To configure it, use the " | ||
| + | |||
| + | \\ | ||
| + | To install the CLI package (without LuCi): | ||
| + | < | ||
| + | opkg update && opkg install hd-idle | ||
| + | </ | ||
| + | To configure it, you can edit the ''/ | ||
| + | |||
| + | Options to configure: | ||
| + | ^ Name ^ Type ^ Default ^ Description | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | :!: Notice that you have to enable it since it isn't by default. | ||