Re: qemu linux kernel with busybox booting problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi...

On Sun, Jun 21, 2009 at 5:31 AM, soumen
acharya<soumen.acharya@xxxxxxxxxxx> wrote:
>
>
>   Hi all,
>
>    I was trying to boot linux kernel with qemu using custom busybox , having
> booting problem.
>
>   I did the following :
>
>   dd if=/dev/zero of=rootfs.img bs=1k count=2048
>   mkfs.ext2 ­i 1024 ­F rootfs.img
>   mkdir /mnt/rootfs
>   mount ­o loop rootfs.img /mnt/rootfs
>   rsync ­a busybox/_install/ /mnt/rootfs/
>   chown ­R root:root /mnt/rootfs/
>   sync
>   qemu -­m 64 -­hda rootfs.img -­kernel linux­2.6.28.4/arch/x86/boot
> /bzImage -­append "root=/dev/hda"
>
> while booting it shows:
>
> VFS : can not open hda
>       append proper root fs in "root="

AFAIK, qemu expect the image file you put in "-hda" or "-hdb" as a
complete disk, not just a single partition. Since you're doing mkfs on
the image file, that means you made it as if it's a single partition.

Use parted or fdisk to create disk label and partition inside that disk image:
# dd if=/dev/zero of=./test.img bs=1k count=10k

# /sbin/parted ./test.img
(parted) mklabel msdos

(parted) mkpartfs primary
File system type?  [ext2]?
Start? 0
End? 10M

(parted) p
Model:  (file)
Disk /home/mulyadi/Virtual/test.img: 10.5MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      16.4kB  10.5MB  10.5MB  primary  ext2

Then simply loop mount the first partition of that first partition:
# /sbin/fdisk -u -l ./test.img

Disk ./test.img: 0 MB, 0 bytes
4 heads, 32 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x0006e46d

     Device Boot      Start         End      Blocks   Id  System
./test.img1              32       20479       10224   83  Linux

# mount -o loop,offset=$((32*512)) ./test.img /mnt/test

regards,

Mulyadi.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux