You are not logged in.

#1 2013-06-01 23:40:01

rfnx
Member
Registered: 2013-06-01
Posts: 2

"WRITE SAME failed. Manually zeroing." error during install or boot

Hello everyone!

Since the lasts kernels (I'm almost sure it happens since 3.9 because 3.8 worked fine) I can't boot on Archlinux anymore. This error floods my screen and I can't do anything, and because the new Archlinux iso (june 2013) comes with 3.9 kernel it now also happens during installation. Fortunately, I saved the may iso so I still can install archlinux and switch during install to LTS kernel but this is not a good solution. I can't find a solution online, some people have this issue but it seems to be a bit different everytime.

I use Archlinux on a server, with hardware raid : Dell PERC H200a with LSI SAS2008 according to my BIOS. According to http://kernelnewbies.org/Linux_3.7, the WRITE SAME SCSI command "allows the same block to be efficiently replicated throughout a block range. Only a single logical block is transferred from the host and the storage device writes the same data to all blocks described by the I/O (commit)". Here is the exact configuration :

- DELL® PowerEdge R210 II
- 1x Intel® Xeon® E3 1220 V2
- HDD: 2 x 1 To SATA2 RAID
- RAID: Hardware, Dell PERC H200, (Raid 1)

So my first problem is that I can't find online if my server is capable of this command (but I don't think so) and then the other issue is that I want to know if I can disable it. I found kernel patches for this issue :
https://patchwork.kernel.org/patch/1898441/ and https://patchwork.kernel.org/patch/1982051/ (the first link seems to be a better solution).
Then, I checked in the kernel source of 3.9 and I think that this patch isn't implemented (there is no device_write_same_capable function for instance). But kernel patching is not a really good solution, if I have to patch my kernel everytime the main kernel is updated...

After some research, I found that my hardware RAID driver seems (I'm not sure) to be the kernel module "mpt2sas", so I checked both may and june isos of Archlinux and it's the same version (14.1) so it shouldn't be the problem.

Does somebody can help me on this issue ? I don't really know what to do now.
Thanks for reading, if I forgot something or if you want more informations, ask me!

Bye.

PS : My English isn't very good, sorry.


EDIT : I found a part of the solution ! It seems to be an issue with the kernel that doesn't detect properly if my disc is capable of doing WRITE SAME command.
So I have to write "0" in the file "max_write_same_blocks" under /sys. But the problem is that /sys is renewed every boot so I don't know how to make my changes permanent. I made a systemd service file, it almost works, but this solution isn't nice : the parameter is applied lately so errors shows at the beginning and this is not really easy to set up. I prefer a solution like "sysctl" but it seems that it only controls parameter under /proc/sys and not /sys, am I right ?

Moreover, I tried two other things : Ubuntu 12.04 with kernel 3.9.4 works and Archlinux iso with 3.8.10 has max_write_same_blocks > 0 and it also works... So I don't really understand this issue. Maybe in 3.8 the parameter max_write_same_blocks has no effect (or not the same as in 3.9) ?

Here is the systemd file that I made to reduce the issue :

[Unit]
Description=No WRITE SAME
After=local-fs.target

[Service]
Type=oneshot
ExecStart=/bin/sh -c 'echo 0 > /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/host0/target0:1:0/0:1:0:0/scsi_disk/0:1:0:0/max_write_same_blocks'
RemainAfterExit=no

[Install]
WantedBy=multi-user.target

This is not a good solution, see my next post. I don't delete it in case you want to compare.

Last edited by rfnx (2013-06-02 15:26:50)

Offline

#2 2013-06-02 15:25:17

rfnx
Member
Registered: 2013-06-01
Posts: 2

Re: "WRITE SAME failed. Manually zeroing." error during install or boot

I found a solution to disable the WRITE SAME command. That doesn't answer all my questions but it solves my issue. I was looking for a file like "sysctl.conf" but for /sys parameters : you already can do that in Arch, just create a file that ends with ".conf" in tmpfiles.d and add one line per parameter you want to modify. This file will be loaded early at boot.

To disable it in an existing Archlinux installation, add in you file the line :

w       /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/host0/target0:1:0/0:1:0:0/scsi_disk/0:1:0:0/max_write_same_blocks     -       -       -       -       0

Read the manpage of tmpfiles.d if you don't understand this line, it depends on your configuration and you can't copy it.
Then reboot and no more error !

If you want to disable it during the Arch install, just change directly the value you want in /sys. You have to do it at the beginning before mounting partitions, for instance just after choosing your keymap.

Bye.

Last edited by rfnx (2013-06-02 15:34:11)

Offline

#3 2013-06-07 09:31:09

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: "WRITE SAME failed. Manually zeroing." error during install or boot

Thanks, I had to use this too

Offline

#4 2013-07-06 13:01:55

apaige
Member
Registered: 2008-06-15
Posts: 96

Re: "WRITE SAME failed. Manually zeroing." error during install or boot

For future reference, this affects Dedibox / Online.net customers.

Offline

Board footer

Powered by FluxBB