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.

Is it possible to mount a directory, either an ext# local one, or one in a /media mounted windows drive, so it is seen as a mounted drive itself?

share|improve this question
add comment

2 Answers

up vote 6 down vote accepted

If you only want quick access to a certain directory in Nautilus and the file dialogs, you can also use a bookmark of course...

Anyway, there is a FUSE filesystem named bindfs Install bindfs that probably does exactly what you want. For example the following:

bindfs -n /media/USB-HDD-01/ISO/ /home/johnc/ISO-images

would result in ISO-images to show up as a mounted filesystem in the Places sidepanel in Nautilus. The -n is required because otherwise bindfs tries to use the allow_other FUSE option, which by default is not allowed for regular users (if you use bindfs in /etc/fstab this is not a problem).

The first directory you give is the existing one, the second directory you give is an empty directory under which the contents of the existing one will appear.

To unmount, use:

fusermount -u /home/johnc/ISO-images

PS: Nautilus (the file manager) will show mountable/mounted filesystems, not drives, but I assume that's what you were looking for.

share|improve this answer
    
Thanks for the comprehensive answer –  johnc Nov 3 '10 at 4:46
1  
A smidge of extra info: You may create a "bind" mount without using FUSE. sudo mount -o bind from_dir to_dir. I believe the result is the same though and using the FUSE filesystem does not require sudo access. –  KFro Nov 3 '10 at 5:30
2  
@KFro: with "mount --bind" it will not show up in the Nautilus "Places sidebar" though (I tested that before answering). –  JanC Nov 3 '10 at 5:36
add comment

If you mount a folder using a transparent fusefs system, gnome will pick it up and show it as a drive. You'll loose some overhead in the calls, but not much for a fast machine.

You could also make a gvfs system that mounts a folder, or a localhost ftp, ssh or other type of mount. That will show as a drive too.

share|improve this answer
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.