User avatar
khisanth
Posts: 36
Joined: Thu Jan 19, 2012 11:49 pm
Location: Farnborough
Contact: Website

Resizing partitions

Tue May 29, 2012 6:02 pm

Got my Pi up and running with the standard Debian "squeeze" build and am using a 32GB SD card no problem. However I noticed that the install has not used the whole card and there is still 28GB sitting there not belonging to a partition.

Whats the best way to resize the existing partitions and which one should I resize? CLI or GUI I am happy either way.

cheers

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Resizing partitions

Tue May 29, 2012 6:07 pm

The best way is to use fdisk to delete and recreate the partition "in place". There is a video floating around telling how to do it.

I really think this is the bet way - even though it is kinda like walking a tightrope blindfolded - because the alternatives (using the GUI and something called "gparted") always seem to ensnare people in su/sudo messes.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

spurious
Posts: 343
Joined: Mon Nov 21, 2011 9:29 pm

Re: Resizing partitions

Tue May 29, 2012 6:08 pm

what operating system are you using on your PC?

@Joe.. I tried the in place fdisk and got corruption.. I find running Linux in VMWare and connection to the physical SD card.. then using fdisk is more stable.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Resizing partitions

Tue May 29, 2012 6:11 pm

spurious wrote:what operating system are you using on your PC?

@Joe.. I tried the in place fdisk and got corruption.. I find running Linux in VMWare and connection to the physical SD card.. then using fdisk is more stable.
Oh, yeah. If you have another machine and can do it there, then of course, that's better.
But people want to do it on the Pi itself.

And, of course, trying to End User Support people doing it on another machine - well that opens up whole other cans of worms...
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
nick.mccloud
Posts: 804
Joined: Sat Feb 04, 2012 4:18 pm

Re: Resizing partitions

Tue May 29, 2012 6:24 pm

See half way down this page:

http://elinux.org/RPi_Easy_SD_Card_Setup

Works for me, done it several times.

User avatar
khisanth
Posts: 36
Joined: Thu Jan 19, 2012 11:49 pm
Location: Farnborough
Contact: Website

Re: Resizing partitions

Tue May 29, 2012 7:04 pm

spurious wrote:what operating system are you using on your PC?

.
Windows 7, but have a Debian install too

User avatar
khisanth
Posts: 36
Joined: Thu Jan 19, 2012 11:49 pm
Location: Farnborough
Contact: Website

Re: Resizing partitions

Tue May 29, 2012 7:39 pm

All done! Did it on the Pi itself and went smoothly.

thanks peeps :D

Harrkev
Posts: 22
Joined: Mon Feb 27, 2012 4:56 pm

Re: Resizing partitions

Thu May 31, 2012 7:49 pm

Quick story: I tried using "gparted" and the latest Ubuntu (running from a USB drive) to move/resize partitions, and it always crashed. Using the command-line "parted" instructions in the Wiki worked fine for me and opened up my 16GB card.

philipm
Posts: 30
Joined: Mon Aug 29, 2011 9:46 am
Contact: Website

Re: Resizing partitions

Fri Jun 01, 2012 3:28 pm

nick.mccloud wrote:See half way down this page:

http://elinux.org/RPi_Easy_SD_Card_Setup

Works for me, done it several times.
I just tried this (running parted on the command line off an Ubuntu system) and it was unhappy when I tried to change partitions with messages like:
Error: Error informing the kernel about modifications to partition /dev/sdc1p1
-- Invalid argument. This means Linux won't know about any changes you made to
/dev/sdc1p1 until you reboot -- so you shouldn't mount it or use it in any way
before rebooting.
Did I do something perhaps inadvertently to make it mount the file system again? I'm running dd again since it didn't leave the device in a happy state.

strawberrytau
Posts: 67
Joined: Wed May 30, 2012 7:56 am

Re: Resizing partitions

Fri Jun 01, 2012 4:51 pm

Is there any way of doing this on a Mac (other than using a gparted LIVE CD). I own a MacBook Air with no CD Drive!

nevyn
Posts: 6
Joined: Wed May 30, 2012 5:28 am

Re: Resizing partitions

Fri Jun 01, 2012 5:30 pm

I followed the tutorial here: http://www.youtube.com/watch?v=R4VovMDnsIE&feature=plcp Using this method you resize the partitions on the Pi and not on your laptop/computer.

I resized the partition to the full SD capacity. Used this method twice with Debian and it worked on both occasions.

Regards,
Mark

User avatar
gordon@drogon.net
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: Resizing partitions

Sat Jun 02, 2012 12:47 pm

Lots of good replys there - I'll add another:

https://projects.drogon.net/raspberry-p ... al-setup1/

Theres a few extra bits & pieces there too.

-Gordon
--
Gordons projects: https://projects.drogon.net/

guleesh
Posts: 1
Joined: Wed May 30, 2012 6:17 am

Re: Resizing partitions

Sat Jun 02, 2012 8:51 pm

I'm glad some people are having success with resizing the partitions on the RaspberryPi itself.
For me it just won't work.

Here's what I did : (maybe someone else has had success with resizing the partition in Archilinux and can help out)

I followed instructions here http://elinux.org/RPi_Easy_SD_Card_Setu ... spberry_Pi

The are only 2 partitions on archlinux img - so I just adapted the instructions and deleted then recreated partition 2.

The recreated partition started at same block as the the partition I had just removed.
I used the default for the end block. This seemed to create the partition using all available space on the sd card - about 14.9 GB

All seemed to go well.
I did see an error message when writing the partition, it said something about the partition will not be usable by kernel until reboot or reloading some kernel modules.

I thought it was fair enough - and that the instructions had said that the partition will not be useful until rebooting anyway - so I rebooted.

After reboot I was unable to log in.
I was presented with a login: prompt but after typing root - the prompt would just immediately popup again.
Eventually giving me this error message
"Unable to determine your tty name"

I'm going to fire up my old ubuntu laptop and try parted, although I would really like to be able to get htis working for Archlinux on the RaspberryPi - since in theory having to have other operating systems around - seems to defeat the point.

Also - perhaps there is another approach where the .img file could be manipulated to take up 8GB or 16GB ?
Does anyone know if this is doable ?

I'm on OS X (which is the basket case of *nix distros) so if anyone knows how to resize it using some OS X tools then do tell.

Return to “Beginners”