Change the default /images location



  • Hi people

    I installed my FOG server in a VM on a 60GB SSD disk, that i made.
    Now i would like to add a secondary Disk of about 300-500GB HDD to that same ubuntu instance to store the images.

    Is there a way i can change the /image folder to that second disk?

    Or should i not bother and install a second FOG server just as a storage node?

    Thanks in advance



  • @george1421 I didn’t know that storage nodes were deploy only. Thank for the info.


  • Moderator

    @Baessens Well you could setup a storage node for that 500GB disk, but I would say since you only have a 60GB ssd you should save that 60GB for the fog server linux OS and snapins. There is not a lot of value in saving it for images, plus you run the risk of filling up the root partition on linux if you happen to capture a big image.

    Depending on the number of client computers in your network, it would not be bad to add a storage node, BUT storage nodes are deploy only. You can only capture to a master node, so you are still stuck with the 60GB limitation. Adding the second drive to the fog server is an easier path to go with less negative impact.



  • @george1421 Thanks for the quick reply. This helped me out, thank you !
    So you wouldn’t recommend me setting up a Fog storage node?


  • Moderator

    The following steps should take over from the tutorial.

    1. Mount the new disk partition over (temporarily) over /mnt to copy the current files
      sudo mount -t ext4 /dev/sdb1 /mnt
    2. Move all of the files
      sudo mv /images/* /mnt
    3. Unmount the new disk
      sudo umount /mnt
    4. If you view the /images directory it should now be blank
      ls -la /images
    5. Edit the /etc/fstab file so that the fog server always mounts the new disk over /images. This command will tell your linux OS to mount /dev/sdb1 on the /images directory upon each reboot.
    /dev/sdb1 /images ext4 defaults 0 1
    
    1. Save and exit the /etc/fstab file.
    2. With the fstab file updated, lets tell the OS to mount all, to test to ensure that our new drive is mounted on each reboot.
      sudo mount -a
    3. Issue the df -h command to show you the mounted devices. You should see a line in the df output that looks similar to this:
      /dev/sdb1 99G 0G 99G 99% /images
    4. Now view the /images directory, all of your files should be back in place.

    Issues you might have:

    1. Make sure you have the proper directory permission on the new /images to match /images before you started with the disk mounting.
    2. Make sure the hidden check files are copied over using the move command ls -la should show you the two hidden check files. There will be one in /images and one in /images/dev directory.

  • Moderator

    The approach on adding this space depends on how you have your FOG server setup. Since you have a ssd and then a traditional hdd its probably easier to just mount over that 500GB hard drive over the /images directory. I have a tutorial that should get you pretty close. Let me see if I can find it.

    Follow this tutorial up to step #7: https://forums.fogproject.org/topic/11048/moving-fog-s-images-files-off-the-root-partition-2017-edition

    Then what you will want to temporarily mount /dev/sdb1 over to /mnt to copy the current content of /images to the new disk. Let me think about step 8 and so on.


Log in to reply
 

353
Online

6.0k
Users

13.3k
Topics

125.2k
Posts