resizing Ubuntu partitions

User discussion and information resource forum for Image products.
Logman
Posts: 112
Joined: Fri Jan 16, 2015 6:10 pm

resizing Ubuntu partitions

Post by Logman »

Not sure if this is the place for this question but here it is.

I have Ubuntu 16.04.1 on one partition and a Ubuntu swap file on another.

I want to resize the main Ubuntu partition and the swap partition.

I'm using unlimited Primaries and the Ubuntu partitions were both created using with BIBM before the Ubuntu install.

I also have 4 other Windows partitions on the same HD but the Ubuntu ones are at the end of the HD.

Do I resize from BIBM or in Ubuntu, not sure because of the unlimited primaries. ?

I would prefer to keep the installation of Ubuntu if possible rather than reinstalling it.
TeraByte Support(PP)
Posts: 1644
Joined: Fri Aug 12, 2011 12:51 am

Re: resizing Ubuntu partitions

Post by TeraByte Support(PP) »

Since you are using unlimited primary partitions you should use BIBM or Partition Work in IFL GUI to make the changes. If you use a partitioning program that doesn't support EMBR type disks it may overwrite partitions it doesn't see or otherwise corrupt them.
Logman
Posts: 112
Joined: Fri Jan 16, 2015 6:10 pm

Re: resizing Ubuntu partitions

Post by Logman »

Thanks for that Paul.

Can I do partition work from the BIBM partition work screen or do I have to do it from an IFL boot disk ?

I did boot from the IFL disk that I just made to make sure it works, and what I want to do is to make the swap partition smaller ( from 20GB to 5GB ) and increase the Ubuntu 80GB to 95GB, but there is no resize option for the swap partition, but there is for the Ubuntu partition.

Do I have to delete the swap partition to enlarge the Ubuntu one, and if so, can I do it from IFL or do I have to do it while in Ubuntu ?
TeraByte Support(PP)
Posts: 1644
Joined: Fri Aug 12, 2011 12:51 am

Re: resizing Ubuntu partitions

Post by TeraByte Support(PP) »

You should do it from either BIBM or IFL. Delete the swap partition and recreate it at the new location with the new size. After you boot back into Ubuntu you would need to reconfigure the new swap partition for use.

For example, in Ubuntu 16.04:

1. Open a terminal.
2. Run: fdisk -l
3. Find the new "Linux swap" partition. /dev/sda2 will be used here.
4. Run: sudo mkswap /dev/sda2
This will format the partition and return the UUID value. 2fb845bd-ce39-4f94-a942-44631332d0b9 is used here.
5. Run: sudo swapon -U 2fb845bd-ce39-4f94-a942-44631332d0b9
6. Edit the /etc/fstab file and update the swap entry with the new UUID.
Run: sudo gedit /etc/fstab
(Use whichever text file editor you have installed. Could be nano, etc.)
The entry will look something like this (spacing varies):
UUID=2fb845bd-ce39-4f94-a942-44631332d0b9 none swap sw 0 0
Logman
Posts: 112
Joined: Fri Jan 16, 2015 6:10 pm

Re: resizing Ubuntu partitions

Post by Logman »

Thanks again Paul, I really appreciate your detailed response !

What about resizing the main Ubuntu partition, I want to make it larger by using the free space from changing the swap partition size.

Can I just resize it from BIBM or IFL or is there a something I have to do in Ubuntu too ?

Sorry for these questions, if it was Windows I would have no trouble doing this at all, but Ubuntu is totally different for me.
mashedmitten
Posts: 151
Joined: Sun Dec 04, 2016 2:16 am

Re: resizing Ubuntu partitions

Post by mashedmitten »

https://www.terabyteunlimited.com/kb/article.php?id=132

I use Defraggler when shrinking to see what's where on a partition and to defrag/move all data to the beginning, if needed, to prevent issues.
Logman
Posts: 112
Joined: Fri Jan 16, 2015 6:10 pm

Re: resizing Ubuntu partitions

Post by Logman »

mashedmitten wrote:
> https://www.terabyteunlimited.com/kb/article.php?id=132
>
> I use Defraggler when shrinking to see what's where on a partition and to
> defrag/move all data to the beginning, if needed, to prevent issues.

Thanks for that M, didn't know there was a kb article for partition work in Linux 8-)

Haven't used defraggler for years, and not sure if it would even apply to a Linux partition and unlimited primaries.
TeraByte Support(PP)
Posts: 1644
Joined: Fri Aug 12, 2011 12:51 am

Re: resizing Ubuntu partitions

Post by TeraByte Support(PP) »

You can resize the Ubuntu partition using either BIBM or IFL. Basically, any partitioning changes (create, delete, resize, slide, etc.) should be done in BIBM or IFL (or something else that supports EMBR disks) since you're using unlimited primary partitions.

You shouldn't need to do anything in Ubuntu for a normal resize. It should see the larger partition.
Assuming you had this:
[...misc. partitions...][Ubuntu 80][swap 20GB]
Delete the swap partition.
[...misc. partitions...][Ubuntu 80GB]
Resize the Ubuntu partition.
[...misc. partitions...][Ubuntu 95GB]
Recreate the swap partition.
[...misc. partitions...][Ubuntu 95GB][swap 5GB]

As with any partitioning changes, having a current backup is recommended before proceeding.
Logman
Posts: 112
Joined: Fri Jan 16, 2015 6:10 pm

Re: resizing Ubuntu partitions

Post by Logman »

Thanks again Paul, perfectly clear for me now !! 8-)
Logman
Posts: 112
Joined: Fri Jan 16, 2015 6:10 pm

Re: resizing Ubuntu partitions

Post by Logman »

Thought I'd say the resizing went ok, had trouble with the swap file ( again :roll: ) but when I followed PP's advice re formatting the swap file in a Terminal, it finally worked, resizing the main Ubuntu partition went fine without having to do anything.

Thanks again Paul, great support ! 8-)
Post Reply