Expand the HDD partition

I have followed the install on PI+HDD tutorial: http://emoncms.org/site/docs/raspberrypihdd

But now, I would like to get access to the 200GB HDD and not only few GB as it is now. As I don't want to destroy everything I would like to know how to expand my partition

Here is what I have if I do:

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          2.7G  2.7G     0 100% /
/dev/root       2.7G  2.7G     0 100% /
devtmpfs        212M     0  212M   0% /dev
tmpfs            44M  372K   44M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            88M     0   88M   0% /run/shm

 

$ cat /etc/fstab
proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
/dev/sda2       /               ext4    defaults,noatime  0       1

 

$ mount
/dev/root on / type ext4 (rw,noatime,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=216108k,nr_inodes=54027,mode=755)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=44876k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=89740k)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)

 

 

darrepac's picture

Re: Expand the HDD partition

About the 200GB USB  HDD

$ sudo fdisk -l /dev/sda2

Disk /dev/sda2: 2899 MB, 2899312640 bytes
255 heads, 63 sectors/track, 352 cylinders, total 5662720 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: 0x00000000

Disk /dev/sda2 doesn't contain a valid partition table

darrepac's picture

Re: Expand the HDD partition

$ sudo fdisk -l /dev/sda

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 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: 0x0002c262

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            8192      122879       57344    c  W95 FAT32 (LBA)
/dev/sda2          122880     5785599     2831360   83  Linux

darrepac's picture

Re: Expand the HDD partition

Thanks Bra1n! Worked like a charm!

Bra1n's picture

Re: Expand the HDD partition

Your very welcome, glad this Linux noob could be of help.

Now I just need to see if I can keep my PI + HDD system running for more than 6 days in a row (my current record !)

nerdy's picture

Re: Expand the HDD partition

And another thanks. Wondered why I couldn't login.

Found the partition full and after searching online remembered there was a link on here.

Worked perfectly

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.