[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: odd dd issue?
From: |
Bob Proulx |
Subject: |
Re: odd dd issue? |
Date: |
Wed, 28 Mar 2001 14:03:27 -0700 |
> Sorry to bug you guys, but I have an odd problem with dd. I'm putting
> together a boot floppy with GNU/Linux. I already made an ext2fs file system
> on /dev/fd0 and am now trying to write in my compressed file system to come
> right after the boot portion: I'm doing this with "dd if=fs.img.gz
> of=/dev/fd0 seek=335 bs=1k". dd tells me "/dev/fd0: Invalid argument"
> despite the fact that there *is* a floppy in the drive that's known to be
> writeable and without errors. An "of=/dev/fd91831903812" (completely bogus)
> completes without complaint.
Hmm... Interesting. I found the following snippet in the code for
dd.c where it tries to avoid this on special devices. I believe
ftruncate is getting macroed into ftruncate64 when it can make use of
large files (aka >2GB, >2^32bits worth).
/* Complain only when ftruncate fails on a regular file, a
directory, or a shared memory object, as the 2000-08
POSIX draft specifies ftruncate's behavior only for these
file types. For example, do not complain when Linux 2.4
ftruncate fails on /dev/fd0. */
if (ftruncate (STDOUT_FILENO, o) != 0
&& (S_ISREG (stdout_stat.st_mode)
|| S_ISDIR (stdout_stat.st_mode)
|| S_TYPEISSHM (stdout_stat.st_mode)))
> Oddly enough, an strace showed the problem occurring at ftruncate64() after
> a successful open on /dev/fd0 -- and ftruncate64() was shown to be passed
> five arguments, despite the fact that the documentation that I have in hand
> (i.e., /usr/include/unistd.h & the kernel source) clearly shows ftruncate as
> taking two parameters.
Hmm... I don't know which version of the code you are using. If you
would like to try a test beta release candidate for 4.1 then newer
versions are available at the following locations.
ftp://alpha.gnu.org/gnu/fetish/fileutils-4.0.43.tar.gz
ftp://freefriends.org/gnu/fetish/fileutils-4.0.43.tar.gz
A workaround to this problem would be to build the entire image in a
file as you want the floppy to hold. Then dd the entire image of the
file in one pass onto the floppy.
Bob
- odd dd issue?, David E. Weekly, 2001/03/27
- Re: odd dd issue?,
Bob Proulx <=