查看分区表:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
root@amd:~# fdisk -l Disk /dev/loop0: 61.93 MiB, 64917504 bytes, 126792 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/loop1: 67.25 MiB, 70508544 bytes, 137712 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/loop2: 43.6 MiB, 45703168 bytes, 89264 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/nvme1n1: 1.88 TiB, 2048408248320 bytes, 4000797360 sectors Disk model: HP SSD FX900 Pro 2TB Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: DABF9F62-3DAD-194D-B359-1D042B991FA0 Device Start End Sectors Size Type /dev/nvme1n1p1 2048 4000797326 4000795279 1.9T Linux filesystem Disk /dev/nvme0n1: 1.88 TiB, 2048408248320 bytes, 4000797360 sectors Disk model: HP SSD FX900 Pro 2TB Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: F24FA021-CA6B-49F8-AA4B-6C5B6164B1AD Device Start End Sectors Size Type /dev/nvme0n1p1 2048 2203647 2201600 1.1G EFI System /dev/nvme0n1p2 2203648 5349375 3145728 1.5G Linux filesystem /dev/nvme0n1p3 5349376 4000794623 3995445248 1.9T Linux filesystem Disk /dev/sda: 3.74 TiB, 4096805658624 bytes, 8001573552 sectors Disk model: Colorful SL500 4 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/md127: 14.93 TiB, 16386680160256 bytes, 32005234688 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 524288 bytes / 2097152 bytes Disk /dev/sdc: 3.74 TiB, 4096805658624 bytes, 8001573552 sectors Disk model: Colorful SL500 4 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/sdd: 3.74 TiB, 4096805658624 bytes, 8001573552 sectors Disk model: Colorful SL500 4 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/sdb: 3.74 TiB, 4096805658624 bytes, 8001573552 sectors Disk model: Colorful SL500 4 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 200 GiB, 214748364800 bytes, 419430400 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/mapper/ubuntu--vg-lv--0: 200 GiB, 214748364800 bytes, 419430400 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/mapper/ubuntu--vg-lv--1: 1.48 TiB, 1616170188800 bytes, 3156582400 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes |
查看软RAID:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
root@amd:~# mdadm /dev/md127 /dev/md127: 15261.29GiB raid0 4 devices, 0 spares. Use mdadm --detail for more detail. root@amd-r06:~# mdadm --detail /dev/md127 /dev/md127: Version : 1.2 Creation Time : Tue Aug 23 09:31:13 2022 Raid Level : raid0 Array Size : 16002617344 (15261.29 GiB 16386.68 GB) Raid Devices : 4 Total Devices : 4 Persistence : Superblock is persistent Update Time : Tue Aug 23 09:31:13 2022 State : clean Active Devices : 4 Working Devices : 4 Failed Devices : 0 Spare Devices : 0 Layout : -unknown- Chunk Size : 512K Consistency Policy : none Name : amd-r06:0 (local to host amd-r06) UUID : bde4c9c3:9ec6ebf3:bb09406f:cc6f9ce2 Events : 0 Number Major Minor RaidDevice State 0 8 0 0 active sync /dev/sda 1 8 16 1 active sync /dev/sdb 2 8 32 2 active sync /dev/sdc 3 8 48 3 active sync /dev/sdd |
创建文件系统:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
root@amd:~# mkfs.ext4 /dev/md127 mke2fs 1.45.5 (07-Jan-2020) /dev/md127 contains a xfs file system Proceed anyway? (y,N) y Discarding device blocks: done Creating filesystem with 4000654336 4k blocks and 500084736 inodes Filesystem UUID: 08375af0-ab1b-490f-93d3-6c50234098fd Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000, 214990848, 512000000, 550731776, 644972544, 1934917632, 2560000000, 3855122432 Allocating group tables: done Writing inode tables: done Creating journal (262144 blocks): done Writing superblocks and filesystem accounting information: done |
mdadm和fdisk都看不出文件系统:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
root@amd:~# mdadm --detail /dev/md127 /dev/md127: Version : 1.2 Creation Time : Tue Aug 23 09:31:13 2022 Raid Level : raid0 Array Size : 16002617344 (15261.29 GiB 16386.68 GB) Raid Devices : 4 Total Devices : 4 Persistence : Superblock is persistent Update Time : Tue Aug 23 09:31:13 2022 State : clean Active Devices : 4 Working Devices : 4 Failed Devices : 0 Spare Devices : 0 Layout : -unknown- Chunk Size : 512K Consistency Policy : none Name : amd:0 (local to host amd) UUID : bde4c9c3:9ec6ebf3:bb09406f:cc6f9ce2 Events : 0 Number Major Minor RaidDevice State 0 8 0 0 active sync /dev/sda 1 8 16 1 active sync /dev/sdb 2 8 32 2 active sync /dev/sdc 3 8 48 3 active sync /dev/sdd root@amd:~# fdisk -l Disk /dev/loop0: 61.93 MiB, 64917504 bytes, 126792 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/loop1: 67.25 MiB, 70508544 bytes, 137712 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/loop2: 43.6 MiB, 45703168 bytes, 89264 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/nvme0n1: 1.88 TiB, 2048408248320 bytes, 4000797360 sectors Disk model: HP SSD FX900 Pro 2TB Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: F24FA021-CA6B-49F8-AA4B-6C5B6164B1AD Device Start End Sectors Size Type /dev/nvme0n1p1 2048 2203647 2201600 1.1G EFI System /dev/nvme0n1p2 2203648 5349375 3145728 1.5G Linux filesystem /dev/nvme0n1p3 5349376 4000794623 3995445248 1.9T Linux filesystem Disk /dev/nvme1n1: 1.88 TiB, 2048408248320 bytes, 4000797360 sectors Disk model: HP SSD FX900 Pro 2TB Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/sdc: 3.74 TiB, 4096805658624 bytes, 8001573552 sectors Disk model: Colorful SL500 4 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/sdb: 3.74 TiB, 4096805658624 bytes, 8001573552 sectors Disk model: Colorful SL500 4 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/sda: 3.74 TiB, 4096805658624 bytes, 8001573552 sectors Disk model: Colorful SL500 4 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/md127: 14.93 TiB, 16386680160256 bytes, 32005234688 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 524288 bytes / 2097152 bytes Disk /dev/sdd: 3.74 TiB, 4096805658624 bytes, 8001573552 sectors Disk model: Colorful SL500 4 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 200 GiB, 214748364800 bytes, 419430400 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/mapper/ubuntu--vg-lv--0: 200 GiB, 214748364800 bytes, 419430400 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/mapper/ubuntu--vg-lv--1: 3.34 TiB, 3664575987712 bytes, 7157374976 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes |
挂载:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
root@amd:~# mount /dev/md127 /home/shared_data/ root@amd:~# df -h Filesystem Size Used Avail Use% Mounted on udev 498G 0 498G 0% /dev tmpfs 100G 16M 100G 1% /run /dev/mapper/ubuntu--vg-ubuntu--lv 196G 11G 176G 6% / tmpfs 498G 4.0K 498G 1% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 498G 0 498G 0% /sys/fs/cgroup /dev/nvme0n1p2 1.5G 111M 1.3G 8% /boot /dev/nvme0n1p1 1.1G 5.3M 1.1G 1% /boot/efi /dev/loop0 62M 62M 0 100% /snap/core20/1328 /dev/mapper/ubuntu--vg-lv--1 3.3T 68M 3.2T 1% /home /dev/loop1 68M 68M 0 100% /snap/lxd/21835 /dev/loop2 44M 44M 0 100% /snap/snapd/14978 tmpfs 100G 0 100G 0% /run/user/1000 /dev/md127 15T 14M 15T 1% /home/shared_data |
开机自动挂载:
1 2 3 4 5 6 7 8 9 |
root@amd:~# sudo mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf ARRAY /dev/md/amd:0 metadata=1.2 name=amd:0 UUID=bde4c9c3:9ec6ebf3:bb09406f:cc6f9ce2 root@amd:~# sudo update-initramfs -u update-initramfs: Generating /boot/initrd.img-5.4.0-100-generic I: The initramfs will attempt to resume from /dev/dm-1 I: (/dev/mapper/ubuntu--vg-lv--0) I: Set the RESUME variable to override this. root@amd:~# echo '/dev/md127 /home/shared_data ext4 defaults,nofail,discard 0 0' | sudo tee -a /etc/fstab /dev/md127 /home/shared_data ext4 defaults,nofail,discard 0 0 |
转载时请保留出处,违法转载追究到底:进城务工人员小梅 » Ubuntu 20.04自动挂载软RAID