Difference between revisions of "Resizing USB mass storage"

From InkBox
Jump to navigation Jump to search
(Credits to 'Fancy' for this)
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
By default, InkBox comes with a '''512 MB virtual partition''' that can be accessed by PC via USB and be used to store eBooks and other user data. If you are using a microSD card '''with more than 4 GB of capacity''' and need more space, it is possible to make this partition larger.
[[Category:InkBox]]By default, InkBox comes with a '''512 MB virtual partition''' that can be accessed by PC via USB and be used to store eBooks and other user data. If you are using a microSD card '''with more than 4 GB of capacity''' and need more space, it is possible to make this partition larger.


1. Remove the microSD card from your eReader and connect it to a PC. Now the system partition needs to be expanded to fill your card. Find the correct partition name first:
1. Remove the microSD card from your eReader and connect it to a PC. Now the system partition needs to be expanded to fill your card. Find the correct partition name first:
Line 5: Line 5:
2. You should find a device tree that looks like similar to this:
2. You should find a device tree that looks like similar to this:
<pre>
<pre>
sdx                    3,6G
sdx                    3.6G
├─sdxp1                19M
├─sdxp1                19M
├─sdxp2                500M
├─sdxp2                500M
├─sdxp3                128M
├─sdxp3                128M
└─sdxp4                2,9G
└─sdxp4                2.9G
</pre>
</pre>
'''Note:''' It is '''vital''' to select the '''right partition''' or you risk '''data loss'''.
'''Note:''' It is '''vital''' to select the '''right partition''' or you risk '''data loss'''.

Latest revision as of 09:46, 23 July 2023

By default, InkBox comes with a 512 MB virtual partition that can be accessed by PC via USB and be used to store eBooks and other user data. If you are using a microSD card with more than 4 GB of capacity and need more space, it is possible to make this partition larger.

1. Remove the microSD card from your eReader and connect it to a PC. Now the system partition needs to be expanded to fill your card. Find the correct partition name first:

$ lsblk -o <NAME>,<SIZE>

2. You should find a device tree that looks like similar to this:

sdx                     3.6G
├─sdxp1                 19M
├─sdxp2                 500M
├─sdxp3                 128M
└─sdxp4                 2.9G

Note: It is vital to select the right partition or you risk data loss.

3. Make sure the partition sizes match the ones in bold above. Make sure to replace sdxp4 with the correct partition name in all following steps.

4. Resize the fourth partition:

# growpart /dev/sdxp4
# resize2fs /dev/sdxp4
Run lsblk again to confirm the partition has been grown as planned.
$ lsblk -o NAME,SIZE

5. Take the new size of sdxp4 and substract 2.5 GB; the result is the new size you want the USB storage partition file to be and will be needed later.

Now mount the same partition, for example like this:
$ mkdir inkbox && sudo mount -t ext4 /dev/sdxp4 inkboxusb

And finally, expand the USB storage partition file. Take the new size for the partition file from the step before and replace it in this command:

# qemu-img resize ./inkboxusb/onboard X.XG

Unmount the partition:

# umount /dev/sdxp4

Eject the microSD card, insert it into the ereader and put the cover back on. Power on the device. Now you should have the maximum possible space available for USB mode.