linux:openwrt:adding_usb_drive

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
linux:openwrt:adding_usb_drive [2022/08/23 03:30] – [パッケージ インストール] ともやんlinux:openwrt:adding_usb_drive [2022/08/23 04:22] (現在) – [パッケージ インストール] ともやん
行 3: 行 3:
 ===== パッケージ インストール ===== ===== パッケージ インストール =====
 [[opkg>block-mount]] - ブロックマウント ([[ow>docs/techref/block_mount|[OpenWrt Wiki] Mounting Block Devices]])\\ [[opkg>block-mount]] - ブロックマウント ([[ow>docs/techref/block_mount|[OpenWrt Wiki] Mounting Block Devices]])\\
-[[opkg>e2fsprogs|e2fsprogs]] - ext2ファイルシステムユーティリティ\\ +[[opkg>e2fsprogs]] - ext2 ファイルシステムユーティリティ\\ 
-[[opkg>kmod-fs-ext4|kmod-fs-ext4]] - ext4ファイルシステムサポートカーネルモジュール\\ +[[opkg>kmod-fs-ext4]] - ext4 ファイルシステムサポートするカーネルモジュール\\ 
-[[opkg>kmod-usb-storage|kmod-usb-storage]] - \\ +[[opkg>kmod-usb-storage]] - USB Mass Storage デバイスをサポートするカーネルモジュール\\ 
-[[opkg>kmod-usb2|kmod-usb2]] - \\ +[[opkg>kmod-usb2]] - USB2 (EHCI) コントローラをサポートするカーネルモジュール\\ 
-[[opkg>kmod-usb3|kmod-usb3]] - \\ +[[opkg>kmod-usb3]] - USB3 (XHCI) コントローラをサポートするカーネルモジュール\\
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
行 91: 行 90:
 </WRAP> </WRAP>
  
 +[[opkg>gdisk]] - GPT 対応のディスク パーティショニング ツール\\
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
行 126: 行 126:
 Configuring libstdcpp6. 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>
行 156: 行 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): 
行 192: 行 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
行 213: 行 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'
行 240: 行 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'
行 285: 行 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 fstab +</pre></html></WRAP> 
-root@OpenWrt:~# uci show fstab+<WRAP color_command><html><pre> 
 +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'
行 298: 行 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'
- +</pre></html></WRAP> 
-root@OpenWrt:~# /etc/init.d/fstab boot+<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
 +</pre></html></WRAP>
 +</WRAP>
  
-root@OpenWrt:~# mount+<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)
行 318: 行 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)
 +</pre></html></WRAP>
 +</WRAP>
  
-root@OpenWrt:~# df -h+<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     14.8M      1.2M  93% /overlay +/dev/ubi0_1              16.8M      2.1M     13.8M  13% /overlay 
-overlayfs:/overlay       16.8M     14.8M      1.2M  93% /+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.1661193026.txt.gz
  • 最終更新: 2022/08/23 03:30
  • by ともやん