thanks.
Sent via Deja.com
http://www.deja.com/
> I copied a kernel image to a floppy, cp /vmlinuz /dev/fd0
> and it would not boot. I used dd if=/vmlinux of=/dev/fdo and it boots.
> Could someone tell me the difference?
man dd and man cp would give you a pretty good idea.
cp copies from file system to filesystem, dd copies from device to device.
> What abt that bs and count
> parameters that I see so often. How do those affect the transfer?
bs=block size, the device you copy to is a block device, you need to tell
it what the block size is that that device accepts. Count is how many of
these blocks.
>
> thanks.
>
>
> Sent via Deja.com
> http://www.deja.com/
>
Groeten,
Dries
Basically, cp copies files between file systems, whereas dd copies raw
data between devices. What this means in your case is that the file you're
copying with dd is actually a disk image complete with boot sector etc.
BTW I notice you cp'd vmlinuz and dd'd vmlinux, is that a typo or is it the
cause of your problem (I can't remember which file is what 8-( )
Steve
It is possible to use "cp" to copy vmlinuz to a floppy. At least it
works if you use these steps.
fdformat /dev/fd0H1440
cp /boot/vmlinuz /dev/fd0
/usr/sbin/rdev
# Shows kernel root device such as "/dev/hda5"
/usr/sbin/rdev /dev/fd0 /dev/hdaX
# hdaX root device shown by command above.
/usr/sbin/rdev -R /dev/fd0 1
# This makes the root device read only
--
Confucius say: He who play in root, eventually kill tree.
Registered with the Linux Counter. http://counter.li.org
ID # 123538
Completed more W/U's than 98.992% of seti users. +/- 0.01%
Huh? So does that mean I can dd an ext2 file to an msdos-formatted
floppy disk and it'll be ok?
> > What abt that bs and count
> > parameters that I see so often. How do those affect the transfer?
>
> bs=block size, the device you copy to is a block device, you need to
tell
> it what the block size is that that device accepts. Count is how many
of
> these blocks.
What if I leave out bs and count? Are there any default values that dd
uses? What if I want to copy /vmlinuz to a floppy (kernel image is 980
blocks, 1 block is 1024 bytes) and I added the wrong parameter values
like, say, bs=512 count=1024, how would it affect the dd? Would I still
be able to boot?
Is ls -b the way to find out the block size of a file?
Disk image complete with boot sector? You mean cp does not copy the
image to the boot sector and dd does? So that's why the image boots
with dd and not cp? Has this anything to do with the first 512 bytes of
a floppy? Sector 0?
> BTW I notice you cp'd vmlinuz and dd'd vmlinux, is that a typo or is
it the
> cause of your problem (I can't remember which file is what 8-( )
Sorry, it's a typo. I meant vmlinuz. The 'z' as in zipped. The kernel
is compressed, zipped, isn't it?
Thanks. But I have to use superformat. fdformat is obsolete in Debian
potato. Can't use it.
>
> cp /boot/vmlinuz /dev/fd0
>
> /usr/sbin/rdev
> # Shows kernel root device such as "/dev/hda5"
>
> /usr/sbin/rdev /dev/fd0 /dev/hdaX
> # hdaX root device shown by command above.
>
> /usr/sbin/rdev -R /dev/fd0 1
> # This makes the root device read only
>
> --
> Confucius say: He who play in root, eventually kill tree.
> Registered with the Linux Counter. http://counter.li.org
> ID # 123538
> Completed more W/U's than 98.992% of seti users. +/- 0.01%
>
This is part of what makes Linux so damn hard for newbies to understand.
Every distro uses different tools to do the same thing.
> > man dd and man cp would give you a pretty good idea.
> > cp copies from file system to filesystem, dd copies from device to >
> > device.
>
> Huh? So does that mean I can dd an ext2 file to an msdos-formatted
> floppy disk and it'll be ok?
That not what I meant. What I mean is, that if you have two devices (let's
say: two harddisk partitions of equal size). If you dd one device to the
other (so the in and output files you give dd are the devices, not the
mount points), dd won't care about filesystems, it will just copy from one
device to the next. This will mean that even the filesystem of the output
partition will be written over by the filesystem of the input partition.
> What if I leave out bs and count? Are there any default values that dd
> uses? What if I want to copy /vmlinuz to a floppy (kernel image is 980
> blocks, 1 block is 1024 bytes) and I added the wrong parameter values
> like, say, bs=512 count=1024, how would it affect the dd? Would I still
> be able to boot?
I never use the dd parameters, the default block size always works for me.
If you give the wrong values, you might not get all the info and you will
most likely not be able to boot.
> Is ls -b the way to find out the block size of a file?
man ls
Groeten,
Dries