How to delete all partitions for a complete reinstall

Alexander Skwar listen at alexander.skwar.name
Tue Aug 15 09:55:52 UTC 2006


Tony Arnold <tony.arnold at manchester.ac.uk>:

> On Mon, 2006-08-14 at 22:25 -0700, Eric Hanchrow wrote:
>> >>>>> "Kevin" == Kevin Zhao <klzhao at gmail.com> writes:
>> 
>>     Kevin> I wonder which commands (fdisk -xxx?  etc) can be used if i
>>     Kevin> boot using ubuntu live cd.
>> 
>> I would use
>> 
>>         $ dd if=/dev/zero count=512 bs=1 of=/dev/hda
> 
> Should that not be:
> 
>         $ dd if=/dev/zero count=1 bs=512 of=/dev/hda
> 
> or are the two commands equivalent?

They are equivalent. Your command shows a better performance, though.

With Erics command, a "huge" number of write requests is sent (512,
to be exact). And every time, just 1 byte is written. That's tremendously
slow!

Now, with 512 byte, it "might" be hard to see the difference :)

But test the following, which will create a FILE of 1MiB in the
current directory:

        time dd if=/dev/zero of=zero.bs1    count=$((1*1024*1024)) bs=1
        time dd if=/dev/zero of=zero.bs1MiB count=1 bs=$((1*1024*1024))

You'll see, that the latter is *WAY* faster.

[11:55:07 vz6tml at dewuib07:~] $ time dd if=/dev/zero of=zero.bs1    count=$((1*1024*1024)) bs=1
1048576+0 records in
1048576+0 records out
1048576 bytes (1,0 MB) copied, 6,25944 seconds, 168 kB/s

real    0m6.290s
user    0m1.290s
sys     0m4.920s
[11:55:19 vz6tml at dewuib07:~] $ time dd if=/dev/zero of=zero.bs1MiB count=1 bs=$((1*1024*1024))
1+0 records in
1+0 records out
1048576 bytes (1,0 MB) copied, 0,0321853 seconds, 32,6 MB/s

real    0m0.050s
user    0m0.010s
sys     0m0.020s
[11:55:21 vz6tml at dewuib07:~] $ ls -la zero.b*
-rw-r--r-- 1 vz6tml pcei 1048576 2006-08-15 11:55 zero.bs1
-rw-r--r-- 1 vz6tml pcei 1048576 2006-08-15 11:55 zero.bs1MiB

Alexander Skwar
-- 
<Culus> "Hello?"  "Hi baybee"  "Are you Johnie Ingram?"  "For you I'll be
        anyone" "Ermm.. Do you sell slink CD's?" "I love slinkies"






More information about the ubuntu-users mailing list