在RAID 1中,如何更改分区的文件系统?

分享于 

4分钟阅读

互联网

  繁體

问题:

我尝试了一个mkfs.xfs /dev/md2,但它不能工作:


root@Debian-105-buster-64-minimal ~ # mkfs.xfs /dev/md2


mkfs.xfs: /dev/md2 contains a mounted filesystem



我也不知道该如何卸载/装载。

df -Th命令:


root@Debian-105-buster-64-minimal ~ # df -Th


Filesystem Type Size Used Avail Use% Mounted on


udev devtmpfs 32G 0 32G 0% /dev


tmpfs tmpfs 6.3G 516K 6.3G 1% /run


/dev/md2 ext4 437G 1.2G 413G 1% /


tmpfs tmpfs 32G 0 32G 0% /dev/shm


tmpfs tmpfs 5.0M 0 5.0M 0% /run/lock


tmpfs tmpfs 32G 0 32G 0% /sys/fs/cgroup


/dev/md1 ext3 487M 53M 409M 12% /boot


tmpfs tmpfs 6.3G 0 6.3G 0% /run/user/1000



fdisk -l命令:


root@Debian-105-buster-64-minimal ~ # fdisk -l


Disk /dev/nvme0n1: 477 GiB, 512110190592 bytes, 1000215216 sectors


Disk model: SAMSUNG MZVLB512HAJQ-00000


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: 0x0289e0d1



Device Boot Start End Sectors Size Id Type


/dev/nvme0n1p1 2048 67110911 67108864 32G fd Linux raid autodetect


/dev/nvme0n1p2 67110912 68159487 1048576 512M fd Linux raid autodetect


/dev/nvme0n1p3 68159488 1000213167 932053680 444.4G fd Linux raid autodetect



Disk /dev/nvme1n1: 477 GiB, 512110190592 bytes, 1000215216 sectors


Disk model: SAMSUNG MZVLB512HAJQ-00000


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: 0xbcb5c0d2



Device Boot Start End Sectors Size Id Type


/dev/nvme1n1p1 2048 67110911 67108864 32G fd Linux raid autodetect


/dev/nvme1n1p2 67110912 68159487 1048576 512M fd Linux raid autodetect


/dev/nvme1n1p3 68159488 1000213167 932053680 444.4G fd Linux raid autodetect



Disk /dev/md1: 511 MiB, 535822336 bytes, 1046528 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/md0: 32 GiB, 34325135360 bytes, 67041280 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/md2: 444.3 GiB, 477076193280 bytes, 931789440 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



mdstat:


root@Debian-105-buster-64-minimal ~ # cat /proc/mdstat


Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]


md2 : active raid1 nvme0n1p3[0] nvme1n1p3[1]


 465894720 blocks super 1.2 [2/2] [UU]


 bitmap: 0/4 pages [0KB], 65536KB chunk



md0 : active (auto-read-only) raid1 nvme0n1p1[0] nvme1n1p1[1]


 33520640 blocks super 1.2 [2/2] [UU]


 resync=PENDING



md1 : active raid1 nvme0n1p2[0] nvme1n1p2[1]


 523264 blocks super 1.2 [2/2] [UU]



unused devices: <none>




答案1:

/dev/md2是您的根文件系统,因此,如果仅格式化该文件,则意味着服务器将永久消失。


唯一的选择是从头开始重新运行安装,并且在设置磁盘时更改默认选项。


文件  PAR  SYS  系统  分区  RAID