GRUB2 install from a chroot environment and a loop device

I created a 10 GB raw .img, formatted it as EXT4 and "rsync'd" my system inside. The plan is to reinstall GRUB2 to its MBR and convert it to .vdi (VirtualBox). I know how to do all that, it's not as difficult as it sounds.
sudo modprobe loop
sudo losetup /dev/loop5 /media/Backup/backup.img
sudo mount -o offset=$((2048 * 512)) /dev/loop5 /mnt
cd /mnt
for i in /proc /sys /dev; do sudo mount -B $i .$i; done
sudo chroot .
sudo grub-install /dev/loop5
sudo grub-mkconfig -o /boot/grub/grub.cfg
(Interesting way to chroot, right?)
...except after converting the .img to .vdi (VBoxManage convertfromraw --format VDI /path/to/backup.img /path/to/backup.vdi), I'm getting:
GRUB loading.
Welcome to GRUB!
error: no such device: 557e19c8-e89b-4661-a1dc-2a3ce3b2064e
Entering rescue mode...
grub rescue> _
However, reinstalling it by hooking up a LiveCD to the VM works:
mount /dev/sda1 /mnt
cd /mnt
for i in /proc /sys /dev; do mount -B $i .$i; done
chroot .
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
It seems to like /dev/sda more than /dev/loop5.
Why is that?
I should mention that the VM's UUID for /dev/sda is the same as /dev/loop5 on the computer.
Last edited by DSpider (2012-07-08 16:14:06)

*bump* I know this thread is older then old, but I have exactly the same problem. It seems that there used to be a workaround (http://superuser.com/questions/130955/h … n-img-file) which has no effect anymore.
The reason I need to do it with loop is, that I'm writing a script for automated virtual-disk creation. So booting a live system is not an option.
Help anybody?

Similar Messages

  • [Solved!]Arch grub2 install from cd

    Hi, I'm somewhat new to Arch, but not new to Linux. I'm very new though to UEFI and I just did a Windows 7 install on my new desktop with 8gbs of ram. before I installed Windows I tried Arch on it and got it to work without a gui, but that's beside the point. In order to Install windows I had to overwrite my Arch install, because Windows 7 refused to write to the hard drive.
    My issue is that I have a comp that has BIOS and UEFI, but I can't use both so I've been trying to install grub2 using these instructions Arch Linux Grub2 but for some reason after I chroot into the system and start using pacman it gives the no address record error after the first refresh. So I tried different repos and they didn't work. I also tried the same repo and it won't refresh. I've looked all over for a solution, but I haven't found one. I've went over my pacman.conf and mirrorlist files and the only thing that I changed on them is uncommenting 1 repo in the mirrorlist. I can ping google and the repos too so it's not my network. I need grub2 in order to dual-boot Arch and Windows 7 with UEFI as I understand it. Any ideas?
    Edit: I just tried it a few days later and it worked. I'm guessing my ISP or the mirrors were affecting it somehow.
    Last edited by Jonnothin (2011-10-20 21:18:07)

    Okay. I'm using dhcp, but could the connection be intermittent given the current info? Because near the beginning of my trying to do this it started to download and one time I even got pacman updated, but stopped working soon afterward.
    Last edited by Jonnothin (2011-10-18 21:00:02)

  • Clean install from DVD failing again and again.

    I tried clean installing Lion:
    I partitioned my hard disk and burned a DVD with the installer.
    When booting from that DVD, it just tells me that setup failed and I should try installing again.
    At that point, the only option is to reboot from DVD again, ending up with the same error, or using the tools delivered on the tool except for installing.
    I tried installing while being booted on the DVD via Terminal by starting /Install Mac OS X Lion.app. This fails after rebooting again as well.

    question , where did you get DVD from ??? i burn it my self via tutorial
    http://lifehacker.com/5823096/how-to-burn-your-own-lion-install-dvd-or-flash-dri ve
    worked for me ....

  • I had to get a new apple ID for my Iphone and delte the old account,but now i can not update the apps I had installed from my old Iphone and could I transfer the music albums I bought to this new apple account as well ?

    could you please get back to me as soon as possible , there is an update I have been anticipating for a about two months now and it  is coming very soon.

    This is a user to user forum; there is no one from Apple here to get back to you. Apps and music are forever associated with the Apple ID  account they were purchased with. There is no way to transfer them to a different account. That is why Apple lets you change the email address associated with your account without having to get a new account. If you didn't do this, but instead got a completely new account, you are out of luck. You can still go back to the old account and just get a new email address for it.

  • Best install from scratch of FDS and CF?

    We have a new server on which we will install CF 7.0.2
    enterprise and FDS 2. We normally install CF in the server
    configuration (no JRun). FDS being a J2EE app we will have to
    install JRun. What is the best install method to take the most
    advantage of FDS and CF? Should we do CF with JRun or CF server
    configuration and FDS with JRun? What about order of
    install?

    There are a few options that work. Really the only trick is
    that both servers need to be running on the same network sub-net.
    They know how to find each other.
    Personally I like to install the CF multi-server w/Jrun
    option (the 2nd radio button in the installer). Then I can create
    different instances for each project. once I have CF installed this
    way I just deploy the flex war into the same instance so they are
    running in the same server side-by-side.
    When I do this the folder structure looks something like this
    \jrun4\server\cfusion\
    \cfusion-ear\
    \flex\
    hth,
    ---nimer

  • I'm trying to update from version 4.1 and it shows device not elligibleAsk your question.

    I try to update from version 4.1, but it shows in ITunes device not elligible. I have the latest version of ITunes, but it seems the phone is a problem. None of the aplications work properly, Facebook and Safari cut off....

    If you have an iPad 1, the max iOS is 5.1.1. For newer iPads, the current iOS is 6.1. The Settings>General>Software Update only appears if you have iOS 5.0 or higher currently installed.
    iOS 5: Updating your device to iOS 5 or Later
    http://support.apple.com/kb/HT4972
    How to install iOS 6
    http://www.macworld.com/article/2010061/hands-on-with-ios-6-installation.html
    iOS: How to update your iPhone, iPad, or iPod touch
    http://support.apple.com/kb/HT4623
    If you are currently running an iOS lower than 5.0, connect the iPad to the computer, open iTunes. Then select the iPad under the Devices heading on the left, click on the Summary tab and then click on Check for Update.
    Tip - If connected to your computer, you may need to disable your firewall and anitvirus software temporarily.  Then download and install the iOS update. Be sure and backup your iPad before the iOS update. After you update an iPad (except iPad 1) to iOS 6.x, the next update can be installed via wifi (i.e., not connected to your computer).
     Cheers, Tom

  • Late 2011 MacBook Pro Audio Crackling from 3.5mm Output and USB Audio Devices.

    Howdy. I don't know what's wrong with my laptop. Recently any headphone I have used with the 3.5mm output has been crackleing. I assumed the jack it's self was broke but when I set up my Audioenndine D1 amp it is still crackling from videos on YouTube, Netflix, iTunes. etc... It even crackles when there is nothing playing. If anyone has any idea what is going on I would apreaciate it.

    You can try a NVRAM/PRAM reset:
    Disconnect all peripherals, power off, power back on holding the following keys  COMMAND OPTION P R
    continue holding till you hear the start chime 2 times then release, reboot.
    If it is still crackling it may be a hardware issue, you can bring it in to a Genius bar and they will disgnose it for free, and give you options.

  • Need help getting songs from iTunes to iCloud and to ios devices.

    I just added some CDs onto my iTunes account on my MacBook and they won't transfer to my iPhone or iPad.  The titles of the songs show up on my IOS devices within the Music app but they are grayed out and won't play. I'm using iCloud and Music Match. Hopefully something simple.  Thanks in advance for your help!

    UPDATE - 20 minutes at the Genius Bar and it was resolved.  The tech that helped me out had never seen anything like it before but he and another tech starting looking up stuff on one of the iPads that they have which provides them with solutions to all kinds of problems.  He tried a few things on my Mac and then kept switching pages on his iPad for solutions.  I'm guessing it said "try this and if that doesn't work then go to the next step".  Eventually he got it to work so obviously there is a "fix" out there for issues related to iMatch, iCloud, and the Moutain Lion update. 
    I asked him what all he did to fix it but he said it was too complicated to explain even though it was very simple.  Oh well, rest assured that it can be corrected and hopefully someone will be able to post the fix on here so as to save people trips to an Apple Store.  One last thing, nothing had to be removed or reloaded in my iTunes account.  I hope this helps you out some.

  • How do I install all my old programs and data from an old system folder after I have reinstalled the same OSX system after a crash?

    The system is OSX10.5.8 Leopard on a 2009 imac. A new system was installed from the installation disks and the original system saved to a folder.
    I need to use my Adobe programs, rescue my email, i-tunes and iphoto data.  The disk utility indicates that my Time Machine back-up disk is damaged and I don't want to take a risk of having Time Machine erase my hard drive and try to reinstall the exact system existing at the time of the crash.  There was over 650 gb of stored files that I was copying and removing from the drive at the time it crashed. The total size of the original system file is still about 650 Gb.
    I would prefer to go back in Time Machine and only rescue the programs as most of the files have been copied to external hard drives, but I can't access the back-up hard drive from the new version of the Time Machine.  Or by I don't want the Time Mchine to start copying the new operating system which would include all the data in the old system file. Time Machine was working fine at the time of the crash.

    No, the disk was backed up with time machine a few hours prior to the crash.  I was unable to open the computer when I tried to restart it- got a grey screen with the spinning disk- after a few minutes the screen would go black and would reboot continuously, but not load any images or programs. I started the computer from the 10.5.4 installation disks and checked both the time machine external hard drive and the Imac internal drive with the disk utilities. Both showed as damaged --the internal drive and permissions were repaired, but the external drive (time machine back-up)  was damaged and not repairable by disk utilities. I don't believe that the external drive for Time Machine was connected to the computer at the time of the crash as I was copying files to a different hard drive drive. And I was not having any problems with the TM back-up drive prior to the crash.
    I accessed the Imac internal disk by firewire (as a target disk) and copied as many data files as I had room for on my external hard drives available.  And I deleted quite a few files from the imac internal drive (mostly just jpegs, duplicate tifs, etc--nothing that was used by i-photos, i-tunes or the Mail program).
    Then I installed a new OSX10.5.4 system from the installation disk and the old system was moved to a folder on the hard drive.  I previousy had had the option to reinstall the complete system from Time Machine when I connected that drive and booted with the installation disks with the C key depressed.  But it didn't seem like a good option because I was unsure of the condition of that external disk and whether it would be able to reinstall my data correctly, once it had erased my internal hard drive. 
    I'm considering buying some new external hard drives and backing up the present system to time Machine (so I'll still have my old data in the old system folder).  And then I would try using the old Time Machine back-up to try to reinstall the sytem previous to the crash.  That back-up would reinstall about 700gb of data and operating software and programs which sounds like a lengthy back-up.  Since I have never used Time Machine to do a full reinstallation (I've only used it for individual files), I'm reluctant to do anything rash.
    I'm a professional designer (with a deadline) but I can still use my Illustrator and Photoshop by opening them from the old system folder and saving the files to an external drive.  So it's not neccessary to do anything hasty except to delete some of the excess art and document files that were causing the computer to run slowly and the  Adobe programs to crash when I tried to save my work. I have quite a few books on tape in the i-tumes folder which is probably talking up tons of space but I don't where the i-tunes files live.
    Thanks for any help. Peggy
    Message was edited by: peggy toole

  • New install from ftp and cd no sound SOLVED

    Hi,
    I've done everything I can find to get sound on this new ftp install but can't get sound to work with the 2.6.23 kernel.
    I've updated a couple of other systems to the new kernel and it has kept sounds working fine but not this new install. I've unmuted everthing and raised levels etc.
    modprobe .conf has this from running alsaconf
    # --- BEGIN: Generated by ALSACONF, do not edit. ---
    # --- ALSACONF version 1.0.15 ---
    alias snd-card-0 snd-intel8x0
    alias sound-slot-0 snd-intel8x0
    # --- END: Generated by ALSACONF, do not edit. ---
    Please can you give me some tips. I've a feeling it's something silly I've not got quite checked off right in alsamixer.
    /etc/rc.d/alsa start is done and alsa is in my rc.conf daemons.
    Thanks
    Regards
    edit;
    I've done another install from cd this time and said no to update to kernel 2.6.23 so now I've got 2.6.22 and sound still does not work. I've done many Arch installs before and never had this problem. what could I have overlooked? xmms with streamtuner is receiving signal but no sound. No system sounds either.
    Last edited by drum (2007-10-23 12:25:08)

    Nope no errors from VLC or Rhythmbox.
    Though i noticed in the volume mixer, i now have 2 devices, which i don't think i had before...
    Usually i'd have my webcam or usb headset plugged in, but they're not atm, just my soundcard.

  • Safari 8 error: "...you need to install the Java Runtime Environment"

    Ever since upgrading to Yosemite and Safari 8, I continually get the error "To view this web content, you need to install the Java Runtime Environment" and, although I did do so the first time I got the error, and Java tells me I do have the latest version installed and running, I continue to get this error constantly.
    Is there a way to stop this, or at least find out what content is causing it? I can't put my finger on any particular content that causes the error.

    This procedure is a diagnostic test. It makes no changes to your data.
    Please triple-click anywhere in the line below on this page to select it:
    java -version
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window by pressing the key combination command-V. I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.
    If the Apple Java runtime is installed and up to date, you should get three lines of output below what you entered, the first of which is this:
    java version "1.6.0_65"
    Is that what you get? You can then quit Terminal.

  • [MOOT] UEFI USB Install (from 201306 image) - blank screen during boot

    I am trying to install Arch Linux on a Lenovo ThinkPad T431s. 
    I created a bootable UEFI USB disk image following the instructions on the wiki.
    https://wiki.archlinux.org/index.php/UE … B_from_ISO
    Attempting to boot from this image I get to a screen that looks like:
    Arch Linux archiso x86_64 UEFI USB
    UEFI Shell x86_64 v1
    UEFI Shell x86_64 v2
    After selecting the first option, I get a blank screen.
    This appears to be the same (or very similar) to the following issues:
    [1] https://bbs.archlinux.org/viewtopic.php?id=151599
    [2] https://bbs.archlinux.org/viewtopic.php?id=158530
    As suggested by
    https://wiki.archlinux.org/index.php/Beginners'_Guide#Preparation
    I tried appending a number of things to the initrd line
    nomodeset
    video=SVIDEO-1:d
    i915.modeset=0
    with no success (the blank screen was exactly the same).
    Some posts in thread [2] indicated that booting in legacy bios mode worked.  I created a new disk image (again following the wiki instructions: https://wiki.archlinux.org/index.php/US … ion_Media) and was able to confirm that I could successfully boot from this other image after switching into legacy mode.
    In thread [1], there was the suggestion to go into a UEFI shell and try a command like
    Shell > fs0:
    FS0:\ > cd \arch\boot\x86_64
    FS0:\arch\boot\x86_64\ > vmlinuz archisobasedir=arch archisolabel=ARCH_201306 initrd=\arch\boot\x86_64\archiso.img
    which I did.  After pressing enter nothing happened (the screen did not go blank, all the text remained, no messages appeared).
    Eventually in that same thread, a workaround was suggested in this post.  I have not tried this because I was unable to understand what exactly was being done, both because of the terse nature of the post and the fact that the referenced article is not in a language which I read (and google translate did not make it clear enough).  I was unable to evaluate whether that was a sensible thing to do.
    Now, finally, the questions
    Firstly, does anyone have any suggestions about how to solve or troubleshoot my blank screen issue?
    If not, does anyone have an opinion about which of the workarounds (switching into legacy mode or the one that I don't quite understand yet) would be better?  I am not planning to dual boot the system, so I do not need to use UEFI to be win8 friendly, etc.
    Last edited by wesphys (2013-06-07 14:36:28)

    Auric wrote:
    Neri, did you get any further with this? I just got my own Thinkpad Yoga and am facing the same problems. Everything works fine in legacy Boot but the screen stays black on UEFI boot regardless of the known workarounds.
    might it help to first install using legacy boot and later on convert to UEFI?
    Not really with Arch directly anyways. What you can do is:
    1. Use Fedora 20 USB to boot the sucker up
    2. Use Archlinux-bootstrap install (download expand etc)
    3. Use refind as the bootmanager seems to solve the dual boot issues
    ATM i'm fighting a mkinitcpio segfault. But that is after the installation was basically successful.  It would be nice if we can find a way to fix the install medium ...
    EDIT:
    All sorted out. Unfortunately you'll have to bypass the Archlinux Install medium and resort to the fedora 20 installer. I used the XFCE4
    version for a smaller download.
    Here are the basic steps for a Dual-Boot setup:
    In windows (Disk Management) truncate your C: Drive.  I ended up making basically what will became /dev/sda4 smaller and didn't not
    touch any partition or free space before that. Here's the final Layout:
    /dev/sda:
        empty space
    1. recovery partition
    2. ESP
    3. reserved
    4. windows
    5. Linux Root
    6. Linux home
    7. Swap
    The installation happened from within Fedora Live using an Archlinux Boot strap image according to the Wiki for installing from an
    existing Linux and the Wiki Installation Guide.  I mounted /dev/sda2 (aka. the existing ESP partition) as /boot and installed refind
    according to the wiki. Please note, when you install Arch through the archlinux bootstrap method make sure you  pacman -S archlinux-keyring
    in the bootstrap chroot first before you run the pacstrap command - it will accelerate the process tremendously!
    Last edited by neri (2014-01-02 21:40:31)

  • My iPod touch will access the app store, but it won't install from it.

    I was given a used iPod Touch, and I don't know any of its history. Eveything was working fine, and then one day I tried to install from the App store and it won't work at all. I can press the "install" button, but then the app store will just close without even setting up an icon on the home screen. If I try to install the same app again, there's no record that I had tried to install it previously. I use this for school, so this is really annoying.
    PS: I am a clueless Windows user, and have never owned and i-anything until now. =)

    Try resetting the iPod. Nothing will be lost
    Reset iPod touch:  Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.

  • HT202912 I get the message "To view this web content, you need to install the Java Runtime Environment" Do I need two versions as this article suggests?

    I just upgraded to Yosemite on my 2010 MacBook Pro.  When I reboot I get the message "To view this web content, you need to install the Java Runtime Environment" and I've also seen the same pop-up once while running OpenOffice.  And now while composing this post. 
    Yes - I followed the link and installed the Oracle version of Java, version 8, and the test page confirms that I have the current version running. 
    I read some threads on discussions.apple.com but didn't like the answers. 
    I found this:  http://www.macworld.co.uk/how-to/mac-software/advanced-tips-for-mac-os-x-yosemit e-3582877/
    and tip # 10 seems to answer my question.
    Anyone else have experience on this?

    Most likely, you have either the Facebook video calling plugin or the "NexDef" plugin for watching baseball streams. Both depend on the Java runtime distributed by Apple. If you no longer need the plugin, remove it. Otherwise, install Java.

  • Creative X-Fi recorder from "what you hear" and splitting tra

    Hi,
    I used to be able to record minutes of music or sound and be able to split this saved file with the splitting option of Smart Recorder. I now have installed a new sound card X-Fi and want to do the same but cannot find where I need to look. Does this new software for X-Fi offer that or not anymore?
    thanks,
    Luke

    I have the software from the CD installed, as I stated earlier, the "What You Hear" option is only missing if you do a CLEAN install of the drivers from the Windows Update. That is?to say if you install the drivers from Microsoft's website with no other X-Fi driver installed on your system.
    If you installed the update over a previous version of the drivers, then the "What You Hear" option remains available.
    I checked this three times by doing a clean install from the Windows Update and then installing the other driver from Creative?s website.
    All three times I deleted the X-Fi driver from my system, then installed the one directly from the Windows Update. I would check my record settings and could not find the "What You Hear" option. I would then install the driver from Creative?s website and checked the settings again and the ?What You Hear? option was available.
    If you just installed the Windows Update driver over the one previously on your system without first deleting it, then yes, you should have the "What You Hear" option.
    I also could not get the "What You Hear" recording option in any software application that previously had it (ie, Adobe Audition, Sony Sound Forge) until I installed the driver form the Creative website.
    Message Edited by SGV on 04-07-200708:56 PM

Maybe you are looking for

  • I'm having trouble downloading itunes to my Windows 7 home premium 64-bit laptop

    i'm trying to sign into itunes library so i can download music to my ipod nano ... i uninstalled itunes and tried to download itunes ... it says it is downloaded after about 2 seconds but it's not there

  • Macbook Pro randomly freezes time to time

    My Macbook Pro, end '11, randomly freezes from time to time. Especially when I'm on iTunes/Spotify/VLC/Skype. I ran the Etrecheck program and got this output. Could someone tell me how to fix this? It isn't exactly really ****** but it does get frust

  • Blinking question mark instead of starting up???

    My iMac seems to have stalled!  It won't shut down, and after I forced it down it won't start up.  I get a white screen with a single gray icon in the center where the Apple logo should go.  It's a blinking folder with a question mark inside.  What i

  • Flushing & Cathicng Exceptions

    Hello ABAP-Experts, I have a problem in understanding how to catch exceptions after calling method cl_gui_cfw=>flush. Why calling "flush": Well, otherwise if there is no FLUSH after directory_create (for example) is called, the value of rc (methods i

  • "Invalid export DLL or export format" with Crystal Reports 2008

    I've included this sticky because we are seeing many posts in this forum regarding the error Invalid export DLL or export format when exporting to Excel and RTF in .NET applications using the Crystal Reports 2008 .NET SDK. Issue - Exporting a Crystal