差分

このページの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>block-mount]] - ブロックマウント ([[ow>docs/techref/block_mount|[OpenWrt Wiki] Mounting Block Devices]])\\
 +[[opkg>e2fsprogs]] - ext2 ファイルシステムユーティリティ\\
 +[[opkg>kmod-fs-ext4]] - ext4 ファイルシステムをサポートするカーネルモジュール\\
 +[[opkg>kmod-usb-storage]] - USB Mass Storage デバイスをサポートするカーネルモジュール\\
 +[[opkg>kmod-usb2]] - USB2 (EHCI) コントローラをサポートするカーネルモジュール\\
 +[[opkg>kmod-usb3]] - USB3 (XHCI) コントローラをサポートするカーネルモジュール\\
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
行 29: 行 37:
 Downloading https://downloads.openwrt.org/releases/21.02.3/packages/arm_cortex-a9/telephony/Packages.sig Downloading https://downloads.openwrt.org/releases/21.02.3/packages/arm_cortex-a9/telephony/Packages.sig
 Signature check passed. Signature check passed.
-Package block-mount (2021-01-04-c53b1882-1) installed in root is up to date+Installing block-mount (2021-01-04-c53b1882-1) to root... 
-Package e2fsprogs (1.45.6-2) installed in root is up to date+Downloading https://downloads.openwrt.org/releases/21.02.3/targets/bcm53xx/generic/packages/block-mount_2021-01-04-c53b1882-1_arm_cortex-a9.ipk 
-Package kmod-fs-ext4 (5.4.188-1) installed in root is up to date.+Installing e2fsprogs (1.45.6-2) to root... 
 +Downloading https://downloads.openwrt.org/releases/21.02.3/packages/arm_cortex-a9/base/e2fsprogs_1.45.6-2_arm_cortex-a9.ipk 
 +Installing libcomerr0 (1.45.6-2) to root... 
 +Downloading https://downloads.openwrt.org/releases/21.02.3/packages/arm_cortex-a9/base/libcomerr0_1.45.6-2_arm_cortex-a9.ipk 
 +Installing libss2 (1.45.6-2) to root... 
 +Downloading https://downloads.openwrt.org/releases/21.02.3/packages/arm_cortex-a9/base/libss2_1.45.6-2_arm_cortex-a9.ipk 
 +Installing libext2fs2 (1.45.6-2) to root... 
 +Downloading https://downloads.openwrt.org/releases/21.02.3/packages/arm_cortex-a9/base/libext2fs2_1.45.6-2_arm_cortex-a9.ipk 
 +Installing kmod-fs-ext4 (5.4.188-1) to root... 
 +Downloading https://downloads.openwrt.org/releases/21.02.3/targets/bcm53xx/generic/packages/kmod-fs-ext4_5.4.188-1_arm_cortex-a9.ipk 
 +Installing kmod-lib-crc16 (5.4.188-1) to root... 
 +Downloading https://downloads.openwrt.org/releases/21.02.3/targets/bcm53xx/generic/packages/kmod-lib-crc16_5.4.188-1_arm_cortex-a9.ipk 
 +Installing kmod-crypto-hash (5.4.188-1) to root... 
 +Downloading https://downloads.openwrt.org/releases/21.02.3/targets/bcm53xx/generic/packages/kmod-crypto-hash_5.4.188-1_arm_cortex-a9.ipk 
 +Installing kmod-crypto-crc32c (5.4.188-1) to root... 
 +Downloading https://downloads.openwrt.org/releases/21.02.3/targets/bcm53xx/generic/packages/kmod-crypto-crc32c_5.4.188-1_arm_cortex-a9.ipk
 Installing kmod-usb-storage (5.4.188-1) to root... Installing kmod-usb-storage (5.4.188-1) to root...
 Downloading https://downloads.openwrt.org/releases/21.02.3/targets/bcm53xx/generic/packages/kmod-usb-storage_5.4.188-1_arm_cortex-a9.ipk Downloading https://downloads.openwrt.org/releases/21.02.3/targets/bcm53xx/generic/packages/kmod-usb-storage_5.4.188-1_arm_cortex-a9.ipk
行 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.
 </pre></html></WRAP> </pre></html></WRAP>
 </WRAP> </WRAP>
行 53: 行 85:
 </pre></html></WRAP> </pre></html></WRAP>
 <WRAP color_result><html><pre> <WRAP color_result><html><pre>
-brw-------    1 root     root        8,   0 Aug 21 06:24 /dev/sda +brw-------    1 root     root        8,   0 Aug 22 22:09 /dev/sda 
-brw-------    1 root     root        8,   1 Aug 21 06:24 /dev/sda1 +brw-------    1 root     root        8,   1 Aug 22 22:09 /dev/sda1
-brw-------    1 root     root        8,   2 Aug 21 06:24 /dev/sda2+
 </pre></html></WRAP> </pre></html></WRAP>
 </WRAP> </WRAP>
  
 +[[opkg>gdisk]] - GPT 対応のディスク パーティショニング ツール\\
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
行 64: 行 96:
 </pre></html></WRAP> </pre></html></WRAP>
 <WRAP color_result><html><pre> <WRAP color_result><html><pre>
 +Downloading https://downloads.openwrt.org/releases/21.02.3/targets/bcm53xx/generic/packages/Packages.gz
 +Updated list of available packages in /var/opkg-lists/openwrt_core
 +Downloading https://downloads.openwrt.org/releases/21.02.3/targets/bcm53xx/generic/packages/Packages.sig
 +Signature check passed.
 +Downloading https://downloads.openwrt.org/releases/21.02.3/packages/arm_cortex-a9/base/Packages.gz
 +Updated list of available packages in /var/opkg-lists/openwrt_base
 +Downloading https://downloads.openwrt.org/releases/21.02.3/packages/arm_cortex-a9/base/Packages.sig
 +Signature check passed.
 +Downloading https://downloads.openwrt.org/releases/21.02.3/packages/arm_cortex-a9/luci/Packages.gz
 +Updated list of available packages in /var/opkg-lists/openwrt_luci
 +Downloading https://downloads.openwrt.org/releases/21.02.3/packages/arm_cortex-a9/luci/Packages.sig
 +Signature check passed.
 +Downloading https://downloads.openwrt.org/releases/21.02.3/packages/arm_cortex-a9/packages/Packages.gz
 +Updated list of available packages in /var/opkg-lists/openwrt_packages
 +Downloading https://downloads.openwrt.org/releases/21.02.3/packages/arm_cortex-a9/packages/Packages.sig
 +Signature check passed.
 +Downloading https://downloads.openwrt.org/releases/21.02.3/packages/arm_cortex-a9/routing/Packages.gz
 +Updated list of available packages in /var/opkg-lists/openwrt_routing
 +Downloading https://downloads.openwrt.org/releases/21.02.3/packages/arm_cortex-a9/routing/Packages.sig
 +Signature check passed.
 +Downloading https://downloads.openwrt.org/releases/21.02.3/packages/arm_cortex-a9/telephony/Packages.gz
 +Updated list of available packages in /var/opkg-lists/openwrt_telephony
 +Downloading https://downloads.openwrt.org/releases/21.02.3/packages/arm_cortex-a9/telephony/Packages.sig
 +Signature check passed.
 Installing gdisk (1.0.6-1) to root... Installing gdisk (1.0.6-1) to root...
 Downloading https://downloads.openwrt.org/releases/21.02.3/packages/arm_cortex-a9/packages/gdisk_1.0.6-1_arm_cortex-a9.ipk Downloading https://downloads.openwrt.org/releases/21.02.3/packages/arm_cortex-a9/packages/gdisk_1.0.6-1_arm_cortex-a9.ipk
 +Installing libstdcpp6 (8.4.0-3) to root...
 +Downloading https://downloads.openwrt.org/releases/21.02.3/targets/bcm53xx/generic/packages/libstdcpp6_8.4.0-3_arm_cortex-a9.ipk
 +Configuring libstdcpp6.
 Configuring gdisk. Configuring gdisk.
 +</pre></html></WRAP>
 +</WRAP>
 +
 +<WRAP color_term>
 +<WRAP color_command><html><pre>
 +# gdisk -l /dev/sda
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre>
 +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  supports only 128-byte entries.
 +Adjusting accordingly, but partition table may be garbage.
 +Warning: Partition table header claims that the size of partition table
 +entries is 0 bytes, but this program  supports only 128-byte entries.
 +Adjusting accordingly, but partition table may be garbage.
 +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/physical): 512/512 bytes
 +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  Start (sector)    End (sector)  Size       Code  Name
 +              2048        30181375   14.4 GiB    0700  Microsoft basic data
 </pre></html></WRAP> </pre></html></WRAP>
 </WRAP> </WRAP>
行 97: 行 196:
 *************************************************************** ***************************************************************
  
- 
-Warning! Secondary partition table overlaps the last partition by 
-14 blocks! 
-Try reducing the partition table size by 56 entries. 
-(Use the 's' item on the experts' menu.) 
  
 Command (? for help): p Command (? for help): p
-Disk /dev/sda: 15433728 sectors, 7.4 GiB +Disk /dev/sda: 30183424 sectors, 14.4 GiB 
-Model: Transcend 8GB   +Model: USB Flash Disk  
 Sector size (logical/physical): 512/512 bytes Sector size (logical/physical): 512/512 bytes
-Disk identifier (GUID): 85CEDCED-CE42-4423-8E5D-FA5A84A30F51+Disk identifier (GUID): 82D735FF-88D8-4779-87A9-9BF0DCAC248C
 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  Start (sector)    End (sector)  Size       Code  Name Number  Start (sector)    End (sector)  Size       Code  Name
-              2048        11239420   5.4 GiB     0700  Microsoft basic data +              2048        30181375   14.4 GiB    0700  Microsoft basic data
-          11239421        15433708   2.0 GiB     8300  Linux filesystem +
- +
-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/physical): 512/512 bytes
 +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  Start (sector)    End (sector)  Size       Code  Name
  
 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}: 34 
-Last sector (34-15433694, default = 15433694) or {+-}size{KMGTP}: +Information: Moved requested sector from 34 to 2048 in 
 +order to align on 2048-sector boundaries. 
 +Use 'l' on the experts' menu to adjust alignment 
 +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 /dev/sda: 15433728 sectors, 7.4 GiB +Disk /dev/sda: 30183424 sectors, 14.4 GiB 
-Model: Transcend 8GB   +Model: USB Flash Disk  
 Sector size (logical/physical): 512/512 bytes Sector size (logical/physical): 512/512 bytes
-Disk identifier (GUID): 85CEDCED-CE42-4423-8E5D-FA5A84A30F51+Disk identifier (GUID): 82D735FF-88D8-4779-87A9-9BF0DCAC248C
 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 sectors (0 bytes)+Total free space is 2014 sectors (1007.KiB)
  
 Number  Start (sector)    End (sector)  Size       Code  Name Number  Start (sector)    End (sector)  Size       Code  Name
-                34        15433694   7.4 GiB     8300  Linux filesystem+              2048        30183390   14.4 GiB    8300  Linux filesystem
  
 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.ext +</pre></html></WRAP> 
-mkfs.ext2  mkfs.ext3  mkfs.ext4 +</WRAP> 
-root@OpenWrt:~# mkfs.ext4 /dev/sda + 
-sda   sda1 +<WRAP color_term> 
-root@OpenWrt:~# mkfs.ext4 /dev/sda1+<WRAP color_command><html><pre> 
 +root@TomoyanWRT-ow:~# mkfs.ext4 /dev/sda1 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre>
 mke2fs 1.45.6 (20-Mar-2020) mke2fs 1.45.6 (20-Mar-2020)
-Creating filesystem with 1929207 4k blocks and 482384 inodes +/dev/sda1 contains a ntfs file system 
-Filesystem UUID: 941c47f3-f75e-4ff1-9875-858deacd2332+Proceed anyway? (y,N) y 
 +Creating filesystem with 3772667 4k blocks and 944704 inodes 
 +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: done +Writing superblocks and filesystem accounting information: done    
 +</pre></html></WRAP> 
 +</WRAP>
  
-root@OpenWrt:~# block detect+<WRAP color_term> 
 +<WRAP color_command><html><pre> 
 +root@TomoyanWRT-ow:~# block detect 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre>
 config 'global' config 'global'
  option anon_swap '0'  option anon_swap '0'
行 181: 行 298:
 config 'mount' config 'mount'
  option target '/mnt/sda1'  option target '/mnt/sda1'
- option uuid '941c47f3-f75e-4ff1-9875-858deacd2332'+ option uuid 'b993d801-42ca-4275-ab3f-ec29ecba4da1'
  option enabled '0'  option enabled '0'
- +</pre></html></WRAP> 
-root@OpenWrt:~# gdisk -l /dev/sda +<WRAP color_command><html><pre> 
-GPT fdisk (gdisk) version 1.0.6 +root@TomoyanWRT-ow:~# block detect | uci import fstab 
- +</pre></html></WRAP> 
-Partition table scan: +<WRAP color_command><html><pre> 
-  MBR: protective +root@TomoyanWRT-ow:~# uci show fstab 
-  BSD: not present +</pre></html></WRAP> 
-  APM: not present +<WRAP color_result><html><pre>
-  GPT: present +
- +
-Found valid GPT with protective MBR; using GPT. +
-Disk /dev/sda: 15433728 sectors, 7.4 GiB +
-Model: Transcend 8GB    +
-Sector size (logical/physical): 512/512 bytes +
-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  Start (sector)    End (sector)  Size       Code  Name +
-                34        15433694   7.4 GiB     8300  Linux filesystem +
-root@OpenWrt:~# cat /etc/config/fstab +
-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' +
- +
-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='0' fstab.@global[0].anon_swap='0'
行 226: 行 317:
 fstab.@mount[0]=mount fstab.@mount[0]=mount
 fstab.@mount[0].target='/mnt/sda1' fstab.@mount[0].target='/mnt/sda1'
-fstab.@mount[0].uuid='941c47f3-f75e-4ff1-9875-858deacd2332'+fstab.@mount[0].uuid='b993d801-42ca-4275-ab3f-ec29ecba4da1'
 fstab.@mount[0].enabled='0' fstab.@mount[0].enabled='0'
-root@OpenWrt:~# uci set fstab.@mount[0].enabled='1' && uci set fstab.@global[0].anon_mount='1' && uci commit fst +</pre></html></WRAP> 
-ab +<WRAP color_command><html><pre> 
-root@OpenWrt:~# uci show fstab+root@TomoyanWRT-ow:~# uci set fstab.@mount[0].enabled='1' && uci set fstab.@global[0].anon_mount='1' && uci commit fstab 
 +</pre></html></WRAP> 
 +<WRAP color_command><html><pre> 
 +root@TomoyanWRT-ow:~# uci show fstab 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre>
 fstab.@global[0]=global fstab.@global[0]=global
 fstab.@global[0].anon_swap='0' fstab.@global[0].anon_swap='0'
行 240: 行 336:
 fstab.@mount[0]=mount fstab.@mount[0]=mount
 fstab.@mount[0].target='/mnt/sda1' fstab.@mount[0].target='/mnt/sda1'
-fstab.@mount[0].uuid='941c47f3-f75e-4ff1-9875-858deacd2332'+fstab.@mount[0].uuid='b993d801-42ca-4275-ab3f-ec29ecba4da1'
 fstab.@mount[0].enabled='1' fstab.@mount[0].enabled='1'
-root@OpenWrt:~# /etc/init.d/fstab boot+</pre></html></WRAP> 
 +<WRAP color_command><html><pre> 
 +root@TomoyanWRT-ow:~# /etc/init.d/fstab boot 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre>
 block: No "mount.ubi" utility available block: No "mount.ubi" utility available
 block: mounting /dev/mtdblock4 (ubi) as /mnt/mtdblock4 failed (2) - No such file or directory block: mounting /dev/mtdblock4 (ubi) as /mnt/mtdblock4 failed (2) - No such file or directory
-root@OpenWrt:~# mount+</pre></html></WRAP> 
 +</WRAP> 
 + 
 +<WRAP color_term> 
 +<WRAP color_command><html><pre> 
 +root@TomoyanWRT-ow:~# mount 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre>
 /dev/root on /rom type squashfs (ro,relatime) /dev/root on /rom type squashfs (ro,relatime)
 proc on /proc type proc (rw,nosuid,nodev,noexec,noatime) proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
行 258: 行 365:
 none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,noatime,mode=700) none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,noatime,mode=700)
 /dev/sda1 on /mnt/sda1 type ext4 (rw,relatime) /dev/sda1 on /mnt/sda1 type ext4 (rw,relatime)
-root@OpenWrt:~# df -h+</pre></html></WRAP> 
 +</WRAP> 
 + 
 +<WRAP color_term> 
 +<WRAP color_command><html><pre> 
 +root@TomoyanWRT-ow:~# df -h 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre>
 Filesystem                Size      Used Available Use% Mounted on Filesystem                Size      Used Available Use% Mounted on
 /dev/root                 3.3M      3.3M         0 100% /rom /dev/root                 3.3M      3.3M         0 100% /rom
-tmpfs                   123.5M      1.1M    122.4M   1% /tmp+tmpfs                   123.5M    244.0K    123.3M   0% /tmp
 /dev/ubi0_1              16.8M      2.1M     13.8M  13% /overlay /dev/ubi0_1              16.8M      2.1M     13.8M  13% /overlay
 overlayfs:/overlay       16.8M      2.1M     13.8M  13% / overlayfs:/overlay       16.8M      2.1M     13.8M  13% /
 tmpfs                   512.0K            512.0K   0% /dev tmpfs                   512.0K            512.0K   0% /dev
-/dev/sda1                 7.2G     33.1M      6.8G   0% /mnt/sda1+/dev/sda1                14.1G     40.0M     13.3G   0% /mnt/sda1
 </pre></html></WRAP> </pre></html></WRAP>
 </WRAP> </WRAP>
  • linux/openwrt/adding_usb_drive.1661064397.txt.gz
  • 最終更新: 2022/08/21 15:46
  • by ともやん