LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Virtual CentOS 6.4 Server Expand Disk for Splunk Instance (https://www.linuxquestions.org/questions/linux-newbie-8/virtual-centos-6-4-server-expand-disk-for-splunk-instance-4175532397/)

Timmac 01-29-2015 10:53 AM

Virtual CentOS 6.4 Server Expand Disk for Splunk Instance
 
As I'm sure there are other posts for this, I'm terrified to mess with disks in Linux as I'm very green. I've looked at one other post which suggests to run the following so I'm going to do the same. The drive provisioned originally had 400 gb, but currently has 500 gb allocated in vmware. Thanks so much in advance!

Code:

fdisk -l
pvs
vgs
lvs
df -h


Code:

[root@uspk10splunk ~]# fdisk -l

Disk /dev/sda: 8589 MB, 8589934592 bytes
64 heads, 32 sectors/track, 8192 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c255c

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          2        501      512000  83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2            502        8192    7875584  8e  Linux LVM
Partition 2 does not end on cylinder boundary.

Disk /dev/sdb: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x69437664

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1              1      52216  419424988+  8e  Linux LVM

Disk /dev/mapper/vg_uspk10vsp03-lv_root: 3833 MB, 3833593856 bytes
255 heads, 63 sectors/track, 466 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


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


Disk /dev/mapper/vg_opt-lv_opt: 429.5 GB, 429488340992 bytes
255 heads, 63 sectors/track, 52215 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Code:

[root@uspk10splunk ~]# pvs
  PV        VG            Fmt  Attr PSize  PFree
  /dev/sda2  vg_uspk10vsp03 lvm2 a--    7.51g    0
  /dev/sdb1  vg_opt        lvm2 a--  399.99g    0

Code:

[root@uspk10splunk ~]# vgs
  VG            #PV #LV #SN Attr  VSize  VFree
  vg_opt          1  1  0 wz--n- 399.99g    0
  vg_uspk10vsp03  1  2  0 wz--n-  7.51g    0

Code:

[root@uspk10splunk ~]# lvs
  LV      VG            Attr      LSize  Pool Origin Data%  Move Log Cpy%Sync                    Convert
  lv_opt  vg_opt        -wi-ao--- 399.99g                                                         
  lv_root vg_uspk10vsp03 -wi-ao---  3.57g                                                         
  lv_swap vg_uspk10vsp03 -wi-ao---  3.94g

Code:

[root@uspk10splunk ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_uspk10vsp03-lv_root
                      3.6G  1.5G  1.9G  45% /
tmpfs                1.9G    0  1.9G  0% /dev/shm
/dev/mapper/vg_opt-lv_opt
                      394G  374G  422M 100% /opt
/dev/sda1            485M  32M  428M  7% /boot


Habitual 01-29-2015 10:58 AM

Welcome to LQ!

Is there a question?

Timmac 01-29-2015 11:00 AM

Oh I'm sorry, I'm not quite sure how to actually do the expansion from this point. All I pretty much know is the allocation portion from the VMware side.

sudowtf 01-29-2015 11:44 AM

yes, it's very scary but i've done it once without issue.
http://www.rootusers.com/how-to-incr...-machine-disk/ (notice he links another lvm method before the content)
best if luck, make backups or snapshot based backups (i like trilead.com free verson)

Timmac 01-29-2015 01:58 PM

Thanks for the help. I've also found this article which is very helpful from the VMware side, in case anyone searches and stumbles on this later.

http://kb.vmware.com/selfservice/mic...rnalId=1006371

Sometimes Windows makes things like this way easier :)

Right click, extend, enter all the way... done :)

sudowtf 01-29-2015 02:23 PM

yes, basically exact same instructions in your link. fyi, a plain ext4 would be just as simple as the windows (use gparted to do the same drag-and-drop expansion).


All times are GMT -5. The time now is 05:16 AM.