unclejed613
Posts: 55
Joined: Sun Jan 15, 2012 10:49 pm

resize root partition, but not to fill whole card

Thu Mar 28, 2013 2:34 am

i'd like to resize the root partition on the raspi. it's a 4G image on an 8G card. the thing is, i want to keep a rather large pool of unused cells for wear leveling, so i only want to expand the partition by 1 or 2G. is there any safe way to do this?

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: resize root partition, but not to fill whole card

Thu Mar 28, 2013 6:53 am

Personally I'd put the card in another Linux box and attack it with gparted.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

jmranger
Posts: 2
Joined: Fri Mar 29, 2013 3:16 am

Re: resize root partition, but not to fill whole card

Fri Mar 29, 2013 4:18 am

Given that not all SD/SDHC/SDXC cards do wear leveling, that it's pretty much impossible to tell whether a specific card is doing wear leveling, that an 8GB card is only worth a few $/€/£, that the card should last quite some time anyway, and that the replacement card will cost even less when yours die... I wouldn't bother.

But to answer your question, you can create an extra (3rd) partition using fdisk (device /dev/mmcblk0) at a specific location, reboot and perform the partition enlarge operation, and then delete the extra partition. I just did exactly that (except for the final delete) to setup a dedicated swap partition.

Good luck!

Return to “Raspbian”