SlideShare une entreprise Scribd logo
1  sur  18
LVMs STEP BY STEP
[root@localhost ~]# fdisk /dev/sda
WARNING:DOS-compatible mode isdeprecated.It'sstronglyrecommendedto
switchoff the mode (command'c') andchange displayunitsto
sectors(command'u').
Command (m for help):n
Firstcylinder(1633-2610, default1633):
Usingdefaultvalue 1633
Last cylinder,+cylindersor+size{K,M,G} (1633-2610, default2610): +50M
Command (m for help):w
The partitiontable hasbeenaltered!
Callingioctl() tore-readpartitiontable.
WARNING:Re-readingthe partitiontable failedwitherror16: Device orresource busy.
The kernel still usesthe oldtable.The new table will be usedat
the nextrebootor afteryourun partprobe(8) orkpartx(8)
Syncingdisks.
[root@localhost ~]# fdisk /dev/sda
WARNING:DOS-compatible mode isdeprecated.It'sstronglyrecommendedto
switchoff the mode (command'c') andchange displayunitsto
sectors(command'u').
Command(mfor help):p
Disk/dev/sda:21.5 GB, 21474836480 bytes
255 heads,63 sectors/track,2610 cylinders
Units= cylindersof 16065 * 512 = 8225280 bytes
Sectorsize (logical/physical):512 bytes/ 512 bytes
I/Osize (minimum/optimal):512 bytes/512 bytes
Diskidentifier:0x00043f93
Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition1 doesnotendon cylinderboundary.
/dev/sda2 26 1301 10240000 83 Linux
/dev/sda3 1301 1562 2097152 82 Linux swap/ Solaris
/dev/sda4 1562 2610 8421849 5 Extended
/dev/sda5 1562 1626 517837+ 83 Linux
/dev/sda6 1627 1632 48163+ 83 Linux
/dev/sda7 1633 1639 56196 83 Linux
Command(mfor help):t
Partitionnumber(1-7):7
Hex code (type L to listcodes):L (Listof Hex codes)
0 Empty 24 NECDOS 81 Minix / oldLin bf Solaris
1 FAT12 39 Plan9 82 Linux swap/ Soc1 DRDOS/sec(FAT-
2 XENIXroot 3c PartitionMagic 83 Linux c4 DRDOS/sec(FAT-
3 XENIXusr 40 Venix 80286 84 OS/2 hiddenC: c6 DRDOS/sec(FAT-
4 FAT16 <32M 41 PPCPRePBoot 85 Linux extended c7 Syrinx
5 Extended 42 SFS 86 NTFS volume setda Non-FSdata
6 FAT16 4d QNX4.x 87 NTFSvolume setdb CP/M/ CTOS/ .
7 HPFS/NTFS 4e QNX4.x 2nd part 88 Linux plaintextde Dell Utility
8 AIX 4f QNX4.x 3rd part 8e LinuxLVM df BootIt
9 AIX bootable 50 OnTrack DM 93 Amoeba e1 DOS access
a OS/2 Boot Manag 51 OnTrack DM6 Aux 94 AmoebaBBT e3 DOS R/O
b W95 FAT32 52 CP/M 9f BSD/OS e4 SpeedStor
c W95 FAT32 (LBA) 53 OnTrack DM6 Aux a0 IBMThinkpadhi eb BeOSfs
e W95 FAT16 (LBA) 54 OnTrackDM6 a5 FreeBSD ee GPT
f W95 Ext'd(LBA) 55 EZ-Drive a6 OpenBSD ef EFI (FAT-12/16/
10 OPUS 56 GoldenBow a7 NeXTSTEP f0 Linux/PA-RISCb
11 HiddenFAT12 5c PriamEdisk a8 DarwinUFS f1 SpeedStor
12 Compaqdiagnost61 SpeedStor a9 NetBSD f4 SpeedStor
14 HiddenFAT16<3 63 GNU HURD or Sys ab Darwinboot f2 DOSsecondary
16 HiddenFAT16 64 Novell Netware af HFS/ HFS+ fb VMware VMFS
17 HiddenHPFS/NTF65 Novell Netware b7 BSDI fs fc VMware VMKCORE
18 ASTSmartSleep 70 DiskSecure Multb8 BSDI swap fd Linux raidauto
1b HiddenW95 FAT3 75 PC/IX bb Boot Wizardhidfe LANstep
1c HiddenW95 FAT3 80 Old Minix be Solarisboot ff BBT
1e HiddenW95 FAT1
Hex code (type L to list codes):8e
Changedsystemtype of partition7to 8e (Linux LVM)
Command(mfor help):w
The partitiontable hasbeenaltered!
Callingioctl() tore-readpartitiontable.
WARNING:Re-readingthe partitiontable failedwitherror16: Device orresource busy.
The kernel still usesthe oldtable.The new table will be usedat
the nextrebootor afteryourun partprobe(8) orkpartx(8)
Syncingdisks.
[root@localhost ~]# partx -a /dev/sda
BLKPG: Device orresource busy
error addingpartition1
BLKPG: Device orresource busy
error addingpartition2
BLKPG: Device orresource busy
error addingpartition3
BLKPG: Device orresource busy
error addingpartition4
BLKPG: Device orresource busy
error addingpartition5
BLKPG: Device orresource busy
error addingpartition6
BLKPG: Device orresource busy
error addingpartition7
[root@localhost ~]# cat /proc/partitions
majorminor #blocks name
8 0 20971520 sda
8 1 204800 sda1
8 2 10240000 sda2
8 3 2097152 sda3
8 4 1 sda4
8 5 517837 sda5
8 6 48163 sda6
8 7 56196 sda7
[root@localhost ~]# pvcreate /dev/sda7
Physical volume"/dev/sda7"successfullycreated
[root@localhost ~]# vgcreate /dev/sda7
Please enteraphysical volume path
Run`vgcreate --help'formore information.
[root@localhost ~]# vgcreate /dev/sda
Please enteraphysical volume path
Run`vgcreate --help'formore information.
[root@localhost ~]# vgcreate Aoc /dev/sda
Device /dev/sdanotfound(orignoredbyfiltering).
Unable toadd physical volume '/dev/sda'tovolume group'Aoc'.
[root@localhost ~]# vgcreate aoc /dev/sda
Device /dev/sdanotfound(orignoredbyfiltering).
Unable toadd physical volume '/dev/sda'tovolume group'aoc'.
[root@localhost ~]# vgcreate vg1 /dev/sda
Device /dev/sdanotfound(orignoredbyfiltering).
Unable toadd physical volume '/dev/sda'tovolume group'vg1'.
[root@localhost ~]# vgdisplay
Novolume groupsfound
[root@localhost ~]# vgcreate aoc /dev/sda7
Volume group"aoc"successfullycreated
[root@localhost ~]# vgdisplay
--- Volume group ---
VG Name aoc
SystemID
Format lvm2
MetadataAreas 1
MetadataSequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
OpenLV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 52.00 MiB
PE Size 4.00 MiB
Total PE 13
AllocPE/ Size 0 / 0
Free PE / Size 13 / 52.00 MiB
VG UUID WiiSuj-VtRD-3zES-YFse-yLwN-3YS9-vnCB2k
[root@localhost ~]# blkid/dev/sda7
/dev/sda7:UUID="3h4r7d-1JO1-kmi5-RWwW-0hJ8-cNQw-oe7BS4"TYPE="LVM2_member"
[root@localhost ~]# lvcreate -L 25M -nAoc1 aoc
Roundingupsize tofull physical extent28.00 MiB
Logical volume "Aoc1"created
[root@localhost ~]# lvs
LV VG Attr LSize OriginSnap% Move Log Copy% Convert
Aoc1 aoc -wi-a- 28.00m
[root@localhost ~]# mkfs.ext4 /dev/aoc/Aoc1
mke2fs1.41.12 (17-May-2010)
Filesystemlabel=
OS type:Linux
Blocksize=1024 (log=0)
Fragmentsize=1024 (log=0)
Stride=0blocks,Stripe width=0blocks
7168 inodes,28672 blocks
1433 blocks(5.00%) reservedforthe superuser
Firstdata block=1
Maximumfilesystemblocks=29360128
4 blockgroups
8192 blockspergroup,8192 fragmentspergroup
1792 inodespergroup
Superblockbackupsstoredonblocks:
8193, 24577
Writinginode tables:done
Creatingjournal (1024 blocks):done
Writingsuperblocksandfilesystemaccountinginformation:done
Thisfilesystemwill be automaticallycheckedevery25 mountsor
180 days,whichevercomesfirst. Use tune2fs -cor -i to override.
[root@localhost ~]# lvs
LV VG Attr LSize OriginSnap% Move Log Copy% Convert
Aoc1 aoc -wi-a- 28.00m
[root@localhost ~]# df -hT
Filesystem Type Size Used Avail Use% Mountedon
/dev/sda2 ext4 9.7G 2.3G 6.9G 25% /
tmpfs tmpfs 504M 260K 504M 1% /dev/shm
/dev/sda1 ext4 194M 24M 161M 13% /boot
/dev/sda5 ext4 490M 11M 455M 3% /usr/olx
/dev/sr0 iso9660 2.8G 2.8G 0 100% /media/RHEL_6.0i386 Disc 1
[root@localhost ~]# df -h
Filesystem Size UsedAvail Use%Mountedon
/dev/sda2 9.7G 2.3G 6.9G 25% /
tmpfs 504M 260K 504M 1% /dev/shm
/dev/sda1 194M 24M 161M 13% /boot
/dev/sda5 490M 11M 455M 3% /usr/olx
/dev/sr0 2.8G 2.8G 0 100% /media/RHEL_6.0 i386 Disc1
[root@localhost ~]# fdisk -l
Disk/dev/sda:21.5 GB, 21474836480 bytes
255 heads,63 sectors/track,2610 cylinders
Units= cylindersof 16065 * 512 = 8225280 bytes
Sectorsize (logical/physical):512 bytes/ 512 bytes
I/Osize (minimum/optimal):512 bytes/512 bytes
Diskidentifier:0x00043f93
Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition1 doesnotendon cylinderboundary.
/dev/sda2 26 1301 10240000 83 Linux
/dev/sda3 1301 1562 2097152 82 Linux swap/ Solaris
/dev/sda4 1562 2610 8421849 5 Extended
/dev/sda5 1562 1626 517837+ 83 Linux
/dev/sda6 1627 1632 48163+ 83 Linux
/dev/sda7 1633 1639 56196 8e Linux LVM
Disk/dev/dm-0:29 MB, 29360128 bytes
255 heads,63 sectors/track,3 cylinders
Units= cylindersof 16065 * 512 = 8225280 bytes
Sectorsize (logical/physical):512 bytes/ 512 bytes
I/Osize (minimum/optimal):512 bytes/512 bytes
Diskidentifier:0x00000000
Disk/dev/dm-0doesn'tcontainavalidpartitiontable
[root@localhost ~]# mkdir AOC
[root@localhost ~]# mount /dev/aoc/Aoc1 AOC
[root@localhost ~]# df -h
Filesystem Size UsedAvail Use%Mountedon
/dev/sda2 9.7G 2.3G 6.9G 25% /
tmpfs 504M 260K 504M 1% /dev/shm
/dev/sda1 194M 24M 161M 13% /boot
/dev/sda5 490M 11M 455M 3% /usr/olx
/dev/sr0 2.8G 2.8G 0 100% /media/RHEL_6.0 i386 Disc1
/dev/mapper/aoc-Aoc1 28M 1.4M 25M 6% /root/AOC
[root@localhost ~]# lvs
LV VG Attr LSize OriginSnap% Move Log Copy% Convert
Aoc1 aoc -wi-ao28.00m
[root@localhost ~]# lvextend -L10M /dev/aoc/Aoc1
Roundingupsize tofull physical extent12.00 MiB
Newsize given(3extents) notlargerthanexistingsize (7extents)
Run`lvextend --help'formore information.
[root@localhost ~]# lvextend -L5M /dev/aoc/Aoc1
Roundingupsize tofull physical extent8.00MiB
Newsize given(2extents) notlargerthanexistingsize (7extents)
Run`lvextend --help'formore information.
[root@localhost ~]# lvextend -L2M /dev/aoc/Aoc1
Roundingupsize tofull physical extent4.00MiB
Newsize given(1extents) notlargerthanexistingsize (7extents)
Run`lvextend --help'formore information.
[root@localhost~]# lvextend -L15M /dev/aoc/Aoc1
Roundingupsize tofull physical extent16.00 MiB
Newsize given(4extents) notlargerthanexistingsize (7extents)
Run`lvextend --help'formore information.
[root@localhost ~]# lvextend -L15M /dev/aoc/Aoc1clear
Logical volume Aoc1clearnotfoundinvolume groupaoc
[root@localhost ~]# clear
[root@localhost ~]# fdisk /dev/sda
WARNING:DOS-compatible mode isdeprecated.It'sstronglyrecommendedto
switchoff the mode (command'c') andchange displayunitsto
sectors(command'u').
Command(mfor help):n
Firstcylinder(1640-2610, default1640):
Usingdefaultvalue 1640
Last cylinder,+cylindersor+size{K,M,G} (1640-2610, default2610): +500M
Command(mfor help):w
The partitiontable hasbeenaltered!
Callingioctl() tore-readpartitiontable.
WARNING:Re-readingthe partitiontable failedwitherror16: Device orresource busy.
The kernel still usesthe oldtable.The new table will be usedat
the nextrebootor afteryourun partprobe(8) orkpartx(8)
Syncingdisks.
[root@localhost ~]# fdisk /dev/sda
WARNING:DOS-compatible mode isdeprecated.It'sstrongly recommendedto
switchoff the mode (command'c') andchange displayunitsto
sectors(command'u').
Command(mfor help):p
Disk/dev/sda:21.5 GB, 21474836480 bytes
255 heads,63 sectors/track,2610 cylinders
Units= cylindersof 16065 * 512 = 8225280 bytes
Sectorsize (logical/physical):512 bytes/ 512 bytes
I/Osize (minimum/optimal):512 bytes/512 bytes
Diskidentifier:0x00043f93
Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition1 doesnotendon cylinderboundary.
/dev/sda2 26 1301 10240000 83 Linux
/dev/sda3 1301 1562 2097152 82 Linux swap/ Solaris
/dev/sda4 1562 2610 8421849 5 Extended
/dev/sda5 1562 1626 517837+ 83 Linux
/dev/sda6 1627 1632 48163+ 83 Linux
/dev/sda7 1633 1639 56196 8e Linux LVM
/dev/sda8 1640 1704 522081 83 Linux
Command (m for help):t
Partition number(1-8): 8
Hex code (type L to list codes):8e
Changedsystemtype of partition8to 8e (Linux LVM)
Command (m for help):w
The partitiontable hasbeenaltered!
Callingioctl() tore-readpartitiontable.
WARNING:Re-readingthe partitiontable failedwitherror16: Device orresource busy.
The kernel still usesthe oldtable.The new table will be usedat
the nextrebootor afteryourun partprobe(8) orkpartx(8)
Syncingdisks.
[root@localhost ~]# partx -a /dev/sda
BLKPG: Device orresource busy
error addingpartition1
BLKPG: Device orresource busy
error addingpartition2
BLKPG: Device orresource busy
error addingpartition3
BLKPG: Device orresource busy
error addingpartition4
BLKPG: Device orresource busy
error addingpartition5
BLKPG: Device orresource busy
error addingpartition6
BLKPG: Device orresource busy
error addingpartition7
[root@localhost ~]# pvcreate /dev/sda8
Physical volume"/dev/sda8"successfullycreated
[root@localhost ~]# vgcreate VG1 /dev/sda8
Volume group"VG1"successfullycreated
[root@localhost ~]# vgdisplay
--- Volume group ---
VG Name VG1
SystemID
Format lvm2
MetadataAreas 1
MetadataSequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
OpenLV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 508.00 MiB
PE Size 4.00 MiB
Total PE 127
AllocPE/ Size 0 / 0
Free PE / Size 127 / 508.00 MiB
VG UUID 5BaD8w-YikM-He7J-3q3P-LdP1-snoO-SflLpS
--- Volume group ---
VG Name aoc
SystemID
Format lvm2
MetadataAreas 1
MetadataSequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
OpenLV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 52.00 MiB
PE Size 4.00 MiB
Total PE 13
AllocPE/ Size 7 / 28.00 MiB
Free PE / Size 6 / 24.00 MiB
VG UUID WiiSuj-VtRD-3zES-YFse-yLwN-3YS9-vnCB2k
[root@localhost ~]# lvcreate -L +100M -n LV1 VG1
Logical volume "LV1"created
[root@localhost ~]# mkfs.ext4 /dev/VG1/LV1
mke2fs1.41.12 (17-May-2010)
Filesystemlabel=
OS type:Linux
Blocksize=1024 (log=0)
Fragmentsize=1024 (log=0)
Stride=0blocks,Stripe width=0blocks
25688 inodes,102400 blocks
5120 blocks(5.00%) reservedforthe superuser
Firstdata block=1
Maximumfilesystemblocks=67371008
13 blockgroups
8192 blockspergroup,8192 fragmentspergroup
1976 inodespergroup
Superblockbackupsstoredonblocks:
8193, 24577, 40961, 57345, 73729
Writinginode tables:done
Creatingjournal (4096 blocks):done
Writingsuperblocksandfilesystemaccountinginformation:done
Thisfilesystemwill be automaticallycheckedevery20 mountsor
180 days,whichevercomesfirst. Use tune2fs -cor -i to override.
[root@localhost ~]# ls
acer Aoc Desktop Downloads install.log.syslog Music Public Templates vinod
anaconda-ks.cfg AOC Documents install.log jeson Pictures sudhaa Videos
[root@localhost ~]# mount /dev/VG1/LV1 jeson/
[root@localhost ~]# df -h
Filesystem Size UsedAvail Use%Mountedon
/dev/sda2 9.7G 2.3G 6.9G 25% /
tmpfs 504M 260K 504M 1% /dev/shm
/dev/sda1 194M 24M 161M 13% /boot
/dev/sda5 490M 11M 455M 3% /usr/olx
/dev/sr0 2.8G 2.8G 0 100% /media/RHEL_6.0 i386 Disc1
/dev/mapper/aoc-Aoc1 28M 1.4M 25M 6% /root/AOC
/dev/mapper/VG1-LV1 97M 5.6M 87M 7% /root/jeson
[root@localhost~]#lvextend -L+50M /dev/VG1/LV1
Roundingupsize tofull physical extent52.00 MiB
Extendinglogical volumeLV1to152.00 MiB
Logical volume LV1successfullyresized
[root@localhost~]#df -hT
Filesystem Type Size Used Avail Use% Mountedon
/dev/sda2 ext4 9.7G 2.3G 6.9G 25% /
tmpfs tmpfs 504M 260K 504M 1% /dev/shm
/dev/sda1 ext4 194M 24M 161M 13% /boot
/dev/sda5 ext4 490M 11M 455M 3% /usr/olx
/dev/sr0 iso9660 2.8G 2.8G 0 100% /media/RHEL_6.0i386 Disc 1
/dev/mapper/aoc-Aoc1
ext4 28M 1.4M 25M 6% /root/AOC
/dev/mapper/VG1-LV1
ext4 97M 5.6M 87M 7% /root/jeson
[root@localhost ~]# resize2fs/dev/VG1/LV1
resize2fs1.41.12 (17-May-2010)
Filesystemat/dev/VG1/LV1ismountedon/root/jeson;on-line resizingrequired
olddesc_blocks= 1, new_desc_blocks=1
Performinganon-lineresizeof /dev/VG1/LV1to155648 (1k) blocks.
The filesystemon/dev/VG1/LV1isnow155648 blockslong.
[root@localhost ~]# df -hT
Filesystem Type Size Used Avail Use% Mountedon
/dev/sda2 ext4 9.7G 2.3G 6.9G 25% /
tmpfs tmpfs 504M 260K 504M 1% /dev/shm
/dev/sda1 ext4 194M 24M 161M 13% /boot
/dev/sda5 ext4 490M 11M 455M 3% /usr/olx
/dev/sr0 iso9660 2.8G 2.8G 0 100% /media/RHEL_6.0i386 Disc 1
/dev/mapper/aoc-Aoc1
ext4 28M 1.4M 25M 6% /root/AOC
/dev/mapper/VG1-LV1
ext4 148M 5.6M 135M 4% /root/jeson
LVM REMOVE
[root@localhost ~]# lvs
LV VG Attr LSize OriginSnap% Move Log Copy% Convert
LV1 VG1 -wi-a- 152.00m
Aoc1 aoc -wi-a- 28.00m
[root@localhost ~]# lvremove /dev/aoc
Do youreallywantto remove active logical volume Aoc1?[y/n]:y
Logical volume "Aoc1"successfullyremoved
[root@localhost ~]# lvs
LV VG Attr LSize OriginSnap% Move Log Copy% Convert
LV1 VG1 -wi-a- 152.00m
[root@localhost ~]# vgremove aoc
Volume group"aoc"successfullyremoved
[root@localhost ~]# vgs
VG #PV #LV #SN Attr VSize VFree
VG1 1 1 0 wz--n- 508.00m 356.00m
[root@localhost ~]# pvremove /dev/sda7
Labelson physical volume "/dev/sda7"successfullywiped

Contenu connexe

Tendances

Tendances (19)

Kernel crashdump
Kernel crashdumpKernel crashdump
Kernel crashdump
 
Project1
Project1Project1
Project1
 
Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)
 
KCC_Final.pdf
KCC_Final.pdfKCC_Final.pdf
KCC_Final.pdf
 
Unixtoolbox
UnixtoolboxUnixtoolbox
Unixtoolbox
 
Logical volume manager xfs
Logical volume manager xfsLogical volume manager xfs
Logical volume manager xfs
 
Userspace Linux I/O
Userspace Linux I/O Userspace Linux I/O
Userspace Linux I/O
 
Oracle cluster installation with grid and iscsi
Oracle cluster  installation with grid and iscsiOracle cluster  installation with grid and iscsi
Oracle cluster installation with grid and iscsi
 
Iscsi
IscsiIscsi
Iscsi
 
Linux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fsLinux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fs
 
Oracle cluster installation with grid and nfs
Oracle cluster  installation with grid and nfsOracle cluster  installation with grid and nfs
Oracle cluster installation with grid and nfs
 
Log
LogLog
Log
 
Software Packaging for Cross OS Distribution
Software Packaging for Cross OS DistributionSoftware Packaging for Cross OS Distribution
Software Packaging for Cross OS Distribution
 
Kdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysisKdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysis
 
Andresen 8 21 02
Andresen 8 21 02Andresen 8 21 02
Andresen 8 21 02
 
Kernel Recipes 2015 - Porting Linux to a new processor architecture
Kernel Recipes 2015 - Porting Linux to a new processor architectureKernel Recipes 2015 - Porting Linux to a new processor architecture
Kernel Recipes 2015 - Porting Linux to a new processor architecture
 
Linux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementLinux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware Management
 
Batel f re v66
Batel f re v66Batel f re v66
Batel f re v66
 
A Journey to Boot Linux on Raspberry Pi
A Journey to Boot Linux on Raspberry PiA Journey to Boot Linux on Raspberry Pi
A Journey to Boot Linux on Raspberry Pi
 

En vedette (12)

Company Profile
Company ProfileCompany Profile
Company Profile
 
Studiekrav m7 5 helsepolitikk powerpoint
Studiekrav m7 5 helsepolitikk powerpointStudiekrav m7 5 helsepolitikk powerpoint
Studiekrav m7 5 helsepolitikk powerpoint
 
SEO Firm india
SEO Firm indiaSEO Firm india
SEO Firm india
 
The Future of UK Solar: An Installer's Perspective
The Future of UK Solar: An Installer's PerspectiveThe Future of UK Solar: An Installer's Perspective
The Future of UK Solar: An Installer's Perspective
 
SEO firm india
SEO firm indiaSEO firm india
SEO firm india
 
Aditya singh
Aditya singhAditya singh
Aditya singh
 
Esakkirajaexppdf
EsakkirajaexppdfEsakkirajaexppdf
Esakkirajaexppdf
 
Rpp smp ipa
Rpp smp ipaRpp smp ipa
Rpp smp ipa
 
LC_CV
LC_CVLC_CV
LC_CV
 
RFID
RFIDRFID
RFID
 
Suman biotech
Suman biotechSuman biotech
Suman biotech
 
Photosynthesis
PhotosynthesisPhotosynthesis
Photosynthesis
 

Similaire à Linux lv ms step by step

Add and configure lu ns in solaris
Add and configure lu ns in solarisAdd and configure lu ns in solaris
Add and configure lu ns in solaris
Amrita Dey
 

Similaire à Linux lv ms step by step (20)

Mirroring the root_disk under solaris SVM
Mirroring the root_disk under solaris SVMMirroring the root_disk under solaris SVM
Mirroring the root_disk under solaris SVM
 
Solaris
SolarisSolaris
Solaris
 
Mac os x mount ntfs
Mac os x mount ntfsMac os x mount ntfs
Mac os x mount ntfs
 
Real time systems
Real time systemsReal time systems
Real time systems
 
Metasploitable
MetasploitableMetasploitable
Metasploitable
 
Unix 6 en
Unix 6 enUnix 6 en
Unix 6 en
 
Add and configure lu ns in solaris
Add and configure lu ns in solarisAdd and configure lu ns in solaris
Add and configure lu ns in solaris
 
Veritas Software Foundations
Veritas Software FoundationsVeritas Software Foundations
Veritas Software Foundations
 
Open Enea Linux workshop at the Embedded Conference Scandinavia 2014
Open Enea Linux workshop at the Embedded Conference Scandinavia 2014Open Enea Linux workshop at the Embedded Conference Scandinavia 2014
Open Enea Linux workshop at the Embedded Conference Scandinavia 2014
 
Jackpot! Attacking Arcade Machines
Jackpot! Attacking Arcade MachinesJackpot! Attacking Arcade Machines
Jackpot! Attacking Arcade Machines
 
101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2
 
PFIセミナー資料 H27.10.22
PFIセミナー資料 H27.10.22PFIセミナー資料 H27.10.22
PFIセミナー資料 H27.10.22
 
Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021
 
Embedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debuggingEmbedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debugging
 
x86_64 Hardware Deep dive
x86_64 Hardware Deep divex86_64 Hardware Deep dive
x86_64 Hardware Deep dive
 
Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]
 
Scaling IO-bound microservices
Scaling IO-bound microservicesScaling IO-bound microservices
Scaling IO-bound microservices
 
005 skyeye
005 skyeye005 skyeye
005 skyeye
 
2.1 design hard disk layout v2
2.1 design hard disk layout v22.1 design hard disk layout v2
2.1 design hard disk layout v2
 
OakTable World Sep14 clonedb
OakTable World Sep14 clonedb OakTable World Sep14 clonedb
OakTable World Sep14 clonedb
 

Dernier

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Dernier (20)

What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 

Linux lv ms step by step

  • 1. LVMs STEP BY STEP [root@localhost ~]# fdisk /dev/sda WARNING:DOS-compatible mode isdeprecated.It'sstronglyrecommendedto switchoff the mode (command'c') andchange displayunitsto sectors(command'u'). Command (m for help):n Firstcylinder(1633-2610, default1633): Usingdefaultvalue 1633 Last cylinder,+cylindersor+size{K,M,G} (1633-2610, default2610): +50M Command (m for help):w The partitiontable hasbeenaltered! Callingioctl() tore-readpartitiontable. WARNING:Re-readingthe partitiontable failedwitherror16: Device orresource busy. The kernel still usesthe oldtable.The new table will be usedat the nextrebootor afteryourun partprobe(8) orkpartx(8) Syncingdisks. [root@localhost ~]# fdisk /dev/sda WARNING:DOS-compatible mode isdeprecated.It'sstronglyrecommendedto switchoff the mode (command'c') andchange displayunitsto sectors(command'u'). Command(mfor help):p Disk/dev/sda:21.5 GB, 21474836480 bytes 255 heads,63 sectors/track,2610 cylinders Units= cylindersof 16065 * 512 = 8225280 bytes Sectorsize (logical/physical):512 bytes/ 512 bytes
  • 2. I/Osize (minimum/optimal):512 bytes/512 bytes Diskidentifier:0x00043f93 Device Boot Start End Blocks Id System /dev/sda1 * 1 26 204800 83 Linux Partition1 doesnotendon cylinderboundary. /dev/sda2 26 1301 10240000 83 Linux /dev/sda3 1301 1562 2097152 82 Linux swap/ Solaris /dev/sda4 1562 2610 8421849 5 Extended /dev/sda5 1562 1626 517837+ 83 Linux /dev/sda6 1627 1632 48163+ 83 Linux /dev/sda7 1633 1639 56196 83 Linux Command(mfor help):t Partitionnumber(1-7):7 Hex code (type L to listcodes):L (Listof Hex codes) 0 Empty 24 NECDOS 81 Minix / oldLin bf Solaris 1 FAT12 39 Plan9 82 Linux swap/ Soc1 DRDOS/sec(FAT- 2 XENIXroot 3c PartitionMagic 83 Linux c4 DRDOS/sec(FAT- 3 XENIXusr 40 Venix 80286 84 OS/2 hiddenC: c6 DRDOS/sec(FAT- 4 FAT16 <32M 41 PPCPRePBoot 85 Linux extended c7 Syrinx 5 Extended 42 SFS 86 NTFS volume setda Non-FSdata 6 FAT16 4d QNX4.x 87 NTFSvolume setdb CP/M/ CTOS/ . 7 HPFS/NTFS 4e QNX4.x 2nd part 88 Linux plaintextde Dell Utility 8 AIX 4f QNX4.x 3rd part 8e LinuxLVM df BootIt 9 AIX bootable 50 OnTrack DM 93 Amoeba e1 DOS access a OS/2 Boot Manag 51 OnTrack DM6 Aux 94 AmoebaBBT e3 DOS R/O
  • 3. b W95 FAT32 52 CP/M 9f BSD/OS e4 SpeedStor c W95 FAT32 (LBA) 53 OnTrack DM6 Aux a0 IBMThinkpadhi eb BeOSfs e W95 FAT16 (LBA) 54 OnTrackDM6 a5 FreeBSD ee GPT f W95 Ext'd(LBA) 55 EZ-Drive a6 OpenBSD ef EFI (FAT-12/16/ 10 OPUS 56 GoldenBow a7 NeXTSTEP f0 Linux/PA-RISCb 11 HiddenFAT12 5c PriamEdisk a8 DarwinUFS f1 SpeedStor 12 Compaqdiagnost61 SpeedStor a9 NetBSD f4 SpeedStor 14 HiddenFAT16<3 63 GNU HURD or Sys ab Darwinboot f2 DOSsecondary 16 HiddenFAT16 64 Novell Netware af HFS/ HFS+ fb VMware VMFS 17 HiddenHPFS/NTF65 Novell Netware b7 BSDI fs fc VMware VMKCORE 18 ASTSmartSleep 70 DiskSecure Multb8 BSDI swap fd Linux raidauto 1b HiddenW95 FAT3 75 PC/IX bb Boot Wizardhidfe LANstep 1c HiddenW95 FAT3 80 Old Minix be Solarisboot ff BBT 1e HiddenW95 FAT1 Hex code (type L to list codes):8e Changedsystemtype of partition7to 8e (Linux LVM) Command(mfor help):w The partitiontable hasbeenaltered! Callingioctl() tore-readpartitiontable. WARNING:Re-readingthe partitiontable failedwitherror16: Device orresource busy. The kernel still usesthe oldtable.The new table will be usedat the nextrebootor afteryourun partprobe(8) orkpartx(8) Syncingdisks. [root@localhost ~]# partx -a /dev/sda BLKPG: Device orresource busy
  • 4. error addingpartition1 BLKPG: Device orresource busy error addingpartition2 BLKPG: Device orresource busy error addingpartition3 BLKPG: Device orresource busy error addingpartition4 BLKPG: Device orresource busy error addingpartition5 BLKPG: Device orresource busy error addingpartition6 BLKPG: Device orresource busy error addingpartition7 [root@localhost ~]# cat /proc/partitions majorminor #blocks name 8 0 20971520 sda 8 1 204800 sda1 8 2 10240000 sda2 8 3 2097152 sda3 8 4 1 sda4 8 5 517837 sda5 8 6 48163 sda6 8 7 56196 sda7 [root@localhost ~]# pvcreate /dev/sda7 Physical volume"/dev/sda7"successfullycreated
  • 5. [root@localhost ~]# vgcreate /dev/sda7 Please enteraphysical volume path Run`vgcreate --help'formore information. [root@localhost ~]# vgcreate /dev/sda Please enteraphysical volume path Run`vgcreate --help'formore information. [root@localhost ~]# vgcreate Aoc /dev/sda Device /dev/sdanotfound(orignoredbyfiltering). Unable toadd physical volume '/dev/sda'tovolume group'Aoc'. [root@localhost ~]# vgcreate aoc /dev/sda Device /dev/sdanotfound(orignoredbyfiltering). Unable toadd physical volume '/dev/sda'tovolume group'aoc'. [root@localhost ~]# vgcreate vg1 /dev/sda Device /dev/sdanotfound(orignoredbyfiltering). Unable toadd physical volume '/dev/sda'tovolume group'vg1'. [root@localhost ~]# vgdisplay Novolume groupsfound [root@localhost ~]# vgcreate aoc /dev/sda7 Volume group"aoc"successfullycreated [root@localhost ~]# vgdisplay --- Volume group --- VG Name aoc SystemID Format lvm2 MetadataAreas 1
  • 6. MetadataSequence No 1 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 OpenLV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 52.00 MiB PE Size 4.00 MiB Total PE 13 AllocPE/ Size 0 / 0 Free PE / Size 13 / 52.00 MiB VG UUID WiiSuj-VtRD-3zES-YFse-yLwN-3YS9-vnCB2k [root@localhost ~]# blkid/dev/sda7 /dev/sda7:UUID="3h4r7d-1JO1-kmi5-RWwW-0hJ8-cNQw-oe7BS4"TYPE="LVM2_member" [root@localhost ~]# lvcreate -L 25M -nAoc1 aoc Roundingupsize tofull physical extent28.00 MiB Logical volume "Aoc1"created [root@localhost ~]# lvs LV VG Attr LSize OriginSnap% Move Log Copy% Convert Aoc1 aoc -wi-a- 28.00m [root@localhost ~]# mkfs.ext4 /dev/aoc/Aoc1 mke2fs1.41.12 (17-May-2010)
  • 7. Filesystemlabel= OS type:Linux Blocksize=1024 (log=0) Fragmentsize=1024 (log=0) Stride=0blocks,Stripe width=0blocks 7168 inodes,28672 blocks 1433 blocks(5.00%) reservedforthe superuser Firstdata block=1 Maximumfilesystemblocks=29360128 4 blockgroups 8192 blockspergroup,8192 fragmentspergroup 1792 inodespergroup Superblockbackupsstoredonblocks: 8193, 24577 Writinginode tables:done Creatingjournal (1024 blocks):done Writingsuperblocksandfilesystemaccountinginformation:done Thisfilesystemwill be automaticallycheckedevery25 mountsor 180 days,whichevercomesfirst. Use tune2fs -cor -i to override. [root@localhost ~]# lvs LV VG Attr LSize OriginSnap% Move Log Copy% Convert Aoc1 aoc -wi-a- 28.00m [root@localhost ~]# df -hT Filesystem Type Size Used Avail Use% Mountedon /dev/sda2 ext4 9.7G 2.3G 6.9G 25% /
  • 8. tmpfs tmpfs 504M 260K 504M 1% /dev/shm /dev/sda1 ext4 194M 24M 161M 13% /boot /dev/sda5 ext4 490M 11M 455M 3% /usr/olx /dev/sr0 iso9660 2.8G 2.8G 0 100% /media/RHEL_6.0i386 Disc 1 [root@localhost ~]# df -h Filesystem Size UsedAvail Use%Mountedon /dev/sda2 9.7G 2.3G 6.9G 25% / tmpfs 504M 260K 504M 1% /dev/shm /dev/sda1 194M 24M 161M 13% /boot /dev/sda5 490M 11M 455M 3% /usr/olx /dev/sr0 2.8G 2.8G 0 100% /media/RHEL_6.0 i386 Disc1 [root@localhost ~]# fdisk -l Disk/dev/sda:21.5 GB, 21474836480 bytes 255 heads,63 sectors/track,2610 cylinders Units= cylindersof 16065 * 512 = 8225280 bytes Sectorsize (logical/physical):512 bytes/ 512 bytes I/Osize (minimum/optimal):512 bytes/512 bytes Diskidentifier:0x00043f93 Device Boot Start End Blocks Id System /dev/sda1 * 1 26 204800 83 Linux Partition1 doesnotendon cylinderboundary. /dev/sda2 26 1301 10240000 83 Linux /dev/sda3 1301 1562 2097152 82 Linux swap/ Solaris /dev/sda4 1562 2610 8421849 5 Extended /dev/sda5 1562 1626 517837+ 83 Linux
  • 9. /dev/sda6 1627 1632 48163+ 83 Linux /dev/sda7 1633 1639 56196 8e Linux LVM Disk/dev/dm-0:29 MB, 29360128 bytes 255 heads,63 sectors/track,3 cylinders Units= cylindersof 16065 * 512 = 8225280 bytes Sectorsize (logical/physical):512 bytes/ 512 bytes I/Osize (minimum/optimal):512 bytes/512 bytes Diskidentifier:0x00000000 Disk/dev/dm-0doesn'tcontainavalidpartitiontable [root@localhost ~]# mkdir AOC [root@localhost ~]# mount /dev/aoc/Aoc1 AOC [root@localhost ~]# df -h Filesystem Size UsedAvail Use%Mountedon /dev/sda2 9.7G 2.3G 6.9G 25% / tmpfs 504M 260K 504M 1% /dev/shm /dev/sda1 194M 24M 161M 13% /boot /dev/sda5 490M 11M 455M 3% /usr/olx /dev/sr0 2.8G 2.8G 0 100% /media/RHEL_6.0 i386 Disc1 /dev/mapper/aoc-Aoc1 28M 1.4M 25M 6% /root/AOC [root@localhost ~]# lvs LV VG Attr LSize OriginSnap% Move Log Copy% Convert Aoc1 aoc -wi-ao28.00m [root@localhost ~]# lvextend -L10M /dev/aoc/Aoc1 Roundingupsize tofull physical extent12.00 MiB Newsize given(3extents) notlargerthanexistingsize (7extents)
  • 10. Run`lvextend --help'formore information. [root@localhost ~]# lvextend -L5M /dev/aoc/Aoc1 Roundingupsize tofull physical extent8.00MiB Newsize given(2extents) notlargerthanexistingsize (7extents) Run`lvextend --help'formore information. [root@localhost ~]# lvextend -L2M /dev/aoc/Aoc1 Roundingupsize tofull physical extent4.00MiB Newsize given(1extents) notlargerthanexistingsize (7extents) Run`lvextend --help'formore information. [root@localhost~]# lvextend -L15M /dev/aoc/Aoc1 Roundingupsize tofull physical extent16.00 MiB Newsize given(4extents) notlargerthanexistingsize (7extents) Run`lvextend --help'formore information. [root@localhost ~]# lvextend -L15M /dev/aoc/Aoc1clear Logical volume Aoc1clearnotfoundinvolume groupaoc [root@localhost ~]# clear [root@localhost ~]# fdisk /dev/sda WARNING:DOS-compatible mode isdeprecated.It'sstronglyrecommendedto switchoff the mode (command'c') andchange displayunitsto sectors(command'u'). Command(mfor help):n Firstcylinder(1640-2610, default1640): Usingdefaultvalue 1640 Last cylinder,+cylindersor+size{K,M,G} (1640-2610, default2610): +500M
  • 11. Command(mfor help):w The partitiontable hasbeenaltered! Callingioctl() tore-readpartitiontable. WARNING:Re-readingthe partitiontable failedwitherror16: Device orresource busy. The kernel still usesthe oldtable.The new table will be usedat the nextrebootor afteryourun partprobe(8) orkpartx(8) Syncingdisks. [root@localhost ~]# fdisk /dev/sda WARNING:DOS-compatible mode isdeprecated.It'sstrongly recommendedto switchoff the mode (command'c') andchange displayunitsto sectors(command'u'). Command(mfor help):p Disk/dev/sda:21.5 GB, 21474836480 bytes 255 heads,63 sectors/track,2610 cylinders Units= cylindersof 16065 * 512 = 8225280 bytes Sectorsize (logical/physical):512 bytes/ 512 bytes I/Osize (minimum/optimal):512 bytes/512 bytes Diskidentifier:0x00043f93 Device Boot Start End Blocks Id System /dev/sda1 * 1 26 204800 83 Linux Partition1 doesnotendon cylinderboundary. /dev/sda2 26 1301 10240000 83 Linux /dev/sda3 1301 1562 2097152 82 Linux swap/ Solaris /dev/sda4 1562 2610 8421849 5 Extended /dev/sda5 1562 1626 517837+ 83 Linux
  • 12. /dev/sda6 1627 1632 48163+ 83 Linux /dev/sda7 1633 1639 56196 8e Linux LVM /dev/sda8 1640 1704 522081 83 Linux Command (m for help):t Partition number(1-8): 8 Hex code (type L to list codes):8e Changedsystemtype of partition8to 8e (Linux LVM) Command (m for help):w The partitiontable hasbeenaltered! Callingioctl() tore-readpartitiontable. WARNING:Re-readingthe partitiontable failedwitherror16: Device orresource busy. The kernel still usesthe oldtable.The new table will be usedat the nextrebootor afteryourun partprobe(8) orkpartx(8) Syncingdisks. [root@localhost ~]# partx -a /dev/sda BLKPG: Device orresource busy error addingpartition1 BLKPG: Device orresource busy error addingpartition2 BLKPG: Device orresource busy error addingpartition3 BLKPG: Device orresource busy error addingpartition4 BLKPG: Device orresource busy error addingpartition5
  • 13. BLKPG: Device orresource busy error addingpartition6 BLKPG: Device orresource busy error addingpartition7 [root@localhost ~]# pvcreate /dev/sda8 Physical volume"/dev/sda8"successfullycreated [root@localhost ~]# vgcreate VG1 /dev/sda8 Volume group"VG1"successfullycreated [root@localhost ~]# vgdisplay --- Volume group --- VG Name VG1 SystemID Format lvm2 MetadataAreas 1 MetadataSequence No 1 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 OpenLV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 508.00 MiB PE Size 4.00 MiB
  • 14. Total PE 127 AllocPE/ Size 0 / 0 Free PE / Size 127 / 508.00 MiB VG UUID 5BaD8w-YikM-He7J-3q3P-LdP1-snoO-SflLpS --- Volume group --- VG Name aoc SystemID Format lvm2 MetadataAreas 1 MetadataSequence No 2 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 OpenLV 1 Max PV 0 Cur PV 1 Act PV 1 VG Size 52.00 MiB PE Size 4.00 MiB Total PE 13 AllocPE/ Size 7 / 28.00 MiB Free PE / Size 6 / 24.00 MiB VG UUID WiiSuj-VtRD-3zES-YFse-yLwN-3YS9-vnCB2k [root@localhost ~]# lvcreate -L +100M -n LV1 VG1
  • 15. Logical volume "LV1"created [root@localhost ~]# mkfs.ext4 /dev/VG1/LV1 mke2fs1.41.12 (17-May-2010) Filesystemlabel= OS type:Linux Blocksize=1024 (log=0) Fragmentsize=1024 (log=0) Stride=0blocks,Stripe width=0blocks 25688 inodes,102400 blocks 5120 blocks(5.00%) reservedforthe superuser Firstdata block=1 Maximumfilesystemblocks=67371008 13 blockgroups 8192 blockspergroup,8192 fragmentspergroup 1976 inodespergroup Superblockbackupsstoredonblocks: 8193, 24577, 40961, 57345, 73729 Writinginode tables:done Creatingjournal (4096 blocks):done Writingsuperblocksandfilesystemaccountinginformation:done Thisfilesystemwill be automaticallycheckedevery20 mountsor 180 days,whichevercomesfirst. Use tune2fs -cor -i to override. [root@localhost ~]# ls acer Aoc Desktop Downloads install.log.syslog Music Public Templates vinod anaconda-ks.cfg AOC Documents install.log jeson Pictures sudhaa Videos
  • 16. [root@localhost ~]# mount /dev/VG1/LV1 jeson/ [root@localhost ~]# df -h Filesystem Size UsedAvail Use%Mountedon /dev/sda2 9.7G 2.3G 6.9G 25% / tmpfs 504M 260K 504M 1% /dev/shm /dev/sda1 194M 24M 161M 13% /boot /dev/sda5 490M 11M 455M 3% /usr/olx /dev/sr0 2.8G 2.8G 0 100% /media/RHEL_6.0 i386 Disc1 /dev/mapper/aoc-Aoc1 28M 1.4M 25M 6% /root/AOC /dev/mapper/VG1-LV1 97M 5.6M 87M 7% /root/jeson [root@localhost~]#lvextend -L+50M /dev/VG1/LV1 Roundingupsize tofull physical extent52.00 MiB Extendinglogical volumeLV1to152.00 MiB Logical volume LV1successfullyresized [root@localhost~]#df -hT Filesystem Type Size Used Avail Use% Mountedon /dev/sda2 ext4 9.7G 2.3G 6.9G 25% / tmpfs tmpfs 504M 260K 504M 1% /dev/shm /dev/sda1 ext4 194M 24M 161M 13% /boot /dev/sda5 ext4 490M 11M 455M 3% /usr/olx /dev/sr0 iso9660 2.8G 2.8G 0 100% /media/RHEL_6.0i386 Disc 1 /dev/mapper/aoc-Aoc1 ext4 28M 1.4M 25M 6% /root/AOC /dev/mapper/VG1-LV1 ext4 97M 5.6M 87M 7% /root/jeson
  • 17. [root@localhost ~]# resize2fs/dev/VG1/LV1 resize2fs1.41.12 (17-May-2010) Filesystemat/dev/VG1/LV1ismountedon/root/jeson;on-line resizingrequired olddesc_blocks= 1, new_desc_blocks=1 Performinganon-lineresizeof /dev/VG1/LV1to155648 (1k) blocks. The filesystemon/dev/VG1/LV1isnow155648 blockslong. [root@localhost ~]# df -hT Filesystem Type Size Used Avail Use% Mountedon /dev/sda2 ext4 9.7G 2.3G 6.9G 25% / tmpfs tmpfs 504M 260K 504M 1% /dev/shm /dev/sda1 ext4 194M 24M 161M 13% /boot /dev/sda5 ext4 490M 11M 455M 3% /usr/olx /dev/sr0 iso9660 2.8G 2.8G 0 100% /media/RHEL_6.0i386 Disc 1 /dev/mapper/aoc-Aoc1 ext4 28M 1.4M 25M 6% /root/AOC /dev/mapper/VG1-LV1 ext4 148M 5.6M 135M 4% /root/jeson LVM REMOVE [root@localhost ~]# lvs LV VG Attr LSize OriginSnap% Move Log Copy% Convert LV1 VG1 -wi-a- 152.00m Aoc1 aoc -wi-a- 28.00m [root@localhost ~]# lvremove /dev/aoc Do youreallywantto remove active logical volume Aoc1?[y/n]:y
  • 18. Logical volume "Aoc1"successfullyremoved [root@localhost ~]# lvs LV VG Attr LSize OriginSnap% Move Log Copy% Convert LV1 VG1 -wi-a- 152.00m [root@localhost ~]# vgremove aoc Volume group"aoc"successfullyremoved [root@localhost ~]# vgs VG #PV #LV #SN Attr VSize VFree VG1 1 1 0 wz--n- 508.00m 356.00m [root@localhost ~]# pvremove /dev/sda7 Labelson physical volume "/dev/sda7"successfullywiped