Recovering your data out of a dead EDmini for dummies

Ethernet disk mini & Ethernet disk mini home edition
Post Reply
linuxdisliker
Posts: 6
Joined: Sat Mar 20, 2010 7:04 pm

Recovering your data out of a dead EDmini for dummies

Post by linuxdisliker » Sat Mar 20, 2010 7:10 pm

Hello,

my ED Mini 250GB crashed 3 weeks ago. The disk was fine, but the circuitry died on overheating. I didn't care about the hardware, it was old enough, but I wanted my data back. Google brought me here and in a thread I cannot find right now (otherwise I would post it there) I found some people with the same problem who got stuck at some point.

After some trial and error I found the way to see my data again. I know most of the following is trivial to all Linux gurus around, but I am not one of them, and three weeks ago I wished badly I had found the following howto:

1) Take the hard disk out of the enclosure and connect it directly to your computer with a USB-IDE cable

2) Start your computer running some Linux Live-CD like Knoppix and open a xterm window

3) Execute the following command:

>fdisk -ul

That will result in a list of all disks connected to your computer and their partitions, including the sector number at which they start. Among others you will see:

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 63 498014 248976 5 Extended
/dev/sdb2 498015 771119 136552+ c W95 FAT32 (LBA)
/dev/sdb3 771120 488397167 243813024 c W95 FAT32 (LBA)
/dev/sdb5 126 257039 128457 82 Linux swap
/dev/sdb6 257103 273104 8001 83 Linux
/dev/sdb7 273168 481949 104391 83 Linux
/dev/sdb8 482013 498014 8001 83 Linux

Regarding their size, you can tell /dev/sdb3 is the partition we need to mount.

4) >cd /home

5) >mkdir test

6) The user data are mounted in the ED mini via a loop device, so we first have to find the first loop device available

>losetup -f
/dev/loop11

7) and then mount /dev/sdb3 on it. For that we need the offset (number of bytes from the start). Since we know a sector has 512 bytes, lets try with 771120*512 = 394813440

>losetup /dev/loop11 /dev/sdb3 -o 394813440

8) and then mount the loop device on our test folder

>mount -t vfat /dev/loop11 /home/test
mount: wrong fs type, bad option, bad superblock on /dev/loop11,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

9) that was not the right offset, so we must try all possible offset values. Detach the loop device

>losetup -d /dev/loop11

10) and repeat steps 7) and 8). Fortunately, the first possible offset (63*512 = 32256) is the right one.

>losetup /dev/loop11 /dev/sdb3 -o 32256

>mount -t vfat /dev/loop11 /home/test

>ls test
films/ mp3s/ photos/ tools/

Voilà!

Mijzelf
Posts: 6226
Joined: Mon Jun 16, 2008 10:45 am

Re: Recovering your data out of a dead EDmini for dummies

Post by Mijzelf » Sun Mar 21, 2010 12:25 pm

Nice story! I'd like to add some background for future readers.

Normally you would be able to mount /dev/sdb3 directly, but because the EDmini can both share it's contents via USB and network, /dev/sdb3 contains the image which is exposed via USB. This means that it starts with a partition table, instead of the expected partition data.
Knowing this, you don't have to guess for the right offset of the embedded partition, just read the partition table:

losetup /dev/loop1 /dev/sdb3
fdisk -lu /dev/loop1

This should show something like this:
Disk /dev/loop1: 249 GB, 249664536576 bytes
255 heads, 63 sectors/track, 30281 cylinders, total 487626048 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xb341b341

Device Boot Start End Blocks Id System
/dev/loop1p1 63 487626047 487625984+ c W95 FAT32 (LBA)

The offset is Start(63) * Unit(512) = 32256

Now use the right offset:
losetup -d /dev/loop1 # unlink /dev/loop1 for reuse
losetup /dev/loop1 /dev/sdb3 -o 32256
mount /dev/loop1 /home/test

Of course you can mount other embedded partitions the same way, when you did repartition the disk via USB.

pamatt
Posts: 2
Joined: Fri Feb 11, 2011 10:05 pm

Re: Recovering your data out of a dead EDmini for dummies

Post by pamatt » Fri Feb 11, 2011 10:12 pm

Hello,
Take the hard disk out of the enclosure and connect it directly to your computer with a USB-IDE cable
Is there a way to connect to the EDmini to my laptop using the ethernet port on the Mini, as opposed to pulling the drive and connecting via a USB-IDE cable? I can't seem to "see" the Lacie drive from Ubuntu when connecting via an ethernet crossover connector? Just trying to make due with available hardware components tonight. I'm a newbie hack trying to recover 500 GB of music on my "dead" Lacie drive.

Thanks in advance.
Matt

Mijzelf
Posts: 6226
Joined: Mon Jun 16, 2008 10:45 am

Re: Recovering your data out of a dead EDmini for dummies

Post by Mijzelf » Sat Feb 12, 2011 7:16 am

No. the ethernet port is a 'high level' port which needs the NAS OS to be running to do anything with it. So when your NAS is dead, the ethernet port is dead too.

pamatt
Posts: 2
Joined: Fri Feb 11, 2011 10:05 pm

Re: Recovering your data out of a dead EDmini for dummies

Post by pamatt » Sat Feb 12, 2011 5:45 pm

Thanks....looks like its out to scrounge up the connector cable. Appreciate the prompt feedback.

tramsey
Posts: 4
Joined: Mon Mar 19, 2012 7:45 pm

Re: Recovering your data out of a dead EDmini for dummies

Post by tramsey » Mon Mar 19, 2012 7:57 pm

Here is the information for my system. I am trying to recover data from a fail Lacie NAS.
I have placed the 1TB drive into a PC running Ubuntu 11 from the 80GB HD. I was able to get the family shared files as they were not locked folders. However all the others I need to pull data from are.

When I try these steps above I get different errors.

So I am a complete noob when it comes to linux systems. I know very little and need some assistance on this please.

root@tony-HP-Compaq-dc7700-Small-Form-Factor:~# fdisk -ul

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00019ea2

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 150155263 75076608 83 Linux
/dev/sda2 150157310 156301311 3072001 5 Extended
/dev/sda5 150157312 156301311 3072000 82 Linux swap / Solaris

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0004ee11

Device Boot Start End Blocks Id System
/dev/sdb1 * 63 6136829 3068383+ 83 Linux
/dev/sdb2 6136830 7197119 530145 82 Linux swap / Solaris
/dev/sdb3 7197120 1953423674 973113277+ 83 Linux
/dev/sdb4 1953423675 1953520064 48195 5 Extended
/dev/sdb5 1953423738 1953471869 24066 83 Linux
/dev/sdb6 1953471933 1953487934 8001 83 Linux
/dev/sdb7 1953487998 1953520064 16033+ 83 Linux
root@tony-HP-Compaq-dc7700-Small-Form-Factor:~#

root@tony-HP-Compaq-dc7700-Small-Form-Factor:~# losetup -f
/dev/loop0

root@tony-HP-Compaq-dc7700-Small-Form-Factor:~# mount -t linux /dev/loop0 /home/test
mount: unknown filesystem type 'linux'

Mijzelf
Posts: 6226
Joined: Mon Jun 16, 2008 10:45 am

Re: Recovering your data out of a dead EDmini for dummies

Post by Mijzelf » Mon Mar 19, 2012 9:08 pm

losetup /dev/loop1 /dev/sdb3
fdisk -lu /dev/loop1

This should show something like this:
Disk /dev/loop1: 249 GB, 249664536576 bytes
255 heads, 63 sectors/track, 30281 cylinders, total 487626048 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xb341b341

Device Boot Start End Blocks Id System
/dev/loop1p1 63 487626047 487625984+ c W95 FAT32 (LBA)


The offset is Start(63) * Unit(512) = 32256

Now use the right offset:
losetup -d /dev/loop1 # unlink /dev/loop1 for reuse
losetup /dev/loop1 /dev/sdb3 -o 32256
mount /dev/loop1 /home/test

tramsey
Posts: 4
Joined: Mon Mar 19, 2012 7:45 pm

Re: Recovering your data out of a dead EDmini for dummies

Post by tramsey » Mon Mar 19, 2012 9:32 pm

tony@tony-HP-Compaq-dc7700-Small-Form-Factor:~$ sudo /bin/bash
[sudo] password for tony:
root@tony-HP-Compaq-dc7700-Small-Form-Factor:~# losetup /dev/loop1 /dev/sdb3
root@tony-HP-Compaq-dc7700-Small-Form-Factor:~# fdisk -lu /dev/loop1

Disk /dev/loop1: 996.5 GB, 996467996160 bytes
255 heads, 63 sectors/track, 121147 cylinders, total 1946226555 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/loop1 doesn't contain a valid partition table
root@tony-HP-Compaq-dc7700-Small-Form-Factor:~#

root@tony-HP-Compaq-dc7700-Small-Form-Factor:~# fdisk -ul

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00019ea2

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 150155263 75076608 83 Linux
/dev/sda2 150157310 156301311 3072001 5 Extended
/dev/sda5 150157312 156301311 3072000 82 Linux swap / Solaris

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0004ee11

Device Boot Start End Blocks Id System
/dev/sdb1 * 63 6136829 3068383+ 83 Linux
/dev/sdb2 6136830 7197119 530145 82 Linux swap / Solaris
/dev/sdb3 7197120 1953423674 973113277+ 83 Linux
/dev/sdb4 1953423675 1953520064 48195 5 Extended
/dev/sdb5 1953423738 1953471869 24066 83 Linux
/dev/sdb6 1953471933 1953487934 8001 83 Linux
/dev/sdb7 1953487998 1953520064 16033+ 83 Linux
root@tony-HP-Compaq-dc7700-Small-Form-Factor:~#

my problem is, in the gui I can mount the drive, however it will not allow me to change teh permissions or ownership so I can open the folders and copy my data off of it.

tramsey
Posts: 4
Joined: Mon Mar 19, 2012 7:45 pm

Re: Recovering your data out of a dead EDmini for dummies

Post by tramsey » Mon Mar 19, 2012 11:19 pm

root@tony-HP-Compaq-dc7700-Small-Form-Factor:~/1tbmnt# sudo mount /dev/sdb3 /home/tony/1tbmnt

I can make it mount this way, however I am still have not figured out how to edit permissions

tramsey
Posts: 4
Joined: Mon Mar 19, 2012 7:45 pm

Re: Recovering your data out of a dead EDmini for dummies

Post by tramsey » Mon Mar 19, 2012 11:52 pm

root@tony-HP-Compaq-dc7700-Small-Form-Factor:~# chown -R tony:tony 1tbmnt
root@tony-HP-Compaq-dc7700-Small-Form-Factor:~# ls

Finally, this was the command I was missing. simple yes I know, difficult for a never used linux but once or twice in my 20 + years working with computers.

What a crash course this was. reminds me of when I was learning DOS MSDOS and then windows fun times.

Mijzelf
Posts: 6226
Joined: Mon Jun 16, 2008 10:45 am

Re: Recovering your data out of a dead EDmini for dummies

Post by Mijzelf » Tue Mar 20, 2012 8:47 am

Glad you sorted it. Are you sure you have an EDmini? Your partition 3 doesn't seem to have a partition table. fdisk doesn't see it, and your Linux box mounted the partition without problems.
Does (did) the box showup as a mass-storage device when connected via USB?

Post Reply