I know I could just create new partitions/lvols and just mount /home /tmp, etc separately, but I want to know if it's possible to extend / dynamically.
Here's what I did (copied from a post on the Debian forum) to manually resize the partiton. I don't know about automatic resizing.
I did this on Ubuntu, with the card as /dev/sdd.
Start with the SD card image written to the card, in a card reader, but with nothing mounted.
$ sudo parted /dev/sdd
(parted) unit chs
(this gave me:)
Model: Generic- SD/MMC (scsi)
Disk /dev/sdd: 121535,3,31
Sector size (logical/physical): 512B/512B
BIOS cylinder,head,sector geometry: 121536,4,32. Each cylinder is 65.5kB.
Partition Table: msdos
Number Start End Type File system Flags
1 16,0,0 1215,3,31 primary fat32 lba
2 1232,0,0 26671,3,31 primary ext4
3 26688,0,0 29743,3,31 primary linux-swap(v1)
(Then carry on…)
(parted) move 3 118479,0,0
(parted) rm 2
(parted) mkpart primary 1232,0,0 118478,3,31
$ sudo e2fsck -f /dev/sdd2
(allow it to add lost-and-found)
$ sudo resize2fs /dev/sdd2
Then put the card in the RPi and boot. You end up with a 7Gb partition…
$ df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 94M 4.0K 94M 1% /lib/init/rw
udev 10M 168K 9.9M 2% /dev
tmpfs 94M 0 94M 0% /dev/shm
rootfs 7.1G 1.3G 5.4G 20% /
/dev/mmcblk0p1 75M 28M 48M 37% /boot