Unable to start up Linux VM because it's looking for a data disk, which I don't need.

Christian Palacios
Christian Palacios used Ask the Experts™
on
Hi there,

I copied the OS drive from the Azure environment as I want to work on a copy of the VM locally instead of in the cloud.  When I turn on the VM, it fails because it is trying to attach a data disk that I didn't download.  The data disk is 1TB so I don't want to download it just to attach it and not use it.  How can I fix this copied VM so that it only tries to boot and not look for this second drive?  I believe I can remove it by putting int he root password so that I can do some maintenance, but with Azure VMs, the root password isn't set and I don't want to change it just in case something happens on the live VM.   Is there another way around it?

I'm getting these errors:

fsck.ext4: Unable to resolve 'UUID=451a8a0d-0c99-4b34-8702-361627fda1a2a' [FAILED]
*** An error occurred during the file system check.  
Give root password for maintenance (or type Control-D to continue):

Thanks!!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
MichelangeloSystem Administrator / Postmaster

Commented:
Out of curiosity, did you try the “CTRL+D” option?Also, USUALLY you can set the root pwd before booting into the OS. Did not understand why you do not want to set it
Christian PalaciosSenior IT Systems Administrator

Author

Commented:
I pressed "CTRL+D" and then is just rebooted and had the same issue.  I don't know if I can set the root password on a VM that is hosted in Azure.  Typically you create a user that is part of the sudo group and that's the user you use when working on an Azure Linux VM.  From there, you can switch to root with sudo su -, but there is never a point where I set the password for root.
MichelangeloSystem Administrator / Postmaster

Commented:
I understand you downloaded the vm so it is a copy of the original one - or you just somehow migrated it on a on prem hypervisor? In the former case you should be able to operate on it without caring about the original vm on azure.
In the latter case, you should still be able to create a root password (yes it can be done, it’s unix. It’s just not set) without consequences.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Christian PalaciosSenior IT Systems Administrator

Author

Commented:
Thank you.  How can I set the root password on my local copy?  I can't even log into it to set it.
nociSoftware Engineer
Distinguished Expert 2018

Commented:
If during boot you can access the kernel command line (from grub or lilo or whatever boot manager...

add init=/bin/bash to the command line, then the pid 1 process will be bash in place of init (systemv) or systemd mast daemon.
... from there you can either remove the  offending entry from fstab  or you can set a root password ...
(you may need to remount the root filesystem rw before you can update /etc/fstab)

use sync; sync; sync if all updates are done to ensure writing them out to disk.
You may need to remount the root filesystem ro again if continuing.
if you then want to continue normal booting type exec /sbin/init  as a command or reboot the hardware  some other way.
(note shutdown / reboot etc. don't work as the original init is not working... halt may work but just halt the system, requiring a powercycle anyway.
MichelangeloSystem Administrator / Postmaster

Commented:
Exactly.
Also have a look here for a complete walkthrough :
https://askubuntu.com/questions/24006/how-do-i-reset-a-lost-administrative-password
Philip ElderTechnical Architect - HA/Compute/Storage

Commented:
The download was the VM and its configuration files?

A VHD?

Set up a new VM in Hyper-V and attach the existing VHD. Boot.
Distinguished Expert 2017

Commented:
noci already pointed to the item as well. not sure whether you can edit it at the boot  (have not tried that so not sure of the effectiveness)

the point is that you have a record in /etc/fstab reference to this drive and is set to be mounted on boot.
remove/comment out the entry in /etc/fstab that reference this mount point and it should stop complaining.

This is based on the error and that you have a device that it was mounting but you do not need it anymore, what was done in between to make sure the system is configured not to need this "drive" any more.

Was the disk already deleted from the VM configuration environment?
David FavorFractional CTO
Distinguished Expert 2018

Commented:
Haven't worked with your specific setup + normally the way this is done...

1) Go through the root password reset, to make sure you have a working password.

2) Boot into single user mode (runlevel == 1).

This bypasses all setup steps, like disks.

3) When your shell starts, mount the device which contains your /etc, so something like...

mount /dev/sda /mnt

What your device name might be, just look through /dev for sdX or mdX (RAID) devices + mount them one at a time.

3) Check for /mnt/etc/fstab + when it appears, edit + remove the offending disk reference.

4) Hit CNTL-D to end the single user shell + continue multi user boot (default runlevel you have set).
Ravi Kumar AtreyCloud Specialist- Azure

Commented:
Just follow the below steps:

at the grub prompt, hit a to append options
add init=/bin/bash to the end of the kernel command line and press enter
The system will boot to a prompt enter the following commands at the prompt

mount -o remount,rw /
vim /etc/fstab

edit the fstab file commenting the secondary mounts by adding a # at the begining of each problematic line, save the file

reboot by pressing CTRL+ALT+DEL
Christian PalaciosSenior IT Systems Administrator

Author

Commented:
Thanks noci.  I can see the Grub menu and then I highlighted the first option and typed 'e' to edit it.  From there I see entries like
"root (0,0)"
"kernel ..."

I put the init=/bin/bash text at the end of the first option "root (0,0)", is that where it should go?  I assumed it was the first option that I needed to edit.  When I did that I'm stuck at a windows that says "Probing EDD (edd=off to disable)....ok".

Thanks,
-Christian
Christian PalaciosSenior IT Systems Administrator

Author

Commented:
Oops, sorry Ravi, I missed your reply.  I just tried your suggestion but I go the EDD message.  I put edd=off at the end of the edited line, but now the screen is black and I can only see the cursor flashing.  Any suggestions?
Distinguished Expert 2017

Commented:
Ii am unfamiliar with the Noci grub.conf path,

Letting the system go through the boot process, enter root password at the maintenance prompt.
Then follow through on looking at /etc/fstab to comment out (put # as the first character on the line that referenced the UUID or the "drive" you no longer need)
Exit out the maintenance window at which point the system will resume to boot.

Was the virtual drive (file ) deleted on the host?. As that is the only way I can think of it going missing.
nociSoftware Engineer
Distinguished Expert 2018

Commented:
you need to add the init=... to the end of the "kernel line".
So the line  kernel....  is the right one..., the other one is identifying the boot partition root(0,0)
Christian PalaciosSenior IT Systems Administrator

Author

Commented:
Ok, I added the init=/bin/bash to the end of the "kernel" line.  I then pressed enter and then 'b' so it would boot from there.  I'm still getting the "Probing EDD" message and it just stays there.  Did I make a mistake somewhere?
Distinguished Expert 2017

Commented:
Could you try the normal boot process, and type in the root password at the maintenance prompt, instead of hitting ctrl-D.
.....

or hit edit, and at the end of the line add single (for single user mode)
nociSoftware Engineer
Distinguished Expert 2018

Commented:
Are you sure the disk you didn't copy wan't the one with the root file system?...
Please verify this on the running system.. (and can you show here)

df

Would show mounted filesystems & sizes.
You may obfusciate entries if they show identifiabla info..
And be sure continer it is NOT in the VMWARE profile that fails to boot.
Senior IT Systems Administrator
Commented:
We ended up just getting help from Microsoft to do it on the live VM instead of trying to this test change on a local VM.  Please go ahead and close this request.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial