root@pve:~# fdisk /dev/bcache0 Welcome to fdisk (util-linux 2.38.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. The device contains 'ext4' signature and it will be removed by a write command. See fdisk(8) man page and --wipe option for more details. Device does not contain a recognized partition table. The size of this disk is 4.9 TiB (5368709111808 bytes). DOS partition table format cannot be used on drives for volumes larger than 2199023255040 bytes for 512-byte sectors. Use GUID partition table format (GPT). Created a new DOS (MBR) disklabel with disk identifier 0xe2e809b2. Command (m forhelp): p Disk /dev/bcache0: 4.88 TiB, 5368709111808 bytes, 10485759984 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 Disklabel type: dos Disk identifier: 0xe2e809b2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
root@pve:~# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8:0 0 10G 0 disk └─bcache0 251:0 0 4.9T 0 disk sdb 8:16 0 30G 0 disk ├─sdb1 8:17 0 1007K 0 part ├─sdb2 8:18 0 512M 0 part └─sdb3 8:19 0 29.5G 0 part ├─pve-swap 252:0 0 3.6G 0 lvm [SWAP] ├─pve-root 252:1 0 12.9G 0 lvm / ├─pve-data_tmeta 252:2 0 1G 0 lvm │ └─pve-data 252:4 0 10.9G 0 lvm └─pve-data_tdata 252:3 0 10.9G 0 lvm └─pve-data 252:4 0 10.9G 0 lvm sdc 8:32 0 4.9T 0 disk └─bcache0 251:0 0 4.9T 0 disk sr0 11:0 1 1.2G 0 rom
虽然分区什么的都还是可以出来的而且容量显示的是4.88T,但是显示的是dos,也就是MBR分区
显示的是4.88T其实实际只能写进去2T的数据
我的解决思路是先将bcache0分区使用gdisk转成GPT分区,然后再格式化ext4并挂载
下面放 我转成GPT格式之后查看的
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
root@pve:~# fdisk /dev/bcache0 Welcome to fdisk (util-linux 2.38.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. The primary GPT table is corrupt, but the backup appears OK, so that will be used. This disk is currently in use - repartitioning is probably a bad idea. It's recommended to umount all file systems, and swapoff all swap partitions on this disk. Command (m for help): p Disk /dev/bcache0: 4.88 TiB, 5368709111808 bytes, 10485759984 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 Disklabel type: gpt Disk identifier: 0FE58467-8968-4452-85E5-EBCA7C9A2792
可以看到已经是变成GPT分区了
但是在格式化之后出现了点问题
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
root@pve:~# mkfs.ext4 /dev/bcache0 mke2fs 1.47.0 (5-Feb-2023) Found a gpt partition table in /dev/bcache0 Proceed anyway? (y,N) y Discarding device blocks: done Creating filesystem with 1310719998 4k blocks and 163840000 inodes Filesystem UUID: 30e5fe27-2d0c-4f46-ae61-23bfe2998d3b 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 Allocating group tables: done Writing inode tables: done Creating journal (262144 blocks): done Writing superblocks and filesystem accounting information: done
root@pve:~# fdisk /dev/bcache0 Welcome to fdisk (util-linux 2.38.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. The device contains 'ext4' signature and it will be removed by a write command. See fdisk(8) man page and --wipe option for more details. Device does not contain a recognized partition table. The size of this disk is 4.9 TiB (5368709111808 bytes). DOS partition table format cannot be used on drives for volumes larger than 2199023255040 bytes for 512-byte sectors. Use GUID partition table format (GPT). Created a new DOS (MBR) disklabel with disk identifier 0x929b70dc. Command (m forhelp): p Disk /dev/bcache0: 4.88 TiB, 5368709111808 bytes, 10485759984 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 Disklabel type: dos Disk identifier: 0x929b70dc Command (m forhelp):