Mobile disk space in linux

Source: Internet
Author: User
To move a disk space in linux to/home: 1. view disk space [root @ computehome] # df-hFilesystemSizeUsedAvailUse % Mountedon/dev/mapper/vg_compute-lv_root... to move a disk space in linux to/home: 1. view disk space [root @ compute home] # df-hFilesystem Size Used Avail Use % Mounted on/dev/mapper/vg_compute-lv_root 531G 48G 478G 10%/tmpfs 16G 88 K 16G 1%/dev/shm/dev/mapper/ddf3164c5349202020202010000055000000004711471100001450p1 485 M 38 M 422 M 9%/boot 2. uninstall/homeumount/home/3. view logical volume group information [root @ compute home] # vgs VG # PV # LV # SN Attr VSize VFree vg_compute 1 3 0 wz -- n-556.44g 712.00 m 4. check whether the disk is normal e2fsck-f/dev/vg_compute/lv_home 5. shrink/home disk size resize2fs/dev/vg_compute/lv_home 1024 Mlvreduce-L 1024 M/dev/vg_compute/lv_home 6. extended/disk size lvextend-L + 489 GB/dev/vg_compute/lv_root resize2fs/dev/vg_compute/lv_root 7. mount/homemount/home 8. restore the user folder in/home 1. create a user folder and modify the permission mkdir/home/shomechown shome: shome/home/shome 2. copy all the files (hidden files) in the/etc/skel directory to your default directory to solve the problem. cp/etc/skel /. bash */home/shome/create a user in Centos, but I do not know why it is not generated in the user's default directory folder ". bash_profile ". when switching to a new user, the following problems will occur, and no shell name solution will appear: all the files in the/etc/skel Directory (hidden files) copy to the user's default directory to solve the problem. because the Volume of Openstack requires an independent Volume shard, I directly created a Volume as the vg during partitioning. Note that the vg name must be "nova-vloumes". you can use vgdisplay to view the appendix: 1 pvs. use lvs vgs -- 1.1 to display the physical volume (pv) information [root @ redhat6 lvm] # pvs pv vg Fmt Attr PSize PFree/dev/sda2 vg_redhat6 lvm2 a -- 14.51g 0/dev/sdb vg_redhat6 lvm2 a -- 4.00g 2.81g -- 1.2 display logical volume Group (vg) information [root @ redhat6 lvm] # vgs VG # PV # LV # SN Attr VSize VFree vg_redhat6 2 3 0 wz -- n-18.50g 2.81g -- 1.3 display logical volume (lv) information [root @ redhat6 lvm] # lvs lv vg Attr LSize Origin Snap % Move Log Copy % Convert lv_pgdata_01 vg_redhat6-wi-ao 700.00 m lv_root vg_redhat6-wi-ao 13.10g lv_swap vg_redhat6-wi-ao 1.91g remarks: previous pvs, lvs, the vgs command displays the image information of LVM by default. II. formatting control -- 2.1 display additional information [root @ redhat6 lvm] # pvs-v Scanning for physical volume names pv vg Fmt Attr PSize PFree DevSize pv uuid/dev/sda2 vg_redhat6 lvm2 -- 14.51g 0 14.51g dpTW84-DHRy-PIA9-u1tY-YUH4-XQKw-8Hy2Zm/dev/sdb vg_redhat6 lvm2 a -- 4.00g 2.81g 4.00g YKIQwX-zc6H-TZ65-P3qr-sRfk-LX0p-T18vdG [root @ redhat6 lvm] # vgs-v Finding all volume groups Finding volume group "vg_redhat6 "VG Attr Ext # PV # LV # SN VSize VFree vg uuid vg_redhat6 wz -- n-4.00 m 2 3 0 18.50g 2.81g E6cA2U-TL1x-ScCV-UnGU-3Kq4-1u6V-WUb5L4 remarks: adding the-v parameter will show additional information about the LVM image, for example, the UUID field. -- 2.2 pvs default output [root @ redhat6 lvm] # pvs pv vg Fmt Attr PSize PFree/dev/sda2 vg_redhat6 lvm2 a -- 14.51g 0/dev/sdb vg_redhat6 lvm2 a -- 4.00g 2.81g -- 2.3 only displays pv_name, dev_size field [root @ redhat6 lvm] # pvs-o pv_name, dev_size PV DevSize/dev/sda2 14.51g/dev/sdb 4.00g remarks: add the-o parameter, specify the fields to be output. -- 2.4 on pvs default output, add Field [root @ redhat6 lvm] # pvs pv vg Fmt Attr PSize PFree/dev/sda2 vg_redhat6 lvm2 a -- 14.51g 0/dev/sdb vg_redhat6 lvm2 a -- 4.00g 2.81g [root @ redhat6 lvm] # pvs-o + pv_uuid pv vg Fmt Attr PSize PFree pv uuid/dev/sda2 vg_redhat6 lvm2 a -- 14.51g 0 dpTW84-DHRy-PIA9-u1tY-YUH4-XQKw-8Hy2Zm/dev/sdb vg_redhat6 lvm2 a -- 4.00g 2.81g YKIQwX-zc6H-TZ65-P3qr-sRfk-LX0p-T18vdG remarks: if you want to add a word to the default output -O + field name. -- 2.5 vgs Display Volume member [root @ redhat6 lvm] # vgs VG # PV # LV # SN Attr VSize VFree vg_redhat6 2 3 0 wz -- n-18.50g 2.81g [root @ redhat6 lvm] # vgs-o + lv_name VG # PV # LV # SN Attr VSize VFree LV vg_redhat6 2 3 0 wz -- n-18.50g 2.81g lv_root vg_redhat6 2 3 0 wz -- n- 18.50g 2.81g lv_swap vg_redhat6 2 3 0 wz -- n-18.50g 2.81g lv_pgdata_01 three-field sorting -- 3.1 sort by lv_size field [root @ redhat6 lvm] # lvs lv vg Attr LSize Origin sn Ap % Move Log Copy % Convert lv_pgdata_01 vg_redhat6-wi-ao 700.00 m lv_root vg_redhat6-wi-ao 13.10g lv_swap Wi-Fi-wi-ao 1.91g [root @ redhat6 lvm] # lvs- O lv_size lv vg Attr LSize Origin Snap % Move Log Copy % Convert lv_pgdata_01 vg_redhat6-wi-ao 700.00 m lv_swap vg_redhat6-wi-ao 1.91g lv_root vg_redhat6-wi-ao 13.10g remarks: if you want to sort by output fields, you can use the-O field name option. The lvs, vgs, and pvs fields -- 4.1 lvs field ------------------- lv_all-All fields in this section. lv_uuid-Unique identifier. lv_name-Name. LVs created for internal use are enclosed in brackets. lv_path-Full pathname for LV. lv_attr-Various attributes-see man page. lv_major-Persistent major number or-1 if not persistent. lv_minor-Persistent minor number or-1 if not persistent. lv_read_ahead-Read ahead setting in current units. lv_kernel_major-Currently assigned major number or-1 if LV is not active. lv_kernel_minor-Currently assigned minor number or-1 if LV is not active. lv_kernel_read_ahead-Currently-in-use read ahead setting in current units. lv_size-Size of LV in current units. seg_count-Number of segments in LV. origin-For snapshots, the origin device of this LV. origin_size-For snapshots, the size of the origin device of this LV. snap_percent-For snapshots, the percentage full if LV is active. copy_percent-For mirrors and pvmove, current percentage in-sync. move_pv-For pvmove, Source PV of temporary LV created by pvmove. convert_lv-For lvconvert, Name of temporary LV created by lvconvert. lv_tags-Tags, if any. performance_log-For mirrors, the LV holding the synchronisation log. modules-Kernel device-mapper modules required for this LV. -- 4.2 pvs field pv_all-All fields in this section. pe_start-Offset to the start of data on the underlying device. pv_size-Size of PV in current units. pv_free-Total amount of unallocated space in current units. pv_used-Total amount of allocated space in current units. pv_attr-Various attributes-see man page. pv_pe_count-Total number of Physical Extents. pv_pe_alloc_count-Total number of allocated Physical Extents. pv_tags-Tags, if any. pv_mda_count-Number of metadata areas on this device. pv_mda_used_count-Number of metadata areas in use on this device. -- 4.3 vgs field vg_all-All fields in this section. vg_fmt-Type of metadata. vg_uuid-Unique identifier. vg_name-Name. vg_attr-Various attributes-see man page. vg_size-Total size of VG in current units. vg_free-Total amount of free space in current units. vg_sysid-System ID indicating when and where it was created. vg_extent_size-Size of Physical Extents in current units. vg_extent_count-Total number of Physical Extents. vg_free_count-Total number of unallocated Physical Extents. max_lv-Maximum number of LVs allowed in VG or 0 if unlimited. max_pv-Maximum number of PVs allowed in VG or 0 if unlimited. pv_count-Number of PVs. lv_count-Number of LVs. snap_count-Number of snapshots. vg_seqno-Revision number of internal metadata. incremented whenever it changes. vg_tags-Tags, if any. vg_mda_count-Number of metadata areas on this VG. vg_mda_used_count-Number of metadata areas in use on this VG. vg_mda_free-Free metadata area space for this VG in current units. vg_mda_size-Size of smallest metadata area for this VG in current units. vg_mda_copies-Target number of in use metadata areas in the VG.
Related Article

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.