差分
このページの2つのバージョン間の差分を表示します。
次のリビジョン | 前のリビジョン | ||
linux:openwrt:adding_usb_drive [2022/08/21 15:46] – 作成 ともやん | linux:openwrt:adding_usb_drive [2022/08/23 04:22] (現在) – [パッケージ インストール] ともやん | ||
---|---|---|---|
行 1: | 行 1: | ||
====== USB ドライブの追加 ====== | ====== USB ドライブの追加 ====== | ||
+ | |||
+ | ===== パッケージ インストール ===== | ||
+ | [[opkg> | ||
+ | [[opkg> | ||
+ | [[opkg> | ||
+ | [[opkg> | ||
+ | [[opkg> | ||
+ | [[opkg> | ||
<WRAP color_term> | <WRAP color_term> | ||
<WRAP color_command>< | <WRAP color_command>< | ||
行 29: | 行 37: | ||
Downloading https:// | Downloading https:// | ||
Signature check passed. | Signature check passed. | ||
- | Package | + | Installing |
- | Package | + | Downloading https:// |
- | Package | + | Installing |
+ | Downloading https:// | ||
+ | Installing libcomerr0 (1.45.6-2) | ||
+ | Downloading https:// | ||
+ | Installing libss2 (1.45.6-2) to root... | ||
+ | Downloading https:// | ||
+ | Installing libext2fs2 (1.45.6-2) to root... | ||
+ | Downloading https:// | ||
+ | Installing | ||
+ | Downloading https:// | ||
+ | Installing kmod-lib-crc16 (5.4.188-1) | ||
+ | Downloading https:// | ||
+ | Installing kmod-crypto-hash (5.4.188-1) to root... | ||
+ | Downloading https:// | ||
+ | Installing kmod-crypto-crc32c (5.4.188-1) to root... | ||
+ | Downloading https:// | ||
Installing kmod-usb-storage (5.4.188-1) to root... | Installing kmod-usb-storage (5.4.188-1) to root... | ||
Downloading https:// | Downloading https:// | ||
行 43: | 行 66: | ||
Configuring kmod-scsi-core. | Configuring kmod-scsi-core. | ||
Configuring kmod-usb-storage. | Configuring kmod-usb-storage. | ||
+ | Configuring kmod-crypto-hash. | ||
Configuring kmod-phy-bcm-ns-usb3. | Configuring kmod-phy-bcm-ns-usb3. | ||
+ | Configuring kmod-lib-crc16. | ||
+ | Configuring kmod-crypto-crc32c. | ||
+ | Configuring block-mount. | ||
Configuring kmod-usb3. | Configuring kmod-usb3. | ||
+ | Configuring kmod-fs-ext4. | ||
+ | Configuring libcomerr0. | ||
+ | Configuring libss2. | ||
+ | Configuring libext2fs2. | ||
+ | Configuring e2fsprogs. | ||
</ | </ | ||
</ | </ | ||
行 52: | 行 84: | ||
# ls -al /dev/sd* | # ls -al /dev/sd* | ||
</ | </ | ||
- | < | + | < |
- | brw------- | + | brw------- |
- | brw------- | + | brw------- |
- | brw------- | + | |
</ | </ | ||
</ | </ | ||
+ | [[opkg> | ||
<WRAP color_term> | <WRAP color_term> | ||
<WRAP color_command>< | <WRAP color_command>< | ||
# opkg update && opkg install gdisk | # opkg update && opkg install gdisk | ||
</ | </ | ||
- | < | + | < |
+ | Downloading https:// | ||
+ | Updated list of available packages in / | ||
+ | Downloading https:// | ||
+ | Signature check passed. | ||
+ | Downloading https:// | ||
+ | Updated list of available packages in / | ||
+ | Downloading https:// | ||
+ | Signature check passed. | ||
+ | Downloading https:// | ||
+ | Updated list of available packages in / | ||
+ | Downloading https:// | ||
+ | Signature check passed. | ||
+ | Downloading https:// | ||
+ | Updated list of available packages in / | ||
+ | Downloading https:// | ||
+ | Signature check passed. | ||
+ | Downloading https:// | ||
+ | Updated list of available packages in / | ||
+ | Downloading https:// | ||
+ | Signature check passed. | ||
+ | Downloading https:// | ||
+ | Updated list of available packages in / | ||
+ | Downloading https:// | ||
+ | Signature check passed. | ||
Installing gdisk (1.0.6-1) to root... | Installing gdisk (1.0.6-1) to root... | ||
Downloading https:// | Downloading https:// | ||
+ | Installing libstdcpp6 (8.4.0-3) to root... | ||
+ | Downloading https:// | ||
+ | Configuring libstdcpp6. | ||
Configuring gdisk. | Configuring gdisk. | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
+ | # gdisk -l /dev/sda | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
+ | GPT fdisk (gdisk) version 1.0.6 | ||
+ | |||
+ | Warning: Partition table header claims that the size of partition table | ||
+ | entries is 0 bytes, but this program | ||
+ | Adjusting accordingly, | ||
+ | Warning: Partition table header claims that the size of partition table | ||
+ | entries is 0 bytes, but this program | ||
+ | Adjusting accordingly, | ||
+ | Partition table scan: | ||
+ | MBR: MBR only | ||
+ | BSD: not present | ||
+ | APM: not present | ||
+ | GPT: not present | ||
+ | |||
+ | |||
+ | *************************************************************** | ||
+ | Found invalid GPT and valid MBR; converting MBR to GPT format | ||
+ | in memory. | ||
+ | *************************************************************** | ||
+ | |||
+ | Disk /dev/sda: 30183424 sectors, 14.4 GiB | ||
+ | Model: USB Flash Disk | ||
+ | Sector size (logical/ | ||
+ | Disk identifier (GUID): 5BE1B0DB-D482-4871-B45D-3848D43639CB | ||
+ | Partition table holds up to 128 entries | ||
+ | Main partition table begins at sector 2 and ends at sector 33 | ||
+ | First usable sector is 34, last usable sector is 30183390 | ||
+ | Partitions will be aligned on 2048-sector boundaries | ||
+ | Total free space is 4029 sectors (2.0 MiB) | ||
+ | |||
+ | Number | ||
+ | | ||
</ | </ | ||
</ | </ | ||
行 97: | 行 196: | ||
*************************************************************** | *************************************************************** | ||
- | |||
- | Warning! Secondary partition table overlaps the last partition by | ||
- | 14 blocks! | ||
- | Try reducing the partition table size by 56 entries. | ||
- | (Use the ' | ||
Command (? for help): p | Command (? for help): p | ||
- | Disk / | + | Disk / |
- | Model: | + | Model: |
Sector size (logical/ | Sector size (logical/ | ||
- | Disk identifier (GUID): | + | Disk identifier (GUID): |
Partition table holds up to 128 entries | Partition table holds up to 128 entries | ||
Main partition table begins at sector 2 and ends at sector 33 | Main partition table begins at sector 2 and ends at sector 33 | ||
- | First usable sector is 34, last usable sector is 15433694 | + | First usable sector is 34, last usable sector is 30183390 |
- | Partitions will be aligned on 1-sector boundaries | + | Partitions will be aligned on 2048-sector boundaries |
- | Total free space is 2014 sectors (1007.0 KiB) | + | Total free space is 4029 sectors (2.0 MiB) |
Number | Number | ||
- | | + | |
- | | + | |
- | + | ||
- | Command (? for help): d | + | |
- | Partition number (1-2): 2 | + | |
Command (? for help): d | Command (? for help): d | ||
Using 1 | Using 1 | ||
+ | |||
+ | Command (? for help): p | ||
+ | Disk /dev/sda: 30183424 sectors, 14.4 GiB | ||
+ | Model: USB Flash Disk | ||
+ | Sector size (logical/ | ||
+ | Disk identifier (GUID): 82D735FF-88D8-4779-87A9-9BF0DCAC248C | ||
+ | Partition table holds up to 128 entries | ||
+ | Main partition table begins at sector 2 and ends at sector 33 | ||
+ | First usable sector is 34, last usable sector is 30183390 | ||
+ | Partitions will be aligned on 2048-sector boundaries | ||
+ | Total free space is 30183357 sectors (14.4 GiB) | ||
+ | |||
+ | Number | ||
Command (? for help): n | Command (? for help): n | ||
Partition number (1-128, default 1): | Partition number (1-128, default 1): | ||
- | First sector (34-15433694, default = 34) or {+-}size{KMGTP}: | + | First sector (34-30183390, default = 2048) or {+-}size{KMGTP}: |
- | Last sector (34-15433694, default = 15433694) or {+-}size{KMGTP}: | + | Information: |
+ | order to align on 2048-sector boundaries. | ||
+ | Use ' | ||
+ | Last sector (2048-30183390, default = 30183390) or {+-}size{KMGTP}: | ||
Current type is 8300 (Linux filesystem) | Current type is 8300 (Linux filesystem) | ||
Hex code or GUID (L to show codes, Enter = 8300): | Hex code or GUID (L to show codes, Enter = 8300): | ||
行 133: | 行 239: | ||
Command (? for help): p | Command (? for help): p | ||
- | Disk / | + | Disk / |
- | Model: | + | Model: |
Sector size (logical/ | Sector size (logical/ | ||
- | Disk identifier (GUID): | + | Disk identifier (GUID): |
Partition table holds up to 128 entries | Partition table holds up to 128 entries | ||
Main partition table begins at sector 2 and ends at sector 33 | Main partition table begins at sector 2 and ends at sector 33 | ||
- | First usable sector is 34, last usable sector is 15433694 | + | First usable sector is 34, last usable sector is 30183390 |
- | Partitions will be aligned on 1-sector boundaries | + | Partitions will be aligned on 2048-sector boundaries |
- | Total free space is 0 sectors (0 bytes) | + | Total free space is 2014 sectors (1007.0 KiB) |
Number | Number | ||
- | | + | |
Command (? for help): w | Command (? for help): w | ||
行 154: | 行 260: | ||
OK; writing new GUID partition table (GPT) to /dev/sda. | OK; writing new GUID partition table (GPT) to /dev/sda. | ||
The operation has completed successfully. | The operation has completed successfully. | ||
- | root@OpenWrt: | + | </ |
- | mkfs.ext2 | + | </ |
- | root@OpenWrt:~# mkfs.ext4 /dev/sda | + | |
- | sda sda1 | + | <WRAP color_term> |
- | root@OpenWrt: | + | <WRAP color_command>< |
+ | root@TomoyanWRT-ow:~# mkfs.ext4 /dev/sda1 | ||
+ | </pre></html></ | ||
+ | <WRAP color_result>< | ||
mke2fs 1.45.6 (20-Mar-2020) | mke2fs 1.45.6 (20-Mar-2020) | ||
- | Creating filesystem with 1929207 | + | /dev/sda1 contains a ntfs file system |
- | Filesystem UUID: 941c47f3-f75e-4ff1-9875-858deacd2332 | + | Proceed anyway? (y,N) y |
+ | Creating filesystem with 3772667 | ||
+ | Filesystem UUID: b993d801-42ca-4275-ab3f-ec29ecba4da1 | ||
Superblock backups stored on blocks: | Superblock backups stored on blocks: | ||
- | 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632 | + | 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208 |
Allocating group tables: done | Allocating group tables: done | ||
Writing inode tables: done | Writing inode tables: done | ||
Creating journal (16384 blocks): done | Creating journal (16384 blocks): done | ||
- | Writing superblocks and filesystem accounting information: | + | Writing superblocks and filesystem accounting information: |
+ | </ | ||
+ | </ | ||
- | root@OpenWrt:~# block detect | + | <WRAP color_term> |
+ | <WRAP color_command>< | ||
+ | root@TomoyanWRT-ow:~# block detect | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
config ' | config ' | ||
option anon_swap ' | option anon_swap ' | ||
行 181: | 行 298: | ||
config ' | config ' | ||
option target '/ | option target '/ | ||
- | option uuid ' | + | option uuid ' |
option enabled ' | option enabled ' | ||
- | + | </pre></html>< | |
- | root@OpenWrt: | + | <WRAP color_command>< |
- | GPT fdisk (gdisk) version 1.0.6 | + | root@TomoyanWRT-ow:~# block detect | uci import fstab |
- | + | </ | |
- | Partition table scan: | + | <WRAP color_command>< |
- | MBR: protective | + | root@TomoyanWRT-ow:~# uci show fstab |
- | BSD: not present | + | </ |
- | APM: not present | + | <WRAP color_result>< |
- | GPT: present | + | |
- | + | ||
- | Found valid GPT with protective MBR; using GPT. | + | |
- | Disk /dev/sda: 15433728 sectors, 7.4 GiB | + | |
- | Model: Transcend 8GB | + | |
- | Sector size (logical/ | + | |
- | Disk identifier (GUID): 85CEDCED-CE42-4423-8E5D-FA5A84A30F51 | + | |
- | Partition table holds up to 128 entries | + | |
- | Main partition table begins at sector 2 and ends at sector 33 | + | |
- | First usable sector is 34, last usable sector is 15433694 | + | |
- | Partitions will be aligned on 2-sector boundaries | + | |
- | Total free space is 0 sectors (0 bytes) | + | |
- | + | ||
- | Number | + | |
- | | + | |
- | root@OpenWrt:~# cat / | + | |
- | config ' | + | |
- | option anon_swap ' | + | |
- | option anon_mount ' | + | |
- | option auto_swap ' | + | |
- | option auto_mount ' | + | |
- | option delay_root ' | + | |
- | option check_fs ' | + | |
- | + | ||
- | root@OpenWrt:~# block detect | uci import fstab | + | |
- | root@OpenWrt:~# uci show fstab | + | |
fstab.@global[0]=global | fstab.@global[0]=global | ||
fstab.@global[0].anon_swap=' | fstab.@global[0].anon_swap=' | ||
行 226: | 行 317: | ||
fstab.@mount[0]=mount | fstab.@mount[0]=mount | ||
fstab.@mount[0].target='/ | fstab.@mount[0].target='/ | ||
- | fstab.@mount[0].uuid=' | + | fstab.@mount[0].uuid=' |
fstab.@mount[0].enabled=' | fstab.@mount[0].enabled=' | ||
- | root@OpenWrt:~# uci set fstab.@mount[0].enabled=' | + | </ |
- | ab | + | <WRAP color_command>< |
- | root@OpenWrt:~# uci show fstab | + | root@TomoyanWRT-ow:~# uci set fstab.@mount[0].enabled=' |
+ | </ | ||
+ | <WRAP color_command>< | ||
+ | root@TomoyanWRT-ow:~# uci show fstab | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
fstab.@global[0]=global | fstab.@global[0]=global | ||
fstab.@global[0].anon_swap=' | fstab.@global[0].anon_swap=' | ||
行 240: | 行 336: | ||
fstab.@mount[0]=mount | fstab.@mount[0]=mount | ||
fstab.@mount[0].target='/ | fstab.@mount[0].target='/ | ||
- | fstab.@mount[0].uuid=' | + | fstab.@mount[0].uuid=' |
fstab.@mount[0].enabled=' | fstab.@mount[0].enabled=' | ||
- | root@OpenWrt:~# / | + | </ |
+ | <WRAP color_command>< | ||
+ | root@TomoyanWRT-ow:~# / | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
block: No " | block: No " | ||
block: mounting / | block: mounting / | ||
- | root@OpenWrt:~# mount | + | </ |
+ | </ | ||
+ | |||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
+ | root@TomoyanWRT-ow:~# mount | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
/dev/root on /rom type squashfs (ro, | /dev/root on /rom type squashfs (ro, | ||
proc on /proc type proc (rw, | proc on /proc type proc (rw, | ||
行 258: | 行 365: | ||
none on /sys/fs/bpf type bpf (rw, | none on /sys/fs/bpf type bpf (rw, | ||
/dev/sda1 on /mnt/sda1 type ext4 (rw, | /dev/sda1 on /mnt/sda1 type ext4 (rw, | ||
- | root@OpenWrt:~# df -h | + | </ |
+ | </ | ||
+ | |||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
+ | root@TomoyanWRT-ow:~# df -h | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
Filesystem | Filesystem | ||
/ | / | ||
- | tmpfs | + | tmpfs |
/ | / | ||
overlayfs:/ | overlayfs:/ | ||
tmpfs | tmpfs | ||
- | / | + | / |
</ | </ | ||
</ | </ |