正在使用的LINUX系统,增加了空间,需要挂载至系统


--------查询需要挂载的设备名--------

  fdisk -l  


Disk /dev/sdb: 2396.0 GB, 2395996160000 bytes

255 heads, 63 sectors/track, 291296 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 4096 bytes

I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk identifier: 0x00000000


Disk /dev/sdc: 2396.0 GB, 2395996160000 bytes

255 heads, 63 sectors/track, 291296 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 4096 bytes

I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk identifier: 0x00000000


-----创建PV----

pvcreate /dev/sdb

pvcreate /dev/sdc

---创建vg-----

vgcreate VolGroup_data /dev/sdb /dev/sdc

mkdir /data

cd

----创建lv-------

lvcreate -l 100%FREE -n lv_data VolGroup_data

----格式化----

mkfs -t ext4 /dev/VolGroup_data/lv_data

-----挂载----

mount /dev/VolGroup_data/lv_data /data/


-------增加到启动挂载-------

vi /etc/fstab

可以按照uuid挂载,也可以按照路径,比如:

uuid可以通过lvdisplay查询。

UUID=22d59ff0-1646-4e28-af50-e7281286934c /                       ext4    defaults        1 1


/dev/mapper/VolGroup_data-lv_data   /data                       ext4   defaults          0 0