[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Parallella Community • View topic - How to expand the Linaro image to fill your SD card
Page 1 of 1

How to expand the Linaro image to fill your SD card

PostPosted: Thu Jun 19, 2014 5:35 am
by DrBlackAdder
First off you'll need to create the device points for SD card access:

sudo mknod -m 660 /dev/mmcblk0 b 179 0

sudo mknod -m 660 /dev/mmcblk0p1 b 179 1

sudo mknod -m 660 /dev/mmcblk0p2 b 179 2

Once done you can use fdisk to resize the disk:
sudo fdisk /dev/mmcblk0

Command (m for help): p

Disk /dev/mmcblk0: 15.9 GB, 15931539456 bytes
4 heads, 16 sectors/track, 486192 cylinders, total 31116288 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00056828

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 2048 264191 131072 b W95 FAT32
/dev/mmcblk0p2 264192 31116287 15426048 83 Linux

Command (m for help): d
Partition number (1-4): 2

Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): p
Partition number (1-4, default 2): 2
First sector (264192-31116287, default 264192):
Using default value 264192
Last sector, +sectors or +size{K,M,G} (264192-31116287, default 31116287):
Using default value 31116287

Command (m for help): p

Disk /dev/mmcblk0: 15.9 GB, 15931539456 bytes
4 heads, 16 sectors/track, 486192 cylinders, total 31116288 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00056828

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 2048 264191 131072 b W95 FAT32
/dev/mmcblk0p2 264192 31116287 15426048 83 Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
linaro-nano:~>

Now reboot your device:
sudo reboot

Lastly run the resize tool on the root partition:
sudo resize2fs /dev/mmcblkp2

Enjoy all the extra space!

Re: How to expand the Linaro image to fill your SD card

PostPosted: Thu Jun 19, 2014 2:25 pm
by over9000

Re: How to expand the Linaro image to fill your SD card

PostPosted: Tue Jun 24, 2014 5:51 pm
by Gravis
another way is to use a gui based partitioning program like GParted on your computer. for those in windows, use a .

Re: How to expand the Linaro image to fill your SD card

PostPosted: Fri Aug 01, 2014 4:10 am
by Feik

Re: How to expand the Linaro image to fill your SD card

PostPosted: Wed Aug 13, 2014 2:05 am
by aihaike
I successfully used gParted.

Re: How to expand the Linaro image to fill your SD card

PostPosted: Wed Aug 13, 2014 10:55 am
by 9600
I tend to use gparted also.

Regards,

Andrew

Re: How to expand the Linaro image to fill your SD card

PostPosted: Sun Nov 09, 2014 8:50 pm
by fuzz

Re: How to expand the Linaro image to fill your SD card

PostPosted: Wed Feb 18, 2015 9:50 pm
by Claggy

Re: How to expand the Linaro image to fill your SD card

PostPosted: Sun Jun 19, 2016 6:43 pm
by zynqfan
Just to reiterate I did this with the most recent Ubuntu headless image, and you can use partprobe also:

Assuming you are already root (sudo su - root) run the following as indicated by fuzz. (I use partprobe instead)

1) fdisk /dev/mmcblk0p2
a) type p to print out what is currently configured and to save so you can recreate the partition if you screw up

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 206847 204800 100M b W95 FAT32
/dev/mmcblk0p2 206848

b) d (press enter)
c) 2 (press enter) [you have now deleted partition 2 from the partition table - but don't worry the OS is still working...]
d) n (press enter) [create a new partition 2]
e) p (press enter)
f) 2 (press enter)
g) choose starting sector as the same (in this case 206848, which it probably defaults to but matches the p statement above)
h) leave default as the very large number, which should now fill all 32gb (or however big) of the SDHC vs the normal 3-4gb

2) fdisk will moan about having to run partprobe or kpartx, so run "partprobe" and hit enter - if you don't have partprobe installed run "apt-get install parted" and then run partprobe
3) resize2fs /dev/mmcblk0p2
4) you should be good without rebooting -- but why not run synq and reboot to make sure there weren't any surprises!