Just made a horrible horrible horrible mistake

Ok, I’m trying not to hyperventilate here…

I chdir’d to /.wine/drive_c/ and ran rm -rf on the /windows/ directory in it, since I made a mistake pertaining to several files in wine’s windows directory. I even double checked, the directory appeared fine. While it was doing that I ran off to eat dinner.

When I came back, I noticed an odd amount of errors in the terminal and it didn’t take long for me to realise that it DELETED ALL THE DATA OFF OF MY OTHER TWO HARD DRIVES WITH WINDOWS ON THEM. I also happen to have an external backup drive too BUT IT DELETED ALL THE DATA OFF OF THAT TOO.

Oh god, what do I do? I know it sounds crazy but is there any way to undo this? Oh god… oh god please help me. I’m still somewhat new to OpenSUSE but I didn’t expect this to happen at all… all I can guess is that there were some symlinks or something somewhere. Oh christ.

Edit: If you think I’m trolling I’m not. This is the output from bash after running the command: http://pastebin.org/63770

In Windows file systems, there are quite a few tools to recover data. You can recover 100% of your data if the file system is NTFS or FAT32.
Now you should first determine which file systems those drives were. I am not expert in anything regarding Windows, so I am unable to recommend a specific tool, but someone will post here soon with more helpful details. So don’t be too mad at you. Don’t attempt to write anything on those drives, just leave them as they are until you can find a tool.

Just saw your output. Are you sure you deleted anything at all? From that output it does not seem to me like you deleted anything. Looks like your system is configured in a way that you do not have access to those partitions, which I suppose are NTFS.

For the future, I would add this entry to your .bashrc (users and root):
alias rm=‘rm -i’
So this way it will ask you confirmation before deleting any files through rm command

I’ve checked all the drives, every directory is completely vacant of files now. It did manage to delete some directories though somehow, like program files.

I’ve also tried to unmount the drives, but it says they’re already unmounted…

I see. Well, don’t be in despair, there are plenty of tools to recover from a NTFS, google returns many results, just I have no idea which programs are good and which not.
Do you have another computer with a Windows?
If you do not, assuming your Windows does not boot or does not work properly any more, in the worst case you could bring it to a computer store and they could do that for you. It should not be too expensive.

TestDisk - CGSecurity

On 12/11/2009 06:16 PM, ChrisH 16 wrote:
>
> G0NZ0;2086442 Wrote:
>> Just saw your output. Are you sure you deleted anything at all? It does
>> not seem to me like you deleted anything from that output. Looks like
>> your system is configured in a way that you do not have access to those
>> partitions, which I suppose are NTFS.
>>
>> For the future, I would add this entry to your .bashrc (users and
>> root):
>> alias rm=‘rm -i’
>> So this way it will ask you confirmation before deleting any files
>> through rm command
> I’ve checked all the drives, every directory is completely vacant of
> files now. It did manage to delete some directories though somehow, like
> program files.
>
> I’ve also tried to unmount the drives, but it says they’re already
> unmounted…

Well, if they’re unmounted you won’t see any files. Try mounting them
and seeing if the files don’t ‘magically’ appear.


Kevin Miller - http://www.alaska.net/~atftb
Juneau, Alaska
In a recent survey, 7 out of 10 hard drives preferred Linux
Registered Linux User No: 307357, http://counter.li.org

When I try to mount them it just says that they don’t exist.

The files do not exists or the drives?

Open a terminal become su and do

fdisk -l

post result - explain which partitions you want to mount from the list

The / before windows/ is probably the reason - there cannot be a /windows/ directory in /.wine/drive_c/

You can test the recovery programs on a USB memory stick.

It’s the drives (or at least the partitions) that are supposedly non-existent.

sda is my primary drive with Windows 7 on it. sda1 is, er, was where it was installed, and sda2 is an extra partition, with a boatload of songs I’ve made and are working on (I’m a producer).

sdb is where opensuse is.

sdc is another storage drive. It might not be as important to my education or pseudo-career (music production), but I still really need it.

sdd is my backup drive.

Disk /dev/sda: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x64061985

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       65271   524288000    7  HPFS/NTFS
/dev/sda2           65271       91201   208282624    7  HPFS/NTFS

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x70841fad

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         523     4200966   82  Linux swap / Solaris
/dev/sdb2             524        8584    64749982+  83  Linux
/dev/sdb3            8585       60801   419433052+  83  Linux

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x70841faa

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       60802   488383488    7  HPFS/NTFS

WARNING: GPT (GUID Partition Table) detected on '/dev/sdd'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
256 heads, 63 sectors/track, 121126 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes
Disk identifier: 0x80fe36d2

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1      266306  2147483647+  ee  GPT

OK. So lets see what is in your fstab currently

cat /etc/fstab

Tell us also. When you were deleting files, were you working as User, you hadn’t switched to su had you?

/dev/disk/by-id/ata-ST3500630AS_9QG3FBBD-part1 swap swap defaults 0 0
/dev/disk/by-id/ata-ST3500630AS_9QG3FBBD-part2 / ext4 acl,user_xattr 1 1
/dev/disk/by-id/ata-ST3500630AS_9QG3FBBD-part3 /home ext4 acl,user_xattr 1 2
/dev/disk/by-id/ata-ST3750640AS_3QD0RB47-part1 /windows/C ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
/dev/disk/by-id/ata-ST3750640AS_3QD0RB47-part2 /windows/D ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
/dev/disk/by-id/ata-ST3500630AS_9QG3F9PA-part1 /windows/E ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0

And no, I didn’t run the rm command as root.

If you navigate in your directory tree to /windows/C (D) (E)

Are you saying there is nothing?

In My Computer, does it show the partitions and do the disk usage stats look correct?

It shows the partitions but the disk usage stats are grossly lower than they should be. Browsing to them in Dolphin, while some directories are still there, quite a few are gone and almost all files are gone. I should note that the system says they’re not mounted but they are. Winecfg also mentions that it can’t detect any drives at all.

Edit: Made a BartPE disk (with some data recovery tools added) in a Win XP under VirtualBox, and right now K3b is burning the iso to disk. As soon as it finishes I’m going to pray that I can recover a decent amount of data.

The less you mess with the partitions the better. Good luck

Remember: http://www.cgsecurity.org/wiki/TestDisk

Tested it out in a virtual machine and glad I did. Even though all requirements are met, the executables just don’t like the PE environment.

And how do I get TestDisk to work? Neither RPM works.

Live cd like Parted Magic
TestDisk Livecd - CGSecurity

ChrisH 16 wrote:
>
> IT DELETED ALL THE DATA

no, YOU deleted all the data…

simple recovery: restore from your current backup


palladium