HDD Image resets after reboot

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
Manio
Posts: 2
Joined: Thu Dec 27, 2012 7:01 pm

HDD Image resets after reboot

Post 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.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: HDD Image resets after reboot

Post by bluemoon »

unbind the loop0 or sync before you reboot.
Manio
Posts: 2
Joined: Thu Dec 27, 2012 7:01 pm

Re: HDD Image resets after reboot

Post 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.
Post Reply