Friday, December 25, 2009

Copying data from an ext3 formatted external hard drive to an internal drive under Windows 7

Background:
My family has been using a Linksys NSLU2 (aka the Slug) network file storage device for a long time, and we've stored about 60GB of family pictures and videos on it. But we just bought a new laptop (Windows 7) for my wife and came to realization that she is the only one editing/viewing the pictures, and having them on the Slug was making her life a drag. By moving them to her laptop, she could get approx 3Gbps speed vs. 100Mbps max via the network with the Slug.

But how to do so? I attached the external drive from the Slug directly into her laptop and it wasn't mounted. After putting it back into the Slug, I discovered (remembered) that I had formatted it as an ext3 file system many years back.

Requirements: copy the pictures, folders, etc. Preserve timestamps.

Options:
1) Copy via network via Slug
2) Copy from drive directly
2a) Explore2fs tool
2b) Disk Internals Linux Reader
2c) ext2ifs driver

Option 1 seemed the most straightforward, but a quick test of a 3.6GB dir reminded me of something: my router/switch likes to crash at the worst times. It crashed after about 3GB of transfer. Also, the copy was not preserving timestamps but marking pictures as created today. That violated one of my requirements.

Option 2 seemed like a much better option, but how to do it? I Googled it a bunch, and found one nice article: Three Ways To Access Linux Partitions (ext2/ext3) From Windows On Dual-Boot Systems. They basically recommend Explore2fs, Disk Internals Linux Reader, and the ext2ifs file system driver.

Option 2a (Explore2fs): this worked ok, recognized my drive. But I had trouble with it stalling while copying from the drive to the laptop internal drive. I had to kill the program because it wouldn't do anything when pressing the "Cancel" button. I discovered later that this was probably an incompatibility with Windows 7. I ran it in Windows XP SP2 compatibility mode and this seemed to solve that problem. It copied my 3.6GB test folder in 15 minutes, but timestamps weren't being preserved on copy, so this option wasn't going to work.

Option 2b (Disk Internals Linux Reader): this has a nicer user interface than Explore2fs. It also preserved timestamps while copying! The problem I had with this was that it was sloooow. It took 1.5 hours to copy the 3.6GB test folder! That would mean around 30 hours to copy the full 60GB!

Option 2c (ext2ifs driver): I had been resisting this option for a while. Installing a driver on my wife's brand new laptop sounded like a risky way to crash it. But I had tried the other options and wasn't getting where I wanted.

The first problem I ran into was that it seems they haven't added Windows 7 support yet. The installer was giving me an error message: "This version of the software runs on Windows NT 4.0, Windows 2000, Windows XP, Windows 2003 and Windows Vista (for the x86 and x64 platform) only." I Googled the issue and found that other people were getting it to work. The issue was that t.ll problem.

Next problem: ext2ifs wouldn't mount the drive! I tried their mountdiag tool and found out that the ext3 file system still had journal entries (i.e. there were unwritten transactions... the file system had not been shut down properly). Strange, don't know if the Slug did that or one of the other apps. So I put the drive back into the Slug, powered on the Slug, let it boot, then powered it off. The Slug (with ext3 support) took care of the problem. Keep in mind that ext2ifs only supports ext2. Ext3 is backwards compatible with ext2, but only if the journaling system doesn't have any outstanding entries.

After that, the tool worked fine. I mapped the ext3 partition as F: and copied my 3.6GB test directory in about 3 minutes, and it preserved the timestamps! I did the full copy, and it took about 45 minutes to copy 60GB. I was also happy that ext2ifs allowed me to install it in read-only mode, so I wouldn't have the possibility of messing up the data on the drive.

No comments:

Post a Comment