PASSWORD ----> SQL Problem after extend disk space ??!!
-
Can you get to a terminal on your server?
https://wiki.fogproject.org/wiki/index.php?title=Reset_WebUI_FOG_password
-
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: …And if i click on “Install/Upgrade” SQL returned me errors “NOT NULL” for tables… (already exists, of course)
Anyone can help me ?
-
@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. https://wiki.fogproject.org/wiki/index.php/Add_%26_Extend_a_2nd_Virtual_HDDDon’t rush into these things. Read the article and look up things you are not familiar with before getting into action.
-
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 ?
-
@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. -
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! " -
@arnaudrigole Oups, you have to use
fdisk
before -
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
<p>artition
numbere <3>
<default>
<default>
<w>rite the changes to disk
<q>uit fdiskthen
mkfs.ext4 /dev/sdb1
then i tried to “resize2fs /dev/sda1” and got this error message
Thanks for your help!..
-
@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 n p 3 w
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 n p 1 w
Then,
mkfs.ext4 /dev/sdb1
Then,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.
Run:
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.
-
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:
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 Why do you keep using /dev/sda? You cannot do anythign with that volume.
-
sorry , i dont understood that i cant use sda anyway.
i have no /dev/sdb like fdisk say:
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 Hi, sorry, I’ve not seen that you had another vdisk, why you have not extend existing vdisk ???
-
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.
-
@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.
-
@Wayne-Workman
@ch3i
@Sebastian-RothOk 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.
Regards
-
@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 )