In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to connect OpenWRT to USB flash drive. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
DIR-505 has a USB2.0 interface, which brings it great expansibility. We can plug in USB disk, removable hard disk, etc., to do file sharing or offline download. Next, we will finish the U disk first.
The first is the kernel module of USB and memory:
Opkg updateopkg install kmod-usb-storageopkg install kmod-scsi-generic
Then there is the file system:
Opkg install kmod-fs-ext4
USB aids, partitions, formatting tools, these are unnecessary, depending on the installation:
Opkg install usbutils fdisk e2fsprogs
Test it. When you don't plug in the flash drive, type lsusb, which is displayed as follows
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
After inserting the USB disk and lsusb, one more is found, which indicates that it is working properly:
Bus 001 Device 002: ID 0603:0908 Novatek Microelectronics Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
If the U disk needs to be re-partitioned, please use fdisk. Without details here, you can do it with diskpart on Windows. If you are still operating on the router, you can refer to this: http://www.leiphone.com/diy-a-smart-router-topic-increase-memory-3.html, the first step: partition the device.
After partitioning, check to see if the hard drive letter and partition letter appear in the / dev directory:
Ls / dev | grep sd
The driver of the ext4 file system is installed on it, because it is most suitable for OpenWRT. If it is not originally in this format, you can format it with the following command after installing e2fsprogs:
Mkfs.ext4 / dev/sda1
Next, hang it with mount. The first and last lines are required, and the middle three lines are a mechanism to prevent them from being written without being attached:
Mkdir / mnt/usbtouch / mnt/usb/USB_DISK_NOT_PRESENTchmod 555 / mnt/usbchmod 444 / mnt/usb/USB_DISK_NOT_PRESENTmount / dev/sda1 / mnt/usb
At this point, you can access the USB disk via / mnt/usb, but the work is only half done. The following also allows the U disk to boot automatically load, the main reference: http://wiki.openwrt.org/doc/techref/block_mount and http://wiki.openwrt.org/doc/uci/fstab. Install the program first:
Opkg install block-mount blkid
If you cherish storage space, you don't have to install blkid,block-mount. Use blkid or block info to check the UUID of the partition. For example, if you use blkid, the USB disk of UMU displays:
/ dev/mtdblock7: TYPE= "squashfs"
Dev/sda1: UUID= "16e381bc-d9bb-40fd-9e98-410b346931ef" TYPE= "ext4"
Next, type block detect to see:
Config 'global'
Option anon_swap'0'
Option anon_mount'0'
Option auto_swap'1'
Option auto_mount'1'
Option delay_root'5'
Option check_fs'0'
Config 'mount'
Option target'/ mnt/sda1'
Option uuid '16e381bc-d9bb-40fd-9e98-410b346931ef'
Option enabled'0'
Generate the configuration file and change the above target to what you want, and the enabled value to 1:
Block detect > / etc/config/fstabuci set fstab.@mount [- 1] .target ='/ mnt/usb'uci set fstab.@mount [- 1] .enabled = 1uci commit fstab this article on "how to attach a USB disk to OpenWRT" ends here. I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.