Link to home
Start Free TrialLog in
Avatar of ThorinO
ThorinOFlag for United States of America

asked on

Alert! /dev/mapper/hostname-root does not exit. Dropping to a shell! (Ubuntu, LVM) Won't boot

I have an Ubuntu x64 server that I came in to find not working. I recently did a V2V of it but it was working after the move then started doing this.

I pressed "c" from the Grub menu and did set and LS to get some information. I also did "e" to try a change but to no avail. Kinda know what is going on but not sure how to resolve.

 User generated image
 User generated image
Avatar of Duncan Roe
Duncan Roe
Flag of Australia image

Personally, I do not use Grub. But faced with this kind of problem, I would boot off a USB stick or CD, mount the regular root disk read/write, and chroot to it. Then I would at least mount /proc or maybe mount -a. Then I would get the boot loader (LILO in my case) to reinstall itself to the boot sector.
Try this:

grub> setup (hd0)
grup> quit
try and modify the kernel line to read the following for the root entry;
   root=/dev/mapper/mon-01-root
Avatar of ThorinO

ASKER

Duncan, would you be able to provide the commands to complete that?

farzanj: it says setup is an unknown command

jools: I changed it to "linux /vmlinuz-2.6.35-28-server root=/dev/mapper/<servername>-root" and removed the ro /quiet. It started to boot so I thought I was good to go but dropped to the shell again with the same error message.
Can you list the devices in /dev/mapper or just specify /dev/<volumegroup>/<root-logicalvolumename>

I've not seen <servername>-root used before but that doesnt mean it cant be setup that way.
btw, you can leave "ro quiet" in there if you like.
Avatar of ThorinO

ASKER

I'm not sure why it is setup the way it is, I let the Ubuntu installation configure LVM. I don't even know why it broke yet either =\
Avatar of ThorinO

ASKER

The LVM name looks correct other than it added additional hypens in there for some reason.

So for exmple my system is called company-mon-01 and it changed it to company--mon--01 and when I change it to a single - it still does not work.
Boot off bootable USB stick or install CD. Get a command prompt: if using the install CD and it goes straight to a GUI you may have to try Ctr-Alt-F2 (function key 2) or other function keys in range 1 - 6.
When you get a command prompt, mount your normal root disk. To do this you may need to modprobe the relevant file system E.g.
mkdir /tmproot
mount /dev/whatever /tmproot

Post back when you can get that far
Alsobe careful of the difference between underscore and minus when renaming
Avatar of ThorinO

ASKER

I downloaded and booted into an Ubuntu LiveCD and have a terminal open. I'm not sure what to do with the modprobe command you suggested.
I guess were still dealing with the /dev/mapper/<whatever> doesnt exist?

Does the file exist? It should be the LV for root on your system.

Unfortunately if you cant find out you will need to use the ubuntu live cd to have a look, does the live cd find the volume groups and enable them?

If it does you can mount the filesystem locally under the live cd and have a look, if it doesnt you may need to scan for the volumes and activate the volume group.
eg/
   # vgscan
   # vgchange -a y <volumegroupname>


You may not have to do a modprobe. You should be able to cat /proc/partitions to see what's available. Maybe the LiveCD has already mounted your disks - try mount to show what is mounted. cat /proc/filesystems to see what file systems are supported by the currently loaded modules.
If your disks have been mounted read-only, it may be prudent to run fsck -n on them before making the writable (by mount -oremount,rw disk_name)
Avatar of ThorinO

ASKER

vgscan did not show anything

cat /proc/partitions has a loop0 listed

Starting to get worried my data is gone :(

Avatar of ThorinO

ASKER

No other drives are mounted either.
vgscan should have picked up some LVM's if they were there, can you post fdisk -l.

Also, whats a v2v and what happened after the v2v and before it just stopped working? Any updates? Hardware changes?
You can also try
 lvmdiskscan

For seeing all the block devices on the system issue this command

lshal | grep 'block.device'
Avatar of ThorinO

ASKER

lvmdiskscan found ram0-15 and loop0

There are 3 block devices found

/dev/fd0 and /dev/sr0

I did a VMware conversion (virtual to virtual) and all was well and then for some reason poof it was broken. Of course I had a backup of the system until the other day when I deleted them...
what about fdisk -l?

What disks are configured in the VM?

Looks pretty bad to me. Sorry I have no further advice.
Avatar of ThorinO

ASKER

fdisk -l shows nothing. The VM only has 1 VMDK on it. I am thinking that maybe I attach the VMDK to another VM (Linux or Windows) and see if I can mount and read it
ASKER CERTIFIED SOLUTION
Avatar of Julian Parker
Julian Parker
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ThorinO

ASKER

My solution was the resolution but help was provided.