Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Costa's Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
LVM operations
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== create LV == 1. create disk partition (fdisk) 2. pvcreate /dev/sdb1 3. lvmdiskscan , pvdisplay , pvscan(to check) 4. vgcreate vg_newlvm /dev/sdb1 vgcreate vg_newlvm /dev/sdb1 /dev/sdc1 5. lvcreate --name centos7_newvol -l 100%FREE vg_newlvm lvcreate -L 15G vg_newlvm lvcreate -l 50%VG -n centos7_newvol vg_newlvm 6. lvdisplay (to check) 7. mkfs.ext4 /dev/vg_newlvm/centos7_newvol ==resize LV == 1. Identify the Volume Group vgs 2. Extend the Volume Group vgextend myvolume /dev/sda2 3. Check vgs , vgdisplay 4. Extend the Logical Volume lvextend -l +100%FREE /dev/myvg/myvolume Note: You can also extend the file system size using single lvextnd command by adding -r at end, example is shown below lvextend -l +100%FREE /dev/myvg/myvolume -r 5. Extend the filesystem xfs_growfs /dev/myvg/myvolume ==disable/delete LV == 1. Delete the entry of the mount point from the /etc/fstab : # cat /etc/fstab ... /dev/mapper/datavg-testlv /data01 ext4 defaults 0 0 ... 2. Unmount the mount point : # umount /data01 3. Disable lvm : # lvchange -an /dev/datavg/testlv 4. Delete lvm volume : # lvremove /dev/datavg/testlv 5. Disable volume group : # vgchange -an datavg 6. Delete volume group : # vgremove datavg 7. Delete physical Volumes being used for the volume group βdatavgβ : # pvremove /dev/sdb /dev/sdc ==mount LVM from external disk == Make sure lvm2 is installed: $ sudo yum install lvm2 Load the necessary module(s) as root: $ sudo modprobe dm-mod Scan your system for LVM volumes and identify in the output the volume group name that has your Fedora volume (mine proved to be VolGroup00): $ sudo vgscan Activate the volume: $ sudo vgchange -ay VolGroup00 Find the logical volume that has your Fedora root filesystem (mine proved to be LogVol00): $ sudo lvs Create a mount point for that volume: $ sudo mkdir /mnt/fcroot Mount it: $ sudo mount /dev/VolGroup00/LogVol00 /mnt/fcroot -o ro,user You're done, navigate to /mnt/fcroot and copy the files and paste somewhere else. Note: In case of bad sectors on the disk, one can prevent journaling with the option noload.
Summary:
Please note that all contributions to Costa's Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Project:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
LVM operations
Add topic