Linux Volume management

Source: Internet
Author: User
Tags gpg uuid

[Email protected] ~]# df-h
Filesystem Size used Avail use% mounted on
/dev/sda3 19G 11G 6.5G 63%/
Tmpfs 995M 239M 756M 24%/DEV/SHM
/DEV/SDA1 194M 46M 139M 25%/boot
/DEV/SDA4 20G 1.4G 18G 7%/rman
/DEV/SDB1 30G 863M 28G 4%/arch1
[Email protected] ~]# fdisk-l

disk/dev/sda:42.9 GB, 42949672960 bytes
255 heads, Sectors/track, 5221 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00079a2c

Device Boot Start End Blocks Id System
/DEV/SDA1 * 1 204800 Linux
Partition 1 does not end on cylinder boundary.
/DEV/SDA2 217 1536000 Swap/solaris
Partition 2 does not end on cylinder boundary.
/dev/sda3 217 2611 19229696-up Linux
/DEV/SDA4 2611 5221 20966162+-up Linux

disk/dev/sdb:32.2 GB, 32212254720 bytes
Heads, Wuyi sectors/track, 19275 cylinders
Units = Cylinders of 3264 * 1671168 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x4867b2f5

Device Boot Start End Blocks Id System
/DEV/SDB1 1 19276 31456256 Linux

disk/dev/sdc:5368 MB, 5368709120 bytes
255 heads, Sectors/track, 652 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00000000

DISK/DEV/SDC doesn ' t contain a valid partition table

disk/dev/sdd:5368 MB, 5368709120 bytes
255 heads, Sectors/track, 652 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00000000

DISK/DEV/SDD doesn ' t contain a valid partition table

disk/dev/sde:5368 MB, 5368709120 bytes
255 heads, Sectors/track, 652 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00000000

Disk/dev/sde doesn ' t contain a valid partition table

disk/dev/sdf:5368 MB, 5368709120 bytes
255 heads, Sectors/track, 652 cylinders
Units = cylinders of 16065 * 8225280 bytes
Sector size (logical/physical): bytes/512 bytes
I/o size (minimum/optimal): BYTES/51 2 bytes
Disk identifier:0x00000000

Disk/dev/sdf doesn ' t contain a valid partition table
[Email protected] ~]# ll/dev/sd*
BRW-RW----. 1 root disk 8, 0 may 09:13/DEV/SDA
BRW-RW----. 1 root disk 8, 1 May 09:13/dev/sda1
BRW-RW----. 1 root disk 8, 2 May 09:13/dev/sda2
BRW-RW----. 1 root disk 8, 3 May 09:13/dev/sda3
BRW-RW----. 1 root disk 8, 4 May 09:13/DEV/SDA4
BRW-RW----. 1 root disk 8, 09:13/dev/sdb
BRW-RW----. 1 root disk 8, may 09:13/DEV/SDB1
BRW-RW----. 1 root disk 8, 09:13/DEV/SDC
BRW-RW----. 1 root disk 8, 09:13/DEV/SDD
BRW-RW----. 1 root disk 8, 09:13/DEV/SDE
BRW-RW----. 1 root disk 8, 09:13/DEV/SDF
[Email protected] ~]#]PVCREATE/DEV/SDC
-bash:]pvcreate:command not found

[Email protected] mnt]# mount/dev/cdrom/mnt/
Mount:block Device/dev/sr0 is write-protected, mounting read-only
[Email protected] mnt]# cd/mnt/
[email protected] mnt]# LL
Total 806
Drwxr-xr-x. 3 root root 2048 EFI
-rw-r--r--. 1 root root 7041 the EULA
-rw-r--r--. 1 root root 7041 may Eula.en_us
-rw-r--r--. 1 root root 3334 may eula.py
-rw-r--r--. 1 root root 18390 the GPL
Drwxr-xr-x. 3 root root 2048 may highavailability
Drwxr-xr-x. 3 root root 2048 may images
Drwxr-xr-x. 2 root root 2048 may Isolinux
Drwxr-xr-x. 3 root root 2048 may LoadBalancer
-rw-r--r--. 1 root root 98 may Media.repo
Drwxr-xr-x. 2 root root 636928 may Packages
-rw-r--r--. 1 root root 2619 may Readme-en
-rw-r--r--. 1 root root 7054 may readme-en.html
-rw-r--r--. 1 root root 17643 may Release-notes-en
-rw-r--r--. 1 root root 20003 may release-notes-en.html
-rw-r--r--. 1 root root 17643 may Release-notes-x86_64-en
-rw-r--r--. 1 root root 20003 may release-notes-x86_64-en.html
-rw-r--r--. 1 root root 17643 may Release-notes-x86-en
-rw-r--r--. 1 root root 20003 may release-notes-x86-en.html
lrwxrwxrwx. 1 root root repodata-Server/repodata
Drwxr-xr-x. 3 root root 2048 may resilientstorage
-rw-r--r--. 1 root root 1011 may Rpm-gpg-key
-rw-r--r--. 1 root root 1011 may rpm-gpg-key-oracle
Drwxr-xr-x. 3 root root 2048 may Scalablefilesystem
Drwxr-xr-x. 4 root root 2048 may Server
-rw-r--r--. 1 root root 108 may Supportinfo
-r--r--r--. 1 root root 6301 may TRANS. TBL
[Email protected] mnt]# CD packages/
[email protected] packages]# Yum install lvm*
[Email protected] packages]# Rpm-qa |grep LVM
Lvm2-libs-2.02.83-3.el6.x86_64
Lvm2-2.02.83-3.el6.x86_64
[[Email protected] packages]# CD
[Email protected] ~]# PVCREATE/DEV/SDC
Physical volume "/DEV/SDC" successfully created
[Email protected] ~]# PVCREATE/DEV/SDD
Physical volume "/DEV/SDD" successfully created
[Email protected] ~]# PVCREATE/DEV/SDE
Physical volume "/DEV/SDE" successfully created
[Email protected] ~]# PVCREATE/DEV/SDF
Physical volume "/DEV/SDF" successfully created
[Email protected] ~]# Lvmdiskscan
/DEV/RAM0 [16.00 MiB]
/DEV/RAM1 [16.00 MiB]
/DEV/SDA1 [200.00 MiB]
/DEV/RAM2 [16.00 MiB]
/dev/sda2 [1.46 GiB]
/DEV/RAM3 [16.00 MiB]
/dev/sda3 [18.34 GiB]
/DEV/RAM4 [16.00 MiB]
/DEV/SDA4 [19.99 GiB]
/DEV/RAM5 [16.00 MiB]
/DEV/RAM6 [16.00 MiB]
/DEV/RAM7 [16.00 MiB]
/DEV/RAM8 [16.00 MiB]
/DEV/RAM9 [16.00 MiB]
/DEV/RAM10 [16.00 MiB]
/DEV/RAM11 [16.00 MiB]
/DEV/RAM12 [16.00 MiB]
/DEV/RAM13 [16.00 MiB]
/DEV/RAM14 [16.00 MiB]
/DEV/RAM15 [16.00 MiB]
/DEV/SDB1 [30.00 GiB]
/DEV/SDC [5.00 GiB] LVM Physical volume
/DEV/SDD [5.00 GiB] LVM Physical volume
/DEV/SDE [5.00 GiB] LVM Physical volume
/DEV/SDF [5.00 GiB] LVM Physical volume
0 disks
Partitions
4 LVM Physical Volume whole disks
0 LVM Physical Volumes
[Email protected] ~]# PVs
PV VG Fmt Attr PSize pfree
/DEV/SDC lvm2 a-5.00g 5.00g
/DEV/SDD lvm2 a-5.00g 5.00g
/DEV/SDE lvm2 a-5.00g 5.00g
/DEV/SDF lvm2 a-5.00g 5.00g
[Email protected] ~]# Pvscan
PV/DEV/SDC lvm2 [5.00 GiB]
PV/DEV/SDD lvm2 [5.00 GiB]
PV/DEV/SDE lvm2 [5.00 GiB]
PV/DEV/SDF lvm2 [5.00 GiB]
Total:4 [20.00 GIB]/in use:0 [0]/In no vg:4 [20.00 GIB]
[Email protected] ~]# Pvdisplay
"/DEV/SDC" is a new physical volume of "5.00 GiB"
---NEW physical volume---
PV NAME/DEV/SDC
VG Name
PV Size 5.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID L9whqw-iiew-6bcm-5ca3-amrn-13ve-fsr1me

"/DEV/SDD" is a new physical volume of "5.00 GiB"
---NEW physical volume---
PV NAME/DEV/SDD
VG Name
PV Size 5.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID Gdu1wp-kxfm-pgvy-dmfk-h72v-tbqs-co57eq

"/dev/sde" is a new physical volume of "5.00 GiB"
---NEW physical volume---
PV NAME/DEV/SDE
VG Name
PV Size 5.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID Ayvcde-ocoy-yyvy-neb9-48dq-ep1e-6yvjku

"/dev/sdf" is a new physical volume of "5.00 GiB"
---NEW physical volume---
PV NAME/DEV/SDF
VG Name
PV Size 5.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID ZERFJH-ZYJZ-QJBS-AWMV-BL03-D0YQ-DAAQBZ

[Email protected] ~]# vgcreate DATAVG/DEV/SDC/DEV/SDD/DEV/SDE/DEV/SDF
Volume Group "Datavg" successfully created
[Email protected] ~]# vgchange-a y datavg
0 Logical Volume (s) in volume group ' datavg ' now active
[Email protected] ~]# Vgscan
Reading all physical volumes. This is a while ...
Found Volume Group "datavg" using metadata type LVM2
[Email protected] ~]# VGS
VG #PV #LV #SN Attr vsize vfree
Datavg 4 0 0 wz--n-19.98g 19.98g
[Email protected] ~]# Vgdiskplay
-bash:vgdiskplay:command not found
[Email protected] ~]# Vgdisplay
---Volume Group---
VG Name Datavg
System ID
Format lvm2
Metadata Areas 4
Metadata Sequence No 1
VG Access Read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 4
ACT PV 4
VG Size 19.98 GiB
PE Size 4.00 MiB
Total PE 5116
Alloc pe/size 0/0
Free Pe/size 5116/19.98 GiB
VG UUID 8ipavp-2hni-qx7q-jcna-8xvz-cpwl-uumeov

[Email protected] ~]# Pvdisplay
---physical volume---
PV NAME/DEV/SDC
VG Name Datavg
PV Size 5.00 Gib/not Usable 4.00 MiB
Allocatable Yes
PE Size 4.00 MiB
Total PE 1279
Free PE 1279
Allocated PE 0
PV UUID L9whqw-iiew-6bcm-5ca3-amrn-13ve-fsr1me

---physical volume---
PV NAME/DEV/SDD
VG Name Datavg
PV Size 5.00 Gib/not Usable 4.00 MiB
Allocatable Yes
PE Size 4.00 MiB
Total PE 1279
Free PE 1279
Allocated PE 0
PV UUID Gdu1wp-kxfm-pgvy-dmfk-h72v-tbqs-co57eq

---physical volume---
PV NAME/DEV/SDE
VG Name Datavg
PV Size 5.00 Gib/not Usable 4.00 MiB
Allocatable Yes
PE Size 4.00 MiB
Total PE 1279
Free PE 1279
Allocated PE 0
PV UUID Ayvcde-ocoy-yyvy-neb9-48dq-ep1e-6yvjku

---physical volume---
PV NAME/DEV/SDF
VG Name Datavg
PV Size 5.00 Gib/not Usable 4.00 MiB
Allocatable Yes
PE Size 4.00 MiB
Total PE 1279
Free PE 1279
Allocated PE 0
PV UUID ZERFJH-ZYJZ-QJBS-AWMV-BL03-D0YQ-DAAQBZ

[Email protected] ~]# Vgdisplay datavg| grep "Total PE"
Total PE 5116
[Email protected] ~]# lvcreate-l 5116 datavg-n Datalv
Logical volume "Datalv" created
[Email protected] ~]# ls-l/dev/datavg/datalv
lrwxrwxrwx. 1 root root 7 11:07/dev/datavg/datalv. /dm-0
[Email protected] ~]# Mkfs.ext4/dev/datavg/datalv
MKE2FS 1.41.12 (17-may-2010)
Filesystem label=
OS Type:linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1310720 inodes, 5238784 blocks
261939 blocks (5.00%) reserved for the Super user
First Data block=0
Maximum filesystem blocks=4294967296
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

Writing Inode Tables:done
Creating Journal (32768 blocks): Done
Writing superblocks and filesystem accounting Information:done

This filesystem'll be automatically checked every mounts or
Whichever comes first. Use Tune2fs-c or-i to override.
[Email protected] ~]# df-h
Filesystem Size used Avail use% mounted on
/dev/sda3 19G 11G 6.5G 63%/
Tmpfs 995M 238M 758M 24%/DEV/SHM
/DEV/SDA1 194M 46M 139M 25%/boot
/DEV/SDA4 20G 1.4G 18G 7%/rman
/DEV/SDB1 30G 863M 28G 4%/arch1
/dev/sr0 3.4G 3.4G 0 100%/mnt
[Email protected] ~]# Mkdir/data
[Email protected] ~]# Mount/dev/datavg/datalv/data
[Email protected] ~]# df-h
Filesystem Size used Avail use% mounted on
/dev/sda3 19G 11G 6.5G 63%/
Tmpfs 995M 238M 758M 24%/DEV/SHM
/DEV/SDA1 194M 46M 139M 25%/boot
/DEV/SDA4 20G 1.4G 18G 7%/rman
/DEV/SDB1 30G 863M 28G 4%/arch1
/dev/sr0 3.4G 3.4G 0 100%/mnt
/dev/mapper/datavg-datalv
20G 172M 19G 1%/data
[Email protected] ~]# Vi/etc/fstab
#
#/etc/fstab
# Created by Anaconda on Wed 20 23:07:53 2015
#
# Accessible filesystems, by reference, is maintained under '/dev/disk '
# See mans Pages Fstab (5), Findfs (8), mount (8) and/or Blkid (8) for more info
#
UUID=30E46482-1E22-413F-BF77-E47497788434/EXT4 Defaults 1 1
Uuid=3b639602-3e2f-4533-80fc-73688caf0e03/boot EXT4 Defaults 1 2
Uuid=10a04773-55e4-44d4-91cb-0f5aa339be00 swap swap defaults 0 0
TMPFS/DEV/SHM TMPFS Defaults 0 0
Devpts/dev/pts devpts gid=5,mode=620 0 0
Sysfs/sys Sysfs Defaults 0 0
PROC/PROC proc Defaults 0 0
/dev/sda4/rman ext3 defaults 1 1
/dev/sdb1/arch1 ext3 defaults 1 1
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~

#
#/etc/fstab
# Created by Anaconda on Wed 20 23:07:53 2015
#
# Accessible filesystems, by reference, is maintained under '/dev/disk '
# See mans Pages Fstab (5), Findfs (8), mount (8) and/or Blkid (8) for more info
#
UUID=30E46482-1E22-413F-BF77-E47497788434/EXT4 Defaults 1 1
Uuid=3b639602-3e2f-4533-80fc-73688caf0e03/boot EXT4 Defaults 1 2
Uuid=10a04773-55e4-44d4-91cb-0f5aa339be00 swap swap defaults 0 0
TMPFS/DEV/SHM TMPFS Defaults 0 0
Devpts/dev/pts devpts gid=5,mode=620 0 0
Sysfs/sys Sysfs Defaults 0 0
PROC/PROC proc Defaults 0 0
/dev/sda4/rman ext3 defaults 1 1
"/etc/fstab" 18L, 1033C written
[Email protected] ~]#
[Email protected] ~]#

Linux Volume management

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.