我刚刚完成了一个Centos 7系统的新安装,该系统中有3个磁盘。最后,我得出了以下结论:
[root@nas /]# fdisk -l
Disk /dev/sda: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x000a491f
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 3907028991 1952464896 8e Linux LVM
Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00031210
Device Boot Start End Blocks Id System
/dev/sdb1 2048 3907028991 1953513472 8e Linux LVM
Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x000839dc
Device Boot Start End Blocks Id System
/dev/sdc1 2048 3907028991 1953513472 8e Linux LVM
Disk /dev/mapper/centos_nas-root: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/centos_nas-swap: 4026 MB, 4026531840 bytes, 7864320 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/centos_nas-home: 5942.4 GB, 5942389243904 bytes, 11606228992 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes和一个刺伤:
[root@nas /]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Mon Dec 3 19:45:04 2018
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos_nas-root / xfs defaults 0 0
UUID=f62f73ae-52eb-49b8-9d40-2cc274c89112 /boot xfs defaults 0 0
/dev/mapper/centos_nas-home /home xfs defaults 0 0
/dev/mapper/centos_nas-swap swap swap defaults 0 0最终,我希望第一个磁盘是带有/ etc挂载点的“系统磁盘”。
然后,我希望第二个磁盘(/dev/sdb)和第三个磁盘(/dev/sdc)成为
/disk-2
/disk-3 所以我有三个独立的磁盘和他们自己的文件系统。
由于我不明白如何“撤消”LVM而不破坏所有东西,我希望有人能允许我调用命令以获得所请求的分区方案?
发布于 2018-12-03 15:21:45
如果您需要要求方法,您可能不应该尝试这个IMHO。
菜谱(显然没有测试,只用于粗略的指导,而不是逐字复制)大致如下:
这在很大程度上取决于物理磁盘当前如何分配给LVM卷组,有多少空间是空闲的或分配给LVM逻辑卷,以及文件系统的大小以及它们中有多少数据。(pvdisplay vgdisplay lvdisplay)
如果安装程序没有分配很多可用的磁盘空间,您可以通过让LVM迁移您的数据来完成相当多的工作,但是如果没有,那么AFAIK XFS文件系统只能增长而不是缩小,您将手动备份数据并删除LVM分区来创建空空间。
/dev/sda2删除底层pvmove /dev/sda2物理磁盘中的所有数据。/dev/sda2和vgreduce centos_nas /dev/sda2从LVM中删除pvremove /dev/sda2fdisk /dev/sda "Linux LVM”mkfs.xfs /dev/sda2mkdir /mnt/temp和mount /dev/sda2 /mnt/temptar --one-file-system -lcf - .|(cd /mnt/temp; tar -xpvf - )或与您选择的备份工具类似的/boot中的grub配置和新的fstab /mnt/temp/etc/fstab以使用/dev/sda2作为根文件系统重新启动
抱最好的希望
移动根文件系统之后,您可以在空闲时间从其他LVM卷中移动数据。
https://serverfault.com/questions/942628
复制相似问题