Discussion:
How do I Resize this partition?
(too old to reply)
Linux Ubuntu
2021-02-19 23:18:15 UTC
Permalink
What's the best way to resize the partition in this picture?

Loading Image...

For some reasons Ubuntu didn't create enough size for this in
Virtualbox.  There is 11GB free and I won't everything to be part of the
"Root" partition.
Pascal Hambourg
2021-02-19 23:29:08 UTC
Permalink
Post by Linux Ubuntu
What's the best way to resize the partition in this picture?
https://images2.imgbox.com/c6/3f/vW5oRYOz_o.png
Delete the swap partition (and the line in /etc/fstab).
Delete the extended partition.
Extend the root partition.
Jonathan N. Little
2021-02-20 22:20:52 UTC
Permalink
Post by Pascal Hambourg
Post by Linux Ubuntu
What's the best way to resize the partition in this picture?
https://images2.imgbox.com/c6/3f/vW5oRYOz_o.png
Delete the swap partition (and the line in /etc/fstab).
Delete the extended partition.
Extend the root partition.
That would be the easiest, especially since the only partition in the
extended partition is a scrapable swap. If there was n important
partition with data such as /home is can be done in gparted but takes a
few steps.

1) resize extended partition (cyan in gparted) to the physical end of drive

2) move logical partitions with extended partition to the right side of
the extended partition

3) resize the left side of extended partition to shrink to fit the
logical partition within

4) resize the originally targeted primary partition to fill the newly
created space on the right.


It works, have done it many times moving systems to larger drive from an
image. You do have to use a live session of course. Often you may have
to reinstall grub, so bet to just do it while you have a live session
going. Looks like a MBR record install so just a couple of commands
assuming '/' is sda1


sudo mount /dev/sda1 /mnt
sudo grub-install --boot-directory=/mnt/boot /dev/sda

then reboot...
--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Carlos E.R.
2021-02-20 22:38:51 UTC
Permalink
Post by Jonathan N. Little
Post by Pascal Hambourg
Post by Linux Ubuntu
What's the best way to resize the partition in this picture?
https://images2.imgbox.com/c6/3f/vW5oRYOz_o.png
Delete the swap partition (and the line in /etc/fstab).
Delete the extended partition.
Extend the root partition.
That would be the easiest, especially since the only partition in the
extended partition is a scrapable swap. If there was n important
partition with data such as /home is can be done in gparted but takes a
few steps.
1) resize extended partition (cyan in gparted) to the physical end of drive
2) move logical partitions with extended partition to the right side of
the extended partition
Considering it is a virtual machine, there are other ways :-)

Create a new virtual disk. In it, create a swap partition; then
deactivate the current swap partition, and attach the new one. Then
delete the old swap partition, and the extended partition.

Also, I would declare that new disk that will contain swap to be fully
assigned from start. Runs faster if swap is actually needed.
Post by Jonathan N. Little
4) resize the originally targeted primary partition to fill the newly
created space on the right.
It works, have done it many times moving systems to larger drive from an
image. You do have to use a live session of course. Often you may have
to reinstall grub, so bet to just do it while you have a live session
going. Looks like a MBR record install so just a couple of commands
assuming '/' is sda1
sudo mount /dev/sda1 /mnt
sudo grub-install --boot-directory=/mnt/boot /dev/sda
then reboot...
--
Cheers, Carlos.
Jasen Betts
2021-02-21 01:41:35 UTC
Permalink
Post by Carlos E.R.
Post by Jonathan N. Little
Post by Pascal Hambourg
Post by Linux Ubuntu
What's the best way to resize the partition in this picture?
https://images2.imgbox.com/c6/3f/vW5oRYOz_o.png
Delete the swap partition (and the line in /etc/fstab).
Delete the extended partition.
Extend the root partition.
That would be the easiest, especially since the only partition in the
extended partition is a scrapable swap. If there was n important
partition with data such as /home is can be done in gparted but takes a
few steps.
1) resize extended partition (cyan in gparted) to the physical end of drive
2) move logical partitions with extended partition to the right side of
the extended partition
Considering it is a virtual machine, there are other ways :-)
Create a new virtual disk. In it, create a swap partition; then
deactivate the current swap partition, and attach the new one. Then
delete the old swap partition, and the extended partition.
Also, I would declare that new disk that will contain swap to be fully
assigned from start. Runs faster if swap is actually needed.
a virtual machine doesn't need swap, just give it more virtual ram,
use the host's swap.
--
Jasen.
Carlos E.R.
2021-02-21 02:24:46 UTC
Permalink
Post by Jasen Betts
Post by Carlos E.R.
Post by Jonathan N. Little
Post by Pascal Hambourg
Post by Linux Ubuntu
What's the best way to resize the partition in this picture?
https://images2.imgbox.com/c6/3f/vW5oRYOz_o.png
Delete the swap partition (and the line in /etc/fstab).
Delete the extended partition.
Extend the root partition.
That would be the easiest, especially since the only partition in the
extended partition is a scrapable swap. If there was n important
partition with data such as /home is can be done in gparted but takes a
few steps.
1) resize extended partition (cyan in gparted) to the physical end of drive
2) move logical partitions with extended partition to the right side of
the extended partition
Considering it is a virtual machine, there are other ways :-)
Create a new virtual disk. In it, create a swap partition; then
deactivate the current swap partition, and attach the new one. Then
delete the old swap partition, and the extended partition.
Also, I would declare that new disk that will contain swap to be fully
assigned from start. Runs faster if swap is actually needed.
a virtual machine doesn't need swap, just give it more virtual ram,
use the host's swap.
The two methods are possible. If you give it swap, the guest may run
slower, but it will impact less the host.

Besides that, swap space in a machine with lots of ram frees even more
ram :-)
--
Cheers, Carlos.
Paul
2021-02-20 07:12:14 UTC
Permalink
Post by Linux Ubuntu
What's the best way to resize the partition in this picture?
https://images2.imgbox.com/c6/3f/vW5oRYOz_o.png
For some reasons Ubuntu didn't create enough size for this in
Virtualbox. There is 11GB free and I won't everything to be part of the
"Root" partition.
Have you considered nuke and pave as an option ?

Then boot the LiveCD, do "Custom", create 1GB Swap,
create Slash, and carry on to do the install ?

I would only spend the time "unbending" this mess,
if you really wanted a learning experience :-)

*******

Fixed.

Loading Image...

(Click Download Original, if picture is too fuzzy.)

Paul
Ant
2021-02-20 20:39:44 UTC
Permalink
Post by Paul
Post by Linux Ubuntu
What's the best way to resize the partition in this picture?
https://images2.imgbox.com/c6/3f/vW5oRYOz_o.png
For some reasons Ubuntu didn't create enough size for this in
Virtualbox. There is 11GB free and I won't everything to be part of the
"Root" partition.
Have you considered nuke and pave as an option ?
Then boot the LiveCD, do "Custom", create 1GB Swap,
create Slash, and carry on to do the install ?
I would only spend the time "unbending" this mess,
if you really wanted a learning experience :-)
*******
Fixed.
https://i.postimg.cc/MGMFZ5X0/fix-ubuntu-install.gif
(Click Download Original, if picture is too fuzzy.)
Either way, back up!
--
:) CNY (Metal Ox)!
Note: A fixed width font (Courier, Monospace, etc.) is required to see this signature correctly.
/\___/\ Ant(Dude) @ http://aqfl.net & http://antfarm.home.dhs.org.
/ /\ /\ \ Please nuke ANT if replying by e-mail.
| |o o| |
\ _ /
( )
Jasen Betts
2021-02-20 21:55:02 UTC
Permalink
Post by Ant
Post by Paul
Post by Linux Ubuntu
What's the best way to resize the partition in this picture?
https://images2.imgbox.com/c6/3f/vW5oRYOz_o.png
For some reasons Ubuntu didn't create enough size for this in
Virtualbox. There is 11GB free and I won't everything to be part of the
"Root" partition.
Have you considered nuke and pave as an option ?
Then boot the LiveCD, do "Custom", create 1GB Swap,
create Slash, and carry on to do the install ?
I would only spend the time "unbending" this mess,
if you really wanted a learning experience :-)
*******
Fixed.
https://i.postimg.cc/MGMFZ5X0/fix-ubuntu-install.gif
(Click Download Original, if picture is too fuzzy.)
Either way, back up!
Seeing as it's obvoiusly a vitual machine (VBOX is not a brand of
physical hard disk), he/she can just make a snapshot.
--
Jasen.
Paul
2021-02-20 22:34:57 UTC
Permalink
Post by Jasen Betts
Post by Ant
Post by Paul
Post by Linux Ubuntu
What's the best way to resize the partition in this picture?
https://images2.imgbox.com/c6/3f/vW5oRYOz_o.png
For some reasons Ubuntu didn't create enough size for this in
Virtualbox. There is 11GB free and I won't everything to be part of the
"Root" partition.
Have you considered nuke and pave as an option ?
Then boot the LiveCD, do "Custom", create 1GB Swap,
create Slash, and carry on to do the install ?
I would only spend the time "unbending" this mess,
if you really wanted a learning experience :-)
*******
Fixed.
https://i.postimg.cc/MGMFZ5X0/fix-ubuntu-install.gif
(Click Download Original, if picture is too fuzzy.)
Either way, back up!
Seeing as it's obvoiusly a vitual machine (VBOX is not a brand of
physical hard disk), he/she can just make a snapshot.
And while preparing the pictures, I did keep a couple
snapshots just in case. I kept the base install handy
just in case. pigz -c some.vhd > some.vhd.gz
While the machine is not running.

When finished, I also used a separate container shrinker,
because I have my favorite for that. A shrinker that
works, and does not foul up any identifiers. It's
a miracle, that at least one person can write software
to do that.

That's part of the fun with VMs, is finding decent orthogonal
tools, that can switch from X to Y, do container expansion
or container shrink, compact files that have been zeroed
out before compaction, and so on. You end up testing
a lot of them and finding issues with them.

Paul
Ant
2021-02-20 20:40:45 UTC
Permalink
Post by Paul
https://i.postimg.cc/MGMFZ5X0/fix-ubuntu-install.gif
(Click Download Original, if picture is too fuzzy.)
Loading Image... for the direct link. :P
--
:) CNY (Metal Ox)!
Note: A fixed width font (Courier, Monospace, etc.) is required to see this signature correctly.
/\___/\ Ant(Dude) @ http://aqfl.net & http://antfarm.home.dhs.org.
/ /\ /\ \ Please nuke ANT if replying by e-mail.
| |o o| |
\ _ /
( )
Loading...