LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-09-2015, 08:55 AM   #1
brjohnsmith
LQ Newbie
 
Registered: Mar 2015
Posts: 8

Rep: Reputation: Disabled
VMware - Linux - How to extend spaces - root directory


Hi,

I extended spaces (20GB) on my VM (Linux), and I also have used GPARTED to resize it, However, there are something wrong or something that I need to do and I missed it.

If you see the screenshots, you will be able to see some differences: the name of devices as /dev/sda1 and 2, but on Linux, the names are /dev/hda1 and 2. On gparted I am able to see the 20GB added to the sda2, but I am not able to see on Linux.

See below other information such as df command, and pv and lv.

So, if someone could help me how to add the space (on root directory) with no losing the data, I would appreciate a lot.

tks.


root@SRV ~]# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/VolGroup00-LogVol00

77G 69G 4,2G 95% /

/dev/hda1 99M 21M 79M 21% /boot

none 1014M 0 1014M 0% /dev/shm

.host:/ 105G 72G 33G 69% /mnt/hgfs

[root@SRV ~]# df -i

Filesystem Inodes IUsed IFree IUse% Mounted on

/dev/mapper/VolGroup00-LogVol00

10240000 258840 9981160 3% /

/dev/hda1 26104 50 26054 1% /boot

none 223818 1 223817 1% /dev/shm

.host:/ 0 0 0 - /mnt/hgfs





[root@SRV ~]# pvdisplay

--- Physical volume ---

PV Name /dev/hda2

VG Name VolGroup00

PV Size 99,90 GB / not usable 25,84 MB

Allocatable yes (but full)

PE Size (KByte) 32768

Total PE 3196

Free PE 0

Allocated PE 3196

PV UUID AQuR38-Uoqh-vjKa-27Kj-0MJu-EFCc-9rM56b



[root@SRV ~]# lvdisplay

--- Logical volume ---

LV Name /dev/VolGroup00/LogVol00

VG Name VolGroup00

LV UUID mn2uXJ-SKIS-i96k-lMBt-bfnb-USGa-EnCfbG

LV Write Access read/write

LV Status available

# open 1

LV Size 98,03 GB

Current LE 3137

Segments 2

Allocation inherit

Read ahead sectors auto

- currently set to 256

Block device 253:0



--- Logical volume ---

LV Name /dev/VolGroup00/LogVol01

VG Name VolGroup00

LV UUID 7YH09Q-Lfb3-nWeK-QyLB-T2ya-UZ0X-5nUjgn

LV Write Access read/write

LV Status available

# open 1

LV Size 1,84 GB

Current LE 59

Segments 1

Allocation inherit

Read ahead sectors auto

- currently set to 256

Block device 253:1





[root@SRV ~]# fdisk -l



Disk /dev/hda: 107.3 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 cylinders

Units = cilindros of 16065 * 512 = 8225280 bytes



Device Boot Start End Blocks Id System

/dev/hda1 * 1 13 104391 83 Linux

/dev/hda2 14 13055 104753177+ 8e Linux LVM
 
Old 03-09-2015, 11:45 AM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
From what I can understand you have Linux guest VM running in VMware. You turned off the VM and increased the size of the existing disk by 20 GB. Turned the VM on after that you are able to see increased space in fdisk -l but your logical volume still shows the old size.

Do you have the backup of the existing system. It is always advisable to have good / verified backup of existing data before playing around with partitions.

Would like to know if you have tried running:

Code:
resize2fs /dev/mapper/VolGroup00-LogVol00
 
Old 03-09-2015, 11:55 AM   #3
brjohnsmith
LQ Newbie
 
Registered: Mar 2015
Posts: 8

Original Poster
Rep: Reputation: Disabled
Hi T3RM1NVT0R,

thank you for the information.

Yes, the increase was done with VM off, and then I started it. I had 80GB before, and I added 20GB, as you see.

When I executed the command that you wrote, I receive a message that the vol is mounted.

If you see the information, the mounted directory is the root (/).

Any other way to execute it or to make it available the 20GB on root directory?

tks.
 
Old 03-09-2015, 12:16 PM   #4
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Sorry I missed that, for that you have to boot the system in rescue mode and from there you need to run resize2fs.
 
Old 03-10-2015, 07:12 AM   #5
brjohnsmith
LQ Newbie
 
Registered: Mar 2015
Posts: 8

Original Poster
Rep: Reputation: Disabled
Hi, I have been trying to boot as rescue mode, but there is something wrong. First of all, the first installation ins Centos 4.9, and I have upgraded to 5.3. None of these operating system are supported and available. So, I have been using the last version (Centos 7). However, when I boot via DVD, the first screen is arisen, but there is no option to rescue mode. If I try to choose Install Centos 7, or other options, it seems that the system hangs and nothing happens.
So, is there other way to resize the root directory, considering that it is the solution to get the additional space extended?
tks.
 
Old 03-10-2015, 07:19 AM   #6
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
You have to type in Linux rescue at the boot prompt when you boot using DVD. Try the following link: https://www.centos.org/docs/5/html/I...mode-boot.html

Edit: Just tested, you can hit escape key and it will drop you to boot: there you type Linux rescue to boot in rescue mode. In earlier version like RHEL5 you get to type upfront without hitting the escape key.

Last edited by T3RM1NVT0R; 03-10-2015 at 08:47 AM.
 
Old 03-11-2015, 06:57 AM   #7
brjohnsmith
LQ Newbie
 
Registered: Mar 2015
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thumbs up

Hi,

I had to download the DVD #1 in order to be able to get the screen with - Rescue Mode option.

After this, I also had to follow some options, and then I was able to write the command: linux rescue.

Once that, it worked, the root directory was resized with the GB added.

I thought that it should work only using GPARTED on boot process, but, anyway....it worked now.

thank you.
 
Old 03-11-2015, 07:04 AM   #8
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
You're welcome. Good to hear that it has been fixed.

Please mark the thread as solved.

Enjoy Linux!!!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to extend root directory on size wise previously it was 15gb i want to increase venkatesh51 Linux - Newbie 5 04-08-2014 07:06 AM
[SOLVED] How to extend root partition in linux jsaravana87 Linux - Server 2 05-18-2012 04:31 PM
Need Help to Extend Disk Space on VPS (VMWARE) eyes_drinker Linux - Virtualization and Cloud 1 12-30-2010 04:16 PM
How to extend a volume Centos 5.4 on VMware ESX 3.5? baldur2630 Linux - Virtualization and Cloud 1 01-30-2010 03:41 AM
Extend Active Directory with OpenLdap Felipe Linux - Server 6 04-04-2008 03:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration