[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Did v7.4 invalidate my hard drive?



Hello Jim,

On Thu, Aug 07, 2014 at 01:52:42PM -0500, Jim Pritchett wrote:
> Hi,
>       this is what happened.  I redownloaded v7.4.0 and burned it to
> a DVD.  I booted from that and used the flash install icon on the
> desktop to make a Knoppix USB stick.  I booted from that and it
> seemed to be fine.  Everything seemed to be fine except that it
> didn't see my 2 TB windows drive.  I didn't really think about that
> at the time.  Everything seemed to be ok.  Then I rebooted Windows
> Vista and the 2 TB drive wasn't there.  After a bit of
> investigation, I booted my old v7.0.5 USB stick and ran gparted.  My
> 2 TB drive now shows up as unallocated.
> 
> Since I didn't really do anything else, I'm guessing that the USB
> flash script somehow stepped on my HD partition table.  I didn't
> find any errors with gparted.  It just shows up unallocated.  I'm
> going to back up the entire drive using DD before I try to repair
> the partition table.

You really made me worry, but I double-checked the script (you may want
to look at it as well) /usr/bin/flash-knoppix.

>From the beginning, the variable $FLASH is filled with what the user
choses in the first dialogs, that variable is consistently used for all
disk operations, also partition-based ones by "${FLASH}1" and such. No
other disks are touched. So, I can rule out an error related to wrong
disk choice or the script accidentially overwriting a disk other than
the selected one.

In the mode "repartition the USB disk and erase all data" (with 2
warnings before it actually does something), the master boot record of
the chosen device is cleared:

 dd if=/dev/zero of="$FLASH" bs=4M count=1 >/dev/null 2>&1

this would be the only place where, when interrupted afterwards, the
script would leave the USB flash disk in an unpartitioned/unallocated
state. However, as you can see, the $FLASH variable is also used here
and contains only the disk you selected.

All other operations also go to that disk.

Now, there is one condition related to hardware problems that I can
think of, which could cause the wrong disk to be worked on. If you plug
in too many devices on the same USB bus, a "current overload" can happen
(look into dmesg!), which causes the USB port to be reset and all
devices get rescanned and renumbered. At that point, your 1TB disk could
take the place that was formerly used for the USB flash disk. Chances of
this happening in the few milliseconds between disk operations are very,
very low, though. The script assumes that you do NOT remove or replug
the disk that you had chosen at the beginning when proceeding.

I checked the flash installer several times with a 1TB and a 2TB disk
attached to a powered USB hub where also 4 USB sticks were
flash-knoppix'ed at the same time, and never had them influence any of
the harddisks. So I can rule out a systematic error.

> I would appreciate any advice on the best way to fix this.

If for some reason which I don't connect to flash-knoppix, the partition
table got overwritten, you can try to fix it with "testdisk" by scanning
the disk for lost partitions and adding them to a new partition table
(checking with the internal file browser), or at least rescue data to a
different volume.

Please let me know if you find an explanation for the disk being
changed.  I don't think that there is a systematic error in
flash-knoppix that could be involved.

Regards
-Klaus Knopper


Reply to: