Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

If I want to mount a file system at /myname is it possible by just editing fstab file?
Or should I do more to be safer?

Is any other way to do it, or its not a good idea to do?

share|improve this question
    
No offense to ctt, but I don't understand why you made his answer the accepted answer when pradeepchhetri's answer came earlier and is way, way better. –  gparent Apr 7 '12 at 16:12
    
It may have been chosen because it answered the question. The other post didn't explain whether editing the fstab was a suitable option (the question posed). It just presented more options. –  ctt Apr 7 '12 at 16:22
    
@gparent ctt is right –  pahnin Apr 8 '12 at 17:01
    
Well, the other answer literally tells you to edit /etc/fstab but I guess that isn't enough. Oh well... –  gparent Apr 8 '12 at 20:57
add comment

2 Answers

up vote 0 down vote accepted

This is the way to do it. By editing the fstab file, you'll have options to maintain the mount across reboot. Also, you'll be able to ask mount to simply mount /myname and it'll work out.

So to answer your question, definitely yes.

share|improve this answer
add comment

You want that partition with a different file system to be mounted in Linux. So there can be two cases:

1. If the partition is to be mounted in every boot:

You have to create an empty directory where you want to mount that file-system. Suppose I want to mount a windows partition(/dev/sda1) to /myname, then i have to create an empty directory /myname

$ sudo mkdir /myname

Now you have to open /etc/fstab file and add the entry for the file-system.

$ sudo vi /etc/fstab

Add the following line to the file:

/dev/sda1 /myname ntfs defaults 0 0

Now since you have changed /etc/fstab file, you have to make the kernel to read the file to mount the entry which you have added just now.

$ sudo mount -a

2. If the partition is to be mounted for this time only, but not for every boot:

You can use mount command to tell it to mount the partition:

$ sudo mount /dev/sda1 /myname

share|improve this answer
    
I know this procedure but I want to mount the fs at /myname like /pahnin –  pahnin Apr 7 '12 at 14:20
    
@pahnin: There won't be any problem even if you want to mount it in a directory like /myname. There are other method also by which you can do this. If you want I can edit my answer with those also but you have to tell me the Linux distro which you are using –  pradeepchhetri Apr 7 '12 at 14:25
    
linux mint debian edition –  pahnin Apr 7 '12 at 15:26
add comment

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.