Is it possible to mount different folders on disk to different locations? I have a disk with two folders, folder1 and folder2. I'd like to mount these folders separately in my home folder, that is, to the locations: Code:
Solution: Suppose you had a user on a ntfs partition, say /dev/sda1 and you wanted to map each user's document folders to a folder, say Documents/Windows in each of those same user's /home directories on your (dual-booting) Linux system. Then the following commands (in bold below) would do the trick. (Lines starting with a hash mark - # - are comments) Code: $ # First, create a mount point for the partition
autoexec.bat Commands hiberfil.sys pagefile.sys Program Files System.sav Windows Books config.sys HP PerfLogs Recovery System Volume Information boot CVS IPH.PH Pictures $RECYCLE.BIN Users bootmgr Documents and Settings MSOCache ProgramData SWSetup Wallpapers $ ls /Vista/Users/ All Users Default Default User desktop.ini Judy Peter Public $ ls /Vista/Users/Peter/ AppData Music Pictures Application Data My Documents PrintHood Contacts NetHood Recent Cookies NTUSER.DAT Saved Games Desktop NTUSER.DAT{3a539871-6a70-11db-887c-d362bd253390}.TM.blf Searches Documents NTUSER.DAT{3a539871-6a70-11db-887c-d362bd253390}.TMContainer00000000000000000001.regtrans-ms SendTo Downloads NTUSER.DAT{3a539871-6a70-11db-887c-d362bd253390}.TMContainer00000000000000000002.regtrans-ms Start Menu Favorites ntuser.dat.LOG1 Templates Links ntuser.dat.LOG2 Videos Local Settings ntuser.ini $ ls /Vista/Users/Peter/Documents/ desktop.ini Downloads My Music My Pictures My Videos $ $ # Create the folder in the user's directory to which Windows folder is to be mapped: $ mkdir -p /home/Peter/Documents/Vista $ # Create the link to the Windows folder $ ln -s /Vista/Users/Peter/Documents/ /home/Peter/Documents/Vista/ $ # Verify that the link works $ ls /home/Peter/Documents/Vista/ Documents $ ls /home/Peter/Documents/Vista/Documents/ desktop.ini Downloads My Music My Pictures My VideosIt's really that simple. (The above an actual terminal session I just ran on my Fedora system.) Oh, I was logged in a Peter when I ran that. If I had been logged in as someone else (e.g., root), the last makdir command would either need to be run as Peter (i.e., su Peter -c 'mkdir -p /home/Peter/Documents/Vista') or followed by a sudo chown Peter:Peter /home/Peter/Documents/Vista so Peter could use the directory.
Have a Linux Problem
Linux Books
Linux Home: Linux System Administration Hints and Tips (c) www.gotothings.com All material on this site is Copyright.
|