[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
unclear cp semantics nuked non-working drive?
From: |
janneke |
Subject: |
unclear cp semantics nuked non-working drive? |
Date: |
26 Nov 2000 14:05:37 +0100 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7 |
Hi,
Parted is a nice and friendly tool, but I managed to distroy a
partition using CP with GNU Parted 1.2.13.
I was working on partitioning my hda drive, and wanted to cp a
partition: /dev/hdb1 to /dev/hda1.
Here's what I did:
~# parted /dev/hda
(parted) help cp
cp MINOR [DEVICE] MINOR copy filesystem to another partition
MINOR is the partition number used by Linux. The primary partitions
number from 1-4, and logical partitions are 5 onwards.
DEVICE is usually /dev/hda or /dev/sda
I wondered about the strange commandline for CP, why is only one
DEVICE allowed? But I acknowledged that one device is enough; you
only may need to specify another SOURCE device, as the destination
device can clearly only be the one you're working on, ie, the one
that was specified on the command line, in my case /dev/hda.
So, to copy /dev/hdb1 to /dev/hda1 I did:
(parted) cp 1 /dev/hdb 1
but apparently, this copies /dev/hda1 to /dev/hdb1? If not, could you
tell me what else may have happened?
I have two strong suggestions:
* it would be good (IMO), if parted would refuse (or at least warn
before) to write to a disk that is not the ``working disk''.
* it would be good to change the CP command and CP help to
cp [FROM-DEVICE] FROM-MINOR [TO-DEVICE] TO-MINOR
(or, at least change the CP help to:
cp FROM-MINOR [TO-DEVICE] TO-MINOR
which reflects the current semantics. But I think it's evil to
write to a device that's not the working device...)
Greetings,
Jan
--
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien | http://www.lilypond.org
- unclear cp semantics nuked non-working drive?,
janneke <=