2

The debugfs manpage gives the impression that the command 'rdump . .' will recursively copy all files found on the specified filesystem from the debugfs cwd to the native filesystem's cwd. Instead I seem to receive a syntax error, and no copy is initiated?

These are the commands I run:

cd /path/to/transfer/destination
debugfs /dev/sda1 -R rdump . .

My task is to copy the entire contents of a clean yet unmountable USB storage device to its host machine's HD. The host machine does not support the inode size used by the USB device's filesystem (256) and its software is not upgradeable, so my intention was to use debugfs to transfer the files. If anyone has any other suggestions for this task I'd be grateful.

tjbp
  • 193
  • 3
  • 6

2 Answers2

0

I don't see the reference to current working directory in the man page for the version I have. The cwd (pwd) is significant in the shell and has no meaning to a device (unlike Windows where each drive has a cwd). I would recommend trying to completely specify both the source and destination directories. Why not use tar or dd or rsync?

Dennis Williamson
  • 60,515
  • 14
  • 113
  • 148
  • I assumed the "." would be effective since "ls -l" within debugfs gives me a file listing including "." and ".." , both of which return the device's root directory contents if used in conjunction with ls. I can specify each directory in the device's root explicitly and it copies all content recursively, but I was hoping to come up with a solution that requires less input. I couldn't find any documentation on using tar, dd or rsync for the purpose of my task? Thanks for the reply! – tjbp Jun 18 '10 at 08:35
  • dd is the way to go if you cannot mount the partition first. – Warner Jun 18 '10 at 13:22
0

How about this?

debugfs /dev/sda1 -R "rdump / /path/to/transfer/destination"

I haven't tested that, as I don't have something to test it on, but TFM seems to imply this is more correct. Actually, you might want to swap arguments around to better match what the man page suggests:

debugfs -R "rdump / /path/to/transfer/destination" /dev/sda1

I don't know if that matters, but it could.

Bill Weiss
  • 10,782
  • 3
  • 37
  • 65
  • Quoting http://ram.kossboss.com/how-to-use-debugfs-to-recover-curropt-ext2ext3ext4-volume/ "If your wondering is there a way to do “ rdump / . ” The answer is no. Thats a lack of the program, so you have to rdump every folder and file on the root one by one as already explained above" –  Dec 21 '15 at 16:52