Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Writing raw image to partition

  1. #1
    Join Date
    Feb 2013
    Posts
    19

    Default Writing raw image to partition

    Hi,

    I'm trying to write USB & disk image of miniSUSE to sda9 partition, add grub entry and boot sysetm, but I have a problem.

    I do it like this:
    Code:
    #Format partition eg. sda9
    mkfs.ext3 -m 0 /dev/sda9
    rm -r lost+found/
    
    #Create directiories
    mkdir /mnt/loop
    mkdir /mnt/miniSUSE
    
    #Mount your raw disk image as a loopback device
    losetup /dev/loop0 /home/mruz/miniSUSE/miniSUSE.x86_64-0.4.35.raw
    
    #Add your partitions to /dev/mapper/loop0pX
    kpartx -va /dev/loop0
    
    #Mount partition as read-only and sda9
    mount -o ro /dev/mapper/loop0p1 /mnt/loop/
    mount /dev/sda9 /mnt/miniSUSE
    
    #Copy files from image to mounted partition
    cp -R /mnt/loop/* /mnt/miniSUSE/
    
    
    #Clean up
    umount /mnt/loop/
    
    #Remove the mapper devices:
    kpartx -d /dev/loop0
    
    #Remove the loopback device:
    losetup -d /dev/loop0
    
    #Add entry to grub /etc/grub.d/40_custom
    menuentry 'miniSUSE' {
    set root=(hd0,9)
    linux /boot/linux.vmx quiet splash=silent
    initrd /boot/initrd.vmx
    }
    
    #Rebuild grub2 config
    grub2-mkconfig -o /boot/grub2/grub.cfg
    In the first boot stage miniSUSE is loading, but when:
    Searching for boot device..
    I receive:
    Failed to find boot device!
    Does anyone have any ideas?

  2. #2
    Join Date
    May 2010
    Location
    Space Colony Lagrange Point 22° à, 77° Ƅ, 56° ɤ, 99° ɜ
    Posts
    3,166

    Default Re: Writing raw image to partition

    mruz wrote:
    >
    > Hi,
    >
    > I'm trying to write USB & disk image of 'miniSUSE'
    > (http://susestudio.com/a/3Xsp3A/minisuse) to sda9 partition, add grub
    > entry and boot sysetm, but I have a problem.
    >
    > I do it like this:
    >
    > Code:
    > --------------------
    >
    > #Format partition eg. sda9
    > mkfs.ext3 -m 0 /dev/sda9
    > rm -r lost+found/
    >
    > #Create directiories
    > mkdir /mnt/loop
    > mkdir /mnt/miniSUSE
    >
    > #Mount your raw disk image as a loopback device
    > losetup /dev/loop0 /home/mruz/miniSUSE/miniSUSE.x86_64-0.4.35.raw
    >
    > #Add your partitions to /dev/mapper/loop0pX
    > kpartx -va /dev/loop0
    >
    > #Mount partition as read-only and sda9
    > mount -o ro /dev/mapper/loop0p1 /mnt/loop/
    > mount /dev/sda9 /mnt/miniSUSE
    >
    > #Copy files from image to mounted partition
    > cp -R /mnt/loop/* /mnt/miniSUSE/
    >
    >
    > #Clean up
    > umount /mnt/loop/
    >
    > #Remove the mapper devices:
    > kpartx -d /dev/loop0
    >
    > #Remove the loopback device:
    > losetup -d /dev/loop0
    >
    > #Add entry to grub /etc/grub.d/40_custom
    > menuentry 'miniSUSE' {
    > set root=(hd0,9)
    > linux /boot/linux.vmx quiet splash=silent
    > initrd /boot/initrd.vmx
    > }
    >
    > #Rebuild grub2 config
    > grub2-mkconfig -o /boot/grub2/grub.cfg
    >
    > --------------------
    >
    >
    > In the first boot stage miniSUSE is loading, but when:
    >>
    >> Searching for boot device..
    >>

    >
    > I receive:
    >>
    >> Failed to find boot device!
    >>

    >
    > Does anyone have any ideas?
    >
    >

    Is that a live image ?

    --
    GNOME 3.6.2
    openSUSE Release 12.3 (Dartmouth) 64-bit
    Kernel Linux 3.7.10-1.16-desktop

  3. #3
    Join Date
    May 2010
    Location
    Space Colony Lagrange Point 22° à, 77° Ƅ, 56° ɤ, 99° ɜ
    Posts
    3,166

    Default Re: Writing raw image to partition

    mruz wrote:
    >
    > Hi,
    >
    > I'm trying to write USB & disk image of 'miniSUSE'
    > (http://susestudio.com/a/3Xsp3A/minisuse) to sda9 partition, add grub
    > entry and boot sysetm, but I have a problem.
    >
    > I do it like this:
    >
    > Code:
    > --------------------
    >
    > #Format partition eg. sda9
    > mkfs.ext3 -m 0 /dev/sda9
    > rm -r lost+found/
    >
    > #Create directiories
    > mkdir /mnt/loop
    > mkdir /mnt/miniSUSE
    >
    > #Mount your raw disk image as a loopback device
    > losetup /dev/loop0 /home/mruz/miniSUSE/miniSUSE.x86_64-0.4.35.raw
    >
    > #Add your partitions to /dev/mapper/loop0pX
    > kpartx -va /dev/loop0
    >
    > #Mount partition as read-only and sda9
    > mount -o ro /dev/mapper/loop0p1 /mnt/loop/
    > mount /dev/sda9 /mnt/miniSUSE
    >
    > #Copy files from image to mounted partition
    > cp -R /mnt/loop/* /mnt/miniSUSE/
    >
    >
    > #Clean up
    > umount /mnt/loop/
    >
    > #Remove the mapper devices:
    > kpartx -d /dev/loop0
    >
    > #Remove the loopback device:
    > losetup -d /dev/loop0
    >
    > #Add entry to grub /etc/grub.d/40_custom
    > menuentry 'miniSUSE' {
    > set root=(hd0,9)
    > linux /boot/linux.vmx quiet splash=silent
    > initrd /boot/initrd.vmx
    > }
    >
    > #Rebuild grub2 config
    > grub2-mkconfig -o /boot/grub2/grub.cfg
    >
    > --------------------
    >
    >
    > In the first boot stage miniSUSE is loading, but when:
    >>
    >> Searching for boot device..
    >>

    >
    > I receive:
    >>
    >> Failed to find boot device!
    >>

    >
    > Does anyone have any ideas?
    >
    >

    FAQ
    https://forums.opensuse.org/english/...isk-grub2.html
    --
    GNOME 3.6.2
    openSUSE Release 12.3 (Dartmouth) 64-bit
    Kernel Linux 3.7.10-1.16-desktop

  4. #4
    Join Date
    Feb 2013
    Posts
    19

    Default Re: Writing raw image to partition

    Quote Originally Posted by vazhavandan View Post
    Is that a live image ?
    No, it's whole disk image (.raw), but I'm trying to write it to a specific partition (sda9) and boot.

  5. #5
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: Writing raw image to partition

    Quote Originally Posted by mruz View Post
    No, it's whole disk image (.raw), but I'm trying to write it to a specific partition (sda9) and boot.
    Normally, you can not boot from sda9 unless Grub has been loaded into the MBR or Partitions 1, 2, 3 or 4 and you are not really "booting" from sda9. Futher, RAW writes must be made to an "identical" partition size and type for a raw write to work. But most likley when switching disks, grub is not install right to work with sda9.

    For more info on Partitions have a look here: Creating Partitions During Install for MBR and GPT Hard Disks - Blogs - openSUSE Forums

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  6. #6
    Join Date
    Feb 2013
    Posts
    19

    Default Re: Writing raw image to partition

    I have installed openSUSE. Grub is on extended partition and it can boot eg. Mint from sda6, so there is no problem.
    miniSUSE start loading, but it stops at the Searching for boot device.

  7. #7
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: Writing raw image to partition

    Quote Originally Posted by mruz View Post
    I have installed openSUSE. Grub is on extended partition and it can boot eg. Mint from sda6, so there is no problem.
    miniSUSE start loading, but it stops at the Searching for boot device.
    Yes, but the only the only way to boot anything from sdx5 or higher, is grub must be in the MBR or in partitions 1, 2, 3 or 4. Placing grub into an Extended Partition is dangerous and most often will fail in a dual boot setup. And never run the Windows Partition program when grub is loaded into an active marked Extended Partition which corrupt its setup.

    Since it is not working as you can see, a more simple setup is suggested.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  8. #8
    Join Date
    Feb 2013
    Posts
    19

    Default Re: Writing raw image to partition

    I moved GRUB to MBR but no avail.
    As I said, I think it is not grub problem, because system starts booting, minisuse's kernel is loading and stops at the stage "Searching for boot device".

  9. #9
    Join Date
    Feb 2013
    Posts
    19

    Default Re: Writing raw image to partition

    Can somebody check my "writing raw to partition" procedure on own pc?
    You can download minisuse from susestudio.com or minisuse.org.

  10. #10
    Join Date
    Feb 2013
    Posts
    19

    Default Re: Writing raw image to partition

    Maybe kernel linux.vmx always looking for boot at the first partition eg sda1 and I can not change it by parameter in the linux line?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •