Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to resize USER partition:
- You will need:
- ninfs
- linux
- ~/.switch/prod.keys (with your bis keys) (hint: use lockpick)
- First, mount your emuMMC's rawnand as a loop block device:
- $ losetup -f --show -o 0x800000 emummc.bin
- This will output the location of the block device it just mounted (usually /dev/loop33 for me).
- Next: Backup files in USER.
- $ mount_nandhac /dev/loop33 ~/mount
- $ losetup -f --show ~/mount/USER.img
- $ sudo mount /dev/loop34 ~/mount2
- $ sudo cp -r ~/mount2/* ~/user_backup/
- $ sudo umount ~/mount2
- $ losetup -d /dev/loop34
- $ sudo umount ~/mount
- (Assuming the first losetup output /dev/loop33 and then second output /dev/loop34)
- Now: Resize the rawnand gpt's USER entry
- $ gdisk /dev/loop33
- i > 11
- d > 11
- n > enter > +XXG/M with XX being whatever size you want and M or G depending if you want it in MebiBytes or GibiBytes > Enter whatever the i > 11 output for "Partition GUID code: ".
- c > 11 > USER
- x > c > 11 > Enter whatever the i > 11 output for "Partition unique GUID: "
- a > 11 > 0 > enter
- finally, i > 11 and verify everything matches the original i > 11 apart from last sector and size
- w > Y
- Finally: Reformat the decrypted USER partition and replace files
- $ mount_nandhac /dev/loop33 ~/mount
- $ losetup -f --show ~/mount/USER.img
- $ gparted /dev/loop34
- Reformat as a FAT32 partition and then close this out (It should show that a FAT32 partition already exists, if not you did something wrong when editing the gpt)
- $ sudo mount /dev/loop34 ~/mount2
- $ sudo cp -r ~/user_backup/* ~/mount2/
- $ sudo umount ~/mount2
- $ losetup -d /dev/loop34
- $ sudo umount ~/mount
- $ losetup -d /dev/loop33
- Finally, truncate your emummc image by however much you shrunk USER by, and fix gpt headers:
- $ truncate -s -XXG/M emummc.img
- $ losetup -f --show -o 0x800000 emummc.bin
- $ gdisk /dev/loop33
- x > e > w > Y
- $ losetup -d /dev/loop33
- This should now be complete! Probably a better way of doing some of this, but this is what worked for me
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement