Freebsd – understanding disk space on ec2 freebsd instance

freebsdhard drive

So I probably lack some basic fundamental understanding when it comes to unix drives.

On amazon-ec2, I just created an instance where I specified the root device to be 30 GB. If I goto volumes I see the volume in use. But when I ssh into the system and run :

# df -h 
Filesystem    Size    Used   Avail Capacity  Mounted on
/dev/ad0a     9.9G    1.4G    7.7G    16%    /
devfs         1.0k    1.0k      0B   100%    /dev

I don't get it?!

Also, on volumes in amazon, on the details I see Attachment : /dev/sda1 , what does this really mean?

Best Answer

For the first question, your partition is 10GB, while the drive is 30. Run gpart show to see the partitions on each "drive", including the freespace. You can then figure out what size you want the partition to be and use gpart resize.

Once the partition is 30GB, or whatever size you want, run growfs to resize the filesystem on the partition. Both of these commands take more arguments than I've listed here, see their man pages for details man gpart and man growfs respectively. If you have any specific problems running the commands ask again, or drop into chat, there are a few FreeBSD experts in there.

FreeBSD is not Linux, though many people confuse the two (as did two Answerers who have subsequently deleted their wrong answers). Unfortunately Amazon is guilty too. Linux uses labeling similar to /dev/sda1 for it's first hard drive. FreeBSD uses /dev/ad0 for it's first (S)ATA hard drive (and /dev/da0 for SCSI/SAS drives, including ATAPI, USB, FireWire). Solaris uses /dev/rdsk/cWtXdYsZ... Also FreeBSD adds letters after the device name for MBR Partitions, so /dev/ad0a is the first partition of the first ATA disk. You'll also see /dev/ad0b/, for historical reasons this is the whole disk just like the device name without a partition letter.