Find the answer to your Linux question:
Results 1 to 3 of 3
How do you link a file directory to an external hard drive.An example would be if I have a usb hard drive and I want the the folder /usr/bin/games to ...
  1. #1
    Just Joined!
    Join Date
    May 2008
    Posts
    3

    Linking Direcotry with Hardrive

    How do you link a file directory to an external hard drive.An example would be if I have a usb hard drive and I want the the folder /usr/bin/games to be considered the external hard drive. Really, my main purpose for this link is to have more space in the folder /usr/bin/games.

    Thanks

  2. #2
    Trusted Penguin Dapper Dan's Avatar
    Join Date
    Oct 2004
    Location
    The Sovereign State of South Carolina
    Posts
    4,562
    I don't know if my answer to your question will be in the way you may be anticipating, but mostly, external hard drives (specifically their file systems) are mounted at /mnt. So let's say you have an external usb hard drive and it is situated in /dev as sda1. First, you would create the directory where it will be mounted to in /mnt...
    Code:
    mkdir /mnt/external_usb
    * you can name it whatever you wish when creating the mount point. After its creation, mount the drive to it:
    Code:
    mount /dev/sda1 /mnt/external_usb
    Then, enter it:
    Code:
    cd /mnt/external_usb
    I hope this helps...
    Linux Mint + IceWM Registered:#371367 New Members: click here

  3. #3
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    And then change your /usr/bin/games directory to a symlink:
    Code:
    rm -rf /usr/bin/games
    ln -s /mnt/eternal_usb /usr/bin/games
    Make sure you save first anything that's under the original /usr/bin/games that you don't want to lose, of course! And /usr/bin/games will be just a dangling link when the usb drive isn't mounted.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...