SOLVED PASSWORD ----> SQL Problem after extend disk space ??!!

  • Hi Fog Community !

    I just can’t login on the fog web interface !? I use FOG since 6 months with the default IDs (fog/password)! today i was defining the AD encrypted password when i was disconnected, and when i try to login FOG say me : “Invalid Login” !

    I have only 1 login on my fog server so i am actually blocked 😞

    I will really appreciate your help!!!


  • Moderator

    @Sebastian-Roth said:

    • You should never use tools like resizefs, gparted or fdisk on your system disk (sda in your case) within the running system!

    I use it each time I have to extend partition on linux within the running system 😄 (I use snapshot before 😛 )

  • @Wayne-Workman

    Ok guys, really appreciate your help but i decided to create anoter VM with much disk space, and i’ll try to connect a network shared folder located on our SAN to it.

    Anyway I think I would have ended up breaking everything on my VM.


  • @Sebastian-Roth said:

    There are so many things that can go wrong if you just “try things out”.

    I’m to the point where I’m so comfortable with FOG and Linux - that I will simply build a new server if I need more drive space and then migrate all images and all data over. I’ve done it 5 times so far, the last two times with over 400GB of image data and the CA and many storage nodes to contend with. I can normally get it done before lunch from scratch.

    But… it’s probably easier to just expand a drive. I’m sure I’ll eventually cross that bridge.

  • Senior Developer

    As I said… this is an advanced topic and I really doubt that you will be able to just fix this in a couple of hours asking questions in a forum! You really need to read about partitioning, virtual disks, linux disk/partition naming, resizing and all that. There are so many things that can go wrong if you just “try things out”.

    As a starter I will explain a little to try to avoid the confusion I see in the last posts.

    • Resizing your first virtual disk (VD) from 45 to 150 GB will not change anything if you don’t use GParted live (or other similar tool) to grow the partition and resize the filesystem in that partition - again - this is not easy stuff!
    • You should never use tools like resizefs, gparted or fdisk on your system disk (sda in your case) within the running system! Use a linux live boot CD/DVD/USB!
    • A different way to approach this problem would be to add a second VD to your VM. Tom Elliott’s long post is showing you how to get this second disk (called sdb in linux) ready.
  • Moderator

    @arnaudrigole Hi, sorry, I’ve not seen that you had another vdisk, why you have not extend existing vdisk ???

  • @Tom-Elliott

    sorry , i dont understood that i cant use sda anyway.

    i have no /dev/sdb like fdisk say:

    alt text

    so i’ve to add it ? hyper-v permit to extend the VD size but the VM dont allow to extend this fresh space to the actual disk ??..

    I’ll reduce the VD already allowed to sda to its original size: 45gb;
    then i’ll add a VD to my VM which will be recognized by my VM as sdb? i try

  • @arnaudrigole Why do you keep using /dev/sda? You cannot do anythign with that volume.

  • @Tom-Elliott

    Hi Tom-Elliott, thanks for the time you wasted to answer!
    It looks very hard for me, i dont understand very well the partitioning of linux…

    I tried to " fdisk /dev/sda" it return : “a new partition 3 type Linux and size 1023kiB has been created”
    then i typed w and it return:
    “Failed to read the partition table, maybe the peripheral is busy” so i rebooted and i’ve now this table:
    alt text

    I’ve deleted the partitions “sda3” and “sda4”, rebooted and do the cmds again: it return the same …
    I’m sorry but i really dont undestand the fact to “mount” an “sdb”, i haven’t a second disk on my VM, so no sdb?

  • @arnaudrigole Your commands won’t work.

    You added a new disk, and are trying to add that new disk to the LVM (Logical Volume Manager) that your primary disk is currently using.

    fdisk /dev/sda

    Will only create partition 3 on the /dev/sda disk (which is already out of room anyway.)

    Seeing as the new disk is its own drive, you’d be better off doing:

    fdisk /dev/sdb

    mkfs.ext4 /dev/sdb1

    mkdir /images2
    cp -Rf /images/* /images2/
    touch /images2/.mntcheck
    touch /images2/dev/.mntcheck
    chown -R fog:root /images2
    chmod 777 -R /images2

    After that, you should verify that /images2 has all the same contents of /images. Once you’re certain they have the same data, you should be safe to delete the /images folder.

    You should, safely, be able to unmount the /images2 folder as well.


    rm -rf /images
    umount /images2
    mv /images{2,}

    Edit the /etc/fstab file so you create a new entry for /dev/sdb1 to be mounted to /images, it should look like:
    /dev/sdb1 /images ext4 defaults 0 1 under all the other entries.

    Then run:
    mount -a

    At this point you should be good to go.

  • @ch3i

    Thanks, but i dont understand the steps i’ve to do;
    In the “Add & Extend a 2nd virtual HDD” FOG procédure; i’ve used this following cmds:

    fdisk /dev/sda
    Create a <n>ew
    numbere <3>
    <w>rite the changes to disk
    <q>uit fdisk


    mkfs.ext4 /dev/sdb1

    then i tried to “resize2fs /dev/sda1” and got this error message

    Thanks for your help!..

  • Moderator

    @arnaudrigole Oups, you have to use fdisk before 😄

  • @ch3i

    Hi ! Thanks for ur reply,

    When i try to “resize2fs /dev/sda1” it return me :
    " Le système de fichiers a déjà 11305984 blocs (4k). Rien à faire! "

  • Moderator

    @arnaudrigole Hi, you can resize with resize2fs : resize2fs /dev/sda1. Take a snapshot before, if your are not sure you can chat with me in french.

  • Thanks for your reply, i think too.

    If i understand, extend the virtual disk space with hyper-v just add a new volume on the VM, but it doesn’t extend the partition size ?

    i dont know if i’ve to extend the /dev/sda1 or add a new partition ?

    alt text

  • Senior Developer

    @arnaudrigole Ahh, now I see. Disk is full and probably the mysql database was kind of damaged as it could not properly write its lock files. This probably caused the invalid login as well I would say.
    Extending the virtual disk does not automatically extend the partition and filesystem on that disk. You would need to boot your VM with something like GParted Live and extend the partition to full size. This is kind of an advanced thing to do and things can go wrong. I suggest taking a backup before. Instead of extending the disk you could add another virtual disk to that VM. There is a wiki article on how to do this.

    Don’t rush into these things. Read the article and look up things you are not familiar with before getting into action.

  • Hi!
    Ok, new problem. I wanna install “sudo” on my server… Shell told me that i haven’t much space to download it.
    45gb on 45gb used on the hard drive. So i stopped the VM, extended the VD to 150gb, then rebooted it.
    Now, look at what the webUI displays me: …

    alt text

    And if i click on “Install/Upgrade” SQL returned me errors “NOT NULL” for tables… (already exists, of course)

    Anyone can help me 😞 ?

  • Moderator