使用LVM和XFS将/ var分离到其自己的分区

时间:2019-01-15 14:43:37

标签: centos lvm xfs

我想使用LVM将/ var分离到一个单独的分区,但是我想先问一些有关它的问题。基本上,我想调整根分区的大小,以便创建一个将/ var挂载到的新分区。

我以什么顺序执行此操作,如何确保现在将数据保留在/ var中?

我具有以下具有XFS和LVM的文件系统:

Centos 7

Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   36G  1.2G   35G   4% /
devtmpfs                 3.9G     0  3.9G   0% /dev
tmpfs                    3.9G     0  3.9G   0% /dev/shm
tmpfs                    3.9G  8.9M  3.9G   1% /run
tmpfs                    3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda1               1014M  145M  870M  15% /boot
tmpfs                    3.9G     0  3.9G   0% /tmp
/dev/mapper/centos-home   18G   46M   18G   1% /home
tmpfs                    783M     0  783M   0% /run/user/1000

lsblk:

NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda               8:0    0   60G  0 disk
├─sda1            8:1    0    1G  0 part /boot
└─sda2            8:2    0   59G  0 part
  ├─centos-root 253:0    0 35.6G  0 lvm  /
  ├─centos-swap 253:1    0    6G  0 lvm  [SWAP]
  └─centos-home 253:2    0 17.4G  0 lvm  /home
sr0              11:0    1 1024M  0 rom

fdisk -l:

Disk /dev/sda: 64.4 GB, 64424509440 bytes, 125829120 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 label type: dos
Disk identifier: 0x000c0e50

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200   125829119    61864960   8e  Linux LVM

Disk /dev/mapper/centos-root: 38.2 GB, 38235275264 bytes, 74678272 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/centos-swap: 6442 MB, 6442450944 bytes, 12582912 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/centos-home: 18.7 GB, 18668847104 bytes, 36462592   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

0 个答案:

没有答案