lvs 分割槽

babyyellow發表於2022-10-21



[root@ecs-bigdata-cdh01-1021973 ~]# lsblk

NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT

vda    253:0    0  100G  0 disk 

├─vda1 253:1    0    4G  0 part [SWAP]

└─vda2 253:2    0   96G  0 part /

vdb    253:16   0    1T  0 disk 

[root@ecs-bigdata-cdh01-1021973 ~]# fdisk /dev/

Display all 151 possibilities? (y or n)

[root@ecs-bigdata-cdh01-1021973 ~]# fdisk /dev/vdb 

Welcome to fdisk (util-linux 2.23.2).


Changes will remain in memory only, until you decide to write them.

Be careful before using the write command.


Device does not contain a recognized partition table

Building a new DOS disklabel with disk identifier 0xc78f8ebc.


Command (m for help): n

Partition type:

   p   primary (0 primary, 0 extended, 4 free)

   e   extended

Select (default p): p

Partition number (1-4, default 1): 1

First sector (2048-2147483647, default 2048): 

Using default value 2048

Last sector, +sectors or +size{K,M,G} (2048-2147483647, default 2147483647): 

Using default value 2147483647

Partition 1 of type Linux and of size 1024 GiB is set


Command (m for help): t

Selected partition 1

Hex code (type L to list all codes): 8e

Changed type of partition 'Linux' to 'Linux LVM'


Command (m for help): w

The partition table has been altered!


Calling ioctl() to re-read partition table.

Syncing disks.

[root@ecs-bigdata-cdh01-1021973 ~]# 



Complete!

[root@ecs-bigdata-cdh01-1021973 ~]# pvcreate   /dev/vdb1 

  Physical volume "/dev/vdb1" successfully created.

[root@ecs-bigdata-cdh01-1021973 ~]# vgc

vgcfgbackup   vgcfgrestore  vgchange      vgck          vgconvert     vgcreate      

[root@ecs-bigdata-cdh01-1021973 ~]# vgcreate   VolGroup  /dev/vdb1 

  Volume group "VolGroup" successfully created

[root@ecs-bigdata-cdh01-1021973 ~]# 

[root@ecs-bigdata-cdh01-1021973 ~]# 

[root@ecs-bigdata-cdh01-1021973 ~]# vgchange -a y VolGroup 

  0 logical volume(s) in volume group "VolGroup" now active

[root@ecs-bigdata-cdh01-1021973 ~]# lvcreate   -L 900G -n lv_data VolGroup 

  Logical volume "lv_data" created.

[root@ecs-bigdata-cdh01-1021973 ~]# mkdir /data

[root@ecs-bigdata-cdh01-1021973 ~]# mkfs

mkfs         mkfs.btrfs   mkfs.cramfs  mkfs.ext2    mkfs.ext3    mkfs.ext4    mkfs.minix   mkfs.xfs     

[root@ecs-bigdata-cdh01-1021973 ~]# mkfs.ext4  /dev/

Display all 154 possibilities? (y or n)

[root@ecs-bigdata-cdh01-1021973 ~]# mkfs.ext4  /dev/VolGroup/lv_data .

./             .bash_history  .bash_profile  .cshrc         .tcshrc        

../            .bash_logout   .bashrc        .ssh/          

[root@ecs-bigdata-cdh01-1021973 ~]# mkfs.ext4  /dev/VolGroup/lv_data   

mke2fs 1.42.9 (28-Dec-2013)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

Stride=0 blocks, Stripe width=0 blocks

58982400 inodes, 235929600 blocks

11796480 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=2384461824

7200 block groups

32768 blocks per group, 32768 fragments per group

8192 inodes per group

Superblock backups stored on blocks: 

        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 

        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 

        102400000, 214990848


Allocating group tables: done                            

Writing inode tables: done                            

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done     


[root@ecs-bigdata-cdh01-1021973 ~]# mount -t  ext4 /dev/VolGroup/lv_data 

mount: can't find /dev/VolGroup/lv_data in /etc/fstab

[root@ecs-bigdata-cdh01-1021973 ~]# 







來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/133735/viewspace-2919728/,如需轉載,請註明出處,否則將追究法律責任。

相關文章