Linux NAS (QNAP) RAID Repair Tips and Tricks

Aus PUCONwiki
Zur Navigation springen Zur Suche springen

Repairing Corrupted RAID Volumes and EXT4FS file systems based on them

Once upon a time, PUCONs main NAS System, a QNAP TS-439, after having to be rebooted upon a network address range change, reported the main Data Volume being "unmounted".

Trying to mount the volume was not successful because the file system had group issues.

running ex2fsck was not successful, because at some point in the process, it reported "memory allocation error"

Fortunately, in the QNAP-Forum the following Thread was found:

https://forum.qnap.com/viewtopic.php?t=58689

This thread describes the following process:

  • add additional swap space on an additional disk volume (I used an external USB drive which had an NTFS file system, but it was OK). This being an USB drive, makes the process painfully slow, but gets the job done
  • run ex2fsck -y /dev/md0 to find and repair any issues
  • after completion, remove the additional swap space and re-mount the volume

This I have tried and it has worked!

In order to keep this information alive, I copied it to here:

by default, e2fsck would not complete due to out of memory error.

To fix this, you need to add extra swap space to the system

  • login as admin
  • unmount the filesystem
 umount /dev/md0
  • use df command to find a partition with a reasonable amount of extra space : I used /mnt/HDA_ROOT
  • cd to /mnt/HDA_ROOT
  • create a 350MB swap file:
   dd if=/dev/zero of=swap1 bs=1M count=350 
   mkswap swap1
   swapon swap1
  • fix filesystem
   e2fsck /dev/md0
  • remove the swapfile
   cd /mnt/HDA_ROOT
   swapoff swap1
   rm swap1
  • remount /dev/md0
 mount /dev/md0  /share/MD0_DATA