Page 1 of 1

Expand root partitition on a rasbian minimal image

Posted: Thu Jun 26, 2014 8:43 pm
by mrdebug
With raspi-config I obtain this error:
Disk /dev/mmcblk0: 1948 MB, 1948254208 bytes
4 heads, 16 sectors/track, 59456 cylinders, total 3805184 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: 0x00027aa3

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 2048 104447 51200 b W95 FAT32
/dev/mmcblk0p2 104448 1742847 819200 83 Linux
/dev/mmcblk0p3 1742848 1945599 101376 82 Linux swap / Solaris

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

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Dispositivo o risorsa occupata.
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.
update-rc.d: using dependency based boot sequencing
update-rc.d: warning: default start runlevel arguments (2 3 4 5) do not match resize2fs_once Default-Start values (2 3 4 5 S)
update-rc.d: warning: default stop runlevel arguments (0 1 6) do not match resize2fs_once Default-Stop values (none)
root@raspberrypi:~#

How can I do to expant the partitition?

Re: Expand root partitition on a rasbian minimal image

Posted: Thu Jun 26, 2014 9:20 pm
by DougieLawson
That p3 swap partition isn't used. Modern versions of raspbian use dphys-swapfile

sudo -i
fdisk /dev/mmcblk0
d
2
d
3
n
p
2
104448
[ENTER]
w
q
resize2fs /dev/mmcblk0p2
reboot

Re: Expand root partitition on a rasbian minimal image

Posted: Fri Jun 27, 2014 3:07 pm
by mrdebug
root@raspberrypi:~# fdisk /dev/mmcblk0

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

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

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 (104448-3805183, default 104448): 104448
Last sector, +sectors or +size{K,M,G} (104448-3805183, default 3805183):
Using default value 3805183

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: Dispositivo o risorsa occupata.
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.
root@raspberrypi:~#


I haven't the original rasbian image because I have a 2gb sdcard. I'm using a mini image.
Can you suggest to me a mini official debian image?

Re: Expand root partitition on a rasbian minimal image

Posted: Fri Jun 27, 2014 4:25 pm
by AndrewS
What about another alternative: have you seen how cheap SD cards are these days? ;)