OVH ProxMox root Password recover - HELP please

  • Thread starter Thread starter noaptus
  • Start date Start date
N

noaptus

Guest
Hi.

For the last 10 hours my OVh ProxMox Debian 6 server has been offline do to I for got the root password.
I know, I know silly me, do you know what, this will happen to all off us, forgetting the root password.

What I have been trying to figure out is how can I create a new root password so I can get my server back online.

I know that OVH has this http://help.ovh.co.uk/RescueMode, as I follow this how to i get some strange fail like this.



root@rescue:~# fdisk -l


WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.




Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Device Boot Start End Blocks Id System
/dev/sda1 1 3907029167 1953514583+ ee GPT
Partition 1 does not start on physical sector boundary.


Disk /dev/mapper/pve-data: 1978.3 GB, 1978344144896 bytes
255 heads, 63 sectors/track, 240519 cylinders, total 3863953408 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/pve-data doesn't contain a valid partition table
root@rescue:~#

---------------------------------------------------------------------

I have tried to mount /dev/sda1 /mnt but that will not work, as I get this error.

root@rescue:~# mount /dev/sda1 /mnt
NTFS signature is missing.
Failed to mount '/dev/sda1': Invalid argument
The device '/dev/sda1' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
root@rescue:~#

-------------------------------------------------------------------------

And if I use this lvm vgscan I get this.

root@rescue:~# lvm vgscan
Reading all physical volumes. This may take a while...
Found volume group "pve" using metadata type lvm2
root@rescue:~#

and I use this lvm vgchange -ay I get this.

root@rescue:~# lvm vgchange -ay
1 logical volume(s) in volume group "pve" now active
root@rescue:~#
-------------------------------------------------------------------------

And for the HDD

root@rescue:~# df -l
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 12370580 79472 12291108 1% /
none 12370580 79472 12291108 1% /
tmpfs 10240 172 10068 2% /dev
tmpfs 2474120 64 2474056 1% /run
tmpfs 5120 0 5120 0% /run/lock
tmpfs 4948220 0 4948220 0% /run/shm
root@rescue:~#


root@rescue:~# cat /proc/partitions
major minor #blocks name


8 0 1953514584 sda
8 1 1004 sda1
8 2 20478976 sda2
8 3 1047552 sda3
8 4 1931981824 sda4
253 0 1931976704 dm-0
root@rescue:~#


I have no clue how to fix this in the proper way so I would not loos any data.

My server is in rescue mode and I am asking you ProxMox experts, please assist me. Please guide me to the right directions, show me how
to change the root password while my server is in Rescue Mode.
OVH does not work on the weekends and gb-servers well some of you know how they are. Well every minute counts.

I appreciate all the help I can get from you.

Regards

Bragi from Iceland.
 
Last edited by a moderator:
try

Code:
mount /dev/sda1 /mnt
mount /dev/mapper/pve-data /mnt/vz

then

Code:
chroot /mnt
passwd root

enter the new password

best regards
 
Hi.

Thanks for the reply.

I did try this as you suggested.

try

This did not work
Code:
mount /dev/sda1 /mnt

This did not work BUT.
Code:
mount /dev/mapper/pve-data /mnt/vz

This did work if I removed /vz
Code:
mount /dev/mapper/pve-data /mnt/vz

And I did this, but I got this error

chroot: failed to run command `/bin/bash': No such file or directory
Code:
chroot /mnt
passwd root

enter the new password

best regards

Any other suggestions?
 
Last edited by a moderator:
This is what I have done so far.

root@rescue:~# mount /dev/sda1 /mntNTFS signature is missing.
Failed to mount '/dev/sda1': Invalid argument
The device '/dev/sda1' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
root@rescue:~# mount /dev/mapper/pve-data /mnt/vz
mount: mount point /mnt/vz does not exist
root@rescue:~# mount /dev/mapper/pve-data /mnt
root@rescue:~# chroot /mnt
chroot: failed to run command `/bin/bash': No such file or directory
root@rescue:~# mount /dev/mapper/pve-data /mnt/pve
mount: mount point /mnt/pve does not exist
root@rescue:~# chroot /dev/sda
sda sda1 sda2 sda3 sda4
root@rescue:~# chroot /dev/sda1
chroot: cannot change root directory to /dev/sda1: Not a directory
root@rescue:~# chroot /dev/sda
chroot: cannot change root directory to /dev/sda: Not a directory
root@rescue:~# chroot /dev/sda2
chroot: cannot change root directory to /dev/sda2: Not a directory
root@rescue:~# chroot /mnt
chroot: failed to run command `/bin/bash': No such file or directory
root@rescue:~#
 
I don't know if this helps or not.

root@rescue:~# cat /proc/mdstatPersonalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty]
unused devices: <none>
root@rescue:~# blkid
/dev/sda2: LABEL="/" UUID="c46e5911-ada2-4dd1-998b-aeb92c11ae6b" TYPE="ext3"
/dev/sda3: UUID="ab12025b-e9eb-419a-8118-ca79a595f392" TYPE="swap"
/dev/sda4: UUID="sFs827-NiMY-PzpQ-5CjU-oP3S-Fteh-ropF5l" TYPE="LVM2_member"
/dev/mapper/pve-data: LABEL="/var/lib/vz" UUID="8841bf3b-4350-4392-a61a-9d168c3ccf2d" TYPE="ext3"
root@rescue:~#
 
Code:
root@rescue:~# mount /dev/sda1 /mnt
NTFS signature is missing.
Failed to mount '/dev/sda1': Invalid argument
The device '/dev/sda1' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
root@rescue:~#

Are you using NTFS or the drive installed Windows NTFS before?
 
As most of my time when I working on my servers I always ask the big man "Google" and I ran in to this,

http://forum.proxmox.com/threads/10280-Root-password-reset-Proxmox-VE-1-9

Should I try this?

When I run this command lvdisplay I see this.

root@rescue:~# lvdisplay --- Logical volume ---
LV Path /dev/pve/data
LV Name data
VG Name pve
LV UUID ZFjELa-WkHB-p3jL-V13R-XVlL-fStY-ytmQqd
LV Write Access read/write
LV Creation host, time rescue.ovh.net, 2013-02-18 16:54:53 +0100
LV Status available
# open 1
LV Size 1.80 TiB
Current LE 471674
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0


root@rescue:~#

In the article he talks about root filesystem, which should look something like /dev/pve/root.


I am still doing a big research on the internet, as I want to crack this case before OVH gets back to work to morrow :)

Regards

Bragi
 
Thad my friend is A big question that I am unable to answer, as I am renting this dedi server from Gb-Servers.

There's no big support from theme over the weekend lol

Code:
root@rescue:~# mount /dev/sda1 /mnt
NTFS signature is missing.
Failed to mount '/dev/sda1': Invalid argument
The device '/dev/sda1' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
root@rescue:~#

Are you using NTFS or the drive installed Windows NTFS before?

Gb-Servers they got the server ready for me to use, the only thing that I had to do is create vps servers.

Regards

Bragi
 
Hi,
perhaps, but you don't have an standard-installation.

But your blkid shows, that this should work:
Code:
mount /dev/sda2 /mnt
ls -l /mnt/etc/passwd
If this work, you can do some bind-mounts, chroot and passwd - (or simply edit /mnt/etc/shadow).

Udo
 
I am so happy and grateful for this. Finally I have my server back online thanks to you Udo, and thanks to you all for the assistant.

Regards

Bragi