How to add extra hard drive as apache webspace

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite












I have searched for this in google with no clear response



I have a webserver that is using one hard drive



/dev/sda4 40%


and have a second hard drive at



/dev/sdb1 0%


How would I mount or add the second hard drive to use the extra disk space in my webpage? I want to use the two hard drives at the same time.



/var/www/vhosts/trexample.com


Can anyone point me to a guide to do this or is there a quick terminal shell command I just can copy paste in root?







share|improve this question


























    up vote
    1
    down vote

    favorite












    I have searched for this in google with no clear response



    I have a webserver that is using one hard drive



    /dev/sda4 40%


    and have a second hard drive at



    /dev/sdb1 0%


    How would I mount or add the second hard drive to use the extra disk space in my webpage? I want to use the two hard drives at the same time.



    /var/www/vhosts/trexample.com


    Can anyone point me to a guide to do this or is there a quick terminal shell command I just can copy paste in root?







    share|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I have searched for this in google with no clear response



      I have a webserver that is using one hard drive



      /dev/sda4 40%


      and have a second hard drive at



      /dev/sdb1 0%


      How would I mount or add the second hard drive to use the extra disk space in my webpage? I want to use the two hard drives at the same time.



      /var/www/vhosts/trexample.com


      Can anyone point me to a guide to do this or is there a quick terminal shell command I just can copy paste in root?







      share|improve this question














      I have searched for this in google with no clear response



      I have a webserver that is using one hard drive



      /dev/sda4 40%


      and have a second hard drive at



      /dev/sdb1 0%


      How would I mount or add the second hard drive to use the extra disk space in my webpage? I want to use the two hard drives at the same time.



      /var/www/vhosts/trexample.com


      Can anyone point me to a guide to do this or is there a quick terminal shell command I just can copy paste in root?









      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 20 at 22:00









      Jason Aller

      44358




      44358










      asked Apr 20 at 21:01









      Gerag2

      61




      61




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          It looks like you need a way to span a single file system across multiple physical volumes. I'll outline two approaches below.



          LVM



          You can set up a logical volume (using LVM) based on sdb1 and maybe parts of what is now sda4 and mount it at /var/www/vhosts/trexample.com.



          1. To set up the logical volume using LVM see https://wiki.ubuntu.com/Lvm.


          2. Format the logical volume with the desired file system.


          3. Move the existing data to the new file system.


          4. To mount the volume at the desired location upon boot see https://help.ubuntu.com/community/Fstab.


          Btrfs



          Some file systems support multiple underlying volumes natively. Btrfs is one of them and available in Ubuntu out of the box.



          1. Shrink sda4 as needed and create a new partition in the newly freed space. Lets say the new partition is sda6.



          2. Format sdb1 as a new, empty Btrfs file system and mount it:



            mkfs.btrfs /dev/sdb1
            mkdir /mnt/trexample.com
            mount -t btrfs /dev/sdb1 /mnt/trexample.com



          3. Add the other volume(s) to the file systems:



            btrfs device add /dev/sda6 /mnt/trexample.com


          4. Move the existing data to the new file system.


          5. To mount the volume at the desired location upon boot see https://help.ubuntu.com/community/Fstab.






          share|improve this answer




















          • looks like my second hard drive /dev/sdb1 0% has stuff in it /dev/sdb1 2 816 556.64 MB 72.98 MB 2 673 388.23 MB 0% can I screw it up If I format it, can I just tell my Dedicated server hosts to do this or as someone who pays rent fo that server I am suposed to do this
            – Gerag2
            Apr 21 at 3:50











          • @Gerag2: Could you please edit your question when you want to add information? Especially file or program output listings (with the help of the button in the editor toolbar) will be much more readable there; alternatively you can use a pastie service for longer listings and include the link of your pastie in your question. Overall it’s best to have everything relevant in one place. Additionally, comments may be deleted for various reasons. Thanks.
            – David Foerster
            Apr 21 at 9:25










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "89"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1026796%2fhow-to-add-extra-hard-drive-as-apache-webspace%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          It looks like you need a way to span a single file system across multiple physical volumes. I'll outline two approaches below.



          LVM



          You can set up a logical volume (using LVM) based on sdb1 and maybe parts of what is now sda4 and mount it at /var/www/vhosts/trexample.com.



          1. To set up the logical volume using LVM see https://wiki.ubuntu.com/Lvm.


          2. Format the logical volume with the desired file system.


          3. Move the existing data to the new file system.


          4. To mount the volume at the desired location upon boot see https://help.ubuntu.com/community/Fstab.


          Btrfs



          Some file systems support multiple underlying volumes natively. Btrfs is one of them and available in Ubuntu out of the box.



          1. Shrink sda4 as needed and create a new partition in the newly freed space. Lets say the new partition is sda6.



          2. Format sdb1 as a new, empty Btrfs file system and mount it:



            mkfs.btrfs /dev/sdb1
            mkdir /mnt/trexample.com
            mount -t btrfs /dev/sdb1 /mnt/trexample.com



          3. Add the other volume(s) to the file systems:



            btrfs device add /dev/sda6 /mnt/trexample.com


          4. Move the existing data to the new file system.


          5. To mount the volume at the desired location upon boot see https://help.ubuntu.com/community/Fstab.






          share|improve this answer




















          • looks like my second hard drive /dev/sdb1 0% has stuff in it /dev/sdb1 2 816 556.64 MB 72.98 MB 2 673 388.23 MB 0% can I screw it up If I format it, can I just tell my Dedicated server hosts to do this or as someone who pays rent fo that server I am suposed to do this
            – Gerag2
            Apr 21 at 3:50











          • @Gerag2: Could you please edit your question when you want to add information? Especially file or program output listings (with the help of the button in the editor toolbar) will be much more readable there; alternatively you can use a pastie service for longer listings and include the link of your pastie in your question. Overall it’s best to have everything relevant in one place. Additionally, comments may be deleted for various reasons. Thanks.
            – David Foerster
            Apr 21 at 9:25














          up vote
          0
          down vote













          It looks like you need a way to span a single file system across multiple physical volumes. I'll outline two approaches below.



          LVM



          You can set up a logical volume (using LVM) based on sdb1 and maybe parts of what is now sda4 and mount it at /var/www/vhosts/trexample.com.



          1. To set up the logical volume using LVM see https://wiki.ubuntu.com/Lvm.


          2. Format the logical volume with the desired file system.


          3. Move the existing data to the new file system.


          4. To mount the volume at the desired location upon boot see https://help.ubuntu.com/community/Fstab.


          Btrfs



          Some file systems support multiple underlying volumes natively. Btrfs is one of them and available in Ubuntu out of the box.



          1. Shrink sda4 as needed and create a new partition in the newly freed space. Lets say the new partition is sda6.



          2. Format sdb1 as a new, empty Btrfs file system and mount it:



            mkfs.btrfs /dev/sdb1
            mkdir /mnt/trexample.com
            mount -t btrfs /dev/sdb1 /mnt/trexample.com



          3. Add the other volume(s) to the file systems:



            btrfs device add /dev/sda6 /mnt/trexample.com


          4. Move the existing data to the new file system.


          5. To mount the volume at the desired location upon boot see https://help.ubuntu.com/community/Fstab.






          share|improve this answer




















          • looks like my second hard drive /dev/sdb1 0% has stuff in it /dev/sdb1 2 816 556.64 MB 72.98 MB 2 673 388.23 MB 0% can I screw it up If I format it, can I just tell my Dedicated server hosts to do this or as someone who pays rent fo that server I am suposed to do this
            – Gerag2
            Apr 21 at 3:50











          • @Gerag2: Could you please edit your question when you want to add information? Especially file or program output listings (with the help of the button in the editor toolbar) will be much more readable there; alternatively you can use a pastie service for longer listings and include the link of your pastie in your question. Overall it’s best to have everything relevant in one place. Additionally, comments may be deleted for various reasons. Thanks.
            – David Foerster
            Apr 21 at 9:25












          up vote
          0
          down vote










          up vote
          0
          down vote









          It looks like you need a way to span a single file system across multiple physical volumes. I'll outline two approaches below.



          LVM



          You can set up a logical volume (using LVM) based on sdb1 and maybe parts of what is now sda4 and mount it at /var/www/vhosts/trexample.com.



          1. To set up the logical volume using LVM see https://wiki.ubuntu.com/Lvm.


          2. Format the logical volume with the desired file system.


          3. Move the existing data to the new file system.


          4. To mount the volume at the desired location upon boot see https://help.ubuntu.com/community/Fstab.


          Btrfs



          Some file systems support multiple underlying volumes natively. Btrfs is one of them and available in Ubuntu out of the box.



          1. Shrink sda4 as needed and create a new partition in the newly freed space. Lets say the new partition is sda6.



          2. Format sdb1 as a new, empty Btrfs file system and mount it:



            mkfs.btrfs /dev/sdb1
            mkdir /mnt/trexample.com
            mount -t btrfs /dev/sdb1 /mnt/trexample.com



          3. Add the other volume(s) to the file systems:



            btrfs device add /dev/sda6 /mnt/trexample.com


          4. Move the existing data to the new file system.


          5. To mount the volume at the desired location upon boot see https://help.ubuntu.com/community/Fstab.






          share|improve this answer












          It looks like you need a way to span a single file system across multiple physical volumes. I'll outline two approaches below.



          LVM



          You can set up a logical volume (using LVM) based on sdb1 and maybe parts of what is now sda4 and mount it at /var/www/vhosts/trexample.com.



          1. To set up the logical volume using LVM see https://wiki.ubuntu.com/Lvm.


          2. Format the logical volume with the desired file system.


          3. Move the existing data to the new file system.


          4. To mount the volume at the desired location upon boot see https://help.ubuntu.com/community/Fstab.


          Btrfs



          Some file systems support multiple underlying volumes natively. Btrfs is one of them and available in Ubuntu out of the box.



          1. Shrink sda4 as needed and create a new partition in the newly freed space. Lets say the new partition is sda6.



          2. Format sdb1 as a new, empty Btrfs file system and mount it:



            mkfs.btrfs /dev/sdb1
            mkdir /mnt/trexample.com
            mount -t btrfs /dev/sdb1 /mnt/trexample.com



          3. Add the other volume(s) to the file systems:



            btrfs device add /dev/sda6 /mnt/trexample.com


          4. Move the existing data to the new file system.


          5. To mount the volume at the desired location upon boot see https://help.ubuntu.com/community/Fstab.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 20 at 22:45









          David Foerster

          26.1k1361106




          26.1k1361106











          • looks like my second hard drive /dev/sdb1 0% has stuff in it /dev/sdb1 2 816 556.64 MB 72.98 MB 2 673 388.23 MB 0% can I screw it up If I format it, can I just tell my Dedicated server hosts to do this or as someone who pays rent fo that server I am suposed to do this
            – Gerag2
            Apr 21 at 3:50











          • @Gerag2: Could you please edit your question when you want to add information? Especially file or program output listings (with the help of the button in the editor toolbar) will be much more readable there; alternatively you can use a pastie service for longer listings and include the link of your pastie in your question. Overall it’s best to have everything relevant in one place. Additionally, comments may be deleted for various reasons. Thanks.
            – David Foerster
            Apr 21 at 9:25
















          • looks like my second hard drive /dev/sdb1 0% has stuff in it /dev/sdb1 2 816 556.64 MB 72.98 MB 2 673 388.23 MB 0% can I screw it up If I format it, can I just tell my Dedicated server hosts to do this or as someone who pays rent fo that server I am suposed to do this
            – Gerag2
            Apr 21 at 3:50











          • @Gerag2: Could you please edit your question when you want to add information? Especially file or program output listings (with the help of the button in the editor toolbar) will be much more readable there; alternatively you can use a pastie service for longer listings and include the link of your pastie in your question. Overall it’s best to have everything relevant in one place. Additionally, comments may be deleted for various reasons. Thanks.
            – David Foerster
            Apr 21 at 9:25















          looks like my second hard drive /dev/sdb1 0% has stuff in it /dev/sdb1 2 816 556.64 MB 72.98 MB 2 673 388.23 MB 0% can I screw it up If I format it, can I just tell my Dedicated server hosts to do this or as someone who pays rent fo that server I am suposed to do this
          – Gerag2
          Apr 21 at 3:50





          looks like my second hard drive /dev/sdb1 0% has stuff in it /dev/sdb1 2 816 556.64 MB 72.98 MB 2 673 388.23 MB 0% can I screw it up If I format it, can I just tell my Dedicated server hosts to do this or as someone who pays rent fo that server I am suposed to do this
          – Gerag2
          Apr 21 at 3:50













          @Gerag2: Could you please edit your question when you want to add information? Especially file or program output listings (with the help of the button in the editor toolbar) will be much more readable there; alternatively you can use a pastie service for longer listings and include the link of your pastie in your question. Overall it’s best to have everything relevant in one place. Additionally, comments may be deleted for various reasons. Thanks.
          – David Foerster
          Apr 21 at 9:25




          @Gerag2: Could you please edit your question when you want to add information? Especially file or program output listings (with the help of the button in the editor toolbar) will be much more readable there; alternatively you can use a pastie service for longer listings and include the link of your pastie in your question. Overall it’s best to have everything relevant in one place. Additionally, comments may be deleted for various reasons. Thanks.
          – David Foerster
          Apr 21 at 9:25

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1026796%2fhow-to-add-extra-hard-drive-as-apache-webspace%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          pylint3 and pip3 broken

          Missing snmpget and snmpwalk

          How to enroll fingerprints to Ubuntu 17.10 with VFS491