Hi.
I had created a VM in Virtualbox running Debian 7 wheezy with a VoIP telephony application, and 10 GB disk in a single partition.
I exported that VM from Virtualbox to VMWare and assign to it 200 GB of hard disk, however, the sda1 partition still shows 10GB
Is there a way to increase the disk size to 200 GB since it has only one partition?
Filesystem Size Used Avail Use% Mounted on
rootfs 9.4G 7.4G 1.6G 83% /
udev 10M 0 10M 0% /dev
tmpfs 801M 212K 801M 1% /run
/dev/disk/by-uuid/9aaef28b-66fa-4dbc-a1f3-9380c1cf4760 9.4G 7.4G 1.6G 83% /
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 1.7G 0 1.7G 0% /run/shm
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 100G 0 disk
├─sda1 8:1 0 9.6G 0 part /
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 466M 0 part [SWAP]
Thanks in advance!
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
[Software] Increase partition size in a virtual disk image
[Software] Increase partition size in a virtual disk image
Last edited by dangeli on 2023-06-06 13:17, edited 2 times in total.
-
- Global Moderator
- Posts: 2926
- Joined: 2014-07-20 18:12
- Location: Europe
- Has thanked: 72 times
- Been thanked: 401 times
Re: [Software] Increase disk size
Hello,
You can use the qemu-nbd command [1] to expose your virtual disk image as a network block device (nbd0 in the example) and to change partitions size using the gparted program. For example:
You have to install the qemu-utils package.
---
[1] https://manpages.debian.org/testing/qemu-utils/qemu-nbd.8.en.html
[2] https://manpages.debian.org/testing/gparted-common/gparted.8.en.html
You can use the qemu-nbd command [1] to expose your virtual disk image as a network block device (nbd0 in the example) and to change partitions size using the gparted program. For example:
Code: Select all
$ su -l -c "modprobe nbd"
$ su -l -c "qemu-nbd -c /dev/nbd0 $PWD/virtual_disk_image.qcow2"
$ /sbin/gparted /dev/nbd0
$ su -l -c "qemu-nbd -d /dev/nbd0"
---
[1] https://manpages.debian.org/testing/qemu-utils/qemu-nbd.8.en.html
[2] https://manpages.debian.org/testing/gparted-common/gparted.8.en.html
Re: [Software] Increase disk size
Thank you so much Aki.
I will try (maybe this weekend) and then let you know
I will try (maybe this weekend) and then let you know
-
- Global Moderator
- Posts: 2926
- Joined: 2014-07-20 18:12
- Location: Europe
- Has thanked: 72 times
- Been thanked: 401 times
Re: [Software] Increase disk size
Hello,
As @ticojohn suggested, please make a copy of the virtual disk image and use it to test partion resizing.
It would be useful to rename the subject of the first post from "[Software] Increase disk size" to "[Software] Increase partition size in a virtual disk image" to be easily spotted by other viewers.
I'll wait for it.
As @ticojohn suggested, please make a copy of the virtual disk image and use it to test partion resizing.
It would be useful to rename the subject of the first post from "[Software] Increase disk size" to "[Software] Increase partition size in a virtual disk image" to be easily spotted by other viewers.
-
- Posts: 444
- Joined: 2023-02-07 13:35
- Been thanked: 105 times
Re: [Software] Increase disk size
As an alternative to the QEMU approach the OP could simply run a live Debian version in VirtualBox with the drive attached to the virtual system so that gparted could be used on it directly from the live ISO.
Jeder nach seinen Fähigkeiten, jedem nach seinen Bedürfnissen.
Re: [Software] Increase partition size in a virtual disk image
Hi,
Thank you for the reply!
I am newby to Linux, and do not quite understand.
You mean that I can create a new VM running debian or Ubuntu, and attach the 10 GB disk running Debian 7 wheezy with a VoIP telephony application, to increase the size using gparted?
In this case, how can I attach the disk to a new VM.
Thanks in advance!
Thank you for the reply!
I am newby to Linux, and do not quite understand.
You mean that I can create a new VM running debian or Ubuntu, and attach the 10 GB disk running Debian 7 wheezy with a VoIP telephony application, to increase the size using gparted?
In this case, how can I attach the disk to a new VM.
Thanks in advance!
-
- Posts: 444
- Joined: 2023-02-07 13:35
- Been thanked: 105 times
Re: [Software] Increase partition size in a virtual disk image
I don't use VirtualBox, it's just awful, so I have no idea about the operational specifics, sorry. Perhaps somebody else can help with that.
Jeder nach seinen Fähigkeiten, jedem nach seinen Bedürfnissen.
-
- df -h | grep > 20TiB
- Posts: 1418
- Joined: 2012-10-06 05:31
- Location: /dev/chair
- Has thanked: 79 times
- Been thanked: 189 times
Re: [Software] Increase partition size in a virtual disk image
Boot the VM from a partitioning livecd iso. gparted live should work nicely, and it has a very easy GUI for moving and resizing.
VirtualBox example: Devices -> Optical Drives -> Choose a disk file -> reboot VM and hit F12 at the "select boot device" prompt to boot from CD.
I don't know anything about VMWare, but presumably it has a comparable feature.
Or as Random_Troll said, make a new VM in VirtualBox (no need to create a hard disk image or install anything), attach your targets virtual disk to it (Settings -> Storage -> select appropriate virtual disk controller -> Add Attachment -> Hard Disk), then proceed as above. Assuming the disk image formats are compatible of course, IIRC they are.
This really has nothing to do with Debian, it's the same generic process you'd use for any guest OS. If you really need a step-by-step how to for attaching storage in [insert VM software of choice], that's more a question for the [insert VM software of choice] people.
VirtualBox example: Devices -> Optical Drives -> Choose a disk file -> reboot VM and hit F12 at the "select boot device" prompt to boot from CD.
I don't know anything about VMWare, but presumably it has a comparable feature.
Or as Random_Troll said, make a new VM in VirtualBox (no need to create a hard disk image or install anything), attach your targets virtual disk to it (Settings -> Storage -> select appropriate virtual disk controller -> Add Attachment -> Hard Disk), then proceed as above. Assuming the disk image formats are compatible of course, IIRC they are.
This really has nothing to do with Debian, it's the same generic process you'd use for any guest OS. If you really need a step-by-step how to for attaching storage in [insert VM software of choice], that's more a question for the [insert VM software of choice] people.
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.