Differences

This shows you the differences between two versions of the page.

doc:howto:usb.storage [2012/12/22 23:56]
freier.radikaler
doc:howto:usb.storage [2014/11/16 14:02] (current)
camd erroneous * removed
Line 1: Line 1:
====== USB Storage ====== ====== USB Storage ======
-Once you have obtained [[usb.essentials| Basic USB support]], you may want to connect a USB storage device (USB stick, USB harddisk, etc) to your router. This HowTo will tell you the steps. You should be aware that any storage device has to be [[wp>Disk partitioning|partitioned]] and [[wp>Disk formatting|formated]] with a [[wp>File system]] (ie. [[wp>ext3]]) before data can be addressed as [[wp>Computer file|files]] by the OS.+Please see the [[doc/techref/flash.layout]]. 
 + 
 +Once you have obtained [[usb.essentials|Basic USB support]], you may want to connect a USB storage device to your router, for example a USB stick, a USB harddisk, etc. This article will tell you the steps and requirements to do this.
===== Preparations ===== ===== Preparations =====
-==== Prerequisites ==== +The main course of action is as follows: 
-  - obtain [[usb.essentials|Basic USB support]] on your OpenWrt-powered device +  - Obtain [[usb.essentials|basic USB support]] on your OpenWrt-powered device; 
-  - install storage and file system requirements ([[usb.storage#Required Packages]]), as shown below. Minimum you need **kmod-usb-storage** to see usb disk devices. +  - Install USB storage prerequisites as shown [[usb.storage#Required Packages for USB Storage|below]]). A connected USB storage device (e.g. hard disc) can now be recognised by the system; 
-  - connect the already partitioned and formatted storage device (e.g. hard disc) to your OpenWrt-powered device; the device itself and its partitions should immediately be available as [[wp>Device file]]s under ''/dev/'', for example ''dev/sda'', ''/dev/sda1'', ''/dev/sda2'', etc.+  - If not already done, partition the device and create the file systems you want (see [[Storage]] on how to do this from within OpenWrt). The device itself and its partitions should immediately be available as [[wp>Device file]]s under ''/dev/''. For example ''/dev/sda'' as the device, with ''/dev/sda1'', ''/dev/sda2'', ... , the partitions. Or, in case it is not partitioned with a partition table and it has a single file system it may be directly accessible under e.g. ''/dev/sda''. Subsequent devices you add will be ''/dev/sdb'', ''/dev/sdc'' and so on. Make sure that the file system requirements are satisfied by installing the proper kernel packages for specific file system support (see [[Storage]]); 
 +  - These file systems can then be mounted and accessed, see [[Storage]]. Optionally, you can now configure automatic mounting at boot using ''[[doc:uci:fstab|/etc/config/fstab]]'' and you can configure it as [[doc:howto:extroot|root file system using extroot]].
-| <HTML><font size="6"; color="red">✘</font> </HTML> | We do **NOT** recommend using [[wp>NTFS]].  While it is possible, it has serious performance issues under Linux. | +===== Required Packages for USB Storage ===== 
-| <HTML><font size="6"; color="green">✔</font> </HTML> | We recommend the file systems **[[wp>ext2]]**, **[[wp&gt;ext3]]**, or **[[wp>ext4]]** (all supported by **kmod-fs-ext4**) |+When your USB device is properly recognised by the system, using the proper driver kernel packages listed in [[usb.essentials|Basic USB support]], the following packages facilitate USB storage support: 
 +  ***''kmod-usb-storage''** //required// ... Kernel support for USB Mass Storage devices
 + ***''kmod-fs-<file_system>''** //required// ... the file system you formatted your partition in. Common examples include kmod_fs_ext4, kmod-fs-hfs, kmod_fs_hfsplus, kmod-fs-msdos, kmod-fs-ntfs, kmod-fs-reiserfs and kmod-fs-xfs. For handling of ntfs filesystems, the package **''ntfs-3g''** must be installed in addition. 
 +  ***''kmod-usb-storage-extras''** //optional// ... Kernel support for some more drivers, such as for SmartMedia card readers. 
 +  ***''block-mount''** //recommended// &amp; //required (if using [[doc:uci:fstab]] UCI configuration or [[luci]] Mount Points)// ... Scripts used to mount and check block devices (filesystems and swap) and hotplug capability (recognition when device is plugged in). 
 +  ***''kmod-scsi-generic''** //FIXME probably required// ... Any mass storage is a generic SCSI device.
-If you are planning on sharing your USB storage with Samba, and/or using it to share large multimedia content over UPnP, e.g. with ushare, you should use ext3 or ext4 rather than ext2.  Default Ext2 partitions will be limited to files of no more than 4 Gb, but this restriction is eliminated with the newer filesystems.  To retain good performance with the newer filesystems, particularly on flash USB storage, you should also consider disabling journaling with the "-O ^has_journal" when using mkfs.ext4 to format the filesystem. Also for ext4, the "extent" formatting option (e.g. "-O ^has_journal,extent") will make filesystem access to large files more performant.+| {{:meta:icons:tango:48px-outdated.svg.png?nolink}} | Before the [[about:history#timeline|Attitude Adjustment]] release, other optional packages included: ''block-hotplug'' for USB recognition upon plug-in and ''block-extroot'' required for [[doc:howto:extroot|rootfs on external storage]]. In [[https://dev.openwrt.org/changeset/26314/trunk|r26314]] the three opkg packages ''block-mount'', ''block-extroot'' and ''block-hotplug'' have been merged into a single package **''block-mount''**. |
- +===== Additional Packages for USB Storage ===== 
-==== Required Packages ==== +  ***''e2fsprogs''** //additional// This package contains essential ext2/ext3/ext4 filesystem utilities for formatting and checking for errors on ext2/ext3/ext4 filesystems like mkfs.ext3, mkfs.ext4, fsck and other core utilities.
-| {{:meta:icons:tango:48px-outdated.svg.png?nolink}} | As of [[https://dev.openwrt.org/changeset/26314/trunk|r26314]] ''block-extroot'' and ''block-hotplug'' have been merged with ''block-mount''. That means that once you select ''block-mount'' the scripts for extroot mounting and hotplug mounting are installed. ''block-mount'' can be installed even if you have not selected a block device package, but if you want to actually mount a block device you must still install the drivers (block device package) as well as the filesystem you want to use (e.g. ext4, **kmod-fs-ext4** and **e2fsprogs**). (FIXME This may not be true for Backfire (10.03.1, r29592) users. It was confirmed that block-mount is not enough to make fstab work → block-hotplug had to be installed separately with opkg install block-hotplug. Its possible that same might be said about the block-extroot package.) | +
- +
-  ***''kmod-usb-storage''** //required// Kernel support for USB Mass Storage devices +
-  ***''kmod-usb-storage-extras''** //optional// Kernel support for some more drivers, such as for SmartMedia card readers +
-  ***''block-mount''** //optional// & //recommended// Scripts used to mount and check block devices (filesystems and swap). //Required// for ''fstab'' configuration. +
-    * Since [[about:history#timeline|Attitude Adjustment]] it includes: +
-      ***''block-hotplug''** //required// for configuration with ''[[doc:uci:fstab|/etc/config/fstab]]'' +
-      ***''block-extroot''** //required// for [[doc:howto:extroot|rootfs on external storage]] +
-    * Dependencies: +
-      ***''blkid''** Command-line utility to locate/print block device attributes +
-      ***''swap-utils''** This package contains a collection of tools for managing swap space: ''mkswap'', ''swapon'' and ''swapoff'' +
- +
-  ***''kmod-fs-????''** //required// the filesystem you formated your partition in +
- +
-  ***''kmod-usb2''** //optional// USB2.0 support, needed for stable USB1.0 usage with some devices (e.g. La Fonera 2), too. +
- +
-  ***''kmod-usb-ohci or kmod-usb-uhci''** //optional// USB1.0 support +
- +
-  ***''kmod-scsi-generic''** //FIXME probably required// Any mass storage is a generic SCSI device. +
- +
- +
-=== Available Filesystems === +
- +
-| {{:meta:icons:tango:48px-outdated.svg.png?nolink}} | As of [[https://dev.openwrt.org/changeset/26645|r26645]] the //modules// for ext2 and ext3 (kmod-fs-ext2 and kmod-fs-ext3) are no longer available. You can use the module for ext4 **kmod-fs-ext4** to mount ext2/ext3 as well, but then you have to mount your ext2 or ext3 partition like ext4 partition: ''mount -t ext4 /dev/sda1 /mnt/share -o rw,sync''  | +
- +
- +
-[[https://forum.openwrt.org/viewtopic.php?id=27750|OpenWrt-Forum: Benchmarks with different filesystems]] +
- +
-Available file systems and their packages can be listed with ''opkg update; opkg list "kmod-fs*"''. +
- +
-^ Name                ^ Description                                                ^ +
-| kmod-fs-autofs4    | Kernel module for AutoFS4 support                          | +
-| kmod-fs-btrfs      | Kernel module for [[wp>Btrfs]] support                    | +
-| kmod-fs-cifs        | Kernel module for CIFS support                            | +
-| kmod-fs-exportfs    | Kernel module for exportfs. Needed for some other modules. | +
-| kmod-fs-ext4       | Kernel module for [[wp>ext2]], [[wp>ext3]] and [[wp>ext4]] filesystem support((But then ext2 or ext3 partition has to be mounted as ext4 partition.))  | +
-| kmod-fs-hfs        | Kernel module for HFS filesystem support                  | +
-| kmod-fs-hfsplus    | Kernel module for HFS+ filesystem support                  | +
-| kmod-fs-isofs      | Kernel module for ISO9660 filesystem support              | +
-| kmod-fs-minix      | Kernel module for [[wp>MINIX file system]] support        | +
-| kmod-fs-msdos      | Kernel module for MSDOS filesystem support                | +
-| kmod-fs-nfs        | Kernel module for NFS support                              | +
-| kmod-fs-nfs-common  | Common NFS filesystem modules                              | +
-| kmod-fs-nfsd        | Kernel module for NFS kernel server support                | +
-| kmod-fs-ntfs        | Kernel module for NTFS __read only__ filesystem support    | +
-| kmod-fs-reiserfs    | Kernel module for [[wp>ReiserFS]] support                  | +
-| kmod-fs-udf        | Kernel module for [[wp>Universal Disk Format|UDF]] filesystem support                  | +
-| kmod-fs-vfat        | Kernel module for VFAT filesystem support                  | +
-| kmod-fs-xfs        | Kernel module for [[wp>XFS]] support                      | +
- +
- +
-| {{:meta:icons:tango:48px-emblem-important.svg.png?nolink}} | You are not required to use NTFS or FAT in order to access the disk from Microsoft Windows! See [[http://wiki.ubuntuusers.de/Linux-Partitionen_unter_Windows]] on HowTo access Linux filesystems from Windows. Thus native Linux file systems like ext2 or ext3 are the first choice when working with Linux. Don't bother with NTFS, VFAT and the like. They all have some quirks we could do without.  | +
- +
-If, for whatever reasons, you insist to utilize NTFS as file system, you may find [[writable_ntfs|Writable NTFS]] helpful. +
- +
-=== Available NLS files === +
- +
-For some filesystems, like for VFAT, you need to additionally install language packages (codepages / charsets) to handle the filenames.  If your mount fails, look in dmesg - a message like +
- +
-''FAT: codepage cp437 not found'' +
- +
-means that you need NLS codepage 437, and a message like +
- +
-''FAT: IO charset iso8859-1 not found'' +
- +
-means that you need NLS ISO 8859-1. +
-   +
-  ***''kmod-nls-base''** Kernel module for NLS (Native Language Support) +
- +
-Available NLS files and their packages can be listed with ''opkg update; opkg list "kmod-nls*"''. +
- +
-^ Name                ^ Description  ^ +
-| kmod-nls-cp1250    | Kernel module for NLS Codepage 1250 (Eastern Europe)      | +
-| kmod-nls-cp1251    | Kernel module for NLS Codepage 1251 (Russian)              | +
-| kmod-nls-cp437      | Kernel module for NLS Codepage 437 (United States, Canada) | +
-| kmod-nls-cp775      | Kernel module for NLS Codepage 775 (Baltic Rim)            | +
-| kmod-nls-cp850      | Kernel module for NLS Codepage 850 (Europe)                | +
-| kmod-nls-cp852      | Kernel module for NLS Codepage 852 (Europe)                | +
-| kmod-nls-cp866      | Kernel module for NLS Codepage 866 (Cyrillic)              | +
-| kmod-nls-iso8859-1  | Kernel module for NLS ISO 8859-1 (Latin 1)                | +
-| kmod-nls-iso8859-13 | Kernel module for NLS ISO 8859-13 (Latin 7; Baltic)        | +
-| kmod-nls-iso8859-15 | Kernel module for NLS ISO 8859-15 (Latin 9)                | +
-| kmod-nls-iso8859-2  | Kernel module for NLS ISO 8859-2 (Latin 2)                | +
-| kmod-nls-koi8r      | Kernel module for NLS KOI8-R (Russian)                    | +
-| kmod-nls-utf8      | Kernel module for NLS UTF-8                                | +
- +
- +
-===== Configuration ===== +
-->''[[doc:uci:fstab|/etc/config/fstab]]'' +
- +
-There is nothing to configure! Read the manpage for [[http://linux.die.net/man/8/mount|mount]]. Pay special attention to the options! You can only mount a partition to an existing directory. You can create it with [[http://linux.die.net/man/1/mkdir|mkdir]], for example: +
-<code> +
-mkdir -p /mnt/shares +
-</code> +
- +
-To manually mount a partition: +
-<code> +
-mount -t ext3 /dev/sda2 /mnt/shares -o rw,sync +
-</code> +
- +
-To unmount: +
-<code> +
-umount /mnt/shares +
-</code> +
- +
-To mount a swap partition: +
-<code> +
-swapon /dev/sda1 +
-</code> +
- +
-To unmount a swap partition: +
-<code> +
-swapoff /dev/sda1 +
-</code>+
===== Examples ===== ===== Examples =====
 +The following will install USB storage support, assuming USB works already, install ext4 file system support and mount a connected USB drive, pre-partitioned with a Linux swap partition and an ext4 partition.
<code> <code>
opkg update opkg update
-opkg install kmod-usb-storage block-mount block-hotplug kmod-fs-ext4+opkg install kmod-usb-storage block-mount kmod-fs-ext4 
 +mkswap /dev/sda1
swapon /dev/sda1 swapon /dev/sda1
mkdir -p /mnt/share mkdir -p /mnt/share
-mount -t ext3 /dev/sda2 /mnt/share -o rw,sync+mount -t ext4 /dev/sda2 /mnt/share -o rw,sync
</code> </code>
-Other example is how to external usb stick with FAt32 partition (but we'll keep ext4 support also)+Note that partitions are usually auto detected, so this should work as well using default settings: 
 + 
 +    mount /dev/sda2 /mnt/share 
 + 
 +Another example is how to use an external usb stick with a FAT32 partition (but we'll keep ext4 support also). See also [[Storage]].
<code> <code>
opkg update opkg update
Line 149: Line 49:
</code> </code>
-===== Start on boot ===== 
-| {{:meta:icons:tango:48px-outdated.svg.png?nolink}} | As of [[https://dev.openwrt.org/changeset/26314/trunk|r26314]] ''block-extroot'' and ''block-hotplug'' have been merged with ''block-mount''.  That means that once you select ''block-mount'' the scripts for extroot mounting and hotplug mounting are installed. ''block-mount'' can be installed even if you have not selected a block device package, but if you want to actually mount a block device you must still install the drivers (block device package) as well as the filesystem you want to use (e.g. ext4, **kmod-fs-ext4** and **e2fsprogs**) | 
-Install the packages ''block-mount'' and ''block-hotplug'', they will take care of this and also enable automatic mount when device is plugged in. +===== Disable writing when not mounted =====
-The configuration file is ''[[doc:uci:fstab|/etc/config/fstab]]''.+
-Example settings in ''fstab'' for mounting to ''/mnt/share'' with automatic detection of the file system: 
-| '' 
-config 'mount' 
- option 'device' '/dev/sda1' 
- option 'options' 'rw,sync' 
- option 'enabled_fsck' '0' 
- option 'enabled' '1' 
- option 'target' '/mnt/share' 
-'' | 
- 
-And to make the fstab settings effective in current session run: 
-<code>/etc/init.d/fstab start</code> 
- 
-To make the fstab settings effective after every reboot run: 
-<code>/etc/init.d/fstab enable</code> 
- 
-UCI CLI commands: 
-<code> 
-/etc/init.d/fstab stop 
-uci add fstab mount 
-uci set fstab.@mount[-1].device=/dev/sda1 
-uci set fstab.@mount[-1].options=rw,sync 
-uci set fstab.@mount[-1].enabled_fsck=0 
-uci set fstab.@mount[-1].enabled=1 
-uci set fstab.@mount[-1].target=/mnt/share 
-uci commit fstab 
-/etc/init.d/fstab start 
-</code> 
- 
-Delete with UCI CLI commands: 
-<code>/etc/init.d/fstab stop 
-uci delete fstab.@mount[0] 
-uci commit fstab 
-/etc/init.d/fstab start</code> 
- 
-:!: **Note:** In order to do ''fsck'' (aka CHKDSK) of FAT32/VFAT partitions before mounting (i.e. during the boot process), you should read the following tickets: 
-[[https://dev.openwrt.org/ticket/10714|Incorrect log output for mount point file systems without a fsck]], and 
-[[https://dev.openwrt.org/ticket/10697|Missing fsck function for block-mount/-hotplug of dos/vfat filesystems]] 
- 
- 
-===== Rigging it up from OpenWrt ===== 
- 
-Actually there are packages in the OpenWrt repositories with which you can partition, format and check filesystems: 
-  ***''fdisk''**  (//for help with **partitioning** see [[http://www.tldp.org/HOWTO/Partition/fdisk_partitioning.html|TLDP]]//) 
-  ***''e2fsprogs''** Contains the essential ext2 filesystem utilities ''e2fsck'', ''mke2fs'', ''debugfs'', ''dumpe2fs'' and ''tune2fs'', and also most of the other core ext2 filesystem utilities available. //for help with **formatting** see [[http://www.tldp.org/HOWTO/Partition/fdisk_partitioning.html|TLDP]]// 
- 
-:!: **Note:** In order to perform a ''e2fsck'' on 1 GiB partition, you will need at least 1 MiB of RAM.(([[http://www.openbsd.org/faq/faq14.html#LargeDrive|Source]].)) The same is true for ''mke2fs''. You can solve this by mounting a SWAP partition (or by using a device with enough RAM). 
- 
-===== Installing OPKG packages in mount point other than root ===== 
- 
-Once you successfully mounted your partition, you may want to install packages onto it. Please see [[doc:techref:opkg#Installation.Destination]] for that. 
- 
-If you plan to install kernel modules on a USB drive you might want to read this: https://dev.openwrt.org/ticket/10739 
- 
-===== Disable writing when not mounted ===== 
You may create an empty file to indicate that the disk is not plugged in so that you don't put files directly onto NAND by doing You may create an empty file to indicate that the disk is not plugged in so that you don't put files directly onto NAND by doing
<code> <code>
-touch /mnt/usbstorage/USB_DISK_NOT_PRESENT +umount /mnt/usb  #make sure the disk isn't mounted before doing this 
-chmod 444 /mnt/usbstorage -R+touch /mnt/usb/USB_DISK_NOT_PRESENT 
 +chmod 555 /mnt/usb  
 +chmod 444 /mnt/usb/USB_DISK_NOT_PRESENT
</code> </code>
-This will prevent only processes not running as root from writing onto NAND. You can of course also use this file in your own scripts. +This will prevent only processes not running as root from writing onto NAND (see [[https://forum.openwrt.org/viewtopic.php?id=42351|this discussion]]). You can of course also use this file in your own scripts.
- +
-===== Manual ===== +
-mount the external drive:\\ +
-(where sda1 is your drive, see **fdisk -ls**, and /mnt/hdd is the point where you wish to mount. Use md to make the directories)\\ +
- +
-<code> +
-ntfs-3g -o rw,noatime /dev/sda1 /mnt/hdd +
-</code> +
- +
-Then make the following script:\\ +
- +
-<code> +
-nano /etc/init.d/hdd +
-</code> +
- +
-And the contents:\\ +
-(In this script, You can control other processes, like transmission, whitch uses Your external drive)\\ +
- +
-|''#!/bin/sh /etc/rc.common +
-  START=98 +
-  STOP=40 +
-   +
-  start() +
-  { +
-  echo -n "Mounting USB drive: " +
-  ntfs-3g -o rw,noatime /dev/sda1 /mnt/hdd +
-  swapon /mnt/hdd/swapfile +
-  mount -o loop /mnt/hdd/owrt_loop /mnt/loopdisk +
-  opkg-link mount /mnt/loopdisk +
-  apachectl start +
-  echo "Done." +
-  } +
-   +
-  stop() +
-  { +
-  echo -n "Umounting USB drive: " +
-  apachectl stop +
-  sync +
-  sync +
-  swapoff /mnt/hdd/swapfile +
-   +
-  umount -l /mnt/loopdisk +
-  umount -l /dev/sda1 +
-  echo "Done." +
-  } +
-   +
-  restart() +
-  { +
-  apachectl restart +
-  } +
-''| +
- +
-Enter the required permissions to it.\\ +
- +
-<code> +
-chmod a+x /etc/init.d/hdd +
-</code> +
- +
-create a swapfile, then format and turned on.\\ +
- +
-<code> +
-dd if=/dev/zero of=/mnt/hdd/swapfile bs=1M count=64 +
-mkswap /mnt/hdd/swapfile +
-swapon /mnt/hdd/swapfile +
-</code> +
- +
-To see if work:\\ +
-  free +
- +
-==== Virtual Disk ==== +
-Now let's do a virtual disk. You need an additional package. +
- +
-<code>  +
-opkg update +
-opkg install kmod-fs-ext3 kmod-loop e2fsprogs +
-insmod ext3 +
-insmod loop +
-</code> +
- +
-Then, create, and format the disk:\\ +
- +
-<code> +
-dd if=/dev/zero of=/mnt/hdd/owrt_loop bs=1M count=128 +
-mke2fs -j -F -b 1024 /mnt/hdd/owrt_loop +
-</code> +
- +
-To be able to use, plug-in for OpenWrt:\\ +
- +
-<code> +
-mkdir /mnt/loopdisk +
-mount -o loop /mnt/hdd/owrt_loop /mnt/loopdisk +
-</code> +
- +
-Now our system is not only the OpenWrt xMB, but x+128 MB\\ +
-\\ +
-Write in ''/etc/opkg.conf'' file into the following line\\ +
- +
-->[[doc:techref:opkg##installation.destinations]] +
- +
-|''dest usb /mnt/loopdisk''| +
- +
-To install package: +
-<code> +
-opkg -dest usb install package +
-</code> +
- +
-To delete package: +
-<code> +
-opkg -dest usb remove package +
-</code> +
- +
-===== Troubleshooting ===== +
- +
-==== FAT, NTFS ==== +
-Prefer EXT2 or EXT3 file system. +
- +
-==== I don't see /dev/sda1 or similar ==== +
-**Symptoms**: I have installed ''kmod-usb-storage'', but I don't see ''sda'', ''sda1'', ''sda2'' or similar in ''/dev'' directory. +
- +
-**Solution**: Make sure you have started and enabled ''usb'' startup script: +
- +
-<code> +
-/etc/init.d/usb start +
-/etc/init.d/usb enable +
-</code> +
- +
-==== kmod-fs-ext4 won't mount ext2 or ext3 partition ==== +
- +
-**Symptoms**: You are trying to mount **ext2** or **ext3** partition and you have installed only **kmod-fs-ext4**. Neither ''mount'' command nor ''fstab'' works. +
- +
-**Solution a)**: you have to make sure that you are trying to mount the ext2 or ext3 partition like it was ext4 partition. Example [[doc:uci:fstab|/etc/config/fstab]] config and mount command follows: +
- +
-|''config mount +
-        option target  /mnt +
-        option device  /dev/sda1  # sda1 is ext3 partition +
-        option fstype  **ext4**        # but is mounted as ext4, since we have installed kmod-fs-ext4 only +
-        option options  rw,sync +
-        option enabled  1 +
-        option enabled_fsck 1 +
-''| +
- +
-<code>mount -t ext4 /dev/sda1 /mnt -o rw,sync</code> +
- +
-FIXME The kmod-fs-ext4 issue above definitely applies to Backfire, but __may not be__ issue for Attitude Adjustment. Could Att. Adj. user confirm this+
- +
-**Solution b)**: install ''kmod-fs-ext3'' or ''kmod-fs-ext2'' filesystem. This is not (probably) available for Attitude Adjustment. +
- +
-<code> +
-opkg update +
-opkg install kmod-fs-ext3 +
-</code> +
- +
-==== Other ==== +
-:!: **Note:** If you are having trouble with fstab, see [[doc:uci:fstab#troubleshooting|fstab troubleshooting]].+
-:!: **Note:** If you are having trouble using storage on a Huaweu 3G dongle, you should read the following ticket:[[https://dev.openwrt.org/ticket/10716|Mass storage missing from 3G dongle]]+===== LUKS ===== 
 +  - Install required packages: <code>opkg install cryptsetup lvm2 kmod-crypto-aes kmod-crypto-misc kmod-crypto-xts kmod-crypto-iv kmod-crypto-cbc kmod-crypto-hash kmod-dm</code> 
 +  - Create necessary config files: Most of the kmod-crypto-* packages create file in /etc/modules.d folder that automatically installs provided modules at boot time. However kmod-crypto-misc containing sha256 module (among others) is an exception to this, hence we need to create such a file manually: <code>echo sha256_generic >/etc/modules.d/11-crypto-misc</code> 
 +  - Mounting your encrypted partition: Replace /dev/encrypted_partition with a path to the device file of your encrypted partition and /mnt/mountpoit with your desired mount point: <code>cryptsetup luksOpen /dev/encrypted_partition usbstorage_luks && mount /dev/mapper/usbstorage_luks /mnt/mountpoint</code> 
 +  - Umounting: <code>umount /mnt/mountpoint && cryptsetup luksClose usbstorage_luks</code>
===== Notes ===== ===== Notes =====
 +<none yet>
 +/* the previous note was moved to the OPKG page since it was specific to that */
---- ----
{{tag>USBrelated}} {{tag>USBrelated}}

Back to top

doc/howto/usb.storage.1356216961.txt.bz2 · Last modified: 2012/12/22 23:56 by freier.radikaler