Fix ext2 magic

From NAS-Central Buffalo - The Linkstation Wiki
Revision as of 00:08, 8 September 2008 by Davy gravy (Talk | contribs)

Jump to: navigation, search
Nuvola apps important.png 
WARNING!

Ensure you only run the tool on the right partition(s) which really need to be fixed.

Also, only use fix_ext2_magic on stock partitions for the LS1, LS2, LS-HG and LS-HS.

Do not use on LSPro or later models.


Background

fix_ext2_magic is a tool which corrects the LinkStation file system magic number.

In order to thwart hacking the LinkStation Buffalo decided to fiddle with the identifier (magic number) which identify the type of the file system on the hard disk partitions. Of course that didn't really thwart hacking :-), but creates a useless minor annoyance when someone wants to access the data on an LS hard drive on a normal Linux system.

The LS uses the common Linux file system ext2. However Buffalo swapped the bytes of the magic number. The file system driver on the LinkStation has been altered by Buffalo to deal with the mangled magic number, while of course this hasn't happen on normal Linux Systems. So when someone tries to connect the hard disk to a normal Linux system a normal Linux can't identify the file system and can't mount it.

This is where fix_ext2_magic comes into play. It replaces the magic number of a partition to the correct ext2 value. After this had been done, the partition can be mounted normally on any Linux system.

Download

Download fix_ext2_magic

Usage

After unpacking the tool is run by specifying the partition which should be fixed:

./fix_ext2_magic --fix /dev/hd=

Where = stands for the partition which should be fixed. For example, a1 or a4.

NOTE: The exact partition to fix depends on how the drive is physically connected (to which IDE controller). Do not just use the partitions as given in the example. You are supposed to know what you are doing before running fix_ext2_magic.

CAUTION: Use only on stock IDE partitions that are created by the LSUpdater.exe program. Do not use on LSPro partitions.