xfs_repair limit memory

Oxnas 810 based
Post Reply
stalica
Posts: 4
Joined: Tue Aug 19, 2014 2:28 pm

xfs_repair limit memory

Post by stalica » Tue Aug 19, 2014 2:43 pm

Hello, when I run a scan on my hard drive is getting this message:

Required memory for repair is greater that the maximum specified with the -m option. Please increase it to at least 404.

I know I can perform a scan with the Ubuntu LiveCD, but not every time I want to pull the drive.
I have access to the console, but after unmounting /dev/md0 and start xfs_repair /dev/md0 I get: "contains a mounted and writable filesystem"

someone help?

sorry for my english.

Mijzelf
Posts: 6198
Joined: Mon Jun 16, 2008 10:45 am

Re: xfs_repair limit memory

Post by Mijzelf » Thu Aug 21, 2014 3:20 pm

stalica wrote:but not every time I want to pull the drive.
Every time? Under normal circumstances your should never have to use xfs_repair. If you often have to repair the filesystem you are doing something wrong (like pulling the power connector without shutting down the nas normally) or your disk is failing.
after unmounting /dev/md0
Did unmounting succeed? Normally it's not easy to unmount /dev/md0, as it's mounted several times by bindmounts, and it's busy. Several processes will have open files on md0.

stalica
Posts: 4
Joined: Tue Aug 19, 2014 2:28 pm

Re: xfs_repair limit memory

Post by stalica » Thu Aug 21, 2014 3:32 pm

The problem arises when a power outage and the NAS is not properly shut.

Yes, I was able to properly unmount /dev/md0 using the -l.
At the next attempt to unmount received information that /dev/md0 is not mounted.

Unfortunately this is not allowed to start because it appeared xfs_repair described earlier message.

I just need to run xfs_repair as does the soft supplied by ZyXEL, but increasing the limit of available memory, nothing more.

Mijzelf
Posts: 6198
Joined: Mon Jun 16, 2008 10:45 am

Re: xfs_repair limit memory

Post by Mijzelf » Thu Aug 21, 2014 6:17 pm

Unmounting with the -l (lazy) option does not actually unmount the device. It marks the device as unmounted, but as long as there are open files on it, the filesystem will be mounted. Only when the last open file is closed, the device will actually be unmounted.

It there might be a way to to get an unmounted /dev/md0. There is a file /etc/init.d/rc.shutdown, which is called when the system. On my old firmware dump of a 210 it's almost empty, but on my 325 it shuts down all processes, unmounts the raid arrays, and disassembles them. Don't know about the latest 210 firmware.

In this file you can insert these lines just before the line 'mdadm -Ss':

Code: Select all

touch /tmp/run
telnetd -l /bin/sh
while [ -f /tmp/run ] ; do
        sleep 10
done
Now shutdown the box. You should be able to connect over telnet, and the data partition should be unmounted. However, I don't know if xfs_repair is still avaible. It might be necessary to copy it to /tmp before shutting down.

When you are done, delete the files /tmp/run to finish the shutdown.

Post Reply