ubuntuusers.de

Software-Raid (mdadm) und NTFS

Status: Gelöst | Ubuntu-Version: Nicht spezifiziert
Antworten |

McMatt

Anmeldungsdatum:
19. Februar 2009

Beiträge: 106

Hallo,

ich habe einen neunen Raid-Controller mit zwei neuen Platten in mein System eingebaut. Ich habe im Bios des Controllers einen Raid-1 Verbund erstellt und diesen unter Windows XP partitioniert und mit NTFS formatiert (schnell).

Der Raid-Controller wird von dmraid nicht erkannt, deshalb habe ich mich entschieden Software-Raids mit mdadm zu erstellen. Leider kann ich diese nicht mounten. Das sagt mein System:

Als erstes einmal die Fehlermeldung: mount /dev/md0 /media/md0 und ntfs-3g /dev/md0 /media/md0 sagen beide:

Failed to read last sector (1228795721): Invalid argument
HINTS: Either the volume is a RAID/LDM but it wasn't setup yet,
   or it was not setup correctly (e.g. by not using mdadm --build ...),
   or a wrong device is tried to be mounted,
   or the partition table is corrupt (partition is smaller than NTFS),
   or the NTFS boot sector is corrupt (NTFS size is not valid).
Failed to mount '/dev/md0': Invalid argument
The device '/dev/md0' doesn't have a valid NTFS.
Maybe you selected the wrong device? Or the whole disk instead of a
partition (e.g. /dev/hda, not /dev/hda1)? Or the other way around?

fdisk -lu /dev/sd[cd]:

Disk /dev/sdc: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xa4d148a5

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1              63  1228795784   614397861    7  HPFS/NTFS
/dev/sdc2      1228795785  2457591569   614397892+   7  HPFS/NTFS
/dev/sdc3      2457591570  2930111414   236259922+   7  HPFS/NTFS

Disk /dev/sdd: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xa4d148a5

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1              63  1228795784   614397861    7  HPFS/NTFS
/dev/sdd2      1228795785  2457591569   614397892+   7  HPFS/NTFS
/dev/sdd3      2457591570  2930111414   236259922+   7  HPFS/NTFS

Partitionsgroesse und letzter Sektor passen zusammen, oder?

mdadm --detail --scan:

ARRAY /dev/md2 level=raid1 num-devices=2 metadata=00.90 UUID=cb14c08f:5b8e760f:cc61f72b:958633bc
ARRAY /dev/md1 level=raid1 num-devices=2 metadata=00.90 UUID=7f7ed513:30c8e758:cc61f72b:958633bc
ARRAY /dev/md0 level=raid1 num-devices=2 metadata=00.90 UUID=a082033f:3c3cbc3b:cc61f72b:958633bc

mdadm --detail /dev/md [ 0 1 2 ]:

/dev/md0:
        Version : 00.90
  Creation Time : Fri Mar 20 12:27:20 2009
     Raid Level : raid1
     Array Size : 614397760 (585.94 GiB 629.14 GB)
  Used Dev Size : 614397760 (585.94 GiB 629.14 GB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Fri Mar 20 15:39:16 2009
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           UUID : a082033f:3c3cbc3b:cc61f72b:958633bc (local to host Eckhard)
         Events : 0.8

    Number   Major   Minor   RaidDevice State
       0       8       33        0      active sync   /dev/sdc1
       1       8       49        1      active sync   /dev/sdd1
/dev/md1:
        Version : 00.90
  Creation Time : Fri Mar 20 14:26:59 2009
     Raid Level : raid1
     Array Size : 614397824 (585.94 GiB 629.14 GB)
  Used Dev Size : 614397824 (585.94 GiB 629.14 GB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 1
    Persistence : Superblock is persistent

    Update Time : Fri Mar 20 15:40:48 2009
          State : active, resyncing
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

 Rebuild Status : 40% complete

           UUID : 7f7ed513:30c8e758:cc61f72b:958633bc (local to host Eckhard)
         Events : 0.7

    Number   Major   Minor   RaidDevice State
       0       8       34        0      active sync   /dev/sdc2
       1       8       50        1      active sync   /dev/sdd2
/dev/md2:
        Version : 00.90
  Creation Time : Fri Mar 20 14:27:55 2009
     Raid Level : raid1
     Array Size : 236259840 (225.31 GiB 241.93 GB)
  Used Dev Size : 236259840 (225.31 GiB 241.93 GB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 2
    Persistence : Superblock is persistent

    Update Time : Fri Mar 20 16:24:46 2009
          State : active
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           UUID : cb14c08f:5b8e760f:cc61f72b:958633bc (local to host Eckhard)
         Events : 0.11

    Number   Major   Minor   RaidDevice State
       0       8       35        0      active sync   /dev/sdc3
       1       8       51        1      active sync   /dev/sdd3

cat /proc/mdstat:

Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md0 : active raid1 sdc1[0] sdd1[1]
      614397760 blocks [2/2] [UU]
      
md1 : active raid1 sdc2[0] sdd2[1]
      614397824 blocks [2/2] [UU]
      [=======>.............]  resync = 37.4% (230243008/614397824) finish=64.2min speed=99578K/sec
      
md2 : active raid1 sdc3[0] sdd3[1]
      236259840 blocks [2/2] [UU]
      
unused devices: <none>

ntfsfix /dev/md0:

Mounting volume... OK
Processing of $MFT and $MFTMirr completed successfully.
NTFS volume version is 3.1.
NTFS partition /dev/md0 was processed successfully.

ntfsfix erzeugt die selbe Ausgabe fuer /dev/md1 und /dev/md2.

Ich habe auch ntfsresize -i /dev/md0 ausprobiert:

ntfsresize v2.0.0 (libntfs 10:0:0)
ERROR: Volume is scheduled for check.
Run chkdsk /f and please try again, or see option -f.

Kann dies mit dem Problem zusammen haengen?

Was kann ich tun, damit die Software-Raids gemounted werden?

Vielen Dank fuer eure Hilfe.

McMatt

(Themenstarter)

Anmeldungsdatum:
19. Februar 2009

Beiträge: 106

Nachdem ich den Rechner mit XP gebootet und dort chkdsk ausgefuehrt habe, und sich die Ausgabe von ntfsresize -i nicht geaendert hat, habe ich ntfsresize einmal mit der option --force ausgefuehrt. ntfsresize -if /dev/md0:

ntfsresize v2.0.0 (libntfs 10:0:0)
Device name        : /dev/md0
NTFS volume version: 3.1
Cluster size       : 4096 bytes
Current volume size: 629143409152 bytes (629144 MB)
Current device size: 629143306240 bytes (629144 MB)
ERROR: Current NTFS volume size is bigger than the device size!
Corrupt partition table or incorrect device partitioning?

Hier gibt es also tatsaechlich ein Problem mit der Partitionsgroesse. Wie kann ich dieses Problem beheben?

McMatt

(Themenstarter)

Anmeldungsdatum:
19. Februar 2009

Beiträge: 106

Ich habe es geloest. (Das Problem mit der Partitionsgroesse kommt uebrigens nicht durch Windows XP, sondern durch mdadm!)

1. Erstellen eines Software-Raids mit mdadm:

# mdadm --create /dev/md0 -l 1 -n 2 /dev/sd[ab]1

2. ntfsresize ausfuehren, um die Groesse des Raids zu erfahren:

# ntfsresize -if /dev/md0

Ausgabe siehe vorangegangener Post.

3. Software-Raid entfernen:

# mdadm --stop /dev/md0

4. Die beiden Partitionen, die vom Software-Raid verbunden werden, getrennt anpassen:

# ntfsresize -fs 629143306240 /dev/sda1
# ntfsresize -fs 629143306240 /dev/sdb1

5. Erneutes Erstellen des Software-Raids:

# mdadm --create /dev/md0 -l 1 -n 2 /dev/sd[ab]1

6. Software-Raid mounten:

# mkdir /media/raid1
# mount /dev/md0 /media/raid1

.


Fuer den Fall, dass jemand Referenzen haben will. Ich hatte nur Threads gefunden, die als Ursache angenommen haben, dass Windows XP das Dateisystem ueber die Partition hinaus zu gross anlegt, und die empfohlen haben, die Partitionstablle mit fdisk anzupassen. Dies hat zum einen nicht funktioniert (Raids konnten trotzdem nicht gemountet werden) und zum anderen dafuer gesorgt, dass die Partitionen unter XP nicht mehr erkannt worden. Bei anderen wiederum hat bereits das Ausfuehren von ntfsfix ausgereicht.


Warum gibt es das Problem ueberhaupt? Wenn ich ntfsresize -if /dev/sda1 aufrufe, dann sind Volume size und Device size identisch, erst nach dem Erstellen des Software-Raids ist das Device kleiner als das Volume.

Antworten |