Difference between revisions of "Fix ext2 magic"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
(Added fixback option in v1.2)
 
(11 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Warning|Ensure you only run the tool on the right partition(s) which really need to be fixed.}}
+
{{Template:Articles|Rescue-Backup|General|Hardware}}
 
+
{{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.
 
'''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.
+
In order to thwart hacking the LinkStation [[w:Melco|Buffalo]] decided to fiddle with the identifier (''[[w:Magic number (programming)|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 [[w:Linux|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.
+
The LS uses the common Linux file system ''[[w:ext2|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.
+
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.
  
fix_ext2_magic can be downloaded from the download area:  
+
==Download==
 +
Download  [http://downloads.nas-central.org/PlatformSupport/i386/ fix_ext2_magic ]
  
* For Intel Linux http://downloads.linkstationwiki.net/software/fix_ext2_magic_i386-1.1.tar.gz
+
==Usage==
* For PPC (to execute on the [[LS1]] itself http://downloads.linkstationwiki.net/software/fix_ext2_magic_powerpc-1.1.tar.gz
+
After unpacking the tool is run by specifying the partition which should be fixed to have a standard ext2 magic number:
 
+
After unpacking the tool is run by specifying the partition which should be fixed:
+
  
 
  ./fix_ext2_magic --fix /dev/hd=
 
  ./fix_ext2_magic --fix /dev/hd=
 +
 +
or, to fix back to Buffalo magic number
 +
 +
./fix_ext2_magic --fixback /dev/hd=
  
 
Where ''='' stands for the partition which should be fixed. For example, ''a1'' or ''a4''.
 
Where ''='' stands for the partition which should be fixed. For example, ''a1'' or ''a4''.
 +
 +
Note that this command needs to be run as root, so you may need to add "sudo" in front of the command, i.e.
 +
 +
sudo ./fix_ext2_magic --fix /dev/hd=
  
 
'''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.
 
'''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, LSLive or any ARM9-based device partitions.'''

Latest revision as of 16:23, 31 March 2009

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 to have a standard ext2 magic number:

./fix_ext2_magic --fix /dev/hd=

or, to fix back to Buffalo magic number

./fix_ext2_magic --fixback /dev/hd=

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

Note that this command needs to be run as root, so you may need to add "sudo" in front of the command, i.e.

sudo ./fix_ext2_magic --fix /dev/hd=

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, LSLive or any ARM9-based device partitions.