Page 1 of 1

HDD Image resets after reboot

Posted: Thu Dec 27, 2012 7:24 pm
by Manio
Hi,

i have a weird poblem. The HDD image I use with qemu to boot my OS keeps resetting to a unformatted one after I reboot my Ubuntu.
It was created the following way:
  • create 100mb file with dd (if=/dev/zero)
  • bind to /dev/loop0 with losetup
  • create partition table, and a primary ext2 partition with gparted
  • install grub on it
Until i reboot the Image works fine. I have tried different harddrives (HDD/SSD), filesystems (ext4/ext2) and copied the file to various places. Every copy got reset too.

I am running a Ubuntu 12.10 32-bit.
Can anyone help me out? Thanks in advance.

Re: HDD Image resets after reboot

Posted: Fri Dec 28, 2012 1:10 am
by bluemoon
unbind the loop0 or sync before you reboot.

Re: HDD Image resets after reboot

Posted: Sat Dec 29, 2012 12:40 pm
by Manio
Thanks for the reply. I found the actual probem now. The way i create the partition table on my HDD image is wrong. This way it didnt save the partition table to the actual file, but was saved only on /dev/loop1, which gets wiped after reboot.