# Mounting ext2fs USB-drive fails. "wrong magic number"



## Nordmann (May 10, 2010)

Hiyas

I had a dedicated linux box (opensuse) serving as a samba/http/ftp server, holding 4TB of data on a software raid array. I've always felt that the box was sluggish so I decided I wanted to change the system..

Long story short, I copied all my data to external USB hard drives formatted as ext2, installed FreeBSD 8.0 RELEASE, got everything I want set up and working perfectly and now I can't make FreeBSD see my USB drive. :\

dmesg when I plug in the USB drive

```
ugen3.2: <Sunplus Technology Inc.> at usbus3
umass0: <Bulk Only Interface> on usbus3
umass0:  SCSI over Bulk-Only; quirks = 0x4000
umass0:0:0:-1: Attached to scbus0
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <ST350032 0AS > Fixed Direct Access SCSI-2 device 
da0: 40.000MB/s transfers
da0: 476940MB (976773168 512 byte sectors: 255H 63S/T 60801C)
```

entering 'mount -t ext2fs /dev/da0s1 /mnt/usb' fails and this line pops up in dmesg


```
ext2fs: da0s1: wrong magic number 0x10 (expected 0xef53)
```

why does this happen, and what can I do to fix this?


----------



## vermaden (May 10, 2010)

FreeBSD supports ext2 filesystem with 128 inode size, there are some patches to extend that support to filesystems created with inode size 256 (but now there is also possibility for 512 inode size filesystems, thanks goes to Linux community ...).

So you will have to check the inode size of that ext2 filesystem:0

`% tune2fs -l /dev/${DISK} | grep -i 'inode size'
Inode size:               128`

Such filesystem can be created that way (same in FreeBSD/Linux):
`# mkfs.ext2 -I 128 /dev/md1`

tune2fs is part of *e2fsprogs* package:
`% pkg_info -L -x e2fsprogs | grep tune2fs
/usr/local/man/man8/tune2fs.8.gz
/usr/local/sbin/tune2fs`


----------



## Nordmann (May 10, 2010)

I see.

Is the same problem that ext2ifs for windows has then, it can't read disks with more inodes than 128.. and thus I can not just install that and transfer the files over ethernet from my windows machine.

You mentioned patches?
is there a way I can make the FreeBSD box read the disks?
I'm currently trying to move the data across ethernet through my netbook running a ubuntu live CD. 4TB at 7.9MB/s is gonna take a while, don't ask why, it just is  :O

So I'm open for suggestions..


----------



## vermaden (May 10, 2010)

Nordmann said:
			
		

> You mentioned patches?
> is there a way I can make the FreeBSD box read the disks?



You can use PATCH from here for example:
http://linux-bsd-sharing.blogspot.com/2009/09/howto-mount-ext2fs-partitions-with.html

Generally google for these keywords: *256 inode patch ext2fs freebsd*


----------

