Adding secondary storage to FOG server



  • Hello all! I’m new to using Linux and FOG both. I would like to learn how to add a secondary hard drive to my FOG server. I currently have a 1TB hard drive running Ubuntu and FOG and would like to add a 8TB drive. I also am considering moving all of my images to the 8TB drive along with FOG. Is there an easy way to accomplish this?



  • @Quazz The standard stuff. The page could not be reached. I also was wondering if I need to uninstall and reinstall FOG anyways, because we have DHCP servers setup on our network, and I skipped all of that through the initial config. Do you think this is maybe why I’m having issues now? I tried to setup the startup script in the CentOS 7 manual, but it seemed not to work. Thanks for any input.


  • Moderator

    @chris178 What do you visually see when you try to access the management page?



  • So I got the FOG server installed, but I had issues with getting my first image. The PXE function seems to work fine but I tried setting the PC for capture under the management console and it said something about the PC wasn’t set for imaging? Does this make sense? So I rebooted, and now I can’t even get into the management console. Any suggestions? Thanks.


  • Moderator

    @george1421 I see you used xfs for all of the existing partitions. If you want to reformat your /dev/sdc1 to use xfs instead of ext4 you can just use the mk.xfs /dev/sdc1 command and then adjust the settings to reference xfs instead of ext4.


  • Moderator

    @chris178 I fixed your post so it was in a code block.

    I see your system used the UUID instead of the partitions. No problem.

    Change this line

    UUID=0b14f21a-8817-46e5-966b-8a813ee5fc0f /images                 xfs     defaults        0 0
    

    to

    UUID=0b14f21a-8817-46e5-966b-8a813ee5fc0f /images2                 xfs     defaults        0 0
    

    and insert a new line

    /dev/sdc1      /images                 ext4     defaults        0 0
    

    And then save the file.



  • @george1421 I’m stuck on editing the /etc/fstab. Here is a copy of what I’m looking at. Can you help? Thanks.

    /etc/fstab

    # Created by anaconda on Thu Jun 29 11:50:55 2017
    #
    # Accessible filesystems, by reference, are maintained under '/dev/disk'
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    UUID=576c1402-3f95-4897-86cd-45a085d0f771 /                       xfs     defaults        0 0
    UUID=02756a47-0f80-4ba2-939b-9345b05bcacf /boot                   xfs     defaults        0 0
    UUID=1D02-E2D7          /boot/efi               vfat    umask=0077,shortname=winnt 0 0
    UUID=ebcbc443-67c3-4ba9-b2e7-3e6f1742a40d /home                   xfs     defaults        0 0
    UUID=0b14f21a-8817-46e5-966b-8a813ee5fc0f /images                 xfs     defaults        0 0
    UUID=5b1c943d-bbe6-470c-b720-42e0553e42ee swap                    swap    defaults        0 0
    

  • Moderator

    @chris178 Then if fog isn’t installed, just skip the bits about copying the files over and permissions. So skip step 5 and 6 and delay 16, 17, 18 and 19 until after FOG is installed.

    Once the system is setup install fog normally there is noting special you need to do once the block level devices are in place.



  • @george1421 No images are in the /images folder at this time. I just would like to install FOG on a separate drive and start fresh, by re-uploading all of my images.



  • I guess I wasn’t too clear. I apologize. I have installed CentOS and the drives are how I showed you previously. However, FOG is not installed at this time. That’s what I meant by start from scratch.


  • Moderator

    @chris178

    Then you need to:

    1. You must execute these commands as root, or use sudo
    2. Since /dev/sdc already has a partition on it that step is done.
    3. If you haven’t formatted it you will need to issue, mkfs.ext4 /dev/sdc1
    4. Mount /dev/sdc1 to a temp location mount -t ext4 /dev/sdc1 /mnt
    5. Copy all of the files from your current images to /dev/sdc1 cp -R /images/* /mnt and cp -R /images/.* /mnt
    6. Ensure the file permissions and file ownership are correct in the /mnt dir.
    7. Move out of the /mnt directory path. cd \
    8. Unmount both /images and /mnt umount /images and umount /mnt
    9. (while you said sacrifice, lets do this just in case later you need the space) mkdir /images2
    10. Edit /etc/fstab
    11. Locate the line that currently mounts /dev/sda3 and duplicate it. It should look something like this.
    /dev/sda3     /images     ext4 defaults 0 1
    

    when you duplicate it, it will look like this

    /dev/sda3     /images     ext4 defaults 0 1
    /dev/sda3     /images     ext4 defaults 0 1
    
    1. Change the first row to mount /dev/sda3 to /images2 and the second row to mount /dev/sdc1 to /images. It should look like this:
    /dev/sda3     /images2     ext4 defaults 0 1
    /dev/sdc1     /images      ext4 defaults 0 1
    
    1. Save and exit your editor.
    2. Mount the volumes with this command mount -a
    3. Confirm that they are mounted correctly with lsblk
    4. Edit /etc/exports
    5. Duplicate the 2 lines in there and modify the contents to look like this:
    /images *(ro,sync,no_wdelay,no_subtree_check,insecure_locks,no_root_squash,insecure,fsid=0)
    /images/dev *(rw,async,no_wdelay,no_subtree_check,no_root_squash,insecure,fsid=1)
    
    /images2 *(ro,sync,no_wdelay,no_subtree_check,insecure_locks,no_root_squash,insecure,fsid=0)
    /images2/dev *(rw,async,no_wdelay,no_subtree_check,no_root_squash,insecure,fsid=1)
    
    1. Refresh your exports with exportfs -ra
    2. Confirm all of your shares are available showmount -e 127.0.0.1
    3. Done.

    Don’t let the number of steps put you discourage you. Adding back in that second yet smaller disk was something you may need some time. We won’t go into the FOG configuration for using that second (original) partition (/dev/sda3). Its there if you need it or to reference it in case something was missed during the migration.



  • @george1421 Yes I want to sacrifice the 830gb partition and just mount the /images on the 7.3tb drive.


  • Moderator

    @chris178 Ok at this point you need to ask your self this, do you sacrifice the 830GB partition [/dev/sda3] and just mount /dev/sdc1 over /images to minimize complexity or do you want to use both storage locations but add a layer of management by adding an additional storage node reference?

    The path is pretty simple either way.



  • @george1421 Here’s what my drives look like:

    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    sda 8:0 0 931.5G 0 disk
    ├─sda1 8:1 0 953M 0 part /boot/efi
    ├─sda2 8:2 0 953M 0 part /boot
    ├─sda3 8:3 0 827.2G 0 part /images
    ├─sda4 8:4 0 51.2G 0 part /
    ├─sda5 8:5 0 32.6G 0 part [SWAP]
    └─sda6 8:6 0 18.6G 0 part /home
    sdc 8:32 0 7.3T 0 disk
    └─sdc1 8:33 0 7.3T 0 part
    sr0 11:0 1 1024M 0 rom



  • @george1421 Ok, change in scenario. I’m starting from scratch. I would like to build a FOG server and put it on a separate drive from CentOS if possible. /sda is my main hard drive (1TB) and /sdc is my secondary 8TB drive. I’ve tried piecing multiple pages of information together to make this work, but nothing seems to be working. I apologize but I can’t have you remote in. Is there a step by step process to make this work? or do I have to install FOG and the OS one one physical drive regardless?


  • Moderator

    @chris178 I did create a tutorial for solving this situation. Its centos centric but the commands are very similar for other versions of linux.
    https://forums.fogproject.org/topic/6642/moving-fog-s-images-files-off-the-root-partition



  • All,

    Thanks for the replies. I just took over this project from someone else. I appreciate all of the comments and I’ll try to answer your questions. I would like to keep both drives. Right now, the way its setup is all of the images, the OS and the FOG server are on one drive. I know this is a bad setup and therefore I would like to migrate the images and the FOG server to the 8TB drive if I could. I just don’t know Linux that well to manage it. Thanks for any help you might provide.


  • Moderator

    @x23piracy said in Adding secondary storage to FOG server:

    why not cloning the complete harddrive from 1tb to 8tb? For me that sounds like the best solution.

    Consider I’m a very old unix guy. But for me you should never have transient data (fog data) on your OS partition. If you fill up your OS partition, the Unix OS breaks (like having to reinstall breaks). This would be equivalent to having a windows file server with user home directories and group files shared out of the C: drive. You never know when a user is going to download a HUGE video file and fill up the C: drive on the server.

    So for transient data like fog images, its best to move them to their own partition/disk. Fill up the /images partition, and linux will complain but the OS will keep running.



  • Hi,

    is this a physical server (not a vm) why not cloning the complete harddrive from 1tb to 8tb? For me that sounds like the best solution. You can even do what @george1421 suggested also a nice solution ;)


  • Moderator

    There is a simple way and a hard way to do this.

    Just a quick question do you want to remove the 1TB drive and replace it with the 8TB or only add on the 8TB drive?

    The easy way is to format that 8TB drive and then attach that to your /images directory (after you’ve moved the contents of the /images over). This will move your fog data to the 8TB drive leaving the rest of the 1TB drive for the FOG program and linux OS.


Log in to reply
 

359
Online

38982
Users

10712
Topics

101678
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.