субота, 8 квітня 2023 р.

Використання USB запам'ятовуючих пристроїв у OpenWrt

     Цей крок гарантує, що потрібні драйвери накопичувача USB встановлено належним чином.

opkg update 
opkg install kmod-usb-storage 
opkg install usbutils 
lsusb -t 
    Буде виведено список портів USB-концентратора пристрою та підключених зовнішніх пристроїв зберігання даних:

root@LEDE45:~# lsusb -t
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
    |__ Port 1: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 480M
    
    Створіть розділ на USB-диску

opkg install gdisk
gdisk /dev/sda
n ... w  y
ls -l /dev/sd*
root@LEDE45:~# gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.1

Partition table scan:
  MBR: not present
  BSD: not present
  APM: not present
  GPT: not present

Creating new GPT entries.

Command (? for help): ?
b       back up GPT data to a file
c       change a partition's name
d       delete a partition
i       show detailed information on a partition
l       list known partition types
n       add a new partition
o       create a new empty GUID partition table (GPT)
p       print the partition table
q       quit without saving changes
r       recovery and transformation options (experts only)
s       sort partitions
t       change a partition's type code
v       verify disk
w       write table to disk and exit
x       extra functionality (experts only)
?       print this menu

Command (? for help): n
Partition number (1-128, default 1):
First sector (34-4108254, default = 2048) or {+-}size{KMGTP}:
Last sector (2048-4108254, default = 4108254) or {+-}size{KMGTP}:
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300):
Changed type of partition to 'Linux filesystem'

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sda.
The operation has completed successfully.

root@LEDE45:~# ls -l /dev/sd*
brw-------    1 root     root        8,   0 Apr  8 18:31 /dev/sda
brw-------    1 root     root        8,   1 Apr  8 18:31 /dev/sda1

    Для SSD-дисків і флеш-накопичувачів установіть файлову систему F2FS і використовуйте F2FS для форматування розділу

opkg install f2fs-tools
opkg install kmod-fs-f2fs
mkfs.f2fs /dev/sda1
root@LEDE45:~# mkfs.f2fs /dev/sda1

        F2FS-tools: mkfs.f2fs Ver: 1.8.0 (2017-02-03)

Info: Debug level = 0
Info: Label =
Info: Trim is enabled
Info: [/dev/sda1] Disk Model: Flash Disk      8.07аЪ
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 4106207 (2004 MB)
Info: zone aligned segment0 blkaddr: 256
Info: format version with
  "Linux version 4.4.182 (buildbot@builds-02.infra.lede-project.org) (gcc version 5.4.0 (LEDE GCC 5.4.0 r3101-

bce140e) ) #0 Tue Jun 18 18:45:43 2019"
Info: [/dev/sda1] Discarding device
Info: This device doesn't support BLKSECDISCARD
Info: This device doesn't support BLKDISCARD
Info: Overprovision ratio = 4.520%
Info: Overprovision segments = 94 (GC reserved = 52)
Info: format successful
mount /dev/sda1 /mnt/sda1
Checking and repairs to F2FS file systems 
fsck.f2fs -f /dev/sdxY













Немає коментарів:

Дописати коментар