Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-11-2009, 02:19 PM   #1
Registered: May 2006
Distribution: CentOS 5
Posts: 47

Rep: Reputation: 15
Mount external hard drive's folder as partition visible in df

Hello there,

I have an external drive which I mounted on /drive
in /drive I have 2 folders: Folder1 and Folder2

I'd like to somehow mount those 2 folders in root so they both can be accessed by /Folder1 and /Folder2 instead of the current /drive/Folder1

But the special thing in that request, is that both /Folder1 and /Folder2 would need to appear when I do the df command, a simple symbolic link is not enough for my needs (Amanda DLE's)

Thank You
Old 03-11-2009, 02:29 PM   #2
Registered: Sep 2008
Distribution: openSUSE, Ubuntu
Posts: 373
Blog Entries: 2

Rep: Reputation: 32
OK first of all you don't mount partition on / instead use /media or /mnt.. i don't know if you can mount folders that easily..
Old 03-11-2009, 02:44 PM   #3
Registered: May 2006
Distribution: CentOS 5
Posts: 47

Original Poster
Rep: Reputation: 15
yes I know the 'proper' way to mount, but for this purpose I need it to have the shortest path possible.
instead of
Old 03-11-2009, 02:45 PM   #4
Registered: Sep 2008
Distribution: openSUSE, Ubuntu
Posts: 373
Blog Entries: 2

Rep: Reputation: 32
why don't you just create a hardlink?
Old 03-11-2009, 02:51 PM   #5
Registered: Oct 2007
Distribution: Fedora, openSUSE
Posts: 252

Rep: Reputation: 39
Are Folder1 and Folder2 the mountpoints of 2 separate partitions, or are they subdirectories of a filesystem mounted at /drive?

If the former, just put appropriate entries in your fstab. If the latter, df can't look at them separately - it can only report free space on a filesystem as a whole.

PS hardlinks can't be made across different filesystems
Old 03-11-2009, 03:42 PM   #6
Registered: Mar 2007
Location: Plymouth, UK
Distribution: Fedora Core, RHEL, Arch
Posts: 342

Rep: Reputation: 38
And hardlinks are forbidden for directories.

I'd say use the bind option of mount. It alows you to mount any folder wherever you like, even if it is on a file-system that is already mounted.

mount --bind olddir newdir
Old 03-11-2009, 08:39 PM   #7
Senior Member
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
Why don't we take a step back and ask what exactly you are trying to achieve and why. In other words, rather than asking a question about how you are trying to do something, let's get back to asking a question about what your purpose and reasoning is.

Since you are on Linux, using Amanda, I presume you are using gnutar for your backups. DLE's using gnutar don't need to be partitions. If you are using dump on Linux, don't.

From the Amanda FAQ: "A DLE refers to one entry in the disklist of an Amanda-configuration. General usage was to describe them as partitions, or file systems. But in fact they do not have to be either. They can be directory trees, or multiple trees, or trees with some branches cut off. So the more generic term DLE was coined."
Old 03-11-2009, 09:33 PM   #8
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678
You could create symbolic links to the subdirectories:
sudo ln -s /mnt/hpmedia/Documents/pdfdoc /pdfdoc
sudo ln -s /mnt/hpmedia/Documents/webarchives /webarchives

The links will be broken when /mnt/hpmedia/Documents is not mounted, but will be OK when it is mounted.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Freecom 500GB External Hard Drive not visible gilbertt Linux - Hardware 3 11-13-2008 08:02 PM
how do I monitor my hard drive's condition? newbiesforever Linux - Software 6 07-29-2008 01:50 AM
Force External USB HDD to mount to certain folder predatorz Linux - Hardware 4 06-18-2008 11:26 AM
Hard drive's not working for knoppix hdinstall gravy Linux - Newbie 1 11-20-2005 11:40 AM
HELP! mounted hard drive's read only system? Devboy Linux - Newbie 8 10-12-2003 07:39 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:28 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration