date
int64
1,220B
1,719B
question_description
stringlengths
28
29.9k
accepted_answer
stringlengths
12
26.4k
question_title
stringlengths
14
159
1,371,094,890,000
So en route from my old laptop to a new one my old laptop's hard drive got some physical damage. badblocks reports 64 bad sectors. I had a two-month-old Ubuntu GNOME setup with a split / and /home partitions. From what I can tell, a few sectors in / were damaged, but that's not an issue. On the other hand, /home's par...
All right, so for the first question it turns out the debugfs stats command tells what the starting blocks for every section of a group are. In addition, I guessed that inumbers had to be consecutive and increasing, so basic addition of the offset into the inode table and the imap command gave me the first inumbers; i...
Can I find out if a given ext4 block is in the inode table, and if so, can I pick it out of a journal with no header by hand?
1,371,094,890,000
I accidentally run rm -r /home/xralf and quickly killed it with Ctrl+C. It seemed that everything is OK, but I noticed that my .vimrc, which is importent for me, is missing. I tried the command: $ extundelete /dev/sda5 --restore-file /home/xralf/.vimrc extundelete: failed to read-only open device "/dev/sda5": Error co...
Error code 13 is EACCES - an access violation. You don't have permission to read from the device. Run the command as the superuser, i.e. use sudo extundelete ....
Recover single file in the $HOME directory
1,371,094,890,000
I'm trying to debug a program which is not logging the information I need. Fortunately, it does write temporary files which should contain the information. These files are written to a directory like: program/temp/{someGUID} on one of ten machines. Neither {someGUID} nor which machine will contain the temp files is kn...
List the files accessed by a program mentions several ways to log the program's file accesses (strace, LD_PRELOAD, LoggedFS, audit), but no convenient way to grab the file contents. A convenient way to save all the program's output is copyfs. CopyFS creates a view of a directory tree that retains all past versions of ...
View temporary files which exist for milliseconds
1,371,094,890,000
I was wondering whether mounting an SSD using the discard option (documented in man mount) is actually required for ATA TRIM to be sent to the SSD's controller. The evidence is a bit circumstantial: Whether or not I mount a partition with discard on a SanDisk SSD PLUS, deleted files can't be restored by running TestDi...
If the filesystem is mounted with discard, then deleting files will automatically cause the TRIM command to be issued. This often has a negative performance impact, so it's generally better not to use that mount option and to instead run fstrim periodically, which will work as long as all the block device layers suppo...
Is mounting with "discard" needed for TRIM?
1,371,094,890,000
I am attempting to save some user data of a disk that has failed in a Window 8 computer. I've removed the HDD that was unable to be read by the Windows 8 laptop, plugged into my OS X machine which can see the partitions but cannot mount them. (ntfs-3g cannot either). diskutil list shows: /dev/disk8 (external, physical...
Disclaimer: I am the developer of RecuperaBit. This answer is a summary of this answer of mine, mixed with feedback by OP. Your ddrescue command is cloning only the fifth partition (/dev/rdisk8s5) which is good if you are sure that the partition table is correct. However, if you have enough space I strongly suggest ...
Using ddrescue to retrieve data off a failing ntfs disk
1,371,094,890,000
I was playing around with zip and accidentally deleted my /home/ folder (I wanted to delete home/ which got created by unzipping an archive). I used rm -r /home/instead of rm -r home/ as root. Is there anything I can do to restore my /home/ dir? I am using Debian 6 as a VM on VMware Player. Unfortunately I have no bac...
First off - stop the VM or remount the volume as read only: mount -o remount,ro /home/ Presuming you are using ext[3,4], you are not lost, but it's not an easy task. The data blocks themselves are not cleared, but the pointers (inodes) are. Most files can be recovered using tools such as photorec . It will identify ...
Undo rm -r, restore data
1,371,094,890,000
I'm doing data recovery right now from a disk I've extracted from an old NAS. It looks like mkfs.ext3 froze on Writing superblocks and filesystem accounting information: since it's more that one hour that I'm waiting for done to appear. The disk is 2TB SATA connected to USB 3.0, is it normal it takes so long? Is it sa...
update: From looking at lsusb and dmesg, confirmed that the drive has dropped off the USB bus. So the mkfs has hung. kill -9 on it may stop it and allow the mdraid array to be stopped, or a reboot may be required. If you have to reboot, beware that the system may not reboot cleanly—so it'd be best to sync and unmount/...
mkfs taking too long
1,371,094,890,000
I'm trying to recover a LVM (no encryption) on a RAID1 using Debian Live. Apparently, the RAID1 can be assembled without issue, but the LVM is broken. You may skip to LVM section. The RAID part is left in case it would matter. The RAID # aptitude install mdadm # mdadm --assemble --scan dmesg: [ 617.036709] md: md0 s...
Your information is contradictory. /dev/md0 cannot simultaneously be a PV and have a partition table. file would recognize a PV. It seems that md0 is partitioned so that the LVM volume is rather /dev/md0p1 or /dev/md0p2. Maybe for some reason pvscan / vgscan ignore /dev/md0 / /dev/md0p1 (and thus LVM cannot find the U...
Recover LVM (on RAID1): No volume groups found. Partition table erased?
1,459,885,916,000
I have 1GB worth of data locked up in an encrypted TrueCrypt volume and I forgot the password to it. Is there any way to recover it?
It is actually possible if you have set a weak password with no key files. You also need a good GPU. This is done using brute forcing and dictionary attacks You can download a tool called Truecrack which does this at: https://code.google.com/p/truecrack/ Here is an article about it. http://it.toolbox.com/blogs/securit...
How to recover TrueCrypt datas?
1,459,885,916,000
After unsuccessful attempt to make a tar.gz file I can't untar the file. It seems like I have lost it and yet this looks like trivial error one should be able to recover from. Is the content of the file really lost? I have tried all sorts of tar and unzip combinations without success. OS environment and tar version: $...
On the line $ tar cvzf file.txt file.tar.gz you have asked to create a compressed archive of the file file.tar.gz, and that the archive should be called file.txt. You have simply swapped the two filenames around. The file file.txt will be overwritten by an empty compressed tar archive. This is why the subsequent c...
Unable to untar file after tar error
1,459,885,916,000
I have a DVD+RW containing a lot of images and videos. Multiple DVD drives fail to read or mount it. I tried to follow this to try and recover the files using DVDisaster, and have created an iso file. But after that, I am lost. The instructions apply to a video DVD, not a data one, so the "split" command doesn't make ...
You may try using PhotoRec with your corrupt image file. It can recover a lot of file types, not just photos as the name may imply. I have used PhotoRec successfully even when I could no longer list the partitions from an image of a broken HDD. http://www.cgsecurity.org/wiki/PhotoRec
Recover files from corrupt DVD
1,459,885,916,000
I just accidentally scrubbed all the partitions from the wrong disk. /dev/sda is the boot disk, and /dev/sdb is a new disk I am trying to set up as a RAID mirror. I accidentally fat-fingered it, and wound up deleting the partition table on /dev/sda, rather then /dev/sdb. The system is still up and running, so it's ru...
The kernel keeps the partition table in cache permanently (unless explicitly told to reload, and that can't be done if some of the partitions are in use). So you're safe until you reboot (or tell the kernel to operate on data that doesn't reflect the true disk contents; for example, if you've already activated mdraid,...
Accidentally deleted the partitions on my boot disk. The system is still running. How can I recover?
1,459,885,916,000
I was messing around with my new hard drive, which only contains some personal files, and to check its write speed, I typed: sudo dd if=/dev/zero of=/dev/sda, /dev/sda/ being the new 2 TB connected to my Raspberry Pi. Hopefully, I cancelled the command and only 11 MB have been written. Now disk content can't show up, ...
You will first need to reconstruct the partition table the way it was. This will not affect the contents of any partition, just the system's idea of where each partition begins and ends. It sounds like you might have already done this because you seem to have a partition that exists that is "unknown", but exactly the ...
Partially overwrote /dev/sda, can I recover anything?
1,459,885,916,000
I have an interesting problem which may or may not have a solution but I'd love to have one if possible: On Solaris an open log file has been removed, which still continues to be populated while the process is running but is now inaccessible to all the other tools like cat, tail, etc. Is there any way to restore the e...
This is doable, with some hacking and limitations (you need root privileges). First find what file descriptor is using the application to write the log file then create a symbolic link in the previous log file location and pointing to the file /proc entry, eg: ln -s /var/tmp/file.log /proc/12345/fd/3 The first limita...
Restoring an open file
1,459,885,916,000
I have a situation, a colleage of mine overwrote PHP files that I've made changes to , is it possible to roll back a file to a previous working version using the command line. No svn repositories are available and also not any backups.
I'm sorry to say that if you didn't make any backups, you're almost certainly SOL here, especially from the command line. Unlinking (deleting) a file can sometimes leave the data recoverable as long as nothing else grabs that particular inode; editing a file overwrites the data. If your colleague still has the editor ...
Rolling back a file
1,459,885,916,000
Before imaging the corrupted filesystem to a file on another hard drive, I decided to dry-run ddrescue (throwing rescued output to /dev/null) just to see how much data is unreadable: # ddrescue -d -b 4096 -r 3 -f /dev/sda1 /dev/null sda1.log In the end it took 3 days to finish. Now I'm ready to make a real image, bu...
Thoroughly reread ddrescue manual and found out the following option: -m file --domain-logfile=file Restrict the rescue domain to the blocks marked as finished in the logfile file. This is useful if the destination drive fails during the rescue. So the invocation of ddrescue would look something like this: # ddresc...
ddrescue: reread only good sectors?
1,459,885,916,000
I'm trying to recover data from a Windows (NTFS) disk that became unreadable for some reason. I'm doing this from within a Linux Mint environment. I can see the partitions normally, and I also see the correct free space of the disk. However, mounting it gives problems: > sudo ntfs-3g -o force,rw /dev/sdc1 /media/windo...
In the end, I gave up solving the problem from Linux, and tried it from Windows. That turned out to be a good idea: running chkdsk solved the problem.
Recovering data from broken (NTFS) partition
1,459,885,916,000
I wanted to convert some logical partitions to extended ones, so I was following this accepted answer. However, at the step of backing up my current partition table, I messed up and typed the following instead of what was written. sfdisk -f /dev/sda > /mnt/parts.txt Which resulted in this: Disk /dev/sda: 30401 cylind...
This is going to be tricky to fix by hand. I hope you haven't modified any more data on this disk, apart from the broken partition table you wrote to it. Using sfdisk, fdisk, etc to create a backup of the partition table is a good idea (when you don't accidentally type the wrong command :) ). But for extra insurance I...
Approximate partition table backup with sfdisk
1,459,885,916,000
I have a Sony VIAO laptop setup as dual boot (Ubuntu 12.10/Windows 7). Since I wanted to try Archlinux, I installed VirtualBox in Ubuntu. To create a bootable USB stick (from the ISO image on my hard drive), I followed the instructions from archlinux installation guide. However, accidentally gave the following command...
Sorry, but you had a Sony VIAO laptop set up as dual boot. Here's why: dd didn't overwrite just the MBR (i.e. the first 512B sector) - that would be quite annoying, but still fixable. It also took good part of at least the first partition on your hard drive. Unless you had a very interesting setup with system partitio...
Overwritten MBR: Is partial/complete recovery possible?
1,459,885,916,000
There are two similar tools for a dd on bad hardware: Kurt Garloff's dd_rescue GNU ddrescue What is the difference between dd_rescue and ddrescue, when to prefer which one?
GNU ddrescue first quickly copies good blocks using a large block size and then optionally tries to recover more data reading smaller blocks within the blocks that failed in the first pass. This requires a log file that records what areas are still missing and the output must go to a file or disk that allows random ac...
What is the difference between dd_rescue and ddrescue, when to prefer which one?
1,459,885,916,000
Several days ago, I dropped my USB external hard disk. As a result, I cannot read some of the files. I would like to recover it, and now I am using safecopy. I used the following command, sudo safecopy /dev/sdb1 data.img --stage1 However, at around 93%, then there is a message something like "cannot read from source"...
First, you may want to try safecopy --stage2 and safecopy --stage3 as well, to try to extract a little more from the disk. If your copy is partial, you have a damaged filesystem. Run fsck on it (e.g. fsck -y copy-of-data.img) to attempt to repair. Note that for NTFS, you'll need a recent version of NTFS-3g. Repairing ...
Recovering NTFS drive with safecopy
1,459,885,916,000
Suppose we have one LV group with 2 logical volumes: /dev/lvm/home and /dev/lvm/root. Suppose I've accidentally deleted some important data on /dev/lvm/home, then turned off the PC the moment I realized that, changed /dev/lvm/home to mount only in read-only mode from fstab, booted from /dev/lvm/root and started using ...
Short answer: yes, your deleted data is as safe as it can be under the circumstances. When you configure normal logical volumes (as opposed to "thin" ones), particular stretch(es) of disk blocks are allocated for each logical volume, and those won't change without using LVM configuration commands again. Unless you sta...
Does writing data on one LV keep deleted files on another LV from the same group intact?
1,459,885,916,000
When I was installing Mint Debian edition unlike the classic edition, the installation automatically formated my home partition when I did not specify to format. So the formatting previously was ext4 as is now. I believe the data is still there as it was a quick format. I have now booted the computer up on a live USB...
Take a look at the e2fsprogs package. It seems that you can get all your backup superblocks from dumpe2fs /dev/sd<partition-id> | grep -i superblock and then have e2fsck check the FS for you, or just try to do mount -o sb=<output-of-dumpe2fs> /dev/sd<partition-id> /your/mountpoint with a backup superblock. See this fo...
Data recovery from an accidental format on ext4 partition
1,459,885,916,000
Some background A friend of mine was using in his office a NAS Buffalo-LS-WVL with two disks of 1TB each. It seems that the two disks were mounted as raid 1, but, as you will read, probably they have been not. The NAS gave some problems of extremely slowness and then suddenly didn't work anymore. I've been called in ...
I hate to be the bearer of bad news, but... Q: I'm new to mdadm, did I do everything correctly? A: No. In fact, you did just about everything in the most destructive way possible. You used --create to destroy the array metadata, instead of using --assemble which probably would have allowed you to read the data (at ...
recovery data from RAID and disk failure (Linux)
1,459,885,916,000
While accessing a drive with high error rates (as, for example, here for opensuse) in FreeBSD, the system eventually disconnects the drive and it disappears from /dev. This makes it impossible to run ddrescue or testdrive in any reasonable fashion.
With FreeBSD 9+ the camcontrol utility can be used to control if either a SATA or a SCSI drive is disconnected, or not, in such circumstances: camcontrol negotiate /dev/<dev> -D disable
How to prevent FreeBSD from disconnecting a drive device?
1,459,885,916,000
I try to recover from disk crash, and while doing so, I make a mistake -- now I have to recover from two things. So the first is recovering previous LVM configuration file for volumne group -- I have the desired file, but I when I run: vgcfgrestore my_vol_group I get error: Couldn't find device with uuid jJ7dXL-2m...
I would try it like this Add a new disk at least as big as the missing one (say /dev/sdX). Create a PV with same uuid as the missing one. pvcreate --restorefile YOUR-FILE --uuid J7dXL-2m2j-d0OC-bczy-fQak-YOj7-OhRLlW /dev/sdX Try again your restore command: vgcfgrestore --restorefile YOUR-FILE my_vol_group See al...
How to restore previous LVM volume group configuration?
1,459,885,916,000
The goal in my case is not to securely erase data, but simply to force sector reallocation by the drives firmware. I have a drive that has had a few file corruptions. It seems to be due to getting very hot at some point in the past, the max reported temperature is 99C ! I've recovered as much data from it as I can wit...
If your goal is to really "zero" the drive, then I bet the fastest you can get is to issue a low-level secure erase command using hdparm (see here for step-by-step instructions). Note two things: As hdparm manpage vividly states, the operation is "DANGEROUS". On the other hand, it may also repair bad blocks.
What is the fastest way to write all sectors on a drive?
1,459,885,916,000
I accidentally overwrote my .zshrc file after a misexecuted command, which contains several hundred lines of configs. However, I still have 5 terminals that had zsh open before this incident, and as a result, they are unaffected. However, any new shell I open loses the entire zsh config, and I have no backup for it. I...
I would have suggested using /proc/PID/fd/ directory, but zsh closes the file descriptor pointing to its configuration after parsing it. From that, my best guess is that your file in its original form is gone. However, there are ways to dump zsh's current configuration, which may help you rebuild it. This other questi...
Recover overwritten .zshrc with still-running zsh
1,459,885,916,000
I don't want to lose any data, so I'm asking if the solution Novell offers is safe to try. If not, are there safe alternatives? Step-by-tedious-step: I have two volume groups: main and Rand; Rand is what I boot from while main is an older group. main/home stopped mounting due to a possible bad superblock. (this erro...
pvcreate writes PV metadata onto the device/partition, I think most would call that "destructive" however, since it's part of the LVM planning and layout it's also "constructive". pvcreate could be destructive to data areas if any of the following parameters were changed to increase the metadata size or location. Depe...
Is pvcreate destructive? Attempting to recover an lvm2 volume group
1,459,885,916,000
The tar command just overwrote my file an hour ago while I was trying to make a tar to backup it. I ran tar zcvf foo.tex foo.bib and after that my tex source file lost. What's worse, this is the second time I lost my file in this way. I use gvim, but 'u' command can recover my file. After browsing some help entries ...
Add this to your .bash_login file. alias tar=tar --backup=simple This will append a ~ to the file it is about to overwrite. So when you create the archive it will always run tar --backup=simple zcvf foo.tex foo.bib and after execution a foo.tex~ will exist (this is the actual tex file and the archive will be in at ...
How to avoid overwriting existing files while using tar command?
1,459,885,916,000
Background I accidentally deleted an important python script, and so I ran the command sudo grep --binary-files=text --context=100 'unique string' /dev/sda1 > recover_file to search for it on my hard drive and save matches to ./recover_file. When I open ./recover_file in Vi ("Vi Unimproved", not Vim) I see that it is...
From looking at your script, you are dumping and try to edit, searching and line editing, binary files with the vi text editor. In that way, you will encounter a lot of control characters that will subvert the notion of lines, length of lines and in some stituations, even possibly the end-of-file. Since you are only i...
How to delete "undeletable" lines in Vi?
1,459,885,916,000
I have a Python daemon running on CentOS that opens a file at the beginning of a session, and keeps writing to it. A cronjob however, gzipped the file that was being written to, and so the file moved from log.txt to log.txt.gz. The daemon however kept writing to log.txt. The daemon then has been stopped and closed the...
AFAICT, no. The problem is that the gzip process will create a new file and will free the previous (the unzipped) one, including a removal from the directory. If no other hard-link in the filesystem is pointing to the file it will get lost once the last file descriptor refering to it is closed. For the future you'd be...
Recovering data written to file that moved
1,379,423,795,000
As far as I can tell from the manpage of ntfsundelete getting a file back is done with e.g. ntfsundelete /dev/sdb3 -u -m important.txt which would undelete the file in-place. If I don't want in-place mode I see this option -d, --destination DIR Destination directory but when I use it -d /tmp/win it thinks it is a r...
I found this blog with a title posted: ntfsundelete - Undeleting NTFS files, and the following example: $ sudo ntfsundelete /dev/sda2 -u -m '*.mp3' -p 100 -t 5m \ -d /media/externalExt3/undeleted Are you using sudo when you run your command?
How to use -d in ntfsundelete?
1,379,423,795,000
I found an old hard drive of mine yesterday and found that it fits into my current laptop. When I started it up, however, it got to the Win XP loading screen and then restarted. Then I thought, if I run some Linux distro off a flash drive, then maybe I could browse the hard drive somehow and recover as many files as ...
First, consider that the Windows install might be broken (rather than the hard drive) or just configured for a different set of hardware, thus Windows is rebooting (or BSOD'ing but set to automatically reboot) since it is not recognizing your machine's hardware. (Windows doesn't take too kindly to hardware changes) - ...
What tools can I use to recover files from an old harddrive?
1,379,423,795,000
I ran fdisk on the wrong HD. I basically cleared partition table, pressed w and quited fdisk and only then realized that that was my main harddrive... I got this message: WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table w...
fdisk just makes partitions; it's up to other things like your kernel command line and the contents of /etc/fstab to decide how to use them. When you told the installer that e.g. /dev/sdb5 was to be used as /home, it did a bunch of things to make that happen (set the partition table, format the partition, adjust fsta...
I ran fdisk on a wrong drive. How can I recover
1,379,423,795,000
I wanted to resize my LVM, followed some tutorial on the net and the system totally crashed (I got some boot error with UUID not found). I ran a LiveCD and tried to at least recover some files but I can't mount the drive. I did pvcreate with the missing UUID on /dev/sda1. When in most tutorials I should do vgchange -a...
After trying hundreds of different command line combinations I found a tutorial (originally targetting other problem) with gparted livecd. I booted it, then in terminal: testdisk Chose the first option, then chose: write It allowed me to mount the disk and recover the folder I needed.
Cannot mount LVMm: resume ioctl on failed
1,379,423,795,000
Yesterday I was trying using the Debian install in rescue mode in order to fix my Grub (The menu-item for Debian was suddenly gone). Now I wasn't able to fix it and didn't have a lot of time, so I thought I'd just reinstall Debian (I know, windows style :P). Problem was that I had installed Debian using full disk encr...
Gave up and formatted the drive containing the lvm as I was really in need of more space.
Recovering overwritten LVM metadata
1,379,423,795,000
I'm unable to mount my 300GB external (in external enclosure) HDD's single partition. None of the fsck tools add anything, they cannot even recognize the partition. I had forgotten whether I had used ext4 or reiserfs myself. The HDD seems ok. Testdisk saw a linux partition but didn't give any more details. Until ... I...
Recovering a damaged reiserfs partition can sometimes destroy the data you're trying to recover (I know, I've done it). So, first off, take a drive level image of the whole disk to something else. dd if=/dev/source of=/home/diskimage.img After you've got the disk image taken, then, and only then, try an fsck or other...
Recover a reiserfs hard disk
1,379,423,795,000
Short version: ext3 root filesystem on rackspace (xen) VM detects aborted journal on boot and mounts read-only. I've attempted to repair this from a rescue environment with tune2fs and e2fsck as prescribed in many articles I read, but the error continues to happen. UPDATE: So based on this article I added "barrier=0" ...
At this point I'm thinking this is very likely an instance of Debian Bug 637234. As this is a cloud VM, the hypervisor kernel is outside of my control. The workaround is using barrier=0 in /etc/fstab for the root filesystem. The long-term fix is to rebuild the box as a next-gen rackspace cloud instance instead of a fi...
ext3 root filesystems goes read-only with aborted journal even after repairs
1,379,423,795,000
I was trying to move my old 7z archive from an older ext4 partition to my current one, but in the process it randomly seems to have cancelled. Not only does the new location possess an incomplete archive, which cant be read, but the old location has a 7z.part file. Is it possible to somehow continue the moving process...
I think I have a hunch what had happened (based on your dmesg). What happened during your move is that your Dolphin has crashed during the moving process. Apr 29 23:14:28 frontear-net kernel: dolphin D 0 567940 1 0x00004084 Apr 29 23:14:28 frontear-net kernel: Call Trace: ... You have used some file...
Failed to move a 7z Archive, now it can’t be read, but there is a fragment left in the original location named .part
1,379,423,795,000
The Windows partition on my laptop seems to refuse to boot, and since I lack the original install CD, I was thinking of installing my preferred Linux distro, Arch on it. I want to recover data off the Windows hard drive (and onto my external) first before installing Arch, so I intend to use a Live CD to do so. Both t...
I use SystemRescueCd. It boots to a bash shell (where you can startx if you want) and can mount ntfs drives using ntfs-3g. It also includes a lot of rescue tools.
A Live CD distro for getting data off a NTFS partition without X Windows
1,379,423,795,000
I have a very strange case of DVD reading failure. It's a video DVD recorded a couple of years ago on a DVD-R disc. Two weeks ago our video DVD player would start having trouble reading parts of it. The problem was reproducible on two PCs, where only part of the videos could be played. Plus, current playing time and t...
Initial Disk Quality Since we're not talking about a hard drive here, which can be recovered, you're sadly experiencing the reality that most consumer grade DVDs are NOT reliable. A physical hard disk has magnetic charged particles in a solid surface, and recovery in worst case scenarios happens by taking the disk apa...
Recovery of damaged DVD yielding "no medium found" error
1,379,423,795,000
Suppose you have an ext3 partition which was unfortunately formated as ext4 partition (and where now are some but not a lot new files on it). Is there any way to recover (some) files from the old ext3 partition?
You can use a tool like PhotoRec to read the blocks and try to recover files. It actually recovers a lot of file types, not just images like the name may suggest. http://www.cgsecurity.org/wiki/PhotoRec
Recover formatted ext3 partition
1,379,423,795,000
All day today, I've been reformatting a USB flash drive repeatedly and I was doing this multiple times in a row, and I began to grow a little too careless... Without paying attention, I accidentally reformatted my /dev/sda1 in the GNOME Disks manager utility in Fedora. I didn't overwrite all the data with 0s, but inst...
You can try recover some files with the program testdisk. They have a good tutorial and in some Linux distros it's already included. If yours has it not, download from here.
Accidentally reformatted /dev/sda1
1,379,423,795,000
I have a four disk RAID 5 array that is in the process of failing hard. One disk is completely dead and smartctl is telling me that a second disk is failing. All the data on the RAID is backed up, however about 1 TB is non trivial to restore since it is ripped CDs and DVDs and I would have to rip them again. I have a ...
"Rebuilding" a newly added disk to a RAID array or accessing a degraded ARRAY are signicantly close in term of stress on the disks. The difference here is more about the size of the data to read: 6 GB against just 1 GB. I would advise you to copy all you can while you can on that spare disk. The worst case scenario be...
Recovering data from a failing RAID 5 setup
1,379,423,795,000
My laptop is failing, but I know for sure the hard drive is okay and fine. I want to take the data inside it, I connect my laptop's hard drive (open suse tumbleweed with btrfs filesystem) to my desktop pc (ubuntu 22.04.01 LTS with vfat filesystem), It could access the hard drive it show some linux system directory on ...
Here's your /etc/fstab recovered from /dev/sdd2 (from chat): UUID=a501872f-9564-4568-a942-8b913bb93166 / btrfs defaults 0 0 UUID=a501872f-9564-4568-a942-8b913bb93166 /var btrfs subvol=/@/var 0 0 UUID=a501872f-9564-4568-a942-8b913bb93166 /usr/local btrfs subvol=/@/usr/local 0 0 UUID=a501872f-9564-4568-a942-8b913bb93166...
how to access linux data from another machine physically?
1,379,423,795,000
I have a disk with a btrfs filesystem on top of bcache that was used in an old installation I no longer have (unintentionally nuked). When I plug in the drive, /dev/bcache0 doesn't show up and I'm not allowed to echo /dev/{dev} into /sys/fs/bcache/register to force it. I have the bcache module loaded, and when I try t...
Mounted the bcache partition to a loop device with sudo losetup -f /dev/[DEVICE] -o 8192 The bcache data is probably only 1KiB or less, but the offset needs to align with the sector size of the disk, in this case 8KiB. This worked perfectly and I've been transferring files to a stable storage pool overnight. If anyone...
Getting files off bcache disk from different computer
1,379,423,795,000
I hadn't sleep much. A bad script was creating a folder under somewhere/~ and I tried to removed it with rm -rf ~. I Ctrl C quickly and I don't think I've lost much files. I get they are lost for good. Is there still a way to get a list of the files that got removed?
I Ctrl C quickly and I don't think I've lost much files. I get they are lost for good. Is there still a way to get a list of the files that got removed? There is no easy way to "list" what you have deleted. You could do an extundelete /dev/home_partition(sdx) --restore-all to try to recover your data, or follow this...
Get list of files deleted by rm -rf
1,379,423,795,000
I know there are similar questions to this but none specific to RAID 10 extracted from a NAS, so any help is greatly appreciated. So, basically the NAS is kaput but the drives are ok. Following the advice of the Seagate tech who basically said that replacing the NAS would format the drives upon start-up I want to conn...
The horror stories are from people running mdadm --create because they want to “create” a new array using existing array components. What --create does is to create a new, empty array, using existing disks or partitions (and overwriting what they used to contain). Each volume in an array contains a header which includ...
Data Recovery from a 4-Disk NAS RAID 10
1,379,423,795,000
I have a 1.5 TB partition of data, of which I accidentally overwrote some bytes at the beginning, due to a typo like: ssh somewhere command | dd of=/dev/sda3 // should have used quotes here, dd was executed locally by mistake! /dev/sda3 holds a LUKS container for the 1.5 TB ext4 partition with important data. Whe...
First: run dmsetup table --showkeys. Save the output of that somewhere safe—that big long hex string it shows is the actual encryption key (master key) used to secure your data. LUKS works by (simplification here) encrypting that key with your passphrase(s), so keep in mind that compromise of that key means game over—...
Recover LUKS partition after overwriting first few bytes of LUKS container? System still up!
1,379,423,795,000
I've damaged the drive I had in my Windows laptop and now I want to try to recover as many files as possible. I know very little about Linux though. I have Ubuntu 10.04 on another machine. I have a docking station for the drive and it is connected to my Linux machine. The drive appears in disk utility. Unfortunately, ...
Data recovery is a tricky thing, and more suited to a few books than a USE answer. There are lots of myths, legends and voodoo recipes out there. :) If the disk appears to be talking on the bus, perhaps you can get some of the data. Look up GNU ddrescue. It does block-level rescue of a disk or individual partitions. T...
Commands to access a SATA drive
1,379,423,795,000
Is there a piece of Linux software that does what GraphClick does in Mac OS X? That is, is there a Linux software that "is a graph digitizer software which allows to automatically retrieve the original (x,y)-data from the image of a scanned graph"?
You can use g3data in conjunction with Gnuplot.
Linux equivalent of GraphClick?
1,379,423,795,000
I ran sudo -u postgres psql -c "show data_directory" and it shows /var/lib/postgresql/9.5/main. If I understand correctly, this is the directory that stores the database files. I ran sudo apt-get purge postgr*. Did this remove the database files? Running sudo apt-file list postgresql did not show /var/lib/postgresql i...
The Debian packages of PostgreSQL before version 11 delete clusters when the server package is removed; so purging postgresql-9.5 in your case would have deleted the database. (See the posgresql-9.6 postrm for the gory details.) You’re not the first person to be surprised by this; bug #911940 requested that the data b...
Does 'sudo apt-get purge postgr*' remove database files?
1,379,423,795,000
I was trying to resize my LUKS crypt following this https://wiki.archlinux.org/index.php/Resizing_LVM-on-LUKS and I got to the partition resize with parted and seriously screwed things up. I typed 870 as the new size and forgot to put a G on the end. It shrunk my partition down to 870M I immediately resized it to 870G...
You can't fix LVM by growing size back to original size, unless you were very lucky and the LV had no fragmentation whatsoever due to previous resizes. Chances are the new LV will have the first 20G or so of your original filesystem but the remaining 780G (or whatever) are scrambled eggs (wrong data, wrong offset, wro...
LVM Filesystem recovery
1,379,423,795,000
For the tl;dr, skip to the bottom. I have a dual-boot setup with Mac OS X at the beginning of my drive and three GNU/Linux partitions at the end of the drive. I don't have the relevant machine on hand to give an fdisk dump, but here's a rough overview of the original disk layout: /dev/sda1: EFI System Partition /dev/s...
LUKS has a distinct header, you could find possible offsets with grep: # grep -a -b --only-matching 'LUKS' /dev/sda5 1832480940:LUKS 1959072314:LUKS 2019974297:LUKS For each possible offset you find, you could create a loop device and see if it's a valid LUKS device or not: # losetup --find --show --offset 1832480940...
How can move a LUKS container from the middle of a partition to the beginning?
1,379,423,795,000
I had a RAID 1 on my server, and apparently both of hard drives have failed at the same time. Server support did a quick check to confirm that HDDTEST-W1F21M6K ERROR Finished (Selftest, Device: sda); HDDTEST-W1F22Y9M ERROR Finished (Values-Check, Device: sdb); However, there still seems to be a partition t...
OK, it'd appear that /dev/sda is very dead, and you're not going to get data off it, at least not without tricks. /dev/sdb on the other hand just seems to have a lot of bad sectors. That's probably a bad sign for it, but you should be able to get your data off. Depending on how important the data is and how confident ...
Recover data from raid 1 when both drives are faulty
1,584,112,268,000
I have a 128 GB Micro SD Card that I formatted as ext4 and used in a Chromebook for an Ubuntu Chroot Environment. I used it for quite some time that way. At some point, I either deleted everything off of it or formatted it using the Chromebook's simple formatting system. After this, I stuck it in a GoPro Hero Session,...
Running testdisk on the ddrescue image as per the instructions in this guide, I was able to recover all files. The initial quickscan did not detect anything useful, but after the quickscan, a deepscan option is available. Deepscan detected three partition file systems- ext4, exFAT, exFAT ext4 was labeled Linux. I di...
SD Card Recovery without data loss or corruption
1,584,112,268,000
This is actually a ctf game: Enigma 2017 practice at hackcenter.com We have to recover a deleted file on ext3. I am following this tutorial. The inode is 1036. istat gives Group 0 fsstat undelete.img Group: 0: Inode Range: 1 - 1280 ... Inode Table: 24 - 183 ... From here the node table has a size of 160 bloc...
You conveniently forgot to mention the URL of the filesystem image, but after registering on hackcenter.com it wasn't that hard to find. (I'm not going to repeat the URL here). Instead of blindly following a recipe, let's look at the image and figure out what happens. fls shows that there's lots of files named filler-...
Recovering a file on ext3
1,584,112,268,000
I recently moved my Kubuntu 12.04 workstation to a new location. It was shutdown normally but when I rebooted it in its new home the RAID-1 array /dev/md0 was GONE! The Elements of the array are listed as spares ?(!) Contained on the RAID-1 Array /dev/md0 were only the critical files and the OS is on its own HDD. Bo...
It seems the RAID metadata got damaged somehow. How did that happen? Once you've fixed any misconfigurations, errant scripts, hardware problems, etc., try to mount read-only: mkdir /mnt/{sdb1,sdc1} mount -o ro,loop,offset=$((2048*512)) /dev/sdb1 /mnt/sdb1 mount -o ro,loop,offset=$((2048*512)) /dev/sdc1 /mnt/sdc1 See ...
RAID-1 doesn't Assemble, elements listed as SPARE, how to recover?
1,584,112,268,000
I wanted to make a bootable USB stick from a Knoppix.iso on GNU/Linux with dd. Situation: Laptop with Linux Mint on it HDD mounted to system (.iso file on it) 1TB HDD (800 GB used) USB stick mounted on system (to make bootable) command used: $ sudo dd if=/HDD/knoppix.iso of=/dev/sdb What happened: I accidently typed...
The good news is that the knoppix iso is relatively small compared to your drive size so even with the 1-2 minutes (an eternity in computer terms) only about 1% of your drive is overwritten, and most of your data is not wiped. If it were wiped, then even trying recovery would be almost impossible without huge cost. Be...
Recover data from HDD
1,584,112,268,000
When you rm a file it will call unlink(), and unlink() will remove the file from the Directory entry and its inode is freed. But, the actual content of the file is still in the disk. Is there any way to get back the file again i.e add it back to directory entry ?
The process will depend on what type of files you have (image, text file, etc.) and what file system is in use. This page of the Arch Wiki has some good places to start. It specifically mentions Foremost, Extundelete, Testdisk, and PhotoRec as some programs to look at. One method mentioned that may be of interest to y...
How to link the unlinked files?
1,584,112,268,000
I have had a situation where I am moving data into a new zfs raidz pool with four devices, some of them virtual to facilitate the migration. The system completely hung in the middle of a device replace of a file based device to a physical device. The system did not even respond to SysRq and had to be reset physically...
Having not inspected the code, this is just speculation, but I'd say "no". ZFS raidz is roughly equivalent to RAID-5, and any competent implementation of RAID-5 will stop a repair when it loses two drives. That's the key right there: you lost two drives. That will kill any single-disk-redundancy system, whether ZFS r...
Can zfs resilvering destroy data with misreported device failures?
1,584,112,268,000
I am running a Zyxxel NAS540 with 4x4TB Hard Drives. A few days ago the NAS started beeping and I saw that the RAID is in a degraded state. Since one of the drives had really bad SMART values, I shut the NAS down, ordered a replacement disk, inserted it and started the repair process via web interface. After a few day...
As stated in the edits i solved my problem by running the mdadm --create command again with the correct data offset. My raid became readable again. Since i already ran the restauration on my new disk3, i was able to run the command as stated in my OP, but assuming you would be in the initial position of the failure yo...
RAID5 repair froze on NAS, trying to restore with mdadm now
1,584,112,268,000
I have heard if you don't make partitions in linux, it is so hard to recover the data. And if you make few partitions it would be easy to recover the data. for example if you make /par1 /part2 /part3 it is better for recovery. But now some of my friends tell me that /home/user/{all data here} has no difference with ma...
To illustrate the question in a simple and efficient manner, consider two scenarios: You install your favourite linux distribution on entire disk i.e. without any partitions: Suppose your system is crashed because operating system is unable to access some sectors and unable to boot. You lost some chunk of data due to...
Why creating partitions in linux is a good solution for easy recovery?
1,584,112,268,000
I'm interested in accurately removing a git repository in a reasonable time. But it takes quite a while to do so. Here, I have a small test repo where the .git folder is < 5MiB. $ du -ac ~/tmp/.git | tail -1 4772 total $ find ~/tmp/.git -type f | wc -l 991 Using shred's default options, this takes quite long. In t...
Forget about shred, it spends a lot of time doing useless things and misses the essential. shred wipes files by making multiple passes of overwriting files with random data (a “Gutmann wipe”), because with the disk technologies of 20–30 years ago and some expensive laboratory equipment, it was possible (at least in th...
How can I shred a git repository, reasonably fast?
1,584,112,268,000
I made a backup of a directory with some directories inside, using rsync -aPv source/ dest. It did not output error messages, neither returned a failure status, and progressed through to the end. It copied every file from source into dest, or so have I thought. The problem is that only the files from the root of the s...
The output is exactly like what you get if you try to list a directory whose x permission bits are missing. Here's an example on how to reproduce the situation: $ cd /tmp $ mkdir dirperms $ cd dirperms $ touch foo bar baz $ mkdir zot $ cd .. $ chmod a-x dirperms $ cd dirperms bash: cd: dirperms: Permission denied $ ls...
File data lost after rsync copy
1,584,112,268,000
I have a failed harddrive with around 400 GB of data, of which approximately 50 GB need to be recovered. All the data is located in a specific directory (/Fotos2018/). The hard drive is a WD My Passport Essential WDBAAA5000ABK (500 GB, USB 2.0). It contained a FAT32 partition containing my data, as well as another par...
My working solution was to copy the contents of ddrescue's output file to a different physical hard drive (of equal or, preferably, larger size): # ddrescue -f defekt_wd.img /dev/sdb to_harddrive.log GNU ddrescue 1.19 Press Ctrl-C to interrupt rescued: 468428 MB, errsize: 0 B, current rate: 4653 kB/s i...
Get contents of ddrescue image file
1,584,112,268,000
I've just written over the wrong hard drive using the command: sudo sh -c 'pv /dev/sdb >/dev/sdc' How do I go about undoing this? I was creating the first even backup of the drive, and I backed up over the wrong drive... The drive which got written over also has no backups, I was going to backup that drive next. Bot...
If you do not have backups, your data wasn't important. It's gone. There is no undo. Especially not with encryption involved. something that produces output > /dev/somedisk overwrites data on the device. Whatever is overwritten can not be restored, so your only chance would be if you noticed and cancelled it right awa...
Backed up over wrong hard drive
1,584,112,268,000
My external HDD got broken. It was formatted with NTFS. In one of the files I had my login and password stored in plain text. Is there any possibility to find this password by looking for the username through all the blocks on the hard drive? Ontrack easy recovery found some files, but unfortunately it is not able t...
You can run strings as root on your filesystem: sudo strings -n 6 /dev/sda Adjust the number 6 to the minimum of the lengths of your login name and password (smaller number gives more stuff to wade through). You can store the output to a file and search through that, or directly pipe into grep with before and after ...
How to find password, knowing username on broken file system
1,584,112,268,000
I accidentally deleted the file .vimrc in my $HOME directory. I rebooted the system and accessed it as root. Then: $ sudo mount -o remount,ro /dev/sda5 $ sudo extundelete /dev/sda5 --restore-file /home/xralf/.vimrc The output of the command indicates that it failed to restore .vimrc file. Is the file already absolutel...
Most probably lost. During the reboot, your system would have written to disk many times. I know it's too late now, but the second you noticed you'd deleted the file you should have physically powered off the machine (not gracefully shut it down - pull the power cord). At that point you could have booted with a recov...
Failed to restore file with extundelete
1,584,112,268,000
I'm running Ubuntu 12.04, and recently tried to safely remove my external hard drive using the GUI, but the "Format" button was right next to the "Safely Remove" button. I stopped the format as soon as it started, but the hard drive won't mount now and I can't access any of the files. I tried to do a data rescue usi...
photorec, despite its name, can be used to recover all sorts of files from a reformatted drive, including documents, photos, movies, etc. You may have better luck than normal because the format wasn't complete. You'll need to have a different drive with at least as much free space as what you had used in your formatt...
Recover Partially Formatted Hard Drive
1,584,112,268,000
Here is what happened: I used the Laptop and accessed some data on my usb stick. Then I closed the Laptop putting the system into sleep mode. The USB-Stick was still plugged in. After the laptop was completely in sleep I removed the Stick (the light was off, so it must have been without power). I woke up the laptop to...
Before you do anything to the USB-stick, you should make an image of it: dd bs=4k of=stick.img if=/dev/disk/by-id/usb-JetFlash_Transcend_4GB_QTMFKJQQ-0\:0 Then you put your stick safely away and use the stick.img file to do your fiddling, instead of destroying more data. Are there important files on it? Check http://...
How to restore a Fat32 filesystem under Linux
1,584,112,268,000
By mistake, I deleted an lxc image file. The container is still running and the file is therefore not yet actually deleted until I stop the container. I'd like to avoid stopping the container as it is quite sensitive. I tried to find the deleted file with: for i in $(ls /proc/|grep '^[0-9]*$'); do ls -l /proc/$i/fd|gr...
[not a complete answer, but too long to put in a comment] You can find the inode of a (possibly deleted) backing file of a loop device with the LOOP_GET_STATUS or LOOP_GET_STATUS64 ioctls: it's the .lo_inode field of the loop_info and loop_info64 structs. As I wasn't able to find any command line utility exposing that...
Recover deleted but mounted loop file/filesystem
1,584,112,268,000
When recovering data from a formatted external hard disk with photorec command of the testdisk tool, if originally the hard disk had 2 partitions (NTFS and ext), does it make sense to run the command twice for each partition-filesystem type?
Although the official documentation states that "photorec ignores the filesystem", even if it was true (it's not), the partition could still play a role, moreso if it's not 4K-aligned. Consider "How PhotoRec works" PhotoRec first tries to find the data block (or cluster) size. If the file system is not corrupted, thi...
Is it convenient to run testdisk photorec command once for each original filesystem?
1,560,974,363,000
I had a folder deleted from a SMB share from a windows machine. Thanks to zero confirmation a whole folder was deleted. First ran photorec that pulled most of the files except 1, the very last file copied. Further testing with extundelete was able to pull the whole folder minus 4-5 files. However the single most impor...
See https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#The_Contents_of_inode.i_block The "File flags: 524288" is 0x80000 in hex, so it is the "extents" flag. So, although your extundelete interpreted the inode.i block as direct/indirect/double indirect/triple indirect block pointers, this is not correct. But we c...
Restoring via inode that's no longer in the journal?
1,560,974,363,000
I have a tar archive and I need to extract the contents of a directory into another directory. So for example the content may be located in /home/me/stuff/ and everything in the stuff folder should be extracted to /extract. So after the extract is complete everything that was in the archived /home/me/stuff/ folder is...
If I understand what you are asking, it looks like, with GNU tar, the following will do it: tar --extract --file in.tar --directory /extract /home/me/stuff --strip 3 Simulating with an archive that has the following contents: $ tar tf in.tar home/ home/me/ home/me/stuff/ home/me/stuff/b home/me/stuff/a home/foo And ...
Extracting the contents of a tar folder into a target directory
1,560,974,363,000
I have a recovered dir with mp3 and flac files. The names were lost. So all I got is a mess of around 30,000 files iwth names like f30818304.flac I played some and see that the tags in the files are intact. But the thing is, most of it I probably don't need. I just want to see if there's any rarities in those files. ...
With eyeD3 (source): sudo apt install eyed3 find /usr/audio/incoming -name '*.mp3' -exec eyeD3 -t 'New Title' '{}' \; -exec mv '{}' /usr/audio/complete \; -t STRING, --title=STRING Set the track title. Or for one folder just eyeD3 --rename '$artist - $album - $track:num - $title' *.mp3
How do I get song names and artists from mp3 files in a dir?
1,560,974,363,000
First time using ddrescue. 3Tb drive was showing errors and going offline (in windows only) so I've booted from a stick into systemrescuecd and used ddrescue -f /dev/sde /dev/sdb /mnt/rescue/mapfile (the mapfile is on a 3rd drive). I may have made a mistake here but wanted to get anything copying from the drive that ...
If target is same or larger it will work. You can check with: blockdev --getsize64 /dev/source /dev/target If it's smaller it will run out of space, but whether that matters depends how many bytes missing / and what's actually there. In hindsight I may have been better copying to an image (?) Image files have downs...
dd rescue to same model drive -will it fit
1,560,974,363,000
I have 40gb image split into 10 4gb files, then combined with dm-linear to create single 40gb drive. One file got damaged single 4kb sector. However when I'm copying data unsing either dd or ddrescue resulting file is 4kb smaller than original file. It results in VM boot failure due to invalid physical disk size. How ...
Use dd bs=4k conv=sync,noerror if=damaged_source_image of=destination_image With noerror, dd will continue after encountering a read error. With sync, the unread bytes (due to the read error) will be written as zeros. See this question for an extended discussion on this.
ddrescue image differs in size
1,560,974,363,000
I accidentally removed 2 or 3 partitions from my main disk (SSD) which were related to windows (I'm dual booting Mint and Win 10). I stopped myself as soon as I realized that I'm working on the wrong drive (I was trying to remove partitions from an internal HDD). The system is still running, how can I recover the part...
As long as you've only removed partitions, and not written anything to the space formerly taken by the partitions, you can re-created the partitions. Just take care to only re-create the partitions and not also create a filesystem on them or otherwise format them. You need to rewrite the partition table only. You can ...
Removed partitions from SSD
1,560,974,363,000
The following screenshot shows the current state of my hard disc. The unallocated part of the disc used to contain two operating systems: Windows and Ubuntu, in this order. Windows has been installed first. Ubuntu used Grub. I do not have information about specific partitioning. There was a home partition of Ubuntu...
Testdisk is your friend. A year ago, I fixed a broken MBR and faced exactly the same issue as yours (MBR's magic number got corrupted) with this tool. There are lots of live media containing it http://www.cgsecurity.org/wiki/TestDisk_Livecd. Once you fix your issue, I suggest you backup your partition table with sfdis...
How to recover the partition table (Windows, Ubuntu) of an unallocated disc?
1,560,974,363,000
I have dragged and dropped a large amount of data between two tabs of Thunar (XFCE 4.10) but accidentally clicked cancel during the process. The data have been removed from the source folder and are of course incomplete on the destination folder. The source and the destination folder are on the same partition (ext4) ...
Solution : Just reselect the remaining source from it's root folder, and then copy it in the destination, unless there are already folders with the same name. This will complete the copy and once finished you'll discover all your data is there. Explanation : When files/folders are moved using a GUI filemanager like Th...
How to recover data lost during aborted local drag and drop?
1,560,974,363,000
I have a situation. I was supposed to run tar -x to recover a tar file from a tape but I pressed "c" and forgot to put the tape on readonly. The file was on fsf position 23, but the tape had 27 files. I know that file 23 is lost but since I pressed ctrl+c to cancel the tar command, can I still hope to somehow recover ...
This question is completely device specific, depending on the drive hardware and its associated driver. When botching tape operations (like interrupting a write) you can easily make a non-readable symbol or even a non-readable stretch on the tape. You've already shown that your driver is not capable of reading past th...
recover partially overwritten tape from tar -c
1,560,974,363,000
I accidentally overwrote dag.repo by trying to add this [dag] name=DAG RPM Repository baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag gpgcheck=1 enabled=1 does anyone have the backup file for dag.repo which is found in /etc/yum.repos.d for centOS 5.8 or where can I download it?
The repo definition does not come with CentOS. But Dag's repo is mostly obsolete at this point; you should be using Repoforge instead.
dag.repo overwritten
1,560,974,363,000
I'm trying the preview release of Flash Player "Square" for Linux and noticed that video files are now being deleted from the /tmp/ folder. Yet the files are still in use (I can see them with lsof): chromium- 8948 user 25u REG 8,5 2599793 229908 /tmp/FlashXXStJt3K (deleted) Is there a way to pr...
I've never tried this before, but... There is a link to the file in /proc/8948/fd/. You can catenate the file as root (it's only readable as root), and pipe it to a new file. Whether the file is intact, I've not verified.
Prevent libflashplayer.so from deleting a file?
1,560,974,363,000
Brief context I have a QNAP TS-451. The NAS has failed, but I'm pretty sure the drives are still fine. I have a new QNAP TS-462 to try to replace it and I'd like to ensure my data is intact in the new system. Question How can I access the contents of the LVM when I cannot assemble the RAID? (more details to the ques...
# mdadm --assemble --readonly /dev/sdc3 mdadm: device /dev/sdc3 exists but is not an md array. Why??? :-( This is quite simply a wrong command; with mdadm, you assemble a /dev/md device, not a /dev/sd device. You can try: mdadm --assemble --run --readonly /dev/md42 /dev/sdc3 However, you already have an md device ...
Problems accessing files on a RAID1+LVM from failed QNAP
1,560,974,363,000
I've just run tar x by mistake instead of tar c, and overwrote my git repo with a few days older version. This will have left alone any files I had newly created though, including objects in .git. How can I recover as much as possible?
Make a copy of the whole mess first, just in case. git fsck will show dangling objects and commits. Find the newest dangling commit. I fed all the commit hashes to gitk, and it just shows the most "recent" one at the top. As well as only having a few commits to deal with, I only had a single branch to recover - thi...
Recover a git repo which was overwritten with an older version
1,560,974,363,000
I accidentally executed man ls > info.txt and now I don't know how to recover the contents of the file.
you've wrote the output of "man ls" command in a file that you called it "info.txt". If your info.txt file was empty, now easily you can delete your file and create new one by using these commands: #rm -f info.txt #vi info.txt (thenCtrl + X and press yes to save it.) Or: you can open info.txt file, and delete content...
How do I recover the contents of a file? [duplicate]
1,560,974,363,000
Some days ago I found that the partition related to my RAID 5 wasn't mounted. I examined my disks and I got: mdadm --examine /dev/sd{a,b,c,d}1 mdadm: No md superblock detected on /dev/sda1. /dev/sdb1: Magic : a92b4efc Version : 1.2 Feature Map : 0x0 Array UUID : 87fdc598:a995d0f7:41123bcf:e...
We need to split your problem into two: Rebuild the array for missing /dev/sda superblock. Handle the damaged data on /dev/sdc Rebuilding the array I presume that the 4kB block not recovered from /dev/sda was the superblock, because your partition started at 1MiB (2048 sectors), and the superblock started at +8 sect...
Recover software RAID5 data
1,560,974,363,000
I was trying to recover some deleted files form my CentOS 7 VM which is live. but I am getting the below error. while entering the command debugfs -w /dev/mapper/centos-root debugfs 1.42.9 (28-Dec-2013) /dev/mapper/centos-root: Bad magic number in super-block while opening filesystem Is there any way to recover the d...
Centos7 might have XFS as root partition instead of ext4, so debugfs won't work. Note that recovery chances are pretty slim if you haven't unmounted filesystem as soon as possible or made a dd(1) image of it to other place. Your best bet would be to try TestDisk and PhotoRec (recovers more than just photos, though): h...
Recover lost data CentOS 7
1,560,974,363,000
I am a bit confused about few things and I hope someone could clear this up for me. Is there any particular difference in disk to disk vs disk to image file approach? I executed following code to recover my dying 2TB USB drive: ddrescue --force --no-split /dev/sdc1 /dev/sdd1 ~/ddrescue.log I thought it will make an i...
The advantage of using disk to image is that it allows you do some surgery on the image later, without affecting an entire filesystem. This is why I always[1] rescue a drive to an image instead of a replacement drive. As for going directly between sdc1 to sdd1, I've always been reluctant when it comes to copying direc...
Recovering broken USB drive: ddrescue disk to disk vs disk to image?
1,560,974,363,000
I have a tar file that I have recreated from two files - xaa, xab (the results of using the split command). The tar file is the size I expect it to be but when I extract it the folder I get is a fraction of the size of the tar file. See the terminal output below for the sequence of my commands. Unfortunately I don't h...
The tar file is extracted until it finds the marker indicating the end of tar file: Physically, an archive consists of a series of file entries terminated by an end-of-archive entry, which consists of two 512 blocks of zero bytes from the tar file format description here. So your archive file probably has material aft...
Why is my tar file bigger than its contents?
1,560,974,363,000
I have a Linux raid (those md device), it only contains one drive, and it has a btrfs patition on it. I accidently do the following thing: fdisk /dev/md126 I didn't see the warning The old btrfs signature will be removed by a write command. Device does not contain a recognized partition table. Created a new DOS disk...
You don't have a partition table on that device. So trying to restore partitions (when you have none) is bound to fail. Writing a partition table onto a device that holds a filesystem, likely damages that filesystem. Trying to re-create your situation: # file -s /dev/md100 /dev/md100: BTRFS Filesystem sectorsize 4096,...
How do I recover the partition table on linux raid
1,560,974,363,000
I have a hard disk with an unfortunate unrecoverable sector in either the partition table or a superblock, which causes the disk firmware to lock up when that LBA is accessed. I'm interested in recovering data that's far away from the physically bad sectors, which I think I have a good chance of doing if I can instruc...
You'd have to remove the entire userland that does a plethora of automations (systemd, udev et al.), so build a minimal initramfs with busybox and ddrescue (or other tools you require) only. You can use this guide for reference: https://wiki.gentoo.org/wiki/Custom_Initramfs In addition to that, you'd have to compile a...
How can I force Linux to not attempt *any* automatic reads to a physical hard disk?
1,560,974,363,000
I used ddrescue yesterday hopefully to retrieve 1:1 copy and stored it as an image on a new drive. Suppose I read backwards, because I knew, that there is a bad cluster at the beginning of the failing drive, i.e. with -R switch, from man page: -R --reverse Reverse the direction of all passes (copying, trimming, scra...
Yes, it is possible. You need to modify the mapfile's line: 0x1375BC000 0x00001000 - to contain question mark at the end like so: 0x1375BC000 0x00001000 ? Now you are ready to restart the recovery process, you just need to add the retry option there: -r n --retry-passes=n Exit after the given number of retry ...
ddrescue: How to retry for 1 bad block after all other data is safely stored?
1,515,038,215,000
I've got a RAID problem. I had a RAID6 array on 4 drives - /dev/sd[bcde]. Working fine. I then added a 5th member - /dev/sda. Working fine. Please note: I didn't have partitions on the drives, just used "bare metal" to create the RAID. I then had an unexpected reboot and the RAID volume is not assembling at a...
After hours of of having the same issue i solved it. What I would recommend is: Move everything off the raid if possible If the array is currently active run mdadm --stop /dev/md0 Zero out those disks: dd if=/dev/zero of=/dev/sd[abce] bs=1M count=100 Create partitions on sda, sdb, sdc, & sde that span 99% of the disk...
Linux RAID array not assembling after reboot
1,515,038,215,000
I had Ubuntu and Windows installed on this 480Gb drive (on my laptop) and decided I'd like to try Linux Mint. One of the options given in the Linux Mint installation Wizard was to delete Ubuntu 15.04 and install Linux Mint in its place. During the installation, an error occurred and I had to hard restart my laptop. ...
If you've only deleted the partition - you stand a better chance of getting your data back. See http://www.dedoimedo.com/computers/linux-data-recovery.html for exmaple. If you've overwritten data - not just changed your partition table you'll need to use a data carving tool such as scalpel. You'll get back bits and p...
Accidentally installed Linux Mint over Windows/Ubuntu. How do I recover data (SSD)?
1,515,038,215,000
I want to be able to use a CD/USB bootable "live" linux distribution to: read a truecrypt volume mount local drives Ubuntu Privacy Remix seemed perfect as it does include TrueCrypt, but it explicitly cannot see local drives (kernel source modified, as discussed here). I want to use this live CD/USB distribution for...
Any live distribution with cryptsetup should be able to read truecrypt volumes, and I thought they all could mount local drives (apparently you found one that can't). I know Linux Mint, Ubuntu, Debian, CrunchBang can, probably any Debian-derived distro, or Arch, or Red Hat, I think they all can install cryptsetup one ...
Live linux distribution that includes TrueCrypt, to be used for data recovery [closed]
1,515,038,215,000
I am trying to recover partitioning information using TestDisk. To try things out I copied all data from the original harddisc to another physical drive using dd as follows: $ dd if=/dev/sda of=/dev/sdb bs=4096 conv=notrunc,noerror,sync Running TestDisk on the original drive shows up like this: Disc /dev/sda - 500 GB...
Finally, I was able to reproduce the output of TestDisk on the second drive. I simply changed the geometry settings to the ones of the original drive. I did the following: Lookup the geometry settings of the original drive: $ sudo sfdisk -g /dev/sda /dev/sda: 969021 cyclinders, 16 heads, 63 sectors/track Open TestDis...
How to copy partioning information with dd?
1,515,038,215,000
Had a power outage two weeks ago on my BSD server that my UPS decided then was a good time to fail. Just fired it up this evening only to have the following errors show during what I would assume is the rebuild process. The port for the ECC error has shown up as either 2 or 1 in following errors, and while the rest o...
What you should do here is trigger a SMART self-test on the bad drive(s). That will pull a lot of the controller/motherboard pieces out of here and give you a better reading on the underlying disks having issues. It's possible for non-drive failure to give wrong results there--power supply failure is the most common...
Worrisome HD related messages after power outage