LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-10-2015, 12:12 PM   #1
vmnrao
LQ Newbie
 
Registered: Aug 2004
Posts: 20

Rep: Reputation: 0
Problems after cloning VM to physical HD


I just cloned a Centos7 "everything install" VM to a physical disk using VMWare Workstation and Clonezilla using the instructions here: https://www.howtoforge.com/convertin...cal-machine-p2

Now, when the clone (physical disk) boots up, it drops into the command line with this:

Quote:
dracut-initqueue[417]: Warning: Could not boot.
dracut-initqueue[417]: Warning: /dev/disk/by-uuid/4b8b5627-9027-46f7-b722-61d3ddd28e74 does not exist Starting dracut emergency shell...
What I've tried:
1. I checked /etc/fstab and the proper UUIDs are there, including the one above.
2. Tried booting via USB stick installer into rescue mode, chroot /mnt/sysimage , and:

Quote:
mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-oh_crud.img
and then
Quote:
dracut /boot/initramfs-$(uname -r).img $(uname -r)
...but I get this:

Quote:
cat: write error: Broken pipe
When I enter "blkid", I see the HD in question showing up as both /dev/block... and /dev/sdb... I tried "lshw -class disk" but it says "command not found". Finally, the rescue shell says it is mounting my disk in /mnt/sysimage and all my files are where they should be, so it appears it is seeing and mounting the HD.

Any suggestions? I am a n00b, so going off a lot of google and not a lot of understanding here.

Last edited by vmnrao; 02-10-2015 at 01:36 PM.
 
Old 02-10-2015, 02:50 PM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
The problem is in the fstab file in the initrd (yeah, stupid to be there).

I had the same problem - but fixed it by using the rescue boot and adding the real root.

Once the system was up I could make any fixes needed to the fstab in the real root, then rebuild the initrd for boot. Personally, I prefer the complete system rather than what Fedora thinks of as a "custom" build. The complete initrd is larger, but it is also portable to any system with the standard drivers, which the custom initrd is not.

I used "dracut -N" which will overwrite the default initrd. In my slightly more cautious momements i added a special version name for testing. Then check that the grub configuration file contains the proper references... (I'm still using grub legacy simply because it is simpler... and happens to date back to Fedora 14)
 
1 members found this post helpful.
Old 02-10-2015, 03:47 PM   #3
vmnrao
LQ Newbie
 
Registered: Aug 2004
Posts: 20

Original Poster
Rep: Reputation: 0
jpollard- I'm afraid your post in just beyond my comprehension level (again, I'm somewhat of a n00b).

My interpretation of your recommendation is to:
- Modify fstab in the initrd
- dracut -N /boot/initramfs-$(uname -r).img $(uname -r)
- Check /etc/grub.conf

Some questions:
1. How do I find the path to the fstab in the initrd?
2. What do I do to the fstab in the initrd? Just make sure the correct UUIDs are present?
3. You say you "fixed it by using the rescue boot and adding the real root". What does this mean?
4. What am I checking in grub.conf?

Thanks for your help!

Last edited by vmnrao; 02-10-2015 at 03:48 PM.
 
Old 02-11-2015, 01:32 AM   #4
vmnrao
LQ Newbie
 
Registered: Aug 2004
Posts: 20

Original Poster
Rep: Reputation: 0
Update:
> sudo dracut -N /boot/initramfs-$(uname -r).img $(uname -r)
cat: write error: Broken pipe
 
Old 02-11-2015, 05:38 AM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by vmnrao View Post
jpollard- I'm afraid your post in just beyond my comprehension level (again, I'm somewhat of a n00b).

My interpretation of your recommendation is to:
- Modify fstab in the initrd
not in the initrd - using the following should replace the initrd.
Quote:
- dracut -N /boot/initramfs-$(uname -r).img $(uname -r)
- Check /etc/grub.conf

Some questions:
1. How do I find the path to the fstab in the initrd?
Some background on how the system actually boots:

1. the kernel and the initrd file are copied into memory.
2. when the kernel starts executing it transfers the initrd to a ramdisk in memory, and uses it as root
3. The real root is mounted on /mnt (as defined by the ramdisk) - then uses a kernel call to switch mountpoints - the ramdisk mount is exchanged for the real root
4. the /mnt mount (now the ramdisk) is dismounted, releasing the memory allocated
5. and the system continues the boot.
Quote:
2. What do I do to the fstab in the initrd? Just make sure the correct UUIDs are present?
Dracut is supposed to copy the relevant mounts (usually the swap, but even the root could be copied)
during the creation of the initrd.
Quote:
3. You say you "fixed it by using the rescue boot and adding the real root". What does this mean?
The rescue boot has an initrd that contains a more generic set of drivers, and a generic fstab that is focused on system initialization. Using this with the "root=" option usually works to recover a system into an operational state.
Quote:
4. What am I checking in grub.conf?
Since you are using 6.5, the /boot/grub/grub.conf contains an entry for each available kernel+initrd that can be used for booting the system. All you are doing is verifying that the new entry (if you did create a new entry) is present. If you replaced an initrd, then there is really nothing to do. (oops sorry, Centos 7, but the new entry should be in the configuration files in /etc/grub2.cfg)
Quote:

Thanks for your help!
No problem. I just moved a VM image of fedora 21 that I had checked out - and had the graphics quit. It turns out that during installation, dracut created a "host only" initrd, so the resulting boot on real hardware didn't work (the video driver wasn't included). I used the recovery boot (though I did have to manually enter it, as the newer systems use grub2) which did work, and specified the root= option to run the system on new hardware.

Since I prefer migratable boots (including the possibility of replacing video cards...) I used the -N option (same as --nohost-only) to build an initrd with all the drivers.

Last edited by jpollard; 02-11-2015 at 05:54 AM.
 
1 members found this post helpful.
Old 02-11-2015, 05:42 AM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by vmnrao View Post
Update:
> sudo dracut -N /boot/initramfs-$(uname -r).img $(uname -r)
cat: write error: Broken pipe
I think you tickled a bug in dracut for 6.5 - it is supposed to be fixed in an update to 6.5 so you might try doing an update first.
 
Old 02-11-2015, 05:46 AM   #7
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by vmnrao View Post
Update:
> sudo dracut -N /boot/initramfs-$(uname -r).img $(uname -r)
cat: write error: Broken pipe
I think you tickled a bug in dracut for 6.5 - it is supposed to be fixed in an update to 6.5 so you might try doing an update first. (I also see it reported for CentOS 7, so it may exist for both).

http://bugs.centos.org/view.php?id=7443

sorry for the double post.
 
Old 02-11-2015, 12:15 PM   #8
vmnrao
LQ Newbie
 
Registered: Aug 2004
Posts: 20

Original Poster
Rep: Reputation: 0
jpollard- thank you for the detailed response- it definitely gives me a better understanding of the boot process. Greatly appreciated!

I do have a few more questions:

1.
Quote:
The rescue boot has an initrd that contains a more generic set of drivers, and a generic fstab that is focused on system initialization. Using this with the "root=" option usually works to recover a system into an operational state.
I'm not familiar with the "root=" option. Are you suggesting that I modify /etc/fstab on the rescue USB by adding the line:
"root=/dev/sdb1"
(this is the boot partition of my physical HD)?

2.
Quote:
...the /etc/grub2.conf contains an entry for each available kernel+initrd that can be used for booting the system. All you are doing is verifying that the new entry (if you did create a new entry) is present.
Are you referring to a new grub entry on the USB rescue, or on the physical HD in question? How is this new entry created, and what exactly should it contain (if I have to type it in manually)?

3.
Quote:
I think you tickled a bug in dracut for 6.5 - it is supposed to be fixed in an update to 6.5 so you might try doing an update first. (I also see it reported for CentOS 7, so it may exist for both).
How do I update dracut on my USB rescue device?

Sorry for the n00b questions, just need to clarify some things before I get started.
 
Old 02-11-2015, 12:18 PM   #9
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
The way I would try is to select the rescue entry and edit the boot line by adding "root=UUID=<uid of root disk>" or "root=LABEL=<name>".

Once the system is booted you should be able to use "yum update".

Alternatively, once the rescue system is booted, you can then mount the real root on /mnt, then use "chroot /mnt" as root.

The network should be up and usable at that point, and you ought to be able to use "yum update".

Last edited by jpollard; 02-11-2015 at 12:20 PM.
 
Old 02-11-2015, 02:03 PM   #10
vmnrao
LQ Newbie
 
Registered: Aug 2004
Posts: 20

Original Poster
Rep: Reputation: 0
jpollard-
Quote:
select the rescue entry and edit the boot line by adding "root=UUID=<uid of root disk>" or "root=LABEL=<name>".
Is this on the USB rescue drive or my physical HD? Am I editing my grub2.cfg or my fstab?
I tried adding this to the fstab on my rescue USB, but it doesn't appear to do anything, and this modification is deleted upon reboot.

Quote:
Once the system is booted you should be able to use "yum update".
So the system will be booting from the USB rescue initially, and then I when select "rescue a Centos install", it will boot from my HD because of the modifications above?

Quote:
Alternatively, once the rescue system is booted, you can then mount the real root on /mnt, then use "chroot /mnt" as root.
I can do this, but dracut is not working.

Quote:
The network should be up and usable at that point, and you ought to be able to use "yum update".
After I've booted in rescue mode and chroot /mnt , the network is not useable.

Sorry for all the confusion.

Last edited by vmnrao; 02-11-2015 at 02:48 PM.
 
Old 02-11-2015, 02:38 PM   #11
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
I was expecting the rescue mode to have the net - if not, you have to initialize it so that you can download the update. It is possible I'm overlooking something.
 
Old 02-11-2015, 02:49 PM   #12
vmnrao
LQ Newbie
 
Registered: Aug 2004
Posts: 20

Original Poster
Rep: Reputation: 0
jpollard- gotchya. Would you mind clarifying the following...

Quote:
select the rescue entry and edit the boot line by adding "root=UUID=<uid of root disk>" or "root=LABEL=<name>".
Is this on the USB rescue drive or my physical HD? Am I editing my grub2.cfg or my fstab?
I tried adding this to the fstab on my rescue USB, but it doesn't appear to do anything, and this modification is deleted upon reboot.

Quote:
Once the system is booted you should be able to use "yum update".
So the system will be booting from the USB rescue initially, and then I when select "rescue a Centos install", it will boot from my HD because of the modifications above?
 
Old 02-11-2015, 03:44 PM   #13
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by vmnrao View Post
jpollard- gotchya. Would you mind clarifying the following...


Is this on the USB rescue drive or my physical HD? Am I editing my grub2.cfg or my fstab?
I tried adding this to the fstab on my rescue USB, but it doesn't appear to do anything, and this modification is deleted upon reboot.
This would be when grub presents a selection menu at boot time. There is no need to change any of the menu entries permanently.
Quote:


So the system will be booting from the USB rescue initially, and then I when select "rescue a Centos install", it will boot from my HD because of the modifications above?
The kernel and initrd will come from the USB - but once they are loaded it is being directed to use the root specified by "root=..." to finish the boot. By default what the rescue boot uses would be the root specified for the USB based root. But this is being overridden by what is actually on the boot command line (which you edited at the menu prompt - I think it still uses "e" to invoke a simple editor for that purpose). This is to modify the kernel parameters for this one boot only. No changes are saved.

The complete grub2 boot manual:
http://www.gnu.org/software/grub/manual/grub.html

Check the section "12.3 Editing a menu entry" for doing so when grub2 is started.

Last edited by jpollard; 02-11-2015 at 03:52 PM.
 
1 members found this post helpful.
Old 02-11-2015, 11:58 PM   #14
vmnrao
LQ Newbie
 
Registered: Aug 2004
Posts: 20

Original Poster
Rep: Reputation: 0
jpollard- I must be missing something very basic here. When I boot from the USB, my options are:

- Install Centos7
- Troubleshooting:
- Rescue a Centos7 Install
- Boot from local disk

I do not see the grub menu anywhere in the installer/rescue USB boot process, nor when I select "Rescue a Centos Install" or "Boot from local disk".

I do get the grub menu when I boot from my physical HD (the one that's the source of all my problems), so I will try your advice from there. Please advise on what I'm missing here, though.

Last edited by vmnrao; 02-12-2015 at 12:14 AM.
 
Old 02-12-2015, 06:39 AM   #15
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
When you select "Rescue a Centos7 Install" you can then use the built in grub editor (I believe it is invoked with an escape character) to modify kernel parameters, and direct it to use your real root rather than the rescue root on the USB drive.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems Cloning Linux System Disk Bob Fletcher Linux - General 4 05-23-2013 04:36 AM
Cloning a virtualbox machine to physical machine with clonezilla eboy98 Linux - General 6 01-14-2013 08:32 AM
interface problems after cloning helmsman Linux - Hardware 4 03-26-2007 07:08 AM
cloning problems: systemimager ?? dereko Linux - Software 2 06-29-2006 07:23 AM
Problems after cloning with Acronis swampthing Linux - Hardware 0 08-17-2004 07:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration