ghost for linux

Rick Stevens rstevens at vitalstream.com
Thu Jul 13 18:35:04 UTC 2006


On Wed, 2006-07-12 at 19:48 -0700, Harold Hallikainen wrote:
> > On Tue, 2006-07-11 at 20:22 -0700, Harold Hallikainen wrote:
> >> Thanks to the help from this list, I now have FC5 running on my HP
> >> zv6000
> >> AMD64 laptop. Next trick is to make a backup so I don't mess things up.
> >> Based on suggestions from the list, I'm trying out g4l. I'm making an
> >> image on a USB hard drive. This seems to work, but I suspect the image
> >> is
> >> larger than it needs to be because I didn't clear out the unused space
> >> on
> >> the laptop drive. g4l comes with a simple script to write nulls to the
> >> drive, then delete the created file. The script is:
> >>
> >> dd if=/dev/zero of=/0bits bs=20M
> >> rm /0bits
> >>
> >>
> >> When I run it as root, I get the following errors:
> >>
> >> ./CleanDrive.sh
> >> ./CleanDrive.sh: line 2: dd if=/dev/zero of=/0bits bs=20M: No such file
> >> or
> >> directory
> >> ./CleanDrive.sh: line 3: rm /0bits: No such file or directory
> >>
> >>
> >> Ideas?
> >
> > When you say "I run it as root", did you "su" or "su -"?  You MUST use
> > "su -", as "dd" is in /bin and that's not part of a regular user's PATH.
> >
> > "su" only changes your UID/GID to root.  "su -" also gives you root's
> > environment (including root's PATH).  Alternately, you could change the
> > script to "/bin/dd if=...." (in other words, specify the full path to
> > dd).
> >
> 
> 
> Thanks! I always wondered what the - did. I just used su. Anyway, I did su
> - and fully specified the path to dd and it still seems to have
> problems...
> 
> [root at hhlaptop Desktop]# ./CleanDrive.sh
> ./CleanDrive.sh: line 2: /bin/dd if=/dev/zero of=/0bits bs=20M: No such
> file or directory
> ./CleanDrive.sh: line 3: rm /0bits: No such file or directory
> [root at hhlaptop Desktop]#

Hmmm, works for me.  You should specify a "count=" parameter as well.
Example:

[root at prophead work]# dd if=/dev/zero of=/0bits bs=20M count=1
1+0 records in
1+0 records out

[root at prophead work]# ls -lh /0bits
-rw-r--r--  1 root root 20M Jul 13 11:31 /0bits

So, if your script is EXACTLY what you said it is, try adding the
"count=" thing to the end.  Also verify that you indeed have the /bin/dd
program and that the /dev/zero device exists.  It should look something
like this:

[root at prophead work]# ls -l /bin/dd
-rwxr-xr-x  1 root root 34540 Jul 25  2005 /bin/dd
[root at prophead work]# ls -l /dev/zero
crw-rw-rw-  1 root root 1, 5 Jun 21 05:12 /dev/zero

Note that the /bin/dd program comes as part of the "coreutils" RPM.

----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-   You possess a mind not merely twisted, but actually sprained.    -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list