how to use an external harddrive for additional space for my hosting server?

Discussion in 'Site & Server Administration' started by ronakrocks28, Dec 16, 2012.

  1. #1
    I have started my own website and am hosting it on my own server.
    I am using ubuntu server edition and have successfully instakked and set up lamp.
    Now I want to host some content of my website like downloadable files, songs, user uploaded content etc on my external 1TB harddrive. Putting it on my original harddrive would consume a lot of my space and it is just 300GB.now how do I go about with that?
    I would also like some of the pages to be on my external harddrive.
    Please tell me how to go about it?

    Thanks in advance
     
    ronakrocks28, Dec 16, 2012 IP
  2. Cybercon

    Cybercon Active Member

    Messages:
    103
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    88
    #2
    Physically add the external drive to your server. Power it on and make sure the external drive is detected.
    When server is powered on, mount the external drive to your file system, say /disk2
    Now you can put whatever files on /disk2 (after you have it formatted)

    If this is new to you, you can ask your host provider to do it for you.
     
    Cybercon, Dec 18, 2012 IP
  3. ronakrocks28

    ronakrocks28 Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Im myself hosting my website!!
    and i need extra disk space which i want to be provided by my external harddrive!!
    Please could you ellaborate?
     
    ronakrocks28, Dec 18, 2012 IP
  4. MilesWeb

    MilesWeb Well-Known Member

    Messages:
    869
    Likes Received:
    35
    Best Answers:
    7
    Trophy Points:
    173
    #4
    You can mount the additional drive and point the sub directory to these websites. This will allow you to utilize the space from the additional drive.
     
    MilesWeb, Dec 19, 2012 IP
  5. ronakrocks28

    ronakrocks28 Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    And how to i point the sub directory to the websites??
    Sorry but I am a complete newbie to all this.
    How can i do this on my ubuntu server edition?
     
    ronakrocks28, Dec 20, 2012 IP
  6. zacharooni

    zacharooni Well-Known Member

    Messages:
    346
    Likes Received:
    20
    Best Answers:
    4
    Trophy Points:
    120
    #6
    This would be inadvisable for several reasons.

    1) The I/O on the drive (I am assuming you have the external mounted via USB) will likely kill your drive, and make your website go very slow and crash as a result if you intend for the site to be open access.
    2) Backups.
    3) Is all the content you're going to have available for download licensed for distribution and/or public domain? You may be hearing from attorneys if not.

    However, to set it up, you'll want to ensure that your drive is mounted. If your external drive is NTFS partitioned, you'll want to use ntfs-3g mount type (a la mount -t ntfs-3g), or if it's already in ext2/ext3, you can just create the mount point as root, and mount /dev/sdX /mountpoint (where sdX is the associated dev entry for your external drive, get this from `df -h`, and /mountpoint is an existing (and empty) folder). After that, you should be able to navigate to /mountpoint.

    The next step will be to decide how to share it. With Apache, you can simply use this syntax in your Apache VirtualHost configuration for the hostname of the site you want to share it on:

    Alias /music /mountpoint/music_folder/
     
    Last edited: Dec 23, 2012
    zacharooni, Dec 23, 2012 IP