[Nintendo Switch News, Guides, Discussion , Develop] fOmey:
OUTDATED METHOD, CAN RESIZE PARTITIONS DIRECTLY IN "HEKATE".

This seems to be a popular question on the release thread, so I thought I would share the method I used to resize the partitions included in the stock switchroot android image.

You can do this a number of ways, I'm lazy tho.. so I went the fastest route I could think of.

All of the following steps were done on a linux virtual machine running the gparted live ISO.. this is not a tutorial how to setup a virtual machine or linux, I'm going to assume you're competent enough to do that as all the steps will require one or the other!

What tools are we going to be using?

gparted (GUI interface)

gdisk (terminal)

The only steps taken prior to what I'm going to share here is that I flashed the 16gb image to my microsd.

So what is the end goal?

Expand the general storage (fat32) partition.

Expand the android user data partition.

Allocate a partition for emummc (optional).

Repair the MBR which we destroy by resizing the partitions.

First thing I did was capture some data of the

default

partition layout for reference:

Great now that we have that, lets get stuck into it.

GPARTED

Fire up gparted and you'll be presented with the following popup:

We want to hit the "Fix" button.. this will allow us to utilise all the remaining space on the microsd card.

As soon as we do this tho, there is no turning back.. you'll need to complete the tutorial.

What we're looking at here is the default layout, note the unallocated space highlighted below:

The first thing we're going to do is expand the android user data partition (sdd7 in the screenshot above).. Right click "userdata" -> "Resize/move".

I decided to go with 32GB which should be plenty, how large you want to make this partition is entirely up to you.

The next thing we're going to do is move the partition down the stack, we do this by entering "0" into the "free space following" field.

You'll notice the white box surrounded by the dark purple border has moved position to the far right to reflect your changes.. hit the "resize/move" button and confirm the warning window.

You can now see the "userdata" partition has moved down the stack, will be resized to 32GB and our unallocated space has moved up.

We're now going to repeat this process for the remaining android partitions (without resizing tho).. starting from the "dtb" partition and working our way up to "vendor".

Right click partition -> "Resize/move".

Modify "free space following" to "0".

Hit the "Resize/move" button.

Confirm the warning.

You get the idea.. repeat this process until you reach the "hos_data" partition.

Eventually you'll be left with something like this, note the unallocated space is now directly under our "hos_data" partition.

It's time to expand our fat32 partition, you can drag the black arrow on the right hand side all the way to the end to set the maximum size.

[EMUMMC USERS ONLY] If you intend on using emummc we can allocate some space for the partition by entering "29856" in the "free space following field", this will automatically reduce the partition size to accommodate the required free space.. this step is completely optional.

[EMUMMC USERS ONLY] We need to create a new partition (right click "unallocated" -> "new").. the only option we're going to change here is the "file system" field to "unformatted".

Now is the time to verify all our settings are correct before finally hitting the apply button.. confirm the warning and let it do its thing.

Before closing gparted, we want to take note of the drive identifier located on the top right of the screen.. mine is "/dev/sdd", we're going to be using the next steps.

GDISK

All the remaining steps will be executed using gdisk in a terminal window.. first of which will be the following command:

sudo gdisk /dev/sdd

Replace "/dev/sdd" with your drive identifier.

Input "r" as a command, this will enter us into the "recovery/transformation" submenu.

You can output the MBR & partition table by inputting "o" & "p" as commands, since we used gparted the MBR has been modified.. we need to revert this back to ensure everything plays nice.

Input "h" as a command, this will create a new hybrid MBR to replace the one we destroyed with gparted. If you intend on using emummc we need to add both the hos_data partition (#1) & the emummc partition (#8)..

You would do this by entering:

1 8

Otherwise if you're not planning to use emummc, we just add the hos_data partition (#1):

1

Place EFI GPT parition first in MBR?

N

Creating entry for GPT partition #1 (MBR partition #1)

Enter an MBR hex code:

EE

Set bootable flag?

N

[EMUMMC USERS ONLY] Creating entry for GPT partition #8 (MBR partition #2)

Enter an MBR hex code:

0b

[EMUMMC USERS ONLY] Set bootable flag?

N

Unused partition space found. Use one to protect more partitions?

N

Great, now lets output the MBR & partition table by inputting the "o" & "p" commands once again to confirm our changes.

Looking good! :good:

The last thing to do is write our changes, we do this by entering the "w" command.

Do you want to proceed?

Y

That's it folks, we're done! I know this was a little lengthy... hopefully this helps some of you out!

If you're interested in knowing more in-depth info about hybrid MBR's I came across the following website that contains invaluable information: HERE.