1

I have an Ubuntu 12.04 machine running as a VM and I would like to create a 'data' directory with the unallocated space left on /dev/sda. I managed to create a /dev/sda3 partition on the available space, but I cannot see any way of defining a mount point for the new space. Is it possible to do this on a running system?

Once I have created the partition with gparted, the system looks like this:

enter image description here

But if I query it from a terminal, /dev/sda3 won't show up:

df -ah
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       7.4G  6.1G  963M  87% /
proc               0     0     0    - /proc
sysfs              0     0     0    - /sys
none               0     0     0    - /sys/fs/fuse/connections
none               0     0     0    - /sys/kernel/debug
none               0     0     0    - /sys/kernel/security
udev            7.7G  4.0K  7.7G   1% /dev
devpts             0     0     0    - /dev/pts
tmpfs           3.1G  404K  3.1G   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            7.8G   72K  7.8G   1% /run/shm

Any ideas?

1 Answer 1

3

Yes it is possible. To mount it on the directory /foo run:

sudo mount /dev/sda3 /foo

To make this permanent you need to edit /etc/fstab and ad a line like this:

/dev/sda3   /foo    ext3    defaults    0   0

This assumes that the partition has an ext3 filesystem. If not, change ext3 to ext4 or ntfs or whatever. Similarly, to specify the filesystem on the command line do:

sudo mount -t ext3 /dev/sda3 /foo
2
  • The issue is that /dev/sda3 doesn't show up in the system.
    – 719016
    Commented Dec 3, 2012 at 19:02
  • @130490868091234, It won't show up in df unless it's mounted. Try the command I gave and then run df again. To see all partitions (mounted or not) run sudo fdisk -l /dev/sda.
    – terdon
    Commented Dec 3, 2012 at 19:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .