LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 04-25-2017, 09:28 AM   #1
redhatwannabe
Member
 
Registered: Dec 2008
Posts: 83

Rep: Reputation: 15
New space not reflected in virtual machine


Dear all,

my host is windows 8.1 and guest is Oracle Linux 6.5

I've extended my virtual disk space
Code:
C:\Users\User>VBoxManage modifyhd "C:\Users\User\VirtualBox VMs\ol65-12102\NewVi
rtualDisk1_root.vdi" --resize 14541
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
after I reboot the virtual machine
when I do a fdisk -l, still the same old disk size is reflected.
Code:
[root@ol65-12102 ~]# fdisk -l

Disk /dev/sda: 12.9 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 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: 0x00038819

   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        1567    12069888   8e  Linux LVM

Disk /dev/mapper/vg_ol6512102-lv_root: 8061 MB, 8061452288 bytes
255 heads, 63 sectors/track, 980 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_ol6512102-lv_swap: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 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
I'm following

https://www.rootusers.com/how-to-inc...-machine-disk/

if fdisk could not detect the new partition, there's not much I could do.
Code:
root@ol65-12102 ~]# df -mT
Filesystem                       Type  1M-blocks  Used Available Use% Mounted on
/dev/mapper/vg_ol6512102-lv_root ext4       7440  6925       130  99% /
tmpfs                            tmpfs      1977     1      1977   1% /dev/shm
/dev/sda1                        ext4        477    55       397  13% /boot
 
Old 04-25-2017, 12:23 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,568

Rep: Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865
May or may not be important but what VirtualBox version are you running?
Are there any snapshots?
Did the actual VDI file resize?
 
Old 04-25-2017, 12:45 PM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,630

Rep: Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265
Probably I missed something, but this is - in general - a two step process:
1. you need to give more space (that is modifyhd), which will (only) allow to increase the size of the filesystem
2. actually that means /dev/sda has more space, but /dev/sda1 and /dev/sda2 did not change at all. If you want to increase the size of your logical volume you need to create a /dev/sda3 containing the space you added in the first step.
3. ok, three steps: you need to add /dev/sda3 to /dev/mapper/vg_ol6512102-lv_root

but again, probably I missed something, so correct me if I misunderstood anything
 
Old 04-26-2017, 09:12 AM   #4
redhatwannabe
Member
 
Registered: Dec 2008
Posts: 83

Original Poster
Rep: Reputation: 15
Dear pan64,

I did a restore from snapshot, but when I do a fdisk -l, there's no difference at all

Code:
Disk /dev/sda: 12.9 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 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: 0x00038819

   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        1567    12069888   8e  Linux LVM

Disk /dev/mapper/vg_ol6512102-lv_root: 8061 MB, 8061452288 bytes
255 heads, 63 sectors/track, 980 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_ol6512102-lv_swap: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 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
the 3 step process that you mentioned,

give more space to which will increase the size of the filesystem. done see my output for modifyhd the output

when i try to create partition 3, the following happens

Code:
[root@ol65-12102 ~]# fdisk /dev/sda

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
No free sectors available

Command (m for help):
no more free space

I'm using virtualbox version 5.1.14r112924 (Qt 5.6.2). file did resize see output for modifyhd.

any suggestion provided will be greatly appreciated!

thanks a lot!

Last edited by redhatwannabe; 04-26-2017 at 09:25 AM. Reason: say thanks
 
Old 04-26-2017, 10:03 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,568

Rep: Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865
I did read that with earlier versions you had to delete the snapshots before you could actually extend the virtual drive space. You could try cloning, then delete the snapshots then see what happens.

You can also create a new VDI and attach it to the VM to extend the root LV space.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to : Open Virtual Machine Manager to create a new virtual machine BKChicago Linux - Newbie 2 11-08-2016 09:48 PM
how to know the remote machine is Virtual machine or physical machine pantdk Linux - Server 19 10-16-2014 01:48 PM
Is base memory of virtual machine used when virtual machine is not running? ravisingh1 Linux - Virtualization and Cloud 3 04-09-2013 03:41 AM
Issue faced while installing Linux in virtual machine in Oracle virtual box ravisingh1 Linux - Virtualization and Cloud 5 04-07-2013 10:42 AM
Running virtual pc files in a virtual machine in linux ... preferably virtual box biharibong Linux - Software 4 01-21-2009 01:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 04:32 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