Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. Rather than RAM (default) or the root partition (/var/ -- far too small!), I used a high-capacity USB drive. Make sure this USB drive has enough free space before starting. You need at least X GB of space if your volume is 8TB like mine was. So, I'm guessing that this is why the fsck fails in the first place - at least, this is what my logs indicated when it said "Error storing directory block information (inode=90885846, block=0, num=6983948): Memory allocation failed"
  2.  
  3. #. Get root access to your NAS. I had already enabled root ssh before things went haywire because after the volume failed, FrontView would not load.
  4. #. Attach a high-capacity storage device to the NAS via USB. Wait while the ReadyNAS loads the drive.
  5. #. Download and compile the latest e2fsckprogs from the internet::
  6.  
  7. wget
  8. cd
  9. ./configure
  10. make
  11.  
  12. #. Configure e2fsck to use a cache::
  13.  
  14. mkdir /USB/USB_HDD/e2fsck #Configure yours accordingly
  15. echo "[scratch_files]
  16. directory = /USB/USB_HDD/e2fsck" > /etc/e2fsck.conf
  17.  
  18. #. Configure a new swap file (I picked 4GB but you might need more) -- This probably isn't necessary::
  19.  
  20. cd /USB/USB_HDD
  21. dd if=/dev/zero of=./swapfile1 bs=1024 count=4194304
  22. mkswap ./swapfile1
  23. swapon ./swapfile1
  24.  
  25. #. XXX Turn off journaling for performance. Make sure you have a UPS if you do this or some other protection from power loss.
  26.  
  27. tune2fs -O ^has_journal /dev/c/c #for performance
  28.  
  29. #. Check the filesystem. I had a superblock failure for my check, so if you do, then you may need to use ``mke2fs -n /dev/c/c`` to find superblock backup locations which you can try sequentially as an argument to ``fsck -b [block]``. The following command will likely fail with a 'Memory allocation failed' error after some time during the check so it needs to be re-run until all problems are fixed::
  30.  
  31. /opt/e2fsckprogs/e2fsprogs-1.42.7/e2fsck/e2fsck -b 98304 -C 0 -y -v /dev/c/c
  32.  
  33. #. XXX Turn back on journaling for protection
  34.  
  35. tune2fs -O has_journal /dev/c/c #turn this back on
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement