0

I have a 500GB HDD for CentOS 6.7 . But when I created a partition, I just have created a small storage size for root, but /home folder had lots of capacity. Could I move available capacity from /home folder for /root folder. It's around 300GB for /root folder

[trieutruong@moodle mapper]$ sudo df -ha
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_moodle-lv_root
                       50G   14G   33G  31% /
proc                     0     0     0    - /proc
sysfs                    0     0     0    - /sys
devpts                   0     0     0    - /dev/pts
tmpfs                 2.9G  144K  2.9G   1% /dev/shm
/dev/sda1             477M   98M  354M  22% /boot
/dev/mapper/vg_moodle-lv_home
                      405G   19G  366G   5% /home
none                     0     0     0    - /proc/sys/fs/binfmt_misc
sunrpc                   0     0     0    - /var/lib/nfs/rpc_pipefs
gvfs-fuse-daemon         0     0     0    - /root/.gvfs

    [trieutruong@owncloud ~]$ sudo vgdisplay
  --- Volume group ---
  VG Name               vg_moodle
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               3
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               465.27 GiB
  PE Size               4.00 MiB
  Total PE              119109
  Alloc PE / Size       119109 / 465.27 GiB
  Free  PE / Size       0 / 0   
  VG UUID               XjErZu-p3bD-2giP-Uy1x-JXpz-qsaN-82zs2X

[trieutruong@owncloud ~]$ sudo lvdisplay
  --- Logical volume ---
  LV Path                /dev/vg_moodle/lv_root
  LV Name                lv_root
  VG Name                vg_moodle
  LV UUID                akruVU-c3oT-eQsr-UTK6-3x70-uwpt-atyMeY
  LV Write Access        read/write
  LV Creation host, time moodle, 2015-04-10 22:44:22 +0700
  LV Status              available
  # open                 1
  LV Size                50.00 GiB
  Current LE             12800
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

  --- Logical volume ---
  LV Path                /dev/vg_moodle/lv_home
  LV Name                lv_home
  VG Name                vg_moodle
  LV UUID                9V7IoG-t4KL-8YOj-TzKQ-jgXf-7DEi-Vc4vWD
  LV Write Access        read/write
  LV Creation host, time moodle, 2015-04-10 22:44:31 +0700
  LV Status              available
  # open                 1
  LV Size                411.52 GiB
  Current LE             105349
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2

  --- Logical volume ---
  LV Path                /dev/vg_moodle/lv_swap
  LV Name                lv_swap
  VG Name                vg_moodle
  LV UUID                IXlxAv-t6J0-NdXa-OaQJ-s9sS-HUNc-LQojsv
  LV Write Access        read/write
  LV Creation host, time moodle, 2015-04-10 22:45:44 +0700
  LV Status              available
  # open                 1
  LV Size                3.75 GiB
  Current LE             960
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1

[trieutruong@owncloud ~]$ sudo fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xd9047926

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64       60802   487873536   8e  Linux LVM

Disk /dev/mapper/vg_moodle-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_moodle-lv_swap: 4026 MB, 4026531840 bytes
255 heads, 63 sectors/track, 489 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_moodle-lv_home: 441.9 GB, 441865732096 bytes
255 heads, 63 sectors/track, 53720 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000
  • 1
    please edit your question and add the output of vgdisplay, lvdisplay and fdisk -l. remember to use the {} icon in the SE editor to format the output as code. – cas Mar 29 '16 at 4:38
  • Please be mindful of the difference between the file system root (/) and the directory /root (which is traditionally the home directory for the root user). – a CVn Mar 29 '16 at 13:37
0

You need to reduce the home LV and then extend the root one. Redusizing/Expanding the size of LV ( presented as a blocking device ) is preceded by unmounting the file system.

Not the answer you're looking for? Browse other questions tagged or ask your own question.