LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-13-2014, 08:00 AM   #1
lee_can
Member
 
Registered: Mar 2011
Posts: 118

Rep: Reputation: 1
Extend partition in Virtualbox machine


Hello,

I am using a linux operating system on virtulbox machine (main operating system is ubuntu).

So I used this command to add additional 20 mb.
e33@e33:~/VirtualBox VMs/Kali$ VBoxManage modifyhd Kali.vdi --resize 40960

by opening gparted, i got the following:

/dev/sda1 ext4 / 20 GiB
/dev/sda2 extend 800 MiB
unallocated unallocated 20 GiB

I just want to resize ext4 to 40 GiB.
I try to unmount ext4, but no possible.

any idea how to proceed in order to extend the ext 4 to 40 GiB?

Best regards

Edit
I run the O.S on recovery mode, and I can use parted, but I am not so familiar with this application and i dont make problems with the partitions.

Last edited by lee_can; 01-13-2014 at 08:30 AM.
 
Old 01-13-2014, 09:04 AM   #2
dolphin_oracle
MX Linux
 
Registered: Dec 2013
Posts: 402

Rep: Reputation: Disabled
ext4 is the filesystem. The device is /dev/sda1.

Your sda1 partition is a primary partition, so you will need to remove the extended partition in order to increase the size of the primary.

also, you'll need to be booted from outside the device. You can not make changes to the partition table of the device you are currently booted from.
 
1 members found this post helpful.
Old 01-13-2014, 10:36 AM   #3
lee_can
Member
 
Registered: Mar 2011
Posts: 118

Original Poster
Rep: Reputation: 1
Thanks for these information dolphin,
But extra help will be appreciate
 
Old 01-13-2014, 10:38 AM   #4
dolphin_oracle
MX Linux
 
Registered: Dec 2013
Posts: 402

Rep: Reputation: Disabled
The easiest way will be to boot from a livecd that also has gparted. Once you are running live, you can remove the extended partition, in your case /dev/sda2 (backup data first if you need to, because anything in the extended partition will be lost). You can then resize the primary partition.
 
Old 01-13-2014, 03:46 PM   #5
lee_can
Member
 
Registered: Mar 2011
Posts: 118

Original Poster
Rep: Reputation: 1
I just download magic partition, and unmount /dev/sda1 & /dev/sda2.
But I didn't find a way to increase /dev/sda1 as it only can be decreased, but sda2 can be increase.
 
Old 01-13-2014, 03:57 PM   #6
dolphin_oracle
MX Linux
 
Registered: Dec 2013
Posts: 402

Rep: Reputation: Disabled
you can't extend the partition because your space is not continuous, and the free space is behind /dev/sda2. You will have to delete /dev/sda2 before you can add space to /dev/sda1.

If there is data in /dev/sda2, when you delete it, you WILL LOSE IT.
 
1 members found this post helpful.
Old 01-13-2014, 04:09 PM   #7
lee_can
Member
 
Registered: Mar 2011
Posts: 118

Original Poster
Rep: Reputation: 1
I found out how:

http://www.rootusers.com/use-gparted...ive-partition/

Thanks man
 
  


Reply

Tags
gparted, virtualbox



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
Cloning a virtualbox machine to physical machine with clonezilla eboy98 Linux - General 6 01-14-2013 08:32 AM
Nagios Root partition warning - How do I extend partition? fireshooter Linux - Newbie 10 01-04-2013 07:01 AM
Extend an partition Jordan Miguel Linux - General 9 04-27-2011 07:51 PM
Extend a partition musiqdefunk Linux - Newbie 7 03-25-2011 02:12 PM
how to extend partition? Sushy *BSD 2 01-25-2007 12:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:29 PM.

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