| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision |
| docs:guide-user:storage:usb-drives [2019/08/03 00:52] – [Install and verify USB drivers] mention UAS driver pilatus | docs:guide-user:storage:usb-drives [2022/04/10 09:15] – hdparm rc.local autostart ivanmara |
|---|
| |__ Port 1: Dev 5, If 0, Class=Mass Storage, Driver=usb-storage, 480M | |__ Port 1: Dev 5, If 0, Class=Mass Storage, Driver=usb-storage, 480M |
| </code> | </code> |
| * "Bus..."-Lines represent the host chip. Here, the "Driver" will be xhci" for USB3.0, "ehci" for USB2.0 and "uhci" or "ohci" for USB1.1. | * "Bus..."-Lines represent the host chip. Here, the "Driver" will be ''xhci'' for USB3.0, ''ehci'' for USB2.0 and ''uhci'' or ''ohci'' for USB1.1. |
| * Lines with "Class=Mass Storage" represent connected USB devices. Here the "Driver" is either "usb-storage" for storage of type [[https://en.wikipedia.org/wiki/USB_mass_storage_device_class|Bulk only Transport]] or "usb-storage-uas" for storage of type [[https://en.wikipedia.org/wiki/USB_Attached_SCSI|USB_Attached_SCSI]] | * Lines with "Class=Mass Storage" represent connected USB devices. Here the "Driver" is either ''usb-storage'' for storage of type [[wp>USB_mass_storage_device_class|Bulk only Transport]] or ''usb-storage-uas'' for storage of type [[wp>USB_Attached_SCSI|USB_Attached_SCSI]] |
| |
| In step 4, 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:guide-user:storage:usb-installing|the Installing USB Drivers]] for more suggestions on drivers. | 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:guide-user:storage:usb-installing|the Installing USB Drivers]] for more suggestions on drivers. |
| |
| ===== Verify that the OS recognizes the attached disk and partitions ===== | ===== Verify that the OS recognizes the attached disk and partitions ===== |
| - This should now show a list of block devices known to the OS<code>brw------- 1 root root 8, 0 Oct 30 12:49 /dev/sda | - This should now show a list of block devices known to the OS<code>brw------- 1 root root 8, 0 Oct 30 12:49 /dev/sda |
| brw------- 1 root root 8, 1 Oct 30 12:49 /dev/sda1</code>This should print at least a connected disk like "/dev/sda" or "/dev/sdb". If no disk at all is listed, recheck USB driver installation and reboot your OpenWrt device once. | brw------- 1 root root 8, 1 Oct 30 12:49 /dev/sda1</code>This should print at least a connected disk like "/dev/sda" or "/dev/sdb". If no disk at all is listed, recheck USB driver installation and reboot your OpenWrt device once. |
| - Install the **block** tool to get more info about existing partitions<code>opkg install block-mount</code> | - Install the **block** tool to get more info about existing partitions<code>opkg install block-mount</code> for exFAT you also need libblkid <code>opkg install libblkid</code> |
| - Run the **block** tool:<code>block info | grep "/dev/sd"</code>and you should see output like this, if your disk already has partitions:<code>/dev/sda1: UUID="2eb39413-83a4-4bae-b148-34fb03a94e89" VERSION="1.0" TYPE="ext4"</code> | - Run the **block** tool:<code>block info | grep "/dev/sd"</code>and you should see output like this, if your disk already has partitions:<code>/dev/sda1: UUID="2eb39413-83a4-4bae-b148-34fb03a94e89" VERSION="1.0" TYPE="ext4"</code> |
| |
| opkg install kmod-fs-ext4 | opkg install kmod-fs-ext4 |
| mkfs.ext4 /dev/sda1</code> | mkfs.ext4 /dev/sda1</code> |
| | * For USB drives formatted as NTFS see [[docs:guide-user:storage:filesystems-and-partitions#setup_ntfs|Filesystems]] and [[docs:guide-user:storage:writable_ntfs|Writable NTFS]] |
| * For SSD drives and thumb drives, install F2FS file system and use F2FS to format the partition (in this example '/dev/sda1'): <code>opkg install f2fs-tools | * For SSD drives and thumb drives, install F2FS file system and use F2FS to format the partition (in this example '/dev/sda1'): <code>opkg install f2fs-tools |
| opkg install kmod-fs-f2fs | opkg install kmod-fs-f2fs |
| |
| 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. For persistent changes use ''/etc/rc.local'' file, like: |
| | <code bash> |
| | # set timeout to put the drive into idle (low-power) mode |
| | /sbin/hdparm -S 240 /dev/sda2 |
| | |
| | exit 0 |
| | </code> |
| |
| |
| </code> | </code> |
| To configure it, use the "Services" menu of the LuCi web GUI of your device. | To configure it, use the "Services" menu of the LuCi web GUI of your device. |
| | |
| | \\ |
| | To install the CLI package (without LuCi): |
| | <code> |
| | opkg update && opkg install hd-idle |
| | </code> |
| | To configure it, you can edit the ''/etc/config/hd-idle'' file and then autostart and run the hd-idle service ''service hd-idle enable && service hd-idle start''. |
| | |
| | Options to configure: |
| | ^ Name ^ Type ^ Default ^ Description ^ |
| | | ''disk'' | string | ''sda'' | Replace ''sda'' with your device's identifier | |
| | | ''enabled'' | boolean | ''0'' | Enable hd-idle operation | |
| | | ''idle_time_unit'' | string | ''minutes'' | The unit of time used in the ''idle_time_interval'' option | |
| | | ''idle_time_interval'' | integer | ''10'' | How much idle time before spindown | |
| | :!: Notice that you have to enable it since it isn't by default. |