New IT forum
23 October 2014, 09:20:01 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: GertDuino now in stock.
 
   Home   SHOP Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Resizing the Rootfs partition(2nd) to fill the SD card.  (Read 5329 times)
NewITMalcolm
Administrator
Sr. Member
*****
Posts: 394


« on: 17 February 2011, 01:53:59 pm »

Now we are selling larger 16Gb SD cards I have created this guide to allow our smaller images to be dd'd onto a larger card and then extended to fill the available space.

The easy way to do this is using a USBtoSD dongle and use GParted on another Linux machine or Guiplug but here is how to do it manually.


Firstly take a backup the card if don't have one already, we will be deleting the Rootfs partition during this process.

Boot to the Nand and insert the SD card to resize.

Check the filesystem
Code:
fsck -n /dev/mmcblk0p2

Remove the journal (make it ext2)
Code:
tune2fs -O ^has_journal /dev/mmcblk0p2

Delete and Recreate the partition with the new larger size.
This won't delete any data.
Code:
fdisk /dev/mmcblk0

Follow these key sequences within fdisk.
This will delete partition 2 then create a new partition 2 which fills the available space.

d <enter>
2 <enter>
n <enter>
p <enter>
2 <enter>
<enter>
<enter>
w <enter>

Check the filesystem
Code:
e2fsck -f /dev/mmcblk0p2

Resize the filesystem
Code:
resize2fs /dev/mmcblk0p2

Check the filesystem
Code:
fsck -n /dev/mmcblk0p2

Put journalling back (make it ext3 again)
Code:
tune2fs -j /dev/mmcblk0p2

That's it, you can reboot to the SD card now.

NewIT Technical
Logged

NewITJames
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!