Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have ubuntu 12.04 running on my system. I repartitioned my hard disk yesterday, I have an empty 40GiB partiton.

Can I mount it at say /data-part ? How do I do this ?

I have formatted it as ext4.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

=== EDIT STARTS ===

I am assuming you want it to be mounted every time you boot, if what you want is to mount it one time:

$ sudo mkdir /data-part
$ sudo mount /dev/sdaX /data-part

should do the trick.

=== EDIT ENDS ===

Sure you can. First you need to know device file of the partition you need to mount (it should be something like sda* in most cases). If you don't know, install and run gparted and find out device file of the partition.

gparted

Once you find the device file, fire up your favorite editor from terminal (assuming device file you want to mount is /dev/sdaX, replace accordingly):

$ sudo gedit /etc/fstab

When editor opens, go to the bottom of the file and add a line like:

/dev/sdaX /data-part ext4 defaults 0 0

And then, all you need to do is to create a directory at mount point:

$ sudo mkdir /data-part

After your next reboot, partition should be mounted at the mount point automatically.

share|improve this answer
    
Awesome, This will be first thing I'll do once I get back home.. Yes I want it to be mouted automatically everytime... So this is how partitions are handled in Linux ?? Is this like Windows' D:/, E:/ etc., –  Bhargav Jan 28 '13 at 10:01
1  
Yes, you can mount a partition to directory you want. What I can suggest is that, instead of mounting partitions in random places, you shall keep mounted directories in a specific folder. For example, I am keeping them in /media folder (like /media/storage /media/backup). –  th0th Jan 28 '13 at 11:46

Try running these commands:

sudo mkdir -p /data-part
sudo mount -t ext4 /dev/sdb1 /data-part

This will do the trick.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.