Mounting a new Hard Drive



  • For the users who have experienced all the problems when mounting a new hard drive to your fog server, this is a tutorial which worked well for me!

    My setup:

    • XenServer as Dedicated OS
    • Ubuntu 12.04 (fully updated at June 20th 2013) as VPS (this is the FOG server)
    • A primary 10GB Storage at [B]/dev/xvda[/B] (on the fog server)
    • A second Virtual Storage of 300GB at [B]/dev/xvdb[/B] (on the fog server)
    • FOG 0.32 installed
    • Webmin 1.630 installed

    When installation of the FOG server is completed:

    To create a new partition on /dev/xvdb:
    [CODE]
    sudo fdisk /dev/xvdb
    type n (new partition)
    type p (primary partition)
    type 1 (to create /dev/xvdb1)
    press enter (to set the first sector)
    press enter (to set the last sector)
    type t (to edit the system id)
    type 83 (to set the system id to LINUX)
    type w (to write the changes to the disk)
    [/CODE]

    The partition /dev/xvdb1 has been created
    To format the device:
    [CODE]
    sudo mkfs.ext3 /dev/xvdb1
    [/CODE]

    The partition is being formatted as ext3 (in my case the problem of read only file systems started here, because there occur some errors at this point)

    If errors occur first try to show the errors:
    [CODE]
    sudo dmesg | less
    [/CODE]
    scroll down to see if any errors occur (in my case there were problems with the "EXT3-fs (xvdb1) journal"
    you can quit this by typing q

    To fix these errors be sure the new partition is NOT mounted and do:
    [CODE]
    sudo fsck /dev/xvdb1
    [/CODE]
    Some errors on the hard disk are being recoverd. [I]To be sure, reboot after this command![/I]

    The partition has been created and is working well. Now you need to mount the /images/ folder to the created partition. But move the /images/ folder first to be sure like:
    [CODE]
    sudo mv /images/ /images.old/
    sudo mkdir /images/
    [/CODE]

    Now create the mount in /etc/fstab to be sure the partition is mounted on a reboot. I did not use the full path but the hard drive UUID:
    [CODE]
    sudo blkid /dev/xvdb1 (copy the UUID="#####" without the TYPE=“ext3”)
    sudo nano /etc/fstab (paste the UUID="####" at the bottom of this file and remove the quotes so UUID=##### remains)
    [/CODE]
    be sure the full line looks like this (my setup):
    [CODE]
    UUID=b414fb0a-70ed-462e-93ad-e7bd90c40a8c /images ext3 defaults 0 0
    [/CODE]

    exit and save by pressing [B]ctrl+x[/B] and type [B]Y[/B] to overwrite and press [B]enter[/B] to save changes
    now type the next command to mount the partition:

    [CODE]
    sudo mount -a
    [/CODE]
    test if the mount is created by typing:
    [CODE]
    sudo mount
    [/CODE]
    the /images/ folder should be in that list

    now the permissions of that folder need to be changed like:
    [CODE]
    sudo chown -R fog.root /images
    sudo chmod 777 /images -R
    [/CODE]

    Now copy the old files from /images.old/ to /images/
    [CODE]
    sudo cp /images.old/* /images/
    sudo touch /images/.mntcheck
    [/CODE]

    reboot and the mount should be ready to use!


  • Moderator

    Do you also need to
    [code]sudo touch /images/dev/.mntcheck[/code]


Log in to reply
 

348
Online

39.3k
Users

11.0k
Topics

104.4k
Posts

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