https://wiki.archlinux.org/api.php?action=feedcontributions&user=Roshless&feedformat=atomArchWiki - User contributions [en]2024-03-29T13:58:17ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Sway&diff=642614Sway2020-11-28T00:05:57Z<p>Roshless: this repository hasn't been updated in over a year, user should be pointed to github</p>
<hr />
<div>[[Category:Tiling WMs]]<br />
[[Category:Dynamic WMs]]<br />
[[ja:Sway]]<br />
[[pt:Sway]]<br />
{{Related articles start}}<br />
{{Related|Window manager}}<br />
{{Related articles end}}<br />
''sway'' is a compositor for [[Wayland]] designed to be fully compatible with [[i3]]. According to [https://swaywm.org the official website]:<br />
:Sway is a tiling Wayland compositor and a drop-in replacement for the i3 window manager for X11. It works with your existing i3 configuration and supports most of i3's features, plus a few extras.<br />
<br />
== Installation ==<br />
<br />
''sway'' can be [[install]]ed with the {{Pkg|sway}} package. The development version can be installed using {{AUR|wlroots-git}} and {{AUR|sway-git}}. It's advisable to always update ''wlroots'' when you update ''sway'', due to tight dependencies.<br />
<br />
{{Note|All proprietary graphics drivers are [https://github.com/swaywm/sway/wiki#nvidia-users not supported], including [[NVIDIA]].}}<br />
<br />
You may also install {{Pkg|swaylock}} and {{Pkg|swayidle}} to lock your screen and set up an idle manager.<br />
<br />
The default application launcher is {{Pkg|dmenu}} and the default terminal emulator is {{Pkg|alacritty}}. Before starting ''sway'' it is advisable to either install them or set a new launcher and terminal in the configuration.<br />
<br />
== Starting ==<br />
<br />
=== Manually ===<br />
<br />
To start Sway, simply type {{ic|sway}} in the Linux console.<br />
<br />
=== From a display manager ===<br />
<br />
{{Note|Sway does not support display managers officially.[https://github.com/swaywm/sway/pull/3634#issuecomment-462779163]}}<br />
<br />
The sway session is located at {{ic|/usr/share/wayland-sessions/sway.desktop}}. It is automatically recognized by modern display managers like [[GDM]] and [[SDDM]].<br />
<br />
It is also possible to start sway as a [https://github.com/swaywm/sway/wiki/Systemd-integration#running-sway-itself-as-a---user-service systemd user service] through the display manager.<br />
<br />
Also you can use text-based session manager, see [[Display manager#Console]].<br />
<br />
== Configuration ==<br />
<br />
If you already use i3, then copy your i3 configuration to {{ic|~/.config/sway/config}} and it should work out of the box. Otherwise, copy the sample configuration file to {{ic|~/.config/sway/config}}. It is located at {{ic|/etc/sway/config}}, unless the {{ic|DFALLBACK_CONFIG_DIR}} flag has been set. See {{man|5|sway}} for information on the configuration.<br />
<br />
=== Keymap ===<br />
<br />
By default, sway starts with the US QWERTY keymap. To configure per-input:<br />
<br />
{{hc|~/.config/sway/config|<br />
input * {<br />
xkb_layout "us,de,ru"<br />
xkb_variant "colemak,,typewriter"<br />
xkb_options "grp:win_space_toggle"<br />
}<br />
<br />
input <identifier> xkb_model "pc101"<br />
}}<br />
<br />
More details are available in {{man|7|xkeyboard-config}} and {{man|5|sway-input}}.<br />
<br />
The keymap can also be configured using environment variables ({{ic|XKB_DEFAULT_LAYOUT}}, {{ic|XKB_DEFAULT_VARIANT}}, etc.) when starting {{ic|sway}}, with config options taking precedence over environment variables.<br />
<br />
=== Typematic delay and rate ===<br />
<br />
To change typematic delay and rate, you can add the following lines to your {{ic|input}} section:<br />
<br />
{{hc|~/.config/sway/config|<br />
input <identifier> repeat_delay 300<br />
input <identifier> repeat_rate 30<br />
}}<br />
<br />
=== Statusbar ===<br />
<br />
''sway'' ships with a default status bar in the form of ''swaybar'' which runs in a pure [[Wayland]] environment. ''swaybar'' can call a shell script or other program to show information in the status bar. See {{man|5|sway-bar}} and {{man|7|swaybar-protocol}} for details.<br />
<br />
Installing the program {{Pkg|i3status}} is an option to obtain a practical, default status bar under Wayland. All one has to do is add following snippet at the end of your sway config:<br />
<br />
{{hc|~/.config/sway/config|<br />
bar {<br />
status_command i3status<br />
}<br />
}}<br />
<br />
If you want to achieve colored output of i3status, you can adjust following part in the i3status configuration:<br />
<br />
{{hc|~/.config/i3status/config|2=<br />
general {<br />
colors = true<br />
interval = 5<br />
}<br />
}}<br />
<br />
In both examples, the system-wide installed configuration files have been copied over to the user directory and then modified. <br />
<br />
{{Tip|{{Pkg|waybar}} is an alternative to the bar included with sway (swaybar).}}<br />
<br />
=== Wallpaper ===<br />
<br />
Since release 1.1.1 the wallpaper part of the SwayWM project was moved to {{Pkg|swaybg}}, which is needed in order to run the output command.<br />
<br />
This line, which can be appended at the end of your sway configuration, sets a background image on all displays (output matches all with name {{ic|"*"}}):<br />
<br />
{{hc|~/.config/sway/config|<br />
output "*" bg /path/to/image fill<br />
}}<br />
<br />
Of course you have to replace the file name and path according to your wallpaper.<br />
<br />
You may use {{AUR|azote}} as the GTK3 frontend to swaybg.<br />
<br />
Solid colors may be set as follows:<br />
<br />
output * bg #000000 solid_color<br />
<br />
=== Input devices ===<br />
<br />
It is possible to tweak specific input device configurations. For example, to enable tap-to-click and natural scrolling for all touchpads:<br />
<br />
{{hc|~/.config/sway/config|<br />
input type:touchpad {<br />
tap enabled<br />
natural_scroll enabled<br />
}<br />
}}<br />
<br />
To set configuration for a particular touchpad, use {{ic|swaymsg -t get_inputs}} to obtain a device identifier and use it instead of {{ic|type:touchpad}}. For example, to set pointer acceleration:<br />
<br />
{{hc|~/.config/sway/config|<br />
input "2:14:ETPS/2_Elantech_Touchpad" pointer_accel 0.2<br />
}}<br />
<br />
{{Note|The output from the {{ic|swaymsg -t get_inputs}} command may contain "\" to escape symbols like "/" (e.g. {{ic|"2:14:ETPS\/2_Elantech_Touchpad"}}) and it needs to be removed.}}<br />
<br />
More documentation and options like acceleration profiles can be found in {{man|5|sway-input}}.<br />
<br />
=== HiDPI ===<br />
<br />
Set your displays scale factor with the {{ic|output}} command in your config file. The scale factor can be fractional, but it is usually 2 for HiDPI screens.<br />
<br />
output <name> scale <factor><br />
<br />
You can find your display name with the following command:<br />
<br />
$ swaymsg -t get_outputs<br />
<br />
=== Custom keybindings ===<br />
<br />
[[Extra keyboard keys|Special keys]] on your keyboard can be used to execute commands, for example to control volume, monitor brightness or media players:<br />
<br />
{{hc|~/.config/sway/config|<br />
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%<br />
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%<br />
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle<br />
bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle<br />
bindsym XF86MonBrightnessDown exec brightnessctl set 5%-<br />
bindsym XF86MonBrightnessUp exec brightnessctl set +5%<br />
bindsym XF86AudioPlay exec playerctl play-pause<br />
bindsym XF86AudioNext exec playerctl next<br />
bindsym XF86AudioPrev exec playerctl previous<br />
}}<br />
<br />
See [[PulseAudio#Keyboard volume control]], [[Advanced Linux Sound Architecture#Keyboard volume control]], [[Backlight#Backlight utilities]] and [[MPRIS]] for details and alternative utilities.<br />
<br />
To allow a keybinding to be executed while the lockscreen is active add the {{ic|--locked}} parameter to bindsym.<br />
<br />
bindsym --locked XF86AudioPlay exec playerctl play-pause<br />
<br />
==== Graphical indicator bars ====<br />
<br />
It is often desirable to have the current level of some percentage-valued setting, such as brightness or volume, be indicated by a graphical bar when it is adjusted. A good option for providing this facility in Sway is {{AUR|wob}} (alternatively {{AUR|wob-git}}), which provides a subset of the functionality of the popular X tool {{AUR|xob}} but as a native Wayland utility implementing the layer-shell protocol. See the [https://github.com/francma/wob project website] for usage examples.<br />
<br />
=== Floating windows ===<br />
<br />
To enable floating windows or window assignments, open the application and then use the {{ic|app_id}}, the {{ic|class}}, the {{ic|instance}} and the {{ic|title}} attributes to enable floating windows/window assignments. The following command will list the properties of all the open windows.<br />
<br />
$ swaymsg -t get_tree<br />
<br />
To get only the {{ic|app_id}}'s of all open windows use:<br />
<br />
$ swaymsg -t get_tree | grep "app_id"<br />
<br />
To get the {{ic|app_id}} of the focused window use:<br />
<br />
$ swaymsg -t get_tree | jq -r '..|try select(.focused == true)'<br />
<br />
If the {{ic|app_id}} happens to be null for some windows, you might have to use the {{ic|class}} and/or the {{ic|instance}} attributes to enable floating mode/window assignments. You can search the output and create fine grained rules for your windows.<br />
<br />
{{hc|~/.config/sway/config|2=<br />
for_window [app_id="galculator"] floating enable<br />
assign [class="firefox"] -> 3<br />
assign [class="^Urxvt$" instance="^htop$"] -> 9<br />
}}<br />
<br />
This is similar to using {{Pkg|xorg-xprop}} to find the {{ic|class}} or {{ic|wm_name}} attributes in [[X11]].<br />
<br />
=== Xresources ===<br />
<br />
Copy {{ic|~/.Xresources}} to {{ic|~/.Xdefaults}} to use them in Sway.<br />
<br />
=== Xwayland ===<br />
<br />
If a program crashes on start with the error message "cannot open display," it is likely that the program you are using is an X11 program. In order to use the Xwayland compatibility layer to run X11 programs under Wayland, it is necessary to install the {{Pkg|xorg-server-xwayland}} package.<br />
<br />
If you would like to disable Xwayland entirely and run a "pure" Wayland session, uninstall the {{Pkg|xorg-server-xwayland}} package and set the following configuration option:<br />
<br />
{{hc|~/.config/sway/config|<br />
xwayland disable<br />
}}<br />
<br />
{{ Note| Some programs need [[Wayland#GUI_libraries|special environment variables or configuration options]] to run natively under Wayland, and other programs (including most proprietary applications) do not support Wayland at all. Currently it is recommended to keep Xwayland on so that legacy applications can be used. }}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Autostart on login ===<br />
<br />
To start sway from tty1 on login with default US keyboard, edit:<br />
<br />
{{hc|~/.bash_profile|<br />
<nowiki>if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then<br />
XKB_DEFAULT_LAYOUT=us exec sway<br />
fi</nowiki><br />
}}<br />
<br />
=== Enable CapsLock/NumLock ===<br />
Enable the capslock and/or numlock by adding the following lines to your sway config<br />
{{hc|~/.config/sway/config|<nowiki><br />
input * xkb_capslock enable<br />
input * xkb_numlock enable<br />
</nowiki>}}<br />
<br />
=== Current keyboard layout ===<br />
<br />
The current keyboard layout can be retrieved as follows, where {{ic|''kbd_identifier''}} needs to be replaced with your keyboard's identifier:<br />
<br />
$ swaymsg -t get_inputs {{!}} jq -r '.[] {{!}} select(.identifier == "''kbd_identifier''") {{!}} .xkb_active_layout_name'<br />
<br />
=== Backlight toggle ===<br />
<br />
To turn off (and on) your displays with a key (e.g. {{ic|Pause}}) bind the following script in your Sway {{ic|config}}:<br />
<br />
{{bc|<br />
#!/bin/sh<br />
read lcd < /tmp/lcd<br />
if [ "$lcd" -eq "0" ]; then<br />
swaymsg "output * dpms on"<br />
echo 1 > /tmp/lcd<br />
else<br />
swaymsg "output * dpms off"<br />
echo 0 > /tmp/lcd<br />
fi<br />
}}<br />
<br />
=== Screen capture and screen sharing ===<br />
<br />
See [[Screen capture#Wayland]].<br />
<br />
=== Control swaynag with the keyboard ===<br />
<br />
Swaynag, the default warning/prompt program shipped with sway, only supports user interaction with the mouse. A helper program such as {{AUR|swaynagmode}} may be used to enable interaction via keyboard shortcuts.<br />
<br />
Swaynagmode works by first launching swaynag, then listening for signals which trigger actions such as selecting the next button, dismissing the prompt, or accepting the selected button. These signals are sent by launching another instance of the swaynagmode script itself with a control argument, such as {{ic|swaynagmode --select right}} or {{ic|swaynagmode --confirm}}. <br />
<br />
Swaynagmode by default triggers the sway mode {{ic|nag}} upon initialization, followed by {{ic|default}} on exit. This makes it easy to define keybindings in your sway configuration:<br />
<br />
{{hc|~/.config/sway/config|<br />
set $nag exec swaynagmode<br />
mode "nag" {<br />
bindsym {<br />
Ctrl+d mode "default"<br />
<br />
Ctrl+c $nag --exit<br />
q $nag --exit<br />
Escape $nag --exit<br />
<br />
Return $nag --confirm<br />
<br />
Tab $nag --select prev<br />
Shift+Tab $nag --select next<br />
<br />
Left $nag --select next<br />
Right $nag --select prev<br />
<br />
Up $nag --select next<br />
Down $nag --select prev<br />
}<br />
}<br />
}}<br />
<br />
Note that, beginning in sway version 1.2, mode names are case-sensitive.<br />
<br />
You can configure sway to use swaynagmode with the configuration command {{ic|swaynag_command swaynagmode}}.<br />
<br />
=== Change cursor theme and size ===<br />
<br />
To set the [[cursor theme]] and size:<br />
<br />
{{hc|~/.config/sway/config|<br />
seat seat0 xcursor_theme ''my_cursor_theme'' ''my_cursor_size''<br />
}}<br />
<br />
Where {{ic|''my_cursor_theme''}} can be set to or replaced by a specific value like {{ic|default}}, {{ic|Adwaita}} or {{ic|Simple-and-Soft}}, and {{ic|''my_cursor_size''}} a value like {{ic|48}}.<br />
<br />
You can inspect their values with {{ic|echo $XCURSOR_SIZE}} and {{ic|echo $XCURSOR_THEME}}.<br />
<br />
Note that you need to restart the application to see the changes.<br />
<br />
{{Note|Wayland uses client-side cursors. It's possible that applications do not evaluate the values of {{ic|$XCURSOR_SIZE}} and {{ic|$XCURSOR_THEME}}.}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Application launchers ===<br />
<br />
i3-dmenu-desktop, {{Pkg|dmenu}}, and {{Pkg|rofi}} all function relatively well in Sway, but all run under XWayland and suffer from the same issue where they can become unresponsive if the cursor is moved to a native Wayland window. The reason for this issue is that Wayland clients/windows do not have access to input devices unless they have focus of the screen. The XWayland server is itself a client to the Wayland compositor, so one of its XWayland clients must have focus for it to access user input. However, once one of its clients has focus, it can gather input and make it available to all XWayland clients through the X11 protocol. Hence, moving the cursor to an XWayland window and pressing Escape should fix the issue, and sometimes running {{ic|pkill}} does too.<br />
<br />
{{Pkg|bemenu}} is a native Wayland dmenu replacement which can optionally be combined with {{AUR|j4-dmenu-desktop}} to provide a Wayland-native combination for launching desktop files (as i3-dmenu-desktop does):<br />
<br />
j4-dmenu-desktop --dmenu='bemenu -i --nb "#3f3f3f" --nf "#dcdccc" --fn "pango:DejaVu Sans Mono 12"' --term='termite'<br />
<br />
You may need to set {{ic|BEMENU_BACKEND}} environment variable to "wayland" if you choose not to disable XWayland.<br />
<br />
You can also build your own with a floating terminal and fzf as discussed in a [https://github.com/swaywm/sway/issues/1367 GitHub issue].<br />
<br />
Also {{ic|krunner}} binary provided by {{Pkg|plasma-workspace}} package can serve as launcher, offering both XWayland and native Wayland support.<br />
<br />
{{AUR|rofi-lbonn-wayland-git}} is a fork of {{Pkg|rofi}} that works in Wayland and also has an {{ic|-x11}} flag if you need to launch it in an X11 session. <br />
<br />
{{AUR|wofi-hg}} is a command launcher, that provides some of the same features as rofi but running under Wayland. wofi lacks some features from rofi like an SSH mode and a window-switching mode. It is based on {{Pkg|wlroots}} library and use GTK3 for rendering. It works pretty well with sway.<br />
<br />
=== Virtualization ===<br />
<br />
Sway works with both [[VirtualBox]] and [[VMware]] ESXi.<br />
<br />
==== Unable to start Sway from tty ====<br />
<br />
For ESXi, you need to enable 3D support under the ''Hardware Configuration > Video card settings''. See also [[VMware#Enable 3D graphics on Intel and Optimus]].<br />
<br />
==== No visible cursor ====<br />
<br />
When using the VMSVGA graphics controller, the cursor is invisible. This can be fixed by using software cursors as discussed in [https://github.com/swaywm/sway/issues/3814]:<br />
<br />
$ export WLR_NO_HARDWARE_CURSORS=1<br />
<br />
=== Sway socket not detected ===<br />
<br />
Using a {{ic|swaymsg}} argument, such as {{ic|swaymsg -t get_outputs}}, will sometimes return the message:<br />
<br />
sway socket not detected.<br />
ERROR: Unable to connect to<br />
<br />
when run inside a terminal multiplexer (such as gnu screen or tmux). This means {{ic|swaymsg}} could not connect to the socket provided in your {{ic|SWAYSOCK}}.<br />
<br />
To view what the current value of {{ic|SWAYSOCK}} is, type:<br />
<br />
$ env | fgrep SWAYSOCK<br />
SWAYSOCK=/run/user/1000/sway-ipc.1000.4981.sock<br />
<br />
To work around this problem, you may try attaching to a socket based on the running sway process:<br />
<br />
$ export SWAYSOCK=/run/user/$(id -u)/sway-ipc.$(id -u).$(pgrep -x sway).sock<br />
<br />
To avoid this error, run the command outside of a multiplexer.<br />
<br />
=== Unable to retrieve socket path ===<br />
<br />
Requesting messages from {{ic|swaymsg -t}} on a tty may return the following message:<br />
<br />
Unable to retrieve socket path<br />
<br />
{{ic|SWAYSOCK}} environment variable is set after launching Sway, therefore a workaround to this error is to request {{ic|swaymsg -t [message]}} in a terminal inside Sway.<br />
<br />
=== Keybindings and keyboard layouts ===<br />
<br />
By default, if you are using more than one keyboard layout, e.g. {{ic|<nowiki>input * xkb_layout "us,ru"</nowiki>}}, bindings may become broken when you switch on some secondary layout.<br />
<br />
Thanks to https://github.com/swaywm/sway/pull/3058, all you need is to add {{ic|--to-code}} key to sensitive {{ic|bindsym}} lines like this:<br />
{{bc|<nowiki><br />
bindsym --to-code {<br />
$mod+$left focus left<br />
$mod+$down focus down<br />
$mod+$up focus up<br />
$mod+$right focus right<br />
}</nowiki><br />
}}<br />
<br />
=== Java applications ===<br />
<br />
Some Java-based applications will display blank screen when opened, for example any Intellij editor. To mitigate this, the application can be started with the {{ic|_JAVA_AWT_WM_NONREPARENTING}} environment variable set to 1.<br />
<br />
If you start the application from a launcher like {{Pkg|rofi}} or {{Pkg|dmenu}}, you might want to modify the application desktop entry as shown in [[Desktop entries#Modify environment variables]].<br />
<br />
Some issues with Java applications have been fixed in OpenJDK 11 and Sway 1.5. However, certain applications require additional configuration to use newer versions of OpenJDK, in the case of JetBrains IDEs you must set {{ic|1=STUDIO_JDK=/usr/lib/jvm/java-11-openjdk-amd64/}}. [https://github.com/swaywm/sway/issues/5414]<br />
<br />
=== Scroll on border ===<br />
<br />
If using the mouse scroll wheel on an application's border crashes sway, you could use {{ic|border none}} for the {{ic|app_id}} (e.g. Firefox).<br />
<br />
== See also ==<br />
<br />
* [https://github.com/swaywm/sway GitHub project]<br />
* [https://github.com/swaywm/sway/wiki Sway official wiki]<br />
* [https://swaywm.org Website]<br />
* [https://drewdevault.com/2019/03/11/Sway-1.0-released.html Announcing the release of sway 1.0]</div>Roshlesshttps://wiki.archlinux.org/index.php?title=Huawei_E1550_3G_modem&diff=581974Huawei E1550 3G modem2019-09-11T15:29:23Z<p>Roshless: typos</p>
<hr />
<div>[[Category:Modems]]<br />
[[ja:Huawei E1550 3G モデム]]<br />
[[ru:USB 3G Modem]]<br />
== Introduction ==<br />
<br />
This article describes how to configure Huawei E1550 3G modems.<br />
<br />
This modem is generic modem device, but there are two kludges:<br />
* you need to switch it into modem mode<br />
* you need to load proper driver (usbserial)<br />
<br />
== Prepare device ==<br />
<br />
=== Switch into modem mode ===<br />
<br />
By default kernel recognizes it as usb-storage device (SCSI CD-ROM). It is true, because of this modem<br />
contains MicroSD card (up to 4Gb) reader and internal flash.<br />
<br />
To turn on modem you should run<br />
$ /lib/udev/usb_modeswitch --vendor 0x12d1 --product 0x1446 --type option-zerocd<br />
command.<br />
<br />
See also the {{Pkg|usb_modeswitch}} package, which you may need in future since in udev-157 modem-modeswitch has been renamed and changed as described in the [http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;h=4dd9b291354e76f34b0d6d7b5c3b28d03a624418 commit]. This package does not need any modifications, just install it.<br />
<br />
Also you can create udev's config: /etc/udev/rules.d/15-huawei-e1550.rules<br />
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1446", RUN+="/lib/udev/usb_modeswitch --vendor 0x12d1 --product 0x1446 --type option-zerocd"<br />
<br />
After that, modem changes its USB IDs to 12d1:140c and /proc/bus/usb/devices shows new USB endpoints.<br />
<br />
=== Driver loading ===<br />
<br />
usbserial is proper driver for this modem, but probably it does not recognize it, so you should<br />
force it, passing USB IDs.<br />
# modprobe usbserial vendor=0x12d1 product=0x140c<br />
or put options into /etc/modprobe.d/modprobe.conf<br />
options usbserial vendor=0x12d1 product=0x140c<br />
(do not forget to 'rmmod usbserial' if it is already loaded before)<br />
<br />
=== Optional: device naming ===<br />
You can generate symlinks to the ttyUSB* ports for a more human readable configuration with udev rules.<br />
<br />
For a Huawei device which identifies with the USB ID 12D1:1001 after modeswitching and has 3 serial ports:<br />
SUBSYSTEMS=="usb", ATTRS{modalias}=="usb:v12D1p1001*", KERNEL=="ttyUSB*", ATTRS{bInterfaceNumber}=="00", ATTRS{bInterfaceProtocol}=="ff", SYMLINK+="ttyUSB_utps_modem"<br />
SUBSYSTEMS=="usb", ATTRS{modalias}=="usb:v12D1p1001*", KERNEL=="ttyUSB*", ATTRS{bInterfaceNumber}=="01", ATTRS{bInterfaceProtocol}=="ff", SYMLINK+="ttyUSB_utps_diag"<br />
SUBSYSTEMS=="usb", ATTRS{modalias}=="usb:v12D1p1001*", KERNEL=="ttyUSB*", ATTRS{bInterfaceNumber}=="02", ATTRS{bInterfaceProtocol}=="ff", SYMLINK+="ttyUSB_utps_pcui"<br />
<br />
For a Huawei device which identifies with the USB ID 12D1:1003 after modeswitching and has 2 serial ports:<br />
SUBSYSTEMS=="usb", ATTRS{modalias}=="usb:v12D1p1003*", KERNEL=="ttyUSB*", ATTRS{bInterfaceNumber}=="00", ATTRS{bInterfaceProtocol}=="ff", SYMLINK+="ttyUSB_utps_modem"<br />
SUBSYSTEMS=="usb", ATTRS{modalias}=="usb:v12D1p1003*", KERNEL=="ttyUSB*", ATTRS{bInterfaceNumber}=="01", ATTRS{bInterfaceProtocol}=="ff", SYMLINK+="ttyUSB_utps_pcui"<br />
<br />
== Connecting internet ==<br />
<br />
Now you have new 2 or 3 /dev/ttyUSB* devices.Most likely first of them (ttyUSB0 if you had not such devices before) is PPP compatible modem. Use it as usual with pppd, kppp, gnome-ppp, network-manager, etc.<br />
<br />
{{Note|If you want to use your 3G modem with [[NetworkManager]], you have to install the package {{Pkg|modemmanager}} and then [[restart]] the {{ic|NetworkManager.service}}. Now you can 'Enable Mobile Broadband' in the networkmanager applet.}}<br />
<br />
== Using gammu ==<br />
<br />
Use {{Pkg|gammu}} to access cell phones functionalities.<br />
<br />
Edit ~/.gammurc<br />
[gammu]<br />
port=/dev/ttyUSB0<br />
connection=at<br />
name=huawei e1550<br />
model=<br />
<br />
you can also generate the config using<br />
$ gammu-detect > ~/.gammurc <br />
<br />
Sending SMS:<br />
# gammu sendsms TEXT +7123456789 -text qwe<br />
<br />
find device info:<br />
# gammu identify<br />
<br />
for gui use {{Pkg|wammu}} or {{Pkg|modem-manager-gui}}.<br />
<br />
== USSD Requests ==<br />
<br />
Use {{AUR|huawei-ussd}}{{Broken package link|{{aur-mirror|huawei-ussd}}}} package. Or use [https://github.com/gnomeby/ussd ussd.php] tool.<br />
<br />
== Success Stories ==<br />
2010-August-03: I didn't do anything, I just installed usb_modeswitch-1.1.3-2 and my kernel is 2.6.33. In the syslog (/var/log/messages.log) the usb_modeswitch can automatically configure the modem correctly but I still cannot connect to the internet using gnome network manager applet, then I installed the modemmanager package and restart the networkmanager service. Everything is working properly now.<br />
<br />
== References ==<br />
* [[USB 3G Modem]]<br />
* [[Huawei E220]]</div>Roshlesshttps://wiki.archlinux.org/index.php?title=Nextcloud&diff=559529Nextcloud2018-12-19T17:46:24Z<p>Roshless: typo</p>
<hr />
<div>[[Category:File sharing]]<br />
[[Category:Web applications]]<br />
[[fr:Owncloud]]<br />
[[ja:Nextcloud]]<br />
{{Related articles start}}<br />
{{Related|Apache HTTP Server}}<br />
{{Related|Nginx}}<br />
{{Related|OpenSSL}}<br />
{{Related|WebDAV}}<br />
{{Related articles end}}<br />
<br />
From [[Wikipedia:Nextcloud]]:<br />
<br />
:Nextcloud is a suite of client-server software for creating and using file hosting services. It is functionally similar to Dropbox, although Nextcloud is free and open-source, allowing anyone to install and operate it on a private server. In contrast to proprietary services like Dropbox, the open architecture allows adding additional functionality to the server in form of applications.<br />
<br />
Nextcloud is a fork of ownCloud. For differences between the two, see [[wikipedia:Nextcloud#Differences from ownCloud]].<br />
<br />
== Prerequisites ==<br />
<br />
Nextcloud requires several components:[https://docs.nextcloud.com/server/14/admin_manual/installation/system_requirements.html#server]<br />
<br />
* A web server: [[Apache]] or [[nginx]]<br />
* A database: [[MariaDB]]/MySQL, [[PostgreSQL]] or [[Oracle]]<br />
* [[PHP]] with [[#PHP setup|additional modules]]<br />
<br />
These will be configured in [[#Setup]].<br />
<br />
Make sure the required components are installed before proceeding.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|nextcloud}} package.<br />
<br />
== Setup ==<br />
<br />
As stated above, in order to setup Nextcloud, you must set up the appropriate PHP requirements;<br />
additionally, you must configure a database and a webserver.<br />
<br />
=== Pacman hook ===<br />
<br />
To upgrade the Nextcloud database automatically on updates, you may want to create a [[pacman hook]]:<br />
<br />
{{hc|/etc/pacman.d/hooks/nextcloud.hook|2=<br />
[Trigger]<br />
Operation = Install<br />
Operation = Upgrade<br />
Type = Package<br />
Target = nextcloud<br />
Target = nextcloud-app-*<br />
<br />
[Action]<br />
Description = Update Nextcloud installation<br />
When = PostTransaction<br />
Exec = /usr/bin/runuser -u http -- /usr/bin/php /usr/share/webapps/nextcloud/occ upgrade<br />
}}<br />
<br />
=== PHP setup ===<br />
<br />
{{Tip|For all prerequisite PHP modules, see upstream documentation: [https://docs.nextcloud.com/server/14/admin_manual/installation/source_installation.html#prerequisites-label Nextcloud 14.0].}}<br />
<br />
Install [[PHP#gd]] and {{pkg|php-intl}} as additional modules. Configure [[PHP#OPCache|OPcache]] as recommended by [https://docs.nextcloud.com/server/14/admin_manual/configuration_server/server_tuning.html#enable-php-opcache the documentation].<br />
<br />
Some apps (''News'' for example) require the {{ic|iconv}} extension, if you wish to use these apps, uncomment the extension in {{ic|/etc/php/php.ini}}.<br />
<br />
Depending on which database backend will be used:<br />
<br />
* For [[MySQL]], see [[PHP#MySQL/MariaDB]].<br />
* For [[PostgreSQL]], see [[PHP#PostgreSQL]].<br />
* For [[SQLite]], see [[PHP#Sqlite]].<br />
<br />
Performance may be improved through the implementation of [[PHP#Caching|caching]], see<br />
[https://docs.nextcloud.com/server/14/admin_manual/configuration_server/caching_configuration.html Configuring Memory Caching]<br />
on the official documentation for details.<br />
<br />
=== Database setup ===<br />
<br />
An SQL database must be setup and used for your Nextcloud installation. After setting up the database here,<br />
you will be prompted for its information when you first create an administrator account.<br />
<br />
==== MariaDB ====<br />
<br />
It is recommended to set up an own database and user when using [[MariaDB]]:<br />
<br />
{{hc|$ mysql -u root -p|2=<br />
mysql> CREATE DATABASE `'''nextcloud'''` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;<br />
mysql> CREATE USER `'''nextcloud'''`@'localhost' IDENTIFIED BY ''''password'''';<br />
mysql> GRANT ALL PRIVILEGES ON `'''nextcloud'''`.* TO `'''nextcloud'''`@`localhost`;<br />
mysql> \q<br />
}}<br />
<br />
{{Note|Create or convert the database with MySQL 4-byte support in order to use Emojis (textbased smilies) on your Nextcloud server [https://docs.nextcloud.com/server/14/admin_manual/configuration_database/mysql_4byte_support.html].}}<br />
<br />
==== PostgreSQL ====<br />
<br />
The following is an example of setting up a [[PostgreSQL]] user and database:<br />
<br />
{{hc|1=[postgres]$ createuser -h localhost -P nextcloud|2=<br />
Enter password for new role:<br />
Enter it again:<br />
}}<br />
<br />
[postgres]$ createdb -O nextcloud nextcloud<br />
<br />
=== Web server setup ===<br />
<br />
{{Warning|It is recommended to use TLS/SSL (HTTPS) over plain HTTP, see [[Apache#TLS]] or [[Nginx#TLS]] for examples and implement this in the examples given below.}}<br />
<br />
Depending on which [[web server]] you are using, further setup is required, indicated below.<br />
<br />
==== Apache ====<br />
<br />
If you have not already, install [[Apache]] and install and enable [[Apache#PHP|Apache's PHP module]]<br />
<br />
Copy the Apache configuration file to the configuration directory:<br />
<br />
# cp /etc/webapps/nextcloud/apache.example.conf /etc/httpd/conf/extra/nextcloud.conf<br />
<br />
Modify the file according to your preferences. By default it includes an alias for {{ic|/nextcloud}} pointing to {{ic|/usr/share/webapps/nextcloud}}.<br />
<br />
And include it in {{ic|/etc/httpd/conf/httpd.conf}}:<br />
<br />
Include conf/extra/nextcloud.conf<br />
<br />
Ensure that the root location of your Nextcloud installation (e.g., {{ic|/usr/share/webapps/nextcloud}}) is accessible by the webserver's user {{ic|http}}.<br />
<br />
Now restart Apache ({{ic|httpd.service}}).<br />
<br />
===== WebDAV =====<br />
<br />
Nextcloud comes with its own [[WebDAV]] implementation enabled, which may conflict with the one shipped with Apache. If you have enabled WebDAV in Apache (not enabled by default), disable the modules {{ic|mod_dav}} and {{ic|mod_dav_fs}} in {{ic|/etc/httpd/conf/httpd.conf}}. See [https://forum.owncloud.org/viewtopic.php?f=17&t=7240] for details.<br />
<br />
==== Nginx ====<br />
<br />
Make sure PHP-FPM has been configured correctly as described in [[Nginx#FastCGI]]. Uncomment {{ic|1=env[PATH]}} in {{ic|/etc/php/php-fpm.d/www.conf}} as it is required by Nextcloud.<br />
<br />
Create a [[Nginx#Server_blocks|server block]] and add the content according to the [https://docs.nextcloud.com/server/14/admin_manual/installation/nginx.html Nextcloud documentation]:<br />
<br />
{{Note|Use {{ic|/usr/share/webapps/nextcloud}} as {{ic|root}} location when using {{Pkg|nextcloud}}.}}<br />
{{Tip|See the [https://github.com/graysky2/configs/blob/master/nginx/nextcloud-initial.conf following template] as initial configuration when setting up [[Let's Encrypt]].}}<br />
<br />
{{hc|/etc/nginx/sites-available/owncloud.conf|2=<nowiki><br />
upstream php-handler {<br />
server unix:/run/php-fpm/php-fpm.sock;<br />
}<br />
<br />
server {<br />
listen 443 ssl http2;<br />
listen [::]:443 ssl http2;<br />
server_name cloud.example.com;<br />
<br />
ssl_certificate /etc/ssl/nginx/cloud.example.com.crt;<br />
ssl_certificate_key /etc/ssl/nginx/cloud.example.com.key;<br />
<br />
..<br />
<br />
# Path to the root of your installation<br />
root /usr/share/webapps/nextcloud/;<br />
<br />
..<br />
<br />
location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {<br />
fastcgi_split_path_info ^(.+\.php)(/.*)$;<br />
include fastcgi_params;<br />
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;<br />
fastcgi_param PATH_INFO $fastcgi_path_info;<br />
fastcgi_param HTTPS on;<br />
#Avoid sending the security headers twice<br />
fastcgi_param modHeadersAvailable true;<br />
fastcgi_param front_controller_active true;<br />
fastcgi_pass php-handler;<br />
fastcgi_intercept_errors on;<br />
fastcgi_request_buffering off;<br />
}<br />
}<br />
</nowiki>}}<br />
<br />
== Initialize ==<br />
<br />
Open the address where you have installed Nextcloud in a web browser (e.g., https://www.example.com/nextcloud).<br />
<br />
=== Create storage directories ===<br />
<br />
To webserver read/write access to the ''apps'' directory (e.g. on "Cannot write into "apps" directory"), setup the correct permissions:<br />
<br />
{{Note|Replace {{ic|http}} when using a different [[user]]/[[user group]] for the webserver.}}<br />
<br />
# mkdir -p /usr/share/webapps/nextcloud/data<br />
# chown http:http /usr/share/webapps/nextcloud/data<br />
# chown -R http:http /usr/share/webapps/nextcloud/apps<br />
# chmod 750 /usr/share/webapps/nextcloud/data<br />
# chmod 750 /usr/share/webapps/nextcloud/apps<br />
<br />
To overrule the data directory on the current setup, [[append]] {{ic|datadirectory}} to {{ic|/etc/webapps/nextcloud/config/config.php}} before the closing tag {{ic|);}}:<br />
<br />
{{hc|/etc/webapps/nextcloud/config/config.php|2=<br />
<br />
'datadirectory' => '/usr/share/webapps/nextcloud/data'<br />
}}<br />
<br />
If you have set {{ic|open_basedir}} in your PHP/web server configuration file (e.g. {{ic|/etc/httpd/conf/extra/nextcloud.conf}}), it may be necessary to add your ''/path/to/data'' directory to the string on the line starting with {{ic|php_admin_value open_basedir }}:<br />
<br />
{{hc|/etc/httpd/conf/extra/nextcloud.conf|2=<br />
<br />
php_admin_value open_basedir "''/path/to/data/'':/srv/http/:/dev/urandom:/tmp/:/usr/share/pear/:/usr/share/webapps/nextcloud/:/etc/webapps/nextcloud"<br />
}}<br />
<br />
=== Configure caching ===<br />
<br />
It is recommended to [https://docs.nextcloud.com/server/14/admin_manual/configuration_server/caching_configuration.html enable caching]. The Nextcloud documentation provides instructions on [[Redis]], Memcached and [[PHP#APCu|APCu]].<br />
<br />
== Security Hardening ==<br />
<br />
See the [https://docs.nextcloud.com/server/14/admin_manual/configuration_server/harden_server.html Nextcloud documentation] and [[Security]]. Nextcloud additionally provides a [https://scan.nextcloud.com/ Security scanner].<br />
<br />
=== uWSGI ===<br />
<br />
You can run Nextcloud in its own process and service by using the [[uWSGI]] application server with {{pkg|uwsgi-plugin-php}}. This allows you to define a [[PHP#Configuration|PHP configuration]] only for this instance of PHP, without the need to edit the global {{ic|php.ini}} and thus keeping your web application configurations compartmentalized. ''uWSGI'' itself has a wealth of features to limit the resource use and to harden the security of the application, and by being a separate process it can run under its own user.<br />
<br />
The only part that differs from [[#Nginx]] is the {{ic|<nowiki>location ~ \.php(?:$|/) {}</nowiki>}} block:<br />
<br />
{{bc|<nowiki><br />
location ~ \.php(?:$|/) {<br />
include uwsgi_params;<br />
uwsgi_modifier1 14;<br />
# Avoid duplicate headers confusing OC checks<br />
uwsgi_hide_header X-Frame-Options;<br />
uwsgi_hide_header X-XSS-Protection;<br />
uwsgi_hide_header X-Content-Type-Options;<br />
uwsgi_hide_header X-Robots-Tag;<br />
uwsgi_pass unix:/run/uwsgi/nextcloud.sock;<br />
}<br />
</nowiki>}}<br />
<br />
Then create a config file for ''uWSGI'':<br />
<br />
{{hc|/etc/uwsgi/nextcloud.ini|<nowiki><br />
[uwsgi]<br />
; load the required plugins<br />
plugins = php<br />
; force the sapi name to 'apache', this will enable the opcode cache <br />
php-sapi-name = apache<br />
<br />
; set master process name and socket<br />
; '%n' refers to the name of this configuration file without extension<br />
procname-master = uwsgi %n<br />
master = true<br />
socket = /run/uwsgi/%n.sock<br />
<br />
; drop privileges<br />
uid = http<br />
gid = http<br />
umask = 027<br />
<br />
; run with at least 1 process but increase up to 4 when needed<br />
processes = 4<br />
cheaper = 1<br />
<br />
; reload whenever this config file changes<br />
; %p is the full path of the current config file<br />
touch-reload = %p<br />
<br />
; disable uWSGI request logging<br />
;disable-logging = true<br />
<br />
; enforce a DOCUMENT_ROOT<br />
php-docroot = /usr/share/webapps/%n<br />
; limit allowed extensions<br />
php-allowed-ext = .php<br />
; and search for index.php if required<br />
php-index = index.php<br />
<br />
; set php configuration for this instance of php, no need to edit global php.ini<br />
php-set = date.timezone=Etc/UTC<br />
;php-set = open_basedir=/tmp/:/usr/share/webapps/nextcloud:/etc/webapps/nextcloud:/dev/urandom<br />
php-set = expose_php=false<br />
; avoid security risk of leaving sessions in world-readable /tmp<br />
php-set = session.save_path=/usr/share/webapps/nextcloud/data<br />
<br />
; port of php directives set upstream in /usr/share/webapps/nextcloud/.user.ini for use with PHP-FPM<br />
php-set = upload_max_filesize=513M<br />
php-set = post_max_size=513M<br />
php-set = memory_limit=512M<br />
php-set = output_buffering=off<br />
<br />
; load all extensions only in this instance of php, no need to edit global php.ini<br />
;; required core modules<br />
php-set = extension=gd<br />
php-set = extension=iconv<br />
;php-set = extension=zip # enabled by default in global php.ini<br />
<br />
;; database connectors<br />
;; uncomment your selected driver<br />
;php-set = extension=pdo_sqlite<br />
;php-set = extension=pdo_mysql<br />
;php-set = extension=pdo_pgsql<br />
<br />
;; recommended extensions<br />
;php-set = extension=curl # enabled by default in global php.ini<br />
php-set = extension=bz2<br />
php-set = extension=intl<br />
<br />
;; required for specific apps<br />
;php-set = extension=ldap # for LDAP integration<br />
;php-set = extension=ftp # for FTP storage / external user authentication<br />
;php-set = extension=imap # for external user authentication, requires php-imap<br />
<br />
;; recommended for specific apps<br />
;php-set = extension=exif # for image rotation in pictures app, requires exiv2<br />
;php-set = extension=gmp # for SFTP storage<br />
<br />
;; for preview generation<br />
;; provided by packages in AUR<br />
; php-set = extension=imagick<br />
<br />
; opcache<br />
php-set = zend_extension=opcache<br />
<br />
; user cache<br />
; provided by php-acpu, to be enabled **either** here **or** in /etc/php/conf.d/apcu.ini<br />
php-set = extension=apcu<br />
; per https://github.com/krakjoe/apcu/blob/simplify/INSTALL<br />
php-set = apc.ttl=7200<br />
php-set = apc.enable_cli=1<br />
<br />
cron2 = minute=-15,unique=1 /usr/bin/php -f /usr/share/webapps/nextcloud/cron.php 1>/dev/null<br />
</nowiki>}}<br />
<br />
{{Note|1=<br />
* Do not forget to set your timezone and uncomment the required database connector in the uWSGI config file<br />
* The [[PHP#Configuration|open_basedir]] directive is optional and commented out. You can uncomment to harden security. Be aware that it may [https://github.com/owncloud/core/search?q=open_basedir&type=Issues occasionally break things].<br />
* Use {{ic|1=php-docroot = /usr/share/webapps}} if placing nextcloud in /nextcloud subdirectory.<br />
}}<br />
<br />
{{Warning|The way the [https://docs.nextcloud.com/server/14/admin_manual/configuration_server/background_jobs_configuration.html Nextcloud background job] is currently set up with [https://uwsgi-docs.readthedocs.org/en/latest/Cron.html uWSGI cron] will make use of the default global configuration from {{ic|/etc/php/php.ini}}. This means that none of the specific parameters defined (e.g. required modules) will be enabled, [https://github.com/owncloud/core/issues/12678#issuecomment-66114448 leading to various issues]. One solution is to copy {{ic|/etc/php/php.ini}} to e.g. {{ic|/etc/uwsgi/cron-php.ini}}, make the required modifications there (mirroring {{ic|/etc/uwsgi/nextcloud.ini}} parameters) and referencing it in the cron directive by adding the {{ic|-c /etc/uwsgi/cron-php.ini}} option to ''php'' invocation.}}<br />
<br />
==== Activation ====<br />
<br />
[[uWSGI]] provides a [[Systemd#Using_units|template unit]] that allows to start and enable application using their configuration file name as instance identifier. For example, [[start]]ing {{ic|uwsgi@nextcloud.socket}} would start it on demand referencing the configuration file {{ic|/etc/uwsgi/nextcloud.ini}}. <br />
<br />
To enable the uwsgi service by default at start-up, [[enable]] {{ic|uwsgi@nextcloud.socket}}.<br />
<br />
{{Note|Here we make use of [http://0pointer.de/blog/projects/socket-activation.html systemd socket activation] to prevent unnecessary resources consumption when no connections are made to the instance. If you would rather have it constantly active, simply remove the {{ic|.socket}} part to start and enable the service instead.}}<br />
<br />
See also [[UWSGI#Running uWSGI]].<br />
<br />
=== Setting strong permissions for the filesystem ===<br />
<br />
You should set the permissions for {{ic|config/}}, {{ic|data/}} and {{ic|apps/}} as strict as possible. That means that your HTTP user (''http'' in case of {{pkg|apache}}) should own them, and the should have {{ic|700}} permissions. You can use the following script to achieve this.<br />
<br />
{{Style|Complex script for trivial one-time task.}}<br />
<br />
{{hc|oc-perms|2=<nowiki><br />
#!/bin/bash<br />
ocpath='/usr/share/webapps/nextcloud'<br />
htuser='http'<br />
htgroup='http'<br />
rootuser='root'<br />
<br />
printf "Creating possible missing Directories\n"<br />
mkdir -p $ocpath/data<br />
mkdir -p $ocpath/assets<br />
<br />
printf "chmod Files and Directories\n"<br />
find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640<br />
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750<br />
<br />
printf "chown Directories\n"<br />
chown -R ${rootuser}:${htgroup} ${ocpath}/<br />
chown -R ${htuser}:${htgroup} ${ocpath}/apps/<br />
chown -R ${htuser}:${htgroup} ${ocpath}/assets/<br />
chown -R ${htuser}:${htgroup} ${ocpath}/config/<br />
chown -R ${htuser}:${htgroup} ${ocpath}/data/<br />
chown -R ${htuser}:${htgroup} ${ocpath}/themes/<br />
chown -R ${htuser}:${htgroup} ${ocpath}/updater/<br />
<br />
chmod +x ${ocpath}/occ<br />
<br />
printf "chmod/chown .htaccess\n"<br />
if [ -f ${ocpath}/.htaccess ]<br />
then<br />
chmod 0644 ${ocpath}/.htaccess<br />
chown ${rootuser}:${htgroup} ${ocpath}/.htaccess<br />
fi<br />
if [ -f ${ocpath}/data/.htaccess ]<br />
then<br />
chmod 0644 ${ocpath}/data/.htaccess<br />
chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess<br />
fi<br />
</nowiki>}}<br />
<br />
If you have customized your Nextcloud installation and your filepaths are different than the standard installation, then modify this script accordingly.<br />
<br />
== Synchronization ==<br />
<br />
=== Desktop ===<br />
<br />
The official client can be installed with the {{Pkg|owncloud-client}} or {{Pkg|nextcloud-client}} package.<br />
Alternative versions are available in the [[AUR]]: {{AUR|owncloud-client-git}}.<br />
<br />
==== Calendar ====<br />
<br />
To access your Nextcloud calendars using Mozilla [[Thunderbird]]'s Lightning calendar you would use the following URL:<br />
<br />
<nowiki>https://ADDRESS/remote.php/caldav/calendars/USERNAME/CALENDARNAME</nowiki><br />
<br />
To access your Nextcloud calendars using CalDAV-compatible programs like Kontact or [[Evolution]], you would use the following URL:<br />
<br />
<nowiki>https://ADDRESS/remote.php/caldav</nowiki><br />
<br />
For details see the [https://docs.nextcloud.com/server/14/user_manual/pim/index.html official documentation].<br />
<br />
==== Contacts ====<br />
<br />
To sync contacts with [[Thunderbird]], see [https://docs.nextcloud.com/server/14/user_manual/pim/sync_thunderbird.html these instructions] from the official doc.<br />
<br />
==== Mounting files with davfs2 ====<br />
<br />
If you want to mount your ownCloud permanently install {{Pkg|davfs2}} (as described in [[davfs2]]) first.<br />
<br />
Considering your ownCloud were at {{ic|https://own.example.com}}, your WebDAV URL would be {{ic|https://own.example.com/remote.php/webdav}} (as of ownCloud 6.0).<br />
<br />
To mount your ownCloud, use:<br />
<br />
# mount -t davfs https://own.example.com/remote.php/webdav /path/to/mount<br />
<br />
You can also create an entry for this in {{ic|/etc/fstab}}<br />
<br />
{{hc|/etc/fstab|<br />
https://own.example.com/remote.php/webdav /path/to/mount davfs rw,user,noauto 0 0<br />
}}<br />
<br />
{{Tip|In order to allow automount you can also store your username (and password if you like) in a file as described in [[davfs2#Storing credentials]].}}<br />
<br />
{{Note|If creating/copying files is not possible, while the same operations work on directories, see [[davfs2#Creating/copying files not possible and/or freezes]].}}<br />
<br />
=== Mounting files in GNOME Files (Nautilus) ===<br />
<br />
You can access the files directly in Nautilus ('+ Other Locations') through WebDAV protocol - use the link as shown in your Nextcloud installation Web GUI (typically: https://example.org/remote.php/webdav/) but replace the protocol name from 'https' to 'davs'. Nautilus will ask for user name and password when trying to connect.<br />
<br />
=== Android ===<br />
<br />
Download the official Nextcloud app from [https://play.google.com/store/apps/details?id=com.nextcloud.client Google Play] or [https://f-droid.org/packages/com.nextcloud.client/ F-Droid].<br />
<br />
To enable contacts and calendar sync (Android 4+):<br />
# download [https://davdroid.bitfire.at/ DAVdroid] ([https://play.google.com/store/apps/details?id=at.bitfire.davdroid Play Store], [https://f-droid.org/app/at.bitfire.davdroid F-Droid])<br />
# Enable mod_rewrite.so in httpd.conf<br />
# create a new DAVdroid account in the ''Account'' settings, and specify your "short" server address and login/password couple, e.g. {{ic|<nowiki>https://cloud.example.com</nowiki>}} (there is no need for the {{ic|<nowiki>/remote.php/{carddav,webdav}</nowiki>}} part if you configured your web server with the proper redirections, as illustrated previously in the article; ''DAVdroid'' will find itself the right URLs)<br />
<br />
=== iOS ===<br />
<br />
Download the official Nextcloud app from the [https://itunes.apple.com/us/app/nextcloud/id1125420102 App Store].<br />
<br />
== Troubleshooting ==<br />
{{Out of date|A lot of references to OwnCloud, are these still valid with Nextcloud?}}<br />
<br />
=== Environment variables not available ===<br />
<br />
Uncomment the line in {{ic|/etc/php/php-fpm.d/www.conf}} as per [https://docs.nextcloud.com/server/14/admin_manual/installation/source_installation.html#php-fpm-tips-label Nextcloud documentation]:<br />
env[PATH] = /usr/local/bin:/usr/bin:/bin<br />
<br />
=== Self-signed certificate not accepted ===<br />
<br />
ownCloud uses [[Wikipedia:cURL]] and [[Wikipedia:SabreDAV]] to check if WebDAV is enabled.<br />
If you use SSL/TLS with a self-signed certificate, e.g. as shown in [[LAMP]], and access ownCloud's admin panel, you will see the following error message:<br />
<br />
Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken.<br />
<br />
Assuming that you followed the [[LAMP]] tutorial, execute the following steps:<br />
<br />
Create a local directory for non-distribution certificates and copy [[LAMP]]s certificate there. This will prevent {{ic|ca-certificates}}-updates from overwriting it.<br />
<br />
# cp /etc/httpd/conf/server.crt /usr/share/ca-certificates/''WWW.EXAMPLE.COM.crt''<br />
<br />
Add ''WWW.EXAMPLE.COM.crt'' to {{ic|/etc/ca-certificates.conf}}:<br />
<br />
''WWW.EXAMPLE.COM.crt''<br />
<br />
Now, regenerate your certificate store:<br />
<br />
# update-ca-certificates<br />
<br />
Restart the httpd service to activate your certificate.<br />
<br />
=== Self-signed certificate for Android devices ===<br />
<br />
Once you have followed the setup for SSL, as on [[Apache HTTP Server#TLS]] for example, early versions of DAVdroid will<br />
reject the connection because the certificate is not trusted. A certificate can be made as follows on your server:<br />
<br />
# openssl x509 -req -days 365 -in /etc/httpd/conf/server.csr -signkey /etc/httpd/conf/server.key -extfile android.txt -out CA.crt<br />
# openssl x509 -inform PEM -outform DER -in CA.crt -out CA.der.crt <br />
<br />
The file {{ic|android.txt}} should contain the following:<br />
<br />
basicConstraints=CA:true<br />
<br />
Then import {{ic|CA.der.crt}} to your Android device:<br />
<br />
Put the {{ic|CA.der.crt}} file onto the sdcard of your Android device (usually to the internal one, e.g. save from a mail attachment).<br />
It should be in the root directory. Go to ''Settings > Security > Credential storage'' and select ''Install from device storage''.<br />
The {{ic|.crt}} file will be detected and you will be prompted to enter a certificate name. After importing the certificate,<br />
you will find it in ''Settings > Security > Credential storage > Trusted credentials > User''.<br />
<br />
Thanks to: [http://www.leftbrainthings.com/2013/10/13/creating-and-importing-self-signed-certificate-to-android-device/]<br />
<br />
Another way is to import the certificate directly from your server via [https://play.google.com/store/apps/details?id=at.bitfire.cadroid CAdroid] and follow the instructions there.<br />
<br />
=== Cannot write into config directory! ===<br />
<br />
If you have set {{ic|open_basedir}} in your PHP/web server configuration file (e.g. {{ic|/etc/httpd/conf/extra/nextcloud.conf}}), make sure that it includes {{ic|/etc/webapps}}.<br />
<br />
Restart the web server to apply the change.<br />
<br />
=== Cannot create data directory ===<br />
<br />
If you have set {{ic|open_basedir}} in your PHP/web server configuration file (e.g. {{ic|/etc/httpd/conf/extra/nextcloud.conf}}), make sure that it includes the data directory.<br />
<br />
Restart the web server to apply the change.<br />
<br />
=== CSync failed to find a specific file. ===<br />
<br />
This is most likely a certificate issue. Recreate it, and do not leave the common name empty or you will see the error again.<br />
<br />
# openssl req -new -x509 -nodes -newkey rsa:4096 -keyout server.key -out server.crt<br />
<br />
=== Seeing white page after login ===<br />
<br />
The cause is probably a new app that you installed. To fix that, you can use the occ command as described<br />
[https://docs.nextcloud.com/server/14/admin_manual/configuration_server/occ_command.html here]. So with<br />
<br />
sudo -u http php /usr/share/webapps/nextcloud/occ app:list<br />
<br />
you can list all apps (if you installed nextcloud in the standard directory), and with <br />
<br />
sudo -u http php /usr/share/webapps/nextcloud/occ app:disable <nameOfExtension><br />
<br />
you can disable the troubling app.<br />
<br />
Alternatively, you can either use [[phpMyAdmin]] to edit the {{ic|oc_appconfig}} table (if you got lucky and the table has an edit option), or do it by hand with mysql:<br />
<br />
mysql -u root -p owncloud<br />
MariaDB [owncloud]> '''delete from''' oc_appconfig '''where''' appid='<nameOfExtension>' '''and''' configkey='enabled' '''and''' configvalue='yes';<br />
MariaDB [owncloud]> '''insert into''' oc_appconfig (appid,configkey,configvalue) '''values''' ('<nameOfExtension>','enabled','no');<br />
<br />
This should delete the relevant configuration from the table and add it again.<br />
<br />
=== GUI sync client fails to connect ===<br />
<br />
If using HTTP basic authentication, make sure to exclude "status.php", which must be publicly accessible. [https://github.com/owncloud/mirall/issues/734]<br />
<br />
=== Some files upload, but give an error 'Integrity constraint violation...' ===<br />
<br />
You may see the following error in the ownCloud sync client:<br />
<br />
SQLSTATE[23000]: Integrity constraint violation: ... Duplicate entry '...' for key 'fs_storage_path_hash')...<br />
<br />
This is caused by an issue with the File Locking app, which is often not sufficient to keep conflicts from occurring on some webserver configurations.<br />
A more complete [https://docs.nextcloud.com/server/14/admin_manual/configuration_files/files_locking_transactional.html Transactional File Locking]<br />
is available that rids these errors, but you must be using the Redis php-caching method. Install {{Pkg|redis}} and {{AUR|php-redis}}, comment out<br />
your current php-cache mechanism, and then in {{ic|/etc/php/conf.d/redis.ini}} uncomment {{ic|1=extension=redis}}.<br />
Then in {{ic|config.php}} make the following changes:<br />
<br />
'memcache.local' => '\OC\Memcache\Redis',<br />
'filelocking.enabled' => 'true',<br />
'memcache.locking' => '\OC\Memcache\Redis',<br />
'redis' => array(<br />
'host' => 'localhost',<br />
'port' => 6379,<br />
'timeout' => 0.0,<br />
),<br />
<br />
and [[start/enable]] {{ic|redis.service}}.<br />
<br />
Finally, disable the File Locking App, as the Transational File Locking will take care of it (and would conflict).<br />
<br />
If everything is working, you should see 'Transactional File Locking Enabled' under Server Status on the Admin page, and syncs should no longer cause issues.<br />
<br />
=== "Cannot write into apps directory" ===<br />
<br />
As mentioned in the [https://docs.nextcloud.com/server/14/admin_manual/installation/apps_management_installation.html official admin manual],<br />
either you need an apps directory that is writable by the http user, or you need to set {{ic|appstoreenabled}} to {{ic|false}}. <br />
<br />
If you have set {{ic|open_basedir}} in your PHP/web server configuration file (e.g. {{ic|/etc/httpd/conf/extra/nextcloud.conf}}), it may be necessary to add your ''/path/to/data'' directory to the string on the line starting with {{ic|php_admin_value open_basedir }}:<br />
<br />
{{hc|/etc/httpd/conf/extra/nextcloud.conf|2=<br />
<br />
php_admin_value open_basedir "''/path/to/data/'':/srv/http/:/dev/urandom:/tmp/:/usr/share/pear/:/usr/share/webapps/nextcloud/:/etc/webapps/nextcloud"<br />
}}<br />
<br />
=== Installed apps get blocked because of MIME type error ===<br />
<br />
If you are putting your apps folder outside of the nextcloud installation directory make sure your webserver serves it properly.<br />
<br />
In nginx this is accomplished by adding a location block to the nginx configuration as the folder will not be included in it by default.<br />
<br />
location ~ /apps2/(.*)$ {<br />
alias /var/www/nextcloud/apps/$1;<br />
}<br />
<br />
=== Security warnings even though the recommended settings have been included in nginx.conf ===<br />
<br />
At the top of the admin page there might be a warning to set the {{ic|Strict-Transport-Security}}, {{ic|X-Content-Type-Options}},<br />
{{ic|X-Frame-Options}}, {{ic|X-XSS-Protection}} and {{ic|X-Robots-Tag}} according to https://docs.nextcloud.com/server/14/admin_manual/configuration_server/harden_server.html<br />
even though they are already set like that.<br />
<br />
A possible cause could be that because owncloud sets those settings, uwsgi passed them along and nginx added them again:<br />
<br />
{{hc|$ curl -I https://domain.tld|<nowiki><br />
...<br />
X-XSS-Protection: 1; mode=block<br />
X-Content-Type-Options: nosniff<br />
X-Frame-Options: Sameorigin<br />
X-Robots-Tag: none<br />
Strict-Transport-Security: max-age=15768000; includeSubDomains; preload;<br />
X-Content-Type-Options: nosniff<br />
X-Frame-Options: SAMEORIGIN<br />
X-XSS-Protection: 1; mode=block<br />
X-Robots-Tag: none<br />
</nowiki>}}<br />
<br />
While the fast_cgi sample config has a parameter to avoid that ( {{ic|fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice}} ), when using uwsgi and nginx the following modification of the uwsgi part in nginx.conf could help:<br />
<br />
{{hc| /etc/nginx/nginx.conf|<nowiki><br />
...<br />
# pass all .php or .php/path urls to uWSGI<br />
location ~ ^(.+\.php)(.*)$ {<br />
include uwsgi_params;<br />
uwsgi_modifier1 14;<br />
# hode following headers received from uwsgi, because otherwise we would send them twice since we already add them in nginx itself<br />
uwsgi_hide_header X-Frame-Options;<br />
uwsgi_hide_header X-XSS-Protection;<br />
uwsgi_hide_header X-Content-Type-Options;<br />
uwsgi_hide_header X-Robots-Tag;<br />
uwsgi_hide_header X-Frame-Options;<br />
#Uncomment line below if you get connection refused error. Remember to commet out line with "uwsgi_pass 127.0.0.1:3001;" below<br />
uwsgi_pass unix:/run/uwsgi/owncloud.sock;<br />
#uwsgi_pass 127.0.0.1:3001;<br />
}<br />
...<br />
</nowiki>}}<br />
<br />
=== "Reading from keychain failed with error: 'No keychain service available'" ===<br />
<br />
Can be fixed for Gnome by installing the following 2 packages, {{Pkg|libgnome-keyring}} and {{Pkg|gnome-keyring}}.<br />
Or the following for KDE, {{Pkg|libgnome-keyring}} and {{Pkg|qtkeychain}}.<br />
<br />
=== FolderSync: "Method Not Allowed" ===<br />
<br />
FolderSync needs access to {{ic|/owncloud/remote.php/webdav}}, so you could create another alias for owncloud in your {{ic|/etc/httpd/conf/extra/nextcloud.conf}}<br />
<br />
<IfModule mod_alias.c><br />
Alias /nextcloud /usr/share/webapps/nextcloud/<br />
Alias /owncloud /usr/share/webapps/nextcloud/<br />
</IfModule><br />
<br />
=== Nextcloud 13 : "Unable to load dynamic library 'mcrypt.so" ===<br />
<br />
Starting with php 7.2 the extension mcrypt was removed.[https://wiki.php.net/rfc/mcrypt-viking-funeral]<br />
<br />
To fix the error about mcrypt in Nextcloud logs, a version of this extension compatible with php 7.2 can be installed via PECL.<br />
<br />
# Install {{AUR|php-pear}} if you do not have it already<br />
# Update PECL channels: {{bc|# pecl channel-update pecl.php.net}}<br />
# Install mcrypt 1.0.1: {{bc|# pecl install mcrypt-1.0.1}}<br />
# Uncomment this line in {{ic|/etc/php/php.conf}}: {{bc|1=;extension=mcrypt.so}}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Running ownCloud in a subdirectory ===<br />
<br />
By including the default {{ic|owncloud.conf}} in {{ic|httpd.conf}}, ownCloud will take control of port 80 and your localhost domain. <br />
<br />
If you would like to have ownCloud run in a subdirectory, then edit the {{ic|/etc/httpd/conf/extra/owncloud.conf}}<br />
you included and comment out the {{ic|<nowiki><VirtualHost *:80> ... </VirtualHost></nowiki>}} part of the include file.<br />
<br />
You can use the following nginx config when using owncloud with uwsgi:<br />
<br />
{{hc|head=/etc/nginx/conf.d/owncloud.conf|output=<nowiki><br />
location = /.well-known/carddav {<br />
return 301 $scheme://$host/owncloud/remote.php/dav;<br />
}<br />
<br />
location = /.well-known/caldav {<br />
return 301 $scheme://$host/owncloud/remote.php/dav;<br />
}<br />
<br />
location /.well-known/acme-challenge { }<br />
<br />
location ^~ /owncloud {<br />
<br />
root /usr/share/webapps;<br />
<br />
# set max upload size<br />
client_max_body_size 512M;<br />
fastcgi_buffers 64 4K;<br />
<br />
# Disable gzip to avoid the removal of the ETag header<br />
gzip off;<br />
<br />
# Uncomment if your server is build with the ngx_pagespeed module<br />
# This module is currently not supported.<br />
#pagespeed off;<br />
<br />
location /owncloud {<br />
rewrite ^ /owncloud/index.php$uri;<br />
}<br />
<br />
location ~ ^/owncloud/(?:build|tests|config|lib|3rdparty|templates|data)/ {<br />
deny all;<br />
}<br />
<br />
location ~ ^/owncloud/(?:\.|autotest|occ|issue|indie|db_|console) {<br />
deny all;<br />
}<br />
<br />
location ~ ^/owncloud/(?:updater|ocs-provider)(?:$|/) {<br />
try_files $uri/ =404;<br />
index index.php;<br />
}<br />
<br />
location ~ ^/owncloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {<br />
include uwsgi_params;<br />
uwsgi_modifier1 14;<br />
# Avoid duplicate headers confusing OC checks<br />
uwsgi_hide_header X-Frame-Options;<br />
uwsgi_hide_header X-XSS-Protection;<br />
uwsgi_hide_header X-Content-Type-Options;<br />
uwsgi_hide_header X-Robots-Tag;<br />
uwsgi_pass unix:/run/uwsgi/owncloud.sock;<br />
}<br />
<br />
# Adding the cache control header for js and css files<br />
# Make sure it is BELOW the PHP block<br />
location ~* \.(?:css|js) {<br />
try_files $uri /owncloud/index.php$uri$is_args$args;<br />
add_header Cache-Control "public, max-age=7200";<br />
# Add headers to serve security related headers (It is intended<br />
# to have those duplicated to the ones above)<br />
# Before enabling Strict-Transport-Security headers please read<br />
# into this topic first.<br />
# add_header Strict-Transport-Security "max-age=15768000;<br />
# includeSubDomains; preload;";<br />
add_header X-Content-Type-Options nosniff;<br />
add_header X-Frame-Options "SAMEORIGIN";<br />
add_header X-XSS-Protection "1; mode=block";<br />
add_header X-Robots-Tag none;<br />
add_header X-Download-Options noopen;<br />
add_header X-Permitted-Cross-Domain-Policies none;<br />
# Optional: Do not log access to assets<br />
access_log off;<br />
}<br />
<br />
location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg) {<br />
try_files $uri /owncloud/index.php$uri$is_args$args;<br />
# Optional: Do not log access to other assets<br />
access_log off;<br />
}<br />
}<br />
</nowiki>}}<br />
<br />
=== Docker ===<br />
<br />
See the [https://hub.docker.com/_/owncloud/ ownCloud] or [https://github.com/nextcloud/docker Nextcloud] repository for [[Docker]].<br />
<br />
=== Upload and share from File Manager ===<br />
<br />
[https://github.com/schiesbn/shareLinkCreator shareLinkCreator] provides the ability to upload a file to<br />
OwnCloud via a supported file manager and receive a link to the uploaded file which can then be emailed or shared in another way.<br />
<br />
=== Defining Background Jobs ===<br />
<br />
Nextcloud requires scheduled execution of some tasks, and by default it achieves this by using AJAX,<br />
however AJAX is the least reliable method, and it is recommended to use [[Cron]] instead. However,<br />
ArchLinux ships with {{Pkg|systemd}}, so the preferred way of executing scheduled tasks is a [[Systemd#Timers|systemd timer]]. <br />
<br />
==== Manual install ====<br />
<br />
First create a service:<br />
<br />
{{hc|/etc/systemd/system/nextcloudcron.service|<nowiki><br />
[Unit]<br />
Description=Nextcloud cron.php job<br />
<br />
[Service]<br />
User=http<br />
ExecStart=/usr/bin/php -f /usr/share/webapps/nextcloud/cron.php<br />
<br />
[Install]<br />
WantedBy=basic.target<br />
</nowiki>}}<br />
<br />
Then create a timer for that service:<br />
<br />
{{hc|/etc/systemd/system/nextcloudcron.timer|<nowiki><br />
[Unit]<br />
Description=Run Nextcloud cron.php every 15 minutes<br />
<br />
[Timer]<br />
OnBootSec=5min<br />
OnUnitActiveSec=15min<br />
Unit=nextcloudcron.service<br />
<br />
[Install]<br />
WantedBy=timers.target<br />
</nowiki>}}<br />
<br />
==== AUR package ====<br />
<br />
Install {{AUR|nextcloud-systemd-timers}}.<br />
<br />
==== Activate timer ====<br />
<br />
[[Start/enable]] {{ic|nextcloudcron.timer}}.<br />
<br />
Confirm that it is running by running<br />
<br />
# systemctl list-timers<br />
<br />
=== Collabora Online Office integration ===<br />
<br />
'''Solution with Docker: ''CODE backend using the official Docker image'''''<br />
<br />
The first, install a {{Pkg|docker}} package to provide collabora files and setup a Collabora server.<br />
<br />
[[Start/enable]] {{ic|docker.service}}.<br />
<br />
Then, download the required binares :<br />
<br />
# docker pull collabora/code<br />
<br />
And, installing a Collabora server. Make sure {{ic|cloud//.example//.com}} is your nextcloud's domain, not a collabora :<br />
<br />
# docker run -t -d -p 127.0.0.1:9980:9980 -e 'domain=cloud\\.example\\.com' --restart always --cap-add MKNOD collabora/code<br />
<br />
Also make sure to escape all dots with double backslashes (\), since this string will be evaluated as a regular expression (and your bash 'eats' the first backslash.) If you want to use the docker container with more than one Nextcloud, you will need to use 'domain=cloud\\.example\\.com\|second\\.example\\.com' instead. (All hosts are separated by \|.) When using `localhost` as domain for testing you need to add {{ic|--net host}} to ensure the docker container can access your Nextcloud server. <br />
<br />
If you need to delete or reinstall Collabora server use:<br />
<br />
For recognition CONTAINER_ID of server<br />
<br />
# docker ps<br />
<br />
Stop and delete<br />
<br />
# docker stop CONTAINER_ID<br />
# docker rm CONTAINER_ID<br />
<br />
Futher, follow the instruction of webserver you are using:<br />
<br />
'''Nginx setup example:'''<br />
<br />
Add following to your nextcloud domain config or add new config file in /etc/nginx/conf.d/ directory, (Do not forget to change {{ic|office.example.com}} and {{ic|ssl_certificate}} to the right values. If you are using docker image, change {{ic|http}} to {{ic|https}}.)<br />
<br />
{{hc|/etc/nginx/conf.d/example.conf|<nowiki><br />
upstream office.example.com {<br />
server 127.0.0.1:9980;<br />
}<br />
<br />
server {<br />
listen 443 ssl;<br />
server_name office.example.com;<br />
<br />
ssl_certificate /etc/letsencrypt/live/office.example.com/fullchain.pem;<br />
ssl_certificate_key /etc/letsencrypt/live/office.example.com/privkey.pem;<br />
<br />
# static files<br />
location ^~ /loleaflet {<br />
proxy_pass http://127.0.0.1:9980;<br />
proxy_set_header Host $host;<br />
}<br />
<br />
# WOPI discovery URL<br />
location ^~ /hosting/discovery {<br />
proxy_pass http://127.0.0.1:9980;<br />
proxy_set_header Host $host;<br />
}<br />
<br />
# Main websocket<br />
location ~ /lool/(.*)/ws$ {<br />
proxy_pass http://127.0.0.1:9980;<br />
proxy_set_header Upgrade $http_upgrade;<br />
proxy_set_header Connection "Upgrade";<br />
proxy_set_header Host $host;<br />
proxy_read_timeout 36000s;<br />
}<br />
<br />
# Admin Console websocket<br />
location ^~ /lool/adminws {<br />
proxy_buffering off;<br />
proxy_pass http://127.0.0.1:9980;<br />
proxy_set_header Upgrade $http_upgrade;<br />
proxy_set_header Connection "Upgrade";<br />
proxy_set_header Host $host;<br />
proxy_read_timeout 36000s;<br />
}<br />
<br />
# download, presentation and image upload<br />
location ~ /lool {<br />
proxy_pass http://127.0.0.1:9980;<br />
proxy_set_header Host $host;<br />
}<br />
}<br />
</nowiki>}}<br />
<br />
Restart a nginx:<br />
<br />
# nginx -s reload<br />
<br />
or [[restart]] {{ic|nginx.service}}.<br />
<br />
'''Apache setup example:'''<br />
<br />
Add following to nextcloud config file. Do not forget to change to the right values<br />
<br />
{{hc|/etc/httpd/conf/extra/nextcloud.conf|<nowiki><br />
<VirtualHost *:443><br />
ServerName office.nextcloud.com:443<br />
<br />
# SSL configuration, you may want to take the easy route instead and use Lets Encrypt!<br />
SSLEngine on<br />
SSLCertificateFile /path/to/signed_certificate<br />
SSLCertificateChainFile /path/to/intermediate_certificate<br />
SSLCertificateKeyFile /path/to/private/key<br />
SSLProtocol all -SSLv2 -SSLv3<br />
SSLCipherSuite ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS<br />
SSLHonorCipherOrder on<br />
<br />
# Encoded slashes need to be allowed<br />
AllowEncodedSlashes NoDecode<br />
<br />
# Container uses a unique non-signed certificate<br />
SSLProxyEngine On<br />
SSLProxyVerify None<br />
SSLProxyCheckPeerCN Off<br />
SSLProxyCheckPeerName Off<br />
<br />
# keep the host<br />
ProxyPreserveHost On<br />
<br />
# static html, js, images, etc. served from loolwsd<br />
# loleaflet is the client part of LibreOffice Online<br />
ProxyPass /loleaflet https://127.0.0.1:9980/loleaflet retry=0<br />
ProxyPassReverse /loleaflet https://127.0.0.1:9980/loleaflet<br />
<br />
# WOPI discovery URL<br />
ProxyPass /hosting/discovery https://127.0.0.1:9980/hosting/discovery retry=0<br />
ProxyPassReverse /hosting/discovery https://127.0.0.1:9980/hosting/discovery<br />
<br />
# Main websocket<br />
ProxyPassMatch "/lool/(.*)/ws$" wss://127.0.0.1:9980/lool/$1/ws nocanon<br />
<br />
# Admin Console websocket<br />
ProxyPass /lool/adminws wss://127.0.0.1:9980/lool/adminws<br />
<br />
# Download as, Fullscreen presentation and Image upload operations<br />
ProxyPass /lool https://127.0.0.1:9980/lool<br />
ProxyPassReverse /lool https://127.0.0.1:9980/lool<br />
</VirtualHost><br />
</nowiki>}}<br />
<br />
After configuring these do restart your apache by [[restart]]ing {{ic|httpd.service}}.<br />
<br />
'''Install the Nextcloud app'''<br />
<br />
Go to the Apps section and choose “Office & Text”, install the “Collabora Online” app. In admin panel select Collabora Online tab and specific the server's domain you have setup before.<br />
<br />
'''Solution without Docker: ''CODE backend using an Archlinux package'''''<br />
<br />
The {{AUR|collabora-online-server-nodocker}} package brings to your Archlinux installation 1º Collabora Office (the desktop suite), and 2º the “CODE” (Collabora Online Development Edition) server, which is based on “lool” (LibreOffice OnLine).<br />
<br />
Alter the `/etc/loolwsd/loolwsd.xml` file, so that:<br />
<br />
* `config > server_name` contains the host and port of the public Nextcloud address, separated by a colon (eg. `example.org:443`),<br />
* `config > ssl > enable` is false (ie. web browser —HTTPS→ proxy —HTTP→ loolwsd),<br />
* `config > ssl > termination` is true (I suppose you’ll manage TLS at the proxy level),<br />
* `config > storage > wopi > host` reflects the actual hostname (or pattern) of the proxy server (eg. `(?:.*\.)?example\.org`),<br />
* `config > admin_console > username` and `config > admin_console > password` are set to values of your choice.<br />
<br />
Then:<br />
<br />
* [[start]] and [[enable]] {{ic|loolwsd.service}};<br />
* configure Nginx as showed in /usr/share/doc/loolwsd/example.nginx.conf, and restart it.<br />
<br />
== See also ==<br />
<br />
* [https://docs.nextcloud.com/ nextcloud official website]<br />
* [https://docs.nextcloud.com/server/14/admin_manual/ nextcloud 14.0 Admin Documentation]</div>Roshlesshttps://wiki.archlinux.org/index.php?title=Nextcloud&diff=559528Nextcloud2018-12-19T17:45:45Z<p>Roshless: note about collabora docker running only on https</p>
<hr />
<div>[[Category:File sharing]]<br />
[[Category:Web applications]]<br />
[[fr:Owncloud]]<br />
[[ja:Nextcloud]]<br />
{{Related articles start}}<br />
{{Related|Apache HTTP Server}}<br />
{{Related|Nginx}}<br />
{{Related|OpenSSL}}<br />
{{Related|WebDAV}}<br />
{{Related articles end}}<br />
<br />
From [[Wikipedia:Nextcloud]]:<br />
<br />
:Nextcloud is a suite of client-server software for creating and using file hosting services. It is functionally similar to Dropbox, although Nextcloud is free and open-source, allowing anyone to install and operate it on a private server. In contrast to proprietary services like Dropbox, the open architecture allows adding additional functionality to the server in form of applications.<br />
<br />
Nextcloud is a fork of ownCloud. For differences between the two, see [[wikipedia:Nextcloud#Differences from ownCloud]].<br />
<br />
== Prerequisites ==<br />
<br />
Nextcloud requires several components:[https://docs.nextcloud.com/server/14/admin_manual/installation/system_requirements.html#server]<br />
<br />
* A web server: [[Apache]] or [[nginx]]<br />
* A database: [[MariaDB]]/MySQL, [[PostgreSQL]] or [[Oracle]]<br />
* [[PHP]] with [[#PHP setup|additional modules]]<br />
<br />
These will be configured in [[#Setup]].<br />
<br />
Make sure the required components are installed before proceeding.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|nextcloud}} package.<br />
<br />
== Setup ==<br />
<br />
As stated above, in order to setup Nextcloud, you must set up the appropriate PHP requirements;<br />
additionally, you must configure a database and a webserver.<br />
<br />
=== Pacman hook ===<br />
<br />
To upgrade the Nextcloud database automatically on updates, you may want to create a [[pacman hook]]:<br />
<br />
{{hc|/etc/pacman.d/hooks/nextcloud.hook|2=<br />
[Trigger]<br />
Operation = Install<br />
Operation = Upgrade<br />
Type = Package<br />
Target = nextcloud<br />
Target = nextcloud-app-*<br />
<br />
[Action]<br />
Description = Update Nextcloud installation<br />
When = PostTransaction<br />
Exec = /usr/bin/runuser -u http -- /usr/bin/php /usr/share/webapps/nextcloud/occ upgrade<br />
}}<br />
<br />
=== PHP setup ===<br />
<br />
{{Tip|For all prerequisite PHP modules, see upstream documentation: [https://docs.nextcloud.com/server/14/admin_manual/installation/source_installation.html#prerequisites-label Nextcloud 14.0].}}<br />
<br />
Install [[PHP#gd]] and {{pkg|php-intl}} as additional modules. Configure [[PHP#OPCache|OPcache]] as recommended by [https://docs.nextcloud.com/server/14/admin_manual/configuration_server/server_tuning.html#enable-php-opcache the documentation].<br />
<br />
Some apps (''News'' for example) require the {{ic|iconv}} extension, if you wish to use these apps, uncomment the extension in {{ic|/etc/php/php.ini}}.<br />
<br />
Depending on which database backend will be used:<br />
<br />
* For [[MySQL]], see [[PHP#MySQL/MariaDB]].<br />
* For [[PostgreSQL]], see [[PHP#PostgreSQL]].<br />
* For [[SQLite]], see [[PHP#Sqlite]].<br />
<br />
Performance may be improved through the implementation of [[PHP#Caching|caching]], see<br />
[https://docs.nextcloud.com/server/14/admin_manual/configuration_server/caching_configuration.html Configuring Memory Caching]<br />
on the official documentation for details.<br />
<br />
=== Database setup ===<br />
<br />
An SQL database must be setup and used for your Nextcloud installation. After setting up the database here,<br />
you will be prompted for its information when you first create an administrator account.<br />
<br />
==== MariaDB ====<br />
<br />
It is recommended to set up an own database and user when using [[MariaDB]]:<br />
<br />
{{hc|$ mysql -u root -p|2=<br />
mysql> CREATE DATABASE `'''nextcloud'''` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;<br />
mysql> CREATE USER `'''nextcloud'''`@'localhost' IDENTIFIED BY ''''password'''';<br />
mysql> GRANT ALL PRIVILEGES ON `'''nextcloud'''`.* TO `'''nextcloud'''`@`localhost`;<br />
mysql> \q<br />
}}<br />
<br />
{{Note|Create or convert the database with MySQL 4-byte support in order to use Emojis (textbased smilies) on your Nextcloud server [https://docs.nextcloud.com/server/14/admin_manual/configuration_database/mysql_4byte_support.html].}}<br />
<br />
==== PostgreSQL ====<br />
<br />
The following is an example of setting up a [[PostgreSQL]] user and database:<br />
<br />
{{hc|1=[postgres]$ createuser -h localhost -P nextcloud|2=<br />
Enter password for new role:<br />
Enter it again:<br />
}}<br />
<br />
[postgres]$ createdb -O nextcloud nextcloud<br />
<br />
=== Web server setup ===<br />
<br />
{{Warning|It is recommended to use TLS/SSL (HTTPS) over plain HTTP, see [[Apache#TLS]] or [[Nginx#TLS]] for examples and implement this in the examples given below.}}<br />
<br />
Depending on which [[web server]] you are using, further setup is required, indicated below.<br />
<br />
==== Apache ====<br />
<br />
If you have not already, install [[Apache]] and install and enable [[Apache#PHP|Apache's PHP module]]<br />
<br />
Copy the Apache configuration file to the configuration directory:<br />
<br />
# cp /etc/webapps/nextcloud/apache.example.conf /etc/httpd/conf/extra/nextcloud.conf<br />
<br />
Modify the file according to your preferences. By default it includes an alias for {{ic|/nextcloud}} pointing to {{ic|/usr/share/webapps/nextcloud}}.<br />
<br />
And include it in {{ic|/etc/httpd/conf/httpd.conf}}:<br />
<br />
Include conf/extra/nextcloud.conf<br />
<br />
Ensure that the root location of your Nextcloud installation (e.g., {{ic|/usr/share/webapps/nextcloud}}) is accessible by the webserver's user {{ic|http}}.<br />
<br />
Now restart Apache ({{ic|httpd.service}}).<br />
<br />
===== WebDAV =====<br />
<br />
Nextcloud comes with its own [[WebDAV]] implementation enabled, which may conflict with the one shipped with Apache. If you have enabled WebDAV in Apache (not enabled by default), disable the modules {{ic|mod_dav}} and {{ic|mod_dav_fs}} in {{ic|/etc/httpd/conf/httpd.conf}}. See [https://forum.owncloud.org/viewtopic.php?f=17&t=7240] for details.<br />
<br />
==== Nginx ====<br />
<br />
Make sure PHP-FPM has been configured correctly as described in [[Nginx#FastCGI]]. Uncomment {{ic|1=env[PATH]}} in {{ic|/etc/php/php-fpm.d/www.conf}} as it is required by Nextcloud.<br />
<br />
Create a [[Nginx#Server_blocks|server block]] and add the content according to the [https://docs.nextcloud.com/server/14/admin_manual/installation/nginx.html Nextcloud documentation]:<br />
<br />
{{Note|Use {{ic|/usr/share/webapps/nextcloud}} as {{ic|root}} location when using {{Pkg|nextcloud}}.}}<br />
{{Tip|See the [https://github.com/graysky2/configs/blob/master/nginx/nextcloud-initial.conf following template] as initial configuration when setting up [[Let's Encrypt]].}}<br />
<br />
{{hc|/etc/nginx/sites-available/owncloud.conf|2=<nowiki><br />
upstream php-handler {<br />
server unix:/run/php-fpm/php-fpm.sock;<br />
}<br />
<br />
server {<br />
listen 443 ssl http2;<br />
listen [::]:443 ssl http2;<br />
server_name cloud.example.com;<br />
<br />
ssl_certificate /etc/ssl/nginx/cloud.example.com.crt;<br />
ssl_certificate_key /etc/ssl/nginx/cloud.example.com.key;<br />
<br />
..<br />
<br />
# Path to the root of your installation<br />
root /usr/share/webapps/nextcloud/;<br />
<br />
..<br />
<br />
location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {<br />
fastcgi_split_path_info ^(.+\.php)(/.*)$;<br />
include fastcgi_params;<br />
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;<br />
fastcgi_param PATH_INFO $fastcgi_path_info;<br />
fastcgi_param HTTPS on;<br />
#Avoid sending the security headers twice<br />
fastcgi_param modHeadersAvailable true;<br />
fastcgi_param front_controller_active true;<br />
fastcgi_pass php-handler;<br />
fastcgi_intercept_errors on;<br />
fastcgi_request_buffering off;<br />
}<br />
}<br />
</nowiki>}}<br />
<br />
== Initialize ==<br />
<br />
Open the address where you have installed Nextcloud in a web browser (e.g., https://www.example.com/nextcloud).<br />
<br />
=== Create storage directories ===<br />
<br />
To webserver read/write access to the ''apps'' directory (e.g. on "Cannot write into "apps" directory"), setup the correct permissions:<br />
<br />
{{Note|Replace {{ic|http}} when using a different [[user]]/[[user group]] for the webserver.}}<br />
<br />
# mkdir -p /usr/share/webapps/nextcloud/data<br />
# chown http:http /usr/share/webapps/nextcloud/data<br />
# chown -R http:http /usr/share/webapps/nextcloud/apps<br />
# chmod 750 /usr/share/webapps/nextcloud/data<br />
# chmod 750 /usr/share/webapps/nextcloud/apps<br />
<br />
To overrule the data directory on the current setup, [[append]] {{ic|datadirectory}} to {{ic|/etc/webapps/nextcloud/config/config.php}} before the closing tag {{ic|);}}:<br />
<br />
{{hc|/etc/webapps/nextcloud/config/config.php|2=<br />
<br />
'datadirectory' => '/usr/share/webapps/nextcloud/data'<br />
}}<br />
<br />
If you have set {{ic|open_basedir}} in your PHP/web server configuration file (e.g. {{ic|/etc/httpd/conf/extra/nextcloud.conf}}), it may be necessary to add your ''/path/to/data'' directory to the string on the line starting with {{ic|php_admin_value open_basedir }}:<br />
<br />
{{hc|/etc/httpd/conf/extra/nextcloud.conf|2=<br />
<br />
php_admin_value open_basedir "''/path/to/data/'':/srv/http/:/dev/urandom:/tmp/:/usr/share/pear/:/usr/share/webapps/nextcloud/:/etc/webapps/nextcloud"<br />
}}<br />
<br />
=== Configure caching ===<br />
<br />
It is recommended to [https://docs.nextcloud.com/server/14/admin_manual/configuration_server/caching_configuration.html enable caching]. The Nextcloud documentation provides instructions on [[Redis]], Memcached and [[PHP#APCu|APCu]].<br />
<br />
== Security Hardening ==<br />
<br />
See the [https://docs.nextcloud.com/server/14/admin_manual/configuration_server/harden_server.html Nextcloud documentation] and [[Security]]. Nextcloud additionally provides a [https://scan.nextcloud.com/ Security scanner].<br />
<br />
=== uWSGI ===<br />
<br />
You can run Nextcloud in its own process and service by using the [[uWSGI]] application server with {{pkg|uwsgi-plugin-php}}. This allows you to define a [[PHP#Configuration|PHP configuration]] only for this instance of PHP, without the need to edit the global {{ic|php.ini}} and thus keeping your web application configurations compartmentalized. ''uWSGI'' itself has a wealth of features to limit the resource use and to harden the security of the application, and by being a separate process it can run under its own user.<br />
<br />
The only part that differs from [[#Nginx]] is the {{ic|<nowiki>location ~ \.php(?:$|/) {}</nowiki>}} block:<br />
<br />
{{bc|<nowiki><br />
location ~ \.php(?:$|/) {<br />
include uwsgi_params;<br />
uwsgi_modifier1 14;<br />
# Avoid duplicate headers confusing OC checks<br />
uwsgi_hide_header X-Frame-Options;<br />
uwsgi_hide_header X-XSS-Protection;<br />
uwsgi_hide_header X-Content-Type-Options;<br />
uwsgi_hide_header X-Robots-Tag;<br />
uwsgi_pass unix:/run/uwsgi/nextcloud.sock;<br />
}<br />
</nowiki>}}<br />
<br />
Then create a config file for ''uWSGI'':<br />
<br />
{{hc|/etc/uwsgi/nextcloud.ini|<nowiki><br />
[uwsgi]<br />
; load the required plugins<br />
plugins = php<br />
; force the sapi name to 'apache', this will enable the opcode cache <br />
php-sapi-name = apache<br />
<br />
; set master process name and socket<br />
; '%n' refers to the name of this configuration file without extension<br />
procname-master = uwsgi %n<br />
master = true<br />
socket = /run/uwsgi/%n.sock<br />
<br />
; drop privileges<br />
uid = http<br />
gid = http<br />
umask = 027<br />
<br />
; run with at least 1 process but increase up to 4 when needed<br />
processes = 4<br />
cheaper = 1<br />
<br />
; reload whenever this config file changes<br />
; %p is the full path of the current config file<br />
touch-reload = %p<br />
<br />
; disable uWSGI request logging<br />
;disable-logging = true<br />
<br />
; enforce a DOCUMENT_ROOT<br />
php-docroot = /usr/share/webapps/%n<br />
; limit allowed extensions<br />
php-allowed-ext = .php<br />
; and search for index.php if required<br />
php-index = index.php<br />
<br />
; set php configuration for this instance of php, no need to edit global php.ini<br />
php-set = date.timezone=Etc/UTC<br />
;php-set = open_basedir=/tmp/:/usr/share/webapps/nextcloud:/etc/webapps/nextcloud:/dev/urandom<br />
php-set = expose_php=false<br />
; avoid security risk of leaving sessions in world-readable /tmp<br />
php-set = session.save_path=/usr/share/webapps/nextcloud/data<br />
<br />
; port of php directives set upstream in /usr/share/webapps/nextcloud/.user.ini for use with PHP-FPM<br />
php-set = upload_max_filesize=513M<br />
php-set = post_max_size=513M<br />
php-set = memory_limit=512M<br />
php-set = output_buffering=off<br />
<br />
; load all extensions only in this instance of php, no need to edit global php.ini<br />
;; required core modules<br />
php-set = extension=gd<br />
php-set = extension=iconv<br />
;php-set = extension=zip # enabled by default in global php.ini<br />
<br />
;; database connectors<br />
;; uncomment your selected driver<br />
;php-set = extension=pdo_sqlite<br />
;php-set = extension=pdo_mysql<br />
;php-set = extension=pdo_pgsql<br />
<br />
;; recommended extensions<br />
;php-set = extension=curl # enabled by default in global php.ini<br />
php-set = extension=bz2<br />
php-set = extension=intl<br />
<br />
;; required for specific apps<br />
;php-set = extension=ldap # for LDAP integration<br />
;php-set = extension=ftp # for FTP storage / external user authentication<br />
;php-set = extension=imap # for external user authentication, requires php-imap<br />
<br />
;; recommended for specific apps<br />
;php-set = extension=exif # for image rotation in pictures app, requires exiv2<br />
;php-set = extension=gmp # for SFTP storage<br />
<br />
;; for preview generation<br />
;; provided by packages in AUR<br />
; php-set = extension=imagick<br />
<br />
; opcache<br />
php-set = zend_extension=opcache<br />
<br />
; user cache<br />
; provided by php-acpu, to be enabled **either** here **or** in /etc/php/conf.d/apcu.ini<br />
php-set = extension=apcu<br />
; per https://github.com/krakjoe/apcu/blob/simplify/INSTALL<br />
php-set = apc.ttl=7200<br />
php-set = apc.enable_cli=1<br />
<br />
cron2 = minute=-15,unique=1 /usr/bin/php -f /usr/share/webapps/nextcloud/cron.php 1>/dev/null<br />
</nowiki>}}<br />
<br />
{{Note|1=<br />
* Do not forget to set your timezone and uncomment the required database connector in the uWSGI config file<br />
* The [[PHP#Configuration|open_basedir]] directive is optional and commented out. You can uncomment to harden security. Be aware that it may [https://github.com/owncloud/core/search?q=open_basedir&type=Issues occasionally break things].<br />
* Use {{ic|1=php-docroot = /usr/share/webapps}} if placing nextcloud in /nextcloud subdirectory.<br />
}}<br />
<br />
{{Warning|The way the [https://docs.nextcloud.com/server/14/admin_manual/configuration_server/background_jobs_configuration.html Nextcloud background job] is currently set up with [https://uwsgi-docs.readthedocs.org/en/latest/Cron.html uWSGI cron] will make use of the default global configuration from {{ic|/etc/php/php.ini}}. This means that none of the specific parameters defined (e.g. required modules) will be enabled, [https://github.com/owncloud/core/issues/12678#issuecomment-66114448 leading to various issues]. One solution is to copy {{ic|/etc/php/php.ini}} to e.g. {{ic|/etc/uwsgi/cron-php.ini}}, make the required modifications there (mirroring {{ic|/etc/uwsgi/nextcloud.ini}} parameters) and referencing it in the cron directive by adding the {{ic|-c /etc/uwsgi/cron-php.ini}} option to ''php'' invocation.}}<br />
<br />
==== Activation ====<br />
<br />
[[uWSGI]] provides a [[Systemd#Using_units|template unit]] that allows to start and enable application using their configuration file name as instance identifier. For example, [[start]]ing {{ic|uwsgi@nextcloud.socket}} would start it on demand referencing the configuration file {{ic|/etc/uwsgi/nextcloud.ini}}. <br />
<br />
To enable the uwsgi service by default at start-up, [[enable]] {{ic|uwsgi@nextcloud.socket}}.<br />
<br />
{{Note|Here we make use of [http://0pointer.de/blog/projects/socket-activation.html systemd socket activation] to prevent unnecessary resources consumption when no connections are made to the instance. If you would rather have it constantly active, simply remove the {{ic|.socket}} part to start and enable the service instead.}}<br />
<br />
See also [[UWSGI#Running uWSGI]].<br />
<br />
=== Setting strong permissions for the filesystem ===<br />
<br />
You should set the permissions for {{ic|config/}}, {{ic|data/}} and {{ic|apps/}} as strict as possible. That means that your HTTP user (''http'' in case of {{pkg|apache}}) should own them, and the should have {{ic|700}} permissions. You can use the following script to achieve this.<br />
<br />
{{Style|Complex script for trivial one-time task.}}<br />
<br />
{{hc|oc-perms|2=<nowiki><br />
#!/bin/bash<br />
ocpath='/usr/share/webapps/nextcloud'<br />
htuser='http'<br />
htgroup='http'<br />
rootuser='root'<br />
<br />
printf "Creating possible missing Directories\n"<br />
mkdir -p $ocpath/data<br />
mkdir -p $ocpath/assets<br />
<br />
printf "chmod Files and Directories\n"<br />
find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640<br />
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750<br />
<br />
printf "chown Directories\n"<br />
chown -R ${rootuser}:${htgroup} ${ocpath}/<br />
chown -R ${htuser}:${htgroup} ${ocpath}/apps/<br />
chown -R ${htuser}:${htgroup} ${ocpath}/assets/<br />
chown -R ${htuser}:${htgroup} ${ocpath}/config/<br />
chown -R ${htuser}:${htgroup} ${ocpath}/data/<br />
chown -R ${htuser}:${htgroup} ${ocpath}/themes/<br />
chown -R ${htuser}:${htgroup} ${ocpath}/updater/<br />
<br />
chmod +x ${ocpath}/occ<br />
<br />
printf "chmod/chown .htaccess\n"<br />
if [ -f ${ocpath}/.htaccess ]<br />
then<br />
chmod 0644 ${ocpath}/.htaccess<br />
chown ${rootuser}:${htgroup} ${ocpath}/.htaccess<br />
fi<br />
if [ -f ${ocpath}/data/.htaccess ]<br />
then<br />
chmod 0644 ${ocpath}/data/.htaccess<br />
chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess<br />
fi<br />
</nowiki>}}<br />
<br />
If you have customized your Nextcloud installation and your filepaths are different than the standard installation, then modify this script accordingly.<br />
<br />
== Synchronization ==<br />
<br />
=== Desktop ===<br />
<br />
The official client can be installed with the {{Pkg|owncloud-client}} or {{Pkg|nextcloud-client}} package.<br />
Alternative versions are available in the [[AUR]]: {{AUR|owncloud-client-git}}.<br />
<br />
==== Calendar ====<br />
<br />
To access your Nextcloud calendars using Mozilla [[Thunderbird]]'s Lightning calendar you would use the following URL:<br />
<br />
<nowiki>https://ADDRESS/remote.php/caldav/calendars/USERNAME/CALENDARNAME</nowiki><br />
<br />
To access your Nextcloud calendars using CalDAV-compatible programs like Kontact or [[Evolution]], you would use the following URL:<br />
<br />
<nowiki>https://ADDRESS/remote.php/caldav</nowiki><br />
<br />
For details see the [https://docs.nextcloud.com/server/14/user_manual/pim/index.html official documentation].<br />
<br />
==== Contacts ====<br />
<br />
To sync contacts with [[Thunderbird]], see [https://docs.nextcloud.com/server/14/user_manual/pim/sync_thunderbird.html these instructions] from the official doc.<br />
<br />
==== Mounting files with davfs2 ====<br />
<br />
If you want to mount your ownCloud permanently install {{Pkg|davfs2}} (as described in [[davfs2]]) first.<br />
<br />
Considering your ownCloud were at {{ic|https://own.example.com}}, your WebDAV URL would be {{ic|https://own.example.com/remote.php/webdav}} (as of ownCloud 6.0).<br />
<br />
To mount your ownCloud, use:<br />
<br />
# mount -t davfs https://own.example.com/remote.php/webdav /path/to/mount<br />
<br />
You can also create an entry for this in {{ic|/etc/fstab}}<br />
<br />
{{hc|/etc/fstab|<br />
https://own.example.com/remote.php/webdav /path/to/mount davfs rw,user,noauto 0 0<br />
}}<br />
<br />
{{Tip|In order to allow automount you can also store your username (and password if you like) in a file as described in [[davfs2#Storing credentials]].}}<br />
<br />
{{Note|If creating/copying files is not possible, while the same operations work on directories, see [[davfs2#Creating/copying files not possible and/or freezes]].}}<br />
<br />
=== Mounting files in GNOME Files (Nautilus) ===<br />
<br />
You can access the files directly in Nautilus ('+ Other Locations') through WebDAV protocol - use the link as shown in your Nextcloud installation Web GUI (typically: https://example.org/remote.php/webdav/) but replace the protocol name from 'https' to 'davs'. Nautilus will ask for user name and password when trying to connect.<br />
<br />
=== Android ===<br />
<br />
Download the official Nextcloud app from [https://play.google.com/store/apps/details?id=com.nextcloud.client Google Play] or [https://f-droid.org/packages/com.nextcloud.client/ F-Droid].<br />
<br />
To enable contacts and calendar sync (Android 4+):<br />
# download [https://davdroid.bitfire.at/ DAVdroid] ([https://play.google.com/store/apps/details?id=at.bitfire.davdroid Play Store], [https://f-droid.org/app/at.bitfire.davdroid F-Droid])<br />
# Enable mod_rewrite.so in httpd.conf<br />
# create a new DAVdroid account in the ''Account'' settings, and specify your "short" server address and login/password couple, e.g. {{ic|<nowiki>https://cloud.example.com</nowiki>}} (there is no need for the {{ic|<nowiki>/remote.php/{carddav,webdav}</nowiki>}} part if you configured your web server with the proper redirections, as illustrated previously in the article; ''DAVdroid'' will find itself the right URLs)<br />
<br />
=== iOS ===<br />
<br />
Download the official Nextcloud app from the [https://itunes.apple.com/us/app/nextcloud/id1125420102 App Store].<br />
<br />
== Troubleshooting ==<br />
{{Out of date|A lot of references to OwnCloud, are these still valid with Nextcloud?}}<br />
<br />
=== Environment variables not available ===<br />
<br />
Uncomment the line in {{ic|/etc/php/php-fpm.d/www.conf}} as per [https://docs.nextcloud.com/server/14/admin_manual/installation/source_installation.html#php-fpm-tips-label Nextcloud documentation]:<br />
env[PATH] = /usr/local/bin:/usr/bin:/bin<br />
<br />
=== Self-signed certificate not accepted ===<br />
<br />
ownCloud uses [[Wikipedia:cURL]] and [[Wikipedia:SabreDAV]] to check if WebDAV is enabled.<br />
If you use SSL/TLS with a self-signed certificate, e.g. as shown in [[LAMP]], and access ownCloud's admin panel, you will see the following error message:<br />
<br />
Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken.<br />
<br />
Assuming that you followed the [[LAMP]] tutorial, execute the following steps:<br />
<br />
Create a local directory for non-distribution certificates and copy [[LAMP]]s certificate there. This will prevent {{ic|ca-certificates}}-updates from overwriting it.<br />
<br />
# cp /etc/httpd/conf/server.crt /usr/share/ca-certificates/''WWW.EXAMPLE.COM.crt''<br />
<br />
Add ''WWW.EXAMPLE.COM.crt'' to {{ic|/etc/ca-certificates.conf}}:<br />
<br />
''WWW.EXAMPLE.COM.crt''<br />
<br />
Now, regenerate your certificate store:<br />
<br />
# update-ca-certificates<br />
<br />
Restart the httpd service to activate your certificate.<br />
<br />
=== Self-signed certificate for Android devices ===<br />
<br />
Once you have followed the setup for SSL, as on [[Apache HTTP Server#TLS]] for example, early versions of DAVdroid will<br />
reject the connection because the certificate is not trusted. A certificate can be made as follows on your server:<br />
<br />
# openssl x509 -req -days 365 -in /etc/httpd/conf/server.csr -signkey /etc/httpd/conf/server.key -extfile android.txt -out CA.crt<br />
# openssl x509 -inform PEM -outform DER -in CA.crt -out CA.der.crt <br />
<br />
The file {{ic|android.txt}} should contain the following:<br />
<br />
basicConstraints=CA:true<br />
<br />
Then import {{ic|CA.der.crt}} to your Android device:<br />
<br />
Put the {{ic|CA.der.crt}} file onto the sdcard of your Android device (usually to the internal one, e.g. save from a mail attachment).<br />
It should be in the root directory. Go to ''Settings > Security > Credential storage'' and select ''Install from device storage''.<br />
The {{ic|.crt}} file will be detected and you will be prompted to enter a certificate name. After importing the certificate,<br />
you will find it in ''Settings > Security > Credential storage > Trusted credentials > User''.<br />
<br />
Thanks to: [http://www.leftbrainthings.com/2013/10/13/creating-and-importing-self-signed-certificate-to-android-device/]<br />
<br />
Another way is to import the certificate directly from your server via [https://play.google.com/store/apps/details?id=at.bitfire.cadroid CAdroid] and follow the instructions there.<br />
<br />
=== Cannot write into config directory! ===<br />
<br />
If you have set {{ic|open_basedir}} in your PHP/web server configuration file (e.g. {{ic|/etc/httpd/conf/extra/nextcloud.conf}}), make sure that it includes {{ic|/etc/webapps}}.<br />
<br />
Restart the web server to apply the change.<br />
<br />
=== Cannot create data directory ===<br />
<br />
If you have set {{ic|open_basedir}} in your PHP/web server configuration file (e.g. {{ic|/etc/httpd/conf/extra/nextcloud.conf}}), make sure that it includes the data directory.<br />
<br />
Restart the web server to apply the change.<br />
<br />
=== CSync failed to find a specific file. ===<br />
<br />
This is most likely a certificate issue. Recreate it, and do not leave the common name empty or you will see the error again.<br />
<br />
# openssl req -new -x509 -nodes -newkey rsa:4096 -keyout server.key -out server.crt<br />
<br />
=== Seeing white page after login ===<br />
<br />
The cause is probably a new app that you installed. To fix that, you can use the occ command as described<br />
[https://docs.nextcloud.com/server/14/admin_manual/configuration_server/occ_command.html here]. So with<br />
<br />
sudo -u http php /usr/share/webapps/nextcloud/occ app:list<br />
<br />
you can list all apps (if you installed nextcloud in the standard directory), and with <br />
<br />
sudo -u http php /usr/share/webapps/nextcloud/occ app:disable <nameOfExtension><br />
<br />
you can disable the troubling app.<br />
<br />
Alternatively, you can either use [[phpMyAdmin]] to edit the {{ic|oc_appconfig}} table (if you got lucky and the table has an edit option), or do it by hand with mysql:<br />
<br />
mysql -u root -p owncloud<br />
MariaDB [owncloud]> '''delete from''' oc_appconfig '''where''' appid='<nameOfExtension>' '''and''' configkey='enabled' '''and''' configvalue='yes';<br />
MariaDB [owncloud]> '''insert into''' oc_appconfig (appid,configkey,configvalue) '''values''' ('<nameOfExtension>','enabled','no');<br />
<br />
This should delete the relevant configuration from the table and add it again.<br />
<br />
=== GUI sync client fails to connect ===<br />
<br />
If using HTTP basic authentication, make sure to exclude "status.php", which must be publicly accessible. [https://github.com/owncloud/mirall/issues/734]<br />
<br />
=== Some files upload, but give an error 'Integrity constraint violation...' ===<br />
<br />
You may see the following error in the ownCloud sync client:<br />
<br />
SQLSTATE[23000]: Integrity constraint violation: ... Duplicate entry '...' for key 'fs_storage_path_hash')...<br />
<br />
This is caused by an issue with the File Locking app, which is often not sufficient to keep conflicts from occurring on some webserver configurations.<br />
A more complete [https://docs.nextcloud.com/server/14/admin_manual/configuration_files/files_locking_transactional.html Transactional File Locking]<br />
is available that rids these errors, but you must be using the Redis php-caching method. Install {{Pkg|redis}} and {{AUR|php-redis}}, comment out<br />
your current php-cache mechanism, and then in {{ic|/etc/php/conf.d/redis.ini}} uncomment {{ic|1=extension=redis}}.<br />
Then in {{ic|config.php}} make the following changes:<br />
<br />
'memcache.local' => '\OC\Memcache\Redis',<br />
'filelocking.enabled' => 'true',<br />
'memcache.locking' => '\OC\Memcache\Redis',<br />
'redis' => array(<br />
'host' => 'localhost',<br />
'port' => 6379,<br />
'timeout' => 0.0,<br />
),<br />
<br />
and [[start/enable]] {{ic|redis.service}}.<br />
<br />
Finally, disable the File Locking App, as the Transational File Locking will take care of it (and would conflict).<br />
<br />
If everything is working, you should see 'Transactional File Locking Enabled' under Server Status on the Admin page, and syncs should no longer cause issues.<br />
<br />
=== "Cannot write into apps directory" ===<br />
<br />
As mentioned in the [https://docs.nextcloud.com/server/14/admin_manual/installation/apps_management_installation.html official admin manual],<br />
either you need an apps directory that is writable by the http user, or you need to set {{ic|appstoreenabled}} to {{ic|false}}. <br />
<br />
If you have set {{ic|open_basedir}} in your PHP/web server configuration file (e.g. {{ic|/etc/httpd/conf/extra/nextcloud.conf}}), it may be necessary to add your ''/path/to/data'' directory to the string on the line starting with {{ic|php_admin_value open_basedir }}:<br />
<br />
{{hc|/etc/httpd/conf/extra/nextcloud.conf|2=<br />
<br />
php_admin_value open_basedir "''/path/to/data/'':/srv/http/:/dev/urandom:/tmp/:/usr/share/pear/:/usr/share/webapps/nextcloud/:/etc/webapps/nextcloud"<br />
}}<br />
<br />
=== Installed apps get blocked because of MIME type error ===<br />
<br />
If you are putting your apps folder outside of the nextcloud installation directory make sure your webserver serves it properly.<br />
<br />
In nginx this is accomplished by adding a location block to the nginx configuration as the folder will not be included in it by default.<br />
<br />
location ~ /apps2/(.*)$ {<br />
alias /var/www/nextcloud/apps/$1;<br />
}<br />
<br />
=== Security warnings even though the recommended settings have been included in nginx.conf ===<br />
<br />
At the top of the admin page there might be a warning to set the {{ic|Strict-Transport-Security}}, {{ic|X-Content-Type-Options}},<br />
{{ic|X-Frame-Options}}, {{ic|X-XSS-Protection}} and {{ic|X-Robots-Tag}} according to https://docs.nextcloud.com/server/14/admin_manual/configuration_server/harden_server.html<br />
even though they are already set like that.<br />
<br />
A possible cause could be that because owncloud sets those settings, uwsgi passed them along and nginx added them again:<br />
<br />
{{hc|$ curl -I https://domain.tld|<nowiki><br />
...<br />
X-XSS-Protection: 1; mode=block<br />
X-Content-Type-Options: nosniff<br />
X-Frame-Options: Sameorigin<br />
X-Robots-Tag: none<br />
Strict-Transport-Security: max-age=15768000; includeSubDomains; preload;<br />
X-Content-Type-Options: nosniff<br />
X-Frame-Options: SAMEORIGIN<br />
X-XSS-Protection: 1; mode=block<br />
X-Robots-Tag: none<br />
</nowiki>}}<br />
<br />
While the fast_cgi sample config has a parameter to avoid that ( {{ic|fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice}} ), when using uwsgi and nginx the following modification of the uwsgi part in nginx.conf could help:<br />
<br />
{{hc| /etc/nginx/nginx.conf|<nowiki><br />
...<br />
# pass all .php or .php/path urls to uWSGI<br />
location ~ ^(.+\.php)(.*)$ {<br />
include uwsgi_params;<br />
uwsgi_modifier1 14;<br />
# hode following headers received from uwsgi, because otherwise we would send them twice since we already add them in nginx itself<br />
uwsgi_hide_header X-Frame-Options;<br />
uwsgi_hide_header X-XSS-Protection;<br />
uwsgi_hide_header X-Content-Type-Options;<br />
uwsgi_hide_header X-Robots-Tag;<br />
uwsgi_hide_header X-Frame-Options;<br />
#Uncomment line below if you get connection refused error. Remember to commet out line with "uwsgi_pass 127.0.0.1:3001;" below<br />
uwsgi_pass unix:/run/uwsgi/owncloud.sock;<br />
#uwsgi_pass 127.0.0.1:3001;<br />
}<br />
...<br />
</nowiki>}}<br />
<br />
=== "Reading from keychain failed with error: 'No keychain service available'" ===<br />
<br />
Can be fixed for Gnome by installing the following 2 packages, {{Pkg|libgnome-keyring}} and {{Pkg|gnome-keyring}}.<br />
Or the following for KDE, {{Pkg|libgnome-keyring}} and {{Pkg|qtkeychain}}.<br />
<br />
=== FolderSync: "Method Not Allowed" ===<br />
<br />
FolderSync needs access to {{ic|/owncloud/remote.php/webdav}}, so you could create another alias for owncloud in your {{ic|/etc/httpd/conf/extra/nextcloud.conf}}<br />
<br />
<IfModule mod_alias.c><br />
Alias /nextcloud /usr/share/webapps/nextcloud/<br />
Alias /owncloud /usr/share/webapps/nextcloud/<br />
</IfModule><br />
<br />
=== Nextcloud 13 : "Unable to load dynamic library 'mcrypt.so" ===<br />
<br />
Starting with php 7.2 the extension mcrypt was removed.[https://wiki.php.net/rfc/mcrypt-viking-funeral]<br />
<br />
To fix the error about mcrypt in Nextcloud logs, a version of this extension compatible with php 7.2 can be installed via PECL.<br />
<br />
# Install {{AUR|php-pear}} if you do not have it already<br />
# Update PECL channels: {{bc|# pecl channel-update pecl.php.net}}<br />
# Install mcrypt 1.0.1: {{bc|# pecl install mcrypt-1.0.1}}<br />
# Uncomment this line in {{ic|/etc/php/php.conf}}: {{bc|1=;extension=mcrypt.so}}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Running ownCloud in a subdirectory ===<br />
<br />
By including the default {{ic|owncloud.conf}} in {{ic|httpd.conf}}, ownCloud will take control of port 80 and your localhost domain. <br />
<br />
If you would like to have ownCloud run in a subdirectory, then edit the {{ic|/etc/httpd/conf/extra/owncloud.conf}}<br />
you included and comment out the {{ic|<nowiki><VirtualHost *:80> ... </VirtualHost></nowiki>}} part of the include file.<br />
<br />
You can use the following nginx config when using owncloud with uwsgi:<br />
<br />
{{hc|head=/etc/nginx/conf.d/owncloud.conf|output=<nowiki><br />
location = /.well-known/carddav {<br />
return 301 $scheme://$host/owncloud/remote.php/dav;<br />
}<br />
<br />
location = /.well-known/caldav {<br />
return 301 $scheme://$host/owncloud/remote.php/dav;<br />
}<br />
<br />
location /.well-known/acme-challenge { }<br />
<br />
location ^~ /owncloud {<br />
<br />
root /usr/share/webapps;<br />
<br />
# set max upload size<br />
client_max_body_size 512M;<br />
fastcgi_buffers 64 4K;<br />
<br />
# Disable gzip to avoid the removal of the ETag header<br />
gzip off;<br />
<br />
# Uncomment if your server is build with the ngx_pagespeed module<br />
# This module is currently not supported.<br />
#pagespeed off;<br />
<br />
location /owncloud {<br />
rewrite ^ /owncloud/index.php$uri;<br />
}<br />
<br />
location ~ ^/owncloud/(?:build|tests|config|lib|3rdparty|templates|data)/ {<br />
deny all;<br />
}<br />
<br />
location ~ ^/owncloud/(?:\.|autotest|occ|issue|indie|db_|console) {<br />
deny all;<br />
}<br />
<br />
location ~ ^/owncloud/(?:updater|ocs-provider)(?:$|/) {<br />
try_files $uri/ =404;<br />
index index.php;<br />
}<br />
<br />
location ~ ^/owncloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {<br />
include uwsgi_params;<br />
uwsgi_modifier1 14;<br />
# Avoid duplicate headers confusing OC checks<br />
uwsgi_hide_header X-Frame-Options;<br />
uwsgi_hide_header X-XSS-Protection;<br />
uwsgi_hide_header X-Content-Type-Options;<br />
uwsgi_hide_header X-Robots-Tag;<br />
uwsgi_pass unix:/run/uwsgi/owncloud.sock;<br />
}<br />
<br />
# Adding the cache control header for js and css files<br />
# Make sure it is BELOW the PHP block<br />
location ~* \.(?:css|js) {<br />
try_files $uri /owncloud/index.php$uri$is_args$args;<br />
add_header Cache-Control "public, max-age=7200";<br />
# Add headers to serve security related headers (It is intended<br />
# to have those duplicated to the ones above)<br />
# Before enabling Strict-Transport-Security headers please read<br />
# into this topic first.<br />
# add_header Strict-Transport-Security "max-age=15768000;<br />
# includeSubDomains; preload;";<br />
add_header X-Content-Type-Options nosniff;<br />
add_header X-Frame-Options "SAMEORIGIN";<br />
add_header X-XSS-Protection "1; mode=block";<br />
add_header X-Robots-Tag none;<br />
add_header X-Download-Options noopen;<br />
add_header X-Permitted-Cross-Domain-Policies none;<br />
# Optional: Do not log access to assets<br />
access_log off;<br />
}<br />
<br />
location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg) {<br />
try_files $uri /owncloud/index.php$uri$is_args$args;<br />
# Optional: Do not log access to other assets<br />
access_log off;<br />
}<br />
}<br />
</nowiki>}}<br />
<br />
=== Docker ===<br />
<br />
See the [https://hub.docker.com/_/owncloud/ ownCloud] or [https://github.com/nextcloud/docker Nextcloud] repository for [[Docker]].<br />
<br />
=== Upload and share from File Manager ===<br />
<br />
[https://github.com/schiesbn/shareLinkCreator shareLinkCreator] provides the ability to upload a file to<br />
OwnCloud via a supported file manager and receive a link to the uploaded file which can then be emailed or shared in another way.<br />
<br />
=== Defining Background Jobs ===<br />
<br />
Nextcloud requires scheduled execution of some tasks, and by default it achieves this by using AJAX,<br />
however AJAX is the least reliable method, and it is recommended to use [[Cron]] instead. However,<br />
ArchLinux ships with {{Pkg|systemd}}, so the preferred way of executing scheduled tasks is a [[Systemd#Timers|systemd timer]]. <br />
<br />
==== Manual install ====<br />
<br />
First create a service:<br />
<br />
{{hc|/etc/systemd/system/nextcloudcron.service|<nowiki><br />
[Unit]<br />
Description=Nextcloud cron.php job<br />
<br />
[Service]<br />
User=http<br />
ExecStart=/usr/bin/php -f /usr/share/webapps/nextcloud/cron.php<br />
<br />
[Install]<br />
WantedBy=basic.target<br />
</nowiki>}}<br />
<br />
Then create a timer for that service:<br />
<br />
{{hc|/etc/systemd/system/nextcloudcron.timer|<nowiki><br />
[Unit]<br />
Description=Run Nextcloud cron.php every 15 minutes<br />
<br />
[Timer]<br />
OnBootSec=5min<br />
OnUnitActiveSec=15min<br />
Unit=nextcloudcron.service<br />
<br />
[Install]<br />
WantedBy=timers.target<br />
</nowiki>}}<br />
<br />
==== AUR package ====<br />
<br />
Install {{AUR|nextcloud-systemd-timers}}.<br />
<br />
==== Activate timer ====<br />
<br />
[[Start/enable]] {{ic|nextcloudcron.timer}}.<br />
<br />
Confirm that it is running by running<br />
<br />
# systemctl list-timers<br />
<br />
=== Collabora Online Office integration ===<br />
<br />
'''Solution with Docker: ''CODE backend using the official Docker image'''''<br />
<br />
The first, install a {{Pkg|docker}} package to provide collabora files and setup a Collabora server.<br />
<br />
[[Start/enable]] {{ic|docker.service}}.<br />
<br />
Then, download the required binares :<br />
<br />
# docker pull collabora/code<br />
<br />
And, installing a Collabora server. Make sure {{ic|cloud//.example//.com}} is your nextcloud's domain, not a collabora :<br />
<br />
# docker run -t -d -p 127.0.0.1:9980:9980 -e 'domain=cloud\\.example\\.com' --restart always --cap-add MKNOD collabora/code<br />
<br />
Also make sure to escape all dots with double backslashes (\), since this string will be evaluated as a regular expression (and your bash 'eats' the first backslash.) If you want to use the docker container with more than one Nextcloud, you will need to use 'domain=cloud\\.example\\.com\|second\\.example\\.com' instead. (All hosts are separated by \|.) When using `localhost` as domain for testing you need to add {ic|--net host}} to ensure the docker container can access your Nextcloud server. <br />
<br />
If you need to delete or reinstall Collabora server use:<br />
<br />
For recognition CONTAINER_ID of server<br />
<br />
# docker ps<br />
<br />
Stop and delete<br />
<br />
# docker stop CONTAINER_ID<br />
# docker rm CONTAINER_ID<br />
<br />
Futher, follow the instruction of webserver you are using:<br />
<br />
'''Nginx setup example:'''<br />
<br />
Add following to your nextcloud domain config or add new config file in /etc/nginx/conf.d/ directory, (Do not forget to change {{ic|office.example.com}} and {{ic|ssl_certificate}} to the right values. If you are using docker image, change {{ic|http}} to {{ic|https}}.)<br />
<br />
{{hc|/etc/nginx/conf.d/example.conf|<nowiki><br />
upstream office.example.com {<br />
server 127.0.0.1:9980;<br />
}<br />
<br />
server {<br />
listen 443 ssl;<br />
server_name office.example.com;<br />
<br />
ssl_certificate /etc/letsencrypt/live/office.example.com/fullchain.pem;<br />
ssl_certificate_key /etc/letsencrypt/live/office.example.com/privkey.pem;<br />
<br />
# static files<br />
location ^~ /loleaflet {<br />
proxy_pass http://127.0.0.1:9980;<br />
proxy_set_header Host $host;<br />
}<br />
<br />
# WOPI discovery URL<br />
location ^~ /hosting/discovery {<br />
proxy_pass http://127.0.0.1:9980;<br />
proxy_set_header Host $host;<br />
}<br />
<br />
# Main websocket<br />
location ~ /lool/(.*)/ws$ {<br />
proxy_pass http://127.0.0.1:9980;<br />
proxy_set_header Upgrade $http_upgrade;<br />
proxy_set_header Connection "Upgrade";<br />
proxy_set_header Host $host;<br />
proxy_read_timeout 36000s;<br />
}<br />
<br />
# Admin Console websocket<br />
location ^~ /lool/adminws {<br />
proxy_buffering off;<br />
proxy_pass http://127.0.0.1:9980;<br />
proxy_set_header Upgrade $http_upgrade;<br />
proxy_set_header Connection "Upgrade";<br />
proxy_set_header Host $host;<br />
proxy_read_timeout 36000s;<br />
}<br />
<br />
# download, presentation and image upload<br />
location ~ /lool {<br />
proxy_pass http://127.0.0.1:9980;<br />
proxy_set_header Host $host;<br />
}<br />
}<br />
</nowiki>}}<br />
<br />
Restart a nginx:<br />
<br />
# nginx -s reload<br />
<br />
or [[restart]] {{ic|nginx.service}}.<br />
<br />
'''Apache setup example:'''<br />
<br />
Add following to nextcloud config file. Do not forget to change to the right values<br />
<br />
{{hc|/etc/httpd/conf/extra/nextcloud.conf|<nowiki><br />
<VirtualHost *:443><br />
ServerName office.nextcloud.com:443<br />
<br />
# SSL configuration, you may want to take the easy route instead and use Lets Encrypt!<br />
SSLEngine on<br />
SSLCertificateFile /path/to/signed_certificate<br />
SSLCertificateChainFile /path/to/intermediate_certificate<br />
SSLCertificateKeyFile /path/to/private/key<br />
SSLProtocol all -SSLv2 -SSLv3<br />
SSLCipherSuite ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS<br />
SSLHonorCipherOrder on<br />
<br />
# Encoded slashes need to be allowed<br />
AllowEncodedSlashes NoDecode<br />
<br />
# Container uses a unique non-signed certificate<br />
SSLProxyEngine On<br />
SSLProxyVerify None<br />
SSLProxyCheckPeerCN Off<br />
SSLProxyCheckPeerName Off<br />
<br />
# keep the host<br />
ProxyPreserveHost On<br />
<br />
# static html, js, images, etc. served from loolwsd<br />
# loleaflet is the client part of LibreOffice Online<br />
ProxyPass /loleaflet https://127.0.0.1:9980/loleaflet retry=0<br />
ProxyPassReverse /loleaflet https://127.0.0.1:9980/loleaflet<br />
<br />
# WOPI discovery URL<br />
ProxyPass /hosting/discovery https://127.0.0.1:9980/hosting/discovery retry=0<br />
ProxyPassReverse /hosting/discovery https://127.0.0.1:9980/hosting/discovery<br />
<br />
# Main websocket<br />
ProxyPassMatch "/lool/(.*)/ws$" wss://127.0.0.1:9980/lool/$1/ws nocanon<br />
<br />
# Admin Console websocket<br />
ProxyPass /lool/adminws wss://127.0.0.1:9980/lool/adminws<br />
<br />
# Download as, Fullscreen presentation and Image upload operations<br />
ProxyPass /lool https://127.0.0.1:9980/lool<br />
ProxyPassReverse /lool https://127.0.0.1:9980/lool<br />
</VirtualHost><br />
</nowiki>}}<br />
<br />
After configuring these do restart your apache by [[restart]]ing {{ic|httpd.service}}.<br />
<br />
'''Install the Nextcloud app'''<br />
<br />
Go to the Apps section and choose “Office & Text”, install the “Collabora Online” app. In admin panel select Collabora Online tab and specific the server's domain you have setup before.<br />
<br />
'''Solution without Docker: ''CODE backend using an Archlinux package'''''<br />
<br />
The {{AUR|collabora-online-server-nodocker}} package brings to your Archlinux installation 1º Collabora Office (the desktop suite), and 2º the “CODE” (Collabora Online Development Edition) server, which is based on “lool” (LibreOffice OnLine).<br />
<br />
Alter the `/etc/loolwsd/loolwsd.xml` file, so that:<br />
<br />
* `config > server_name` contains the host and port of the public Nextcloud address, separated by a colon (eg. `example.org:443`),<br />
* `config > ssl > enable` is false (ie. web browser —HTTPS→ proxy —HTTP→ loolwsd),<br />
* `config > ssl > termination` is true (I suppose you’ll manage TLS at the proxy level),<br />
* `config > storage > wopi > host` reflects the actual hostname (or pattern) of the proxy server (eg. `(?:.*\.)?example\.org`),<br />
* `config > admin_console > username` and `config > admin_console > password` are set to values of your choice.<br />
<br />
Then:<br />
<br />
* [[start]] and [[enable]] {{ic|loolwsd.service}};<br />
* configure Nginx as showed in /usr/share/doc/loolwsd/example.nginx.conf, and restart it.<br />
<br />
== See also ==<br />
<br />
* [https://docs.nextcloud.com/ nextcloud official website]<br />
* [https://docs.nextcloud.com/server/14/admin_manual/ nextcloud 14.0 Admin Documentation]</div>Roshlesshttps://wiki.archlinux.org/index.php?title=Nextcloud&diff=506531Nextcloud2018-01-07T16:49:02Z<p>Roshless: since we disable collabora's own ssl later this won't work (probably the same with apache, but I didn't test it)</p>
<hr />
<div>[[Category:File sharing]]<br />
[[Category:Web applications]]<br />
[[fr:Owncloud]]<br />
[[ja:Nextcloud]]<br />
{{Related articles start}}<br />
{{Related|Apache HTTP Server}}<br />
{{Related|Nginx}}<br />
{{Related|OpenSSL}}<br />
{{Related|WebDAV}}<br />
{{Related articles end}}<br />
<br />
From [[Wikipedia:Nextcloud|Wikipedia]]:<br />
<br />
:Nextcloud is a suite of client-server software for creating and using file hosting services. It is functionally similar to Dropbox, although Nextcloud is free and open-source, allowing anyone to install and operate it on a private server. In contrast to proprietary services like Dropbox, the open architecture allows adding additional functionality to the server in form of applications.<br />
<br />
Nextcloud is a fork of ownCloud. For differences between the two, see [[wikipedia:Nextcloud#Differences from ownCloud]].<br />
<br />
== Prerequisites ==<br />
Nextcloud requires several components:<br />
* A web server: [[Apache]] or [[nginx]]<br />
* A database: [[MariaDB]] or [[PostgreSQL]]<br />
* [[PHP]] with [[#PHP_setup|additional modules]].<br />
<br />
These will be configured in [[#Setup]].<br />
<br />
Make sure the required components are installed before proceeding.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|nextcloud}} package.<br />
<br />
== Setup ==<br />
<br />
As stated above, in order to setup Nextcloud, you must set up the appropriate PHP requirements;<br />
additionally, you must configure a database and a webserver.<br />
<br />
=== Pacman hook ===<br />
<br />
To do nextcloud database upgrade automatically you may set up pacman post upgrade hook based on following example:<br />
<br />
# Update Nextcloud when core or -apps are touched<br />
<br />
[Trigger]<br />
Operation = Install<br />
Operation = Upgrade<br />
Type = Package<br />
Target = nextcloud<br />
Target = nextcloud-app-*<br />
<br />
[Action]<br />
Description = Updating Nextcloud installation<br />
When = PostTransaction<br />
Exec = /usr/bin/runuser -u http -- /usr/bin/php /usr/share/webapps/nextcloud/occ upgrade<br />
<br />
You need to put it into /etc/pacman.d/hooks/nextcloud.hook if you did not customize HookDir in pacman.conf.<br />
<br />
See also [[Pacman#Hooks]]<br />
<br />
=== PHP setup ===<br />
<br />
{{Note|Nextcloud does not support PHP 7.2 as of version 12.0.4. [https://github.com/nextcloud/server/issues/6786] Until version 13 is released, [[install]] the {{AUR|php70}} package or update to {{AUR|nextcloud-testing}}.}}<br />
<br />
{{Tip|For all prerequisite PHP modules, see upstream documentation: [https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#prerequisites-label Nextcloud 12.0].}}<br />
<br />
Install [[PHP#gd]] and {{pkg|php-intl}} as additional modules.<br />
<br />
Some apps(News for example) require the iconv extension, if you wish to use these apps, uncomment the extension in {{ic|/etc/php/php.ini}}.<br />
<br />
Depending on which database backend will be used:<br />
* For [[MySQL]], see [[PHP#MySQL/MariaDB]].<br />
* For [[PostgreSQL]], see [[PHP#PostgreSQL]].<br />
* For [[SQLite]], see [[PHP#Sqlite]].<br />
<br />
Performance may be improved through the implementation of [[PHP#Caching|caching]], see<br />
[https://docs.nextcloud.com/server/12/admin_manual/configuration_server/caching_configuration.html Configuring Memory Caching]<br />
on the official documentation for details.<br />
<br />
=== Database setup ===<br />
<br />
An SQL database must be setup and used for your Nextcloud installation. After setting up the database here,<br />
you will be prompted for its information when you first create an administrator account.<br />
<br />
==== MariaDB ====<br />
<br />
{{Note|It's is highly recommended to set {{ic|binlog_format}} to ''mixed'' [https://docs.nextcloud.com/server/12/admin_manual/configuration_database/linux_database_configuration.html#db-binlog-label] in {{ic|/etc/mysql/my.cnf}}.}}<br />
<br />
The following is an example of setting up a [[MariaDB]] database and user:<br />
<br />
{{hc|$ mysql -u root -p|2=<br />
mysql> CREATE DATABASE `'''nextcloud'''` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;<br />
mysql> CREATE USER `'''nextcloud'''`@'localhost' IDENTIFIED BY ''''password'''';<br />
mysql> GRANT ALL PRIVILEGES ON `'''nextcloud'''`.* TO `'''nextcloud'''`@`localhost`;<br />
mysql> \q<br />
}}<br />
<br />
==== PostgreSQL ====<br />
<br />
The following is an example of setting up a [[PostgreSQL]] user and database:<br />
{{hc|1=$ sudo -u postgres createuser -h localhost -P nextcloud|2=<br />
Enter password for new role:<br />
Enter it again:<br />
}}<br />
<br />
$ sudo -u postgres createdb -O nextcloud nextcloud<br />
<br />
=== Webserver setup ===<br />
<br />
{{Warning|It is recommended to use TLS/SSL (HTTPS) over plain HTTP, see [[Apache#TLS/SSL]] or [[Nginx#TLS/SSL]] for examples and implement this in the examples given below.}}<br />
<br />
Depending on which [[webserver]] you are using, further setup is required, indicated below.<br />
<br />
==== Apache ====<br />
<br />
If you haven't already, install [[Apache]] and install and enable [[Apache#PHP|Apache's PHP module]]<br />
<br />
Copy the Apache configuration file to the configuration directory:<br />
<br />
# cp /etc/webapps/nextcloud/apache.example.conf /etc/httpd/conf/extra/nextcloud.conf<br />
<br />
Modify the file according to your preferences. By default it includes an alias<br />
for {{ic|/nextcloud}} pointing to {{ic|/usr/share/webapps/nextcloud}}.<br />
<br />
And include it in {{ic|/etc/httpd/conf/httpd.conf}}:<br />
Include conf/extra/nextcloud.conf<br />
<br />
Ensure that the root location of your Nextcloud installation (e.g., {{ic|/usr/share/webapps/nextcloud}}) is accessible by the webserver's user {{ic|http}}.<br />
<br />
Now restart Apache ({{ic|httpd.service}}).<br />
<br />
===== WebDAV =====<br />
Nextcloud comes with its own [[WebDAV]] implementation enabled, which may conflict with the one shipped with Apache. If you have enabled WebDAV in Apache (not enabled by default), disable the modules {{ic|mod_dav}} and {{ic|mod_dav_fs}} in {{ic|/etc/httpd/conf/httpd.conf}}. See [https://forum.owncloud.org/viewtopic.php?f=17&t=7240] for details.<br />
<br />
==== Nginx ====<br />
Create an empty directory to hold the cloud-specific config file:<br />
# mkdir /etc/nginx/conf.d/<br />
<br />
In {{ic|/etc/nginx/nginx.conf}}, add the following lines under the "http" section:<br />
<br />
http {<br />
...<br />
...<br />
server_names_hash_bucket_size 64;<br />
include conf.d/*.conf;<br />
}<br />
<br />
<br />
Create a config file {{ic|/etc/nginx/conf.d/nextcloud.conf}} according to the [https://docs.nextcloud.com/server/12/admin_manual/installation/nginx.html documentation]. You will have to change the {{ic|root}} location, as the Arch package installs to {{ic|/usr/share/webapps/nextcloud}} instead of {{ic|/var/www/nextcloud}}.<br />
<br />
Addtitionally, you change the php-handler block so it looks like this one <br />
<br />
upstream php-handler {<br />
server unix:/run/php-fpm/php-fpm.sock;<br />
}<br />
<br />
in the {{ic|/etc/nginx/conf.d/nextcloud.conf}} file.<br />
<br />
From this point on, it is recommended to obtain a secure-certificates using [[Let's Encrypt]], see [[#Security Hardening]].<br />
<br />
===== PHP-FPM configuration =====<br />
<br />
Make sure PHP-FPM has been configured correctly as described in [[Nginx#FastCGI]].<br />
<br />
Uncomment {{ic|1=env[PATH] = /usr/local/bin:/usr/bin:/bin}} in {{ic|/etc/php/php-fpm.d/www.conf}} and [[restart]] {{ic|php-fpm.service}} to apply the changes.<br />
<br />
== Initialize ==<br />
<br />
Open the address where you have installed Nextcloud in a web browser (e.g., https://www.examples.com/nextcloud).<br />
<br />
=== Create storage directories ===<br />
<br />
You will now see "Cannot write into "apps" directory". This is because Arch packages Nextcloud in a way where the ''apps'' folder only has the webserver as a group without web permissions and the ''data'' folder is nonexistent.<br />
<br />
The easiest non-conflicting way is to create a new writable folder for apps and also create a writable data folder. Replace the http group with the group your webserver uses if needed.<br />
<br />
# mkdir -p /usr/share/webapps/nextcloud/data<br />
# mkdir -p /usr/share/webapps/nextcloud/apps2<br />
# chown http:http /usr/share/webapps/nextcloud/data<br />
# chown http:http /usr/share/webapps/nextcloud/apps2<br />
# chmod 700 /usr/share/webapps/nextcloud/data<br />
# chmod 700 /usr/share/webapps/nextcloud/apps2<br />
<br />
Next edit the configuration file at {{ic|/etc/webapps/nextcloud/config/config.php}} and add following lines before the closing {{ic|);}} of the file.<br />
<br />
{{hc|/etc/webapps/nextcloud/config/config.php|2=<br />
'apps_paths' =><br />
array (<br />
0 =><br />
array (<br />
'path' => '/usr/share/webapps/nextcloud/apps',<br />
'url' => '/apps',<br />
'writable' => false,<br />
),<br />
1 =><br />
array (<br />
'path' => '/usr/share/webapps/nextcloud/apps2',<br />
'url' => '/apps2',<br />
'writable' => true,<br />
),<br />
),<br />
'datadirectory' => '/usr/share/webapps/nextcloud/data'<br />
}}<br />
<br />
Refresh the page and the error should be gone.<br />
<br />
From there follow the instructions in adding an administrator account as well as selecting the database you created earlier.<br />
<br />
== Security Hardening ==<br />
<br />
The [https://docs.nextcloud.com/server/12/admin_manual/configuration_server/harden_server.html Nextcloud Hardening and Security]<br />
article guides along generic topics. See also the project's [https://scan.nextcloud.com/ Security scanner].<br />
<br />
=== Let's Encrypt ===<br />
==== nginx ====<br />
{{Move|Let's Encrypt|A simple example of configuring an 'empty' domain for Let's Encrypt should be created. The example file given is too big and could be far easier.}}<br />
1. Create the cloud configuration {{ic|/etc/nginx/conf.d/cloud-initial.conf}} using [https://github.com/graysky2/configs/blob/master/nginx/nextcloud-initial.conf this initial file] as a template. Substitute the literal "@@FQDN@@" in the template file with the actual [[wikipedia:Fully_qualified_domain_name|FQDN]] to be used. The certs for the server need to be generated using this unencrypted configuration initially. Follow the steps outlined on [[Let’s Encrypt]] to generate the server encryption certificates.<br />
<br />
2. Upon successfully generating certificates, replace {{ic|/etc/nginx/conf.d/cloud-initial.conf}} (it may be safely renamed so long as it does not end in ".conf" or simply deleted) with a new file, {{ic|/etc/nginx/conf.d/cloud.conf}} using [https://github.com/graysky2/configs/blob/master/nginx/nextcloud.conf this file] as a template. Again, substitute the literal "@@FQDN@@" in the template file with the actual [[wikipedia:Fully_qualified_domain_name|FQDN]] to be used. [[Start]] and optionally [[enable]] {{ic|nginx.service}}.<br />
<br />
=== uWSGI ===<br />
<br />
You can run Nextcloud in its own process and service by using the [[uWSGI]] application server with {{pkg|uwsgi-plugin-php}}. This allows you to define a [[PHP#Configuration|PHP configuration]] only for this instance of PHP, without the need to edit the global {{ic|php.ini}} and thus keeping your web application configurations compartmentalized. ''uWSGI'' itself has a wealth of features to limit the resource use and to harden the security of the application, and by being a separate process it can run under its own user.<br />
<br />
The only part that differs from [[#php-fpm configuration]]{{Broken section link}} is the {{ic|<nowiki>location ~ \.php(?:$|/) {}</nowiki>}} block:<br />
{{bc|<nowiki><br />
location ~ \.php(?:$|/) {<br />
include uwsgi_params;<br />
uwsgi_modifier1 14;<br />
# Avoid duplicate headers confusing OC checks<br />
uwsgi_hide_header X-Frame-Options;<br />
uwsgi_hide_header X-XSS-Protection;<br />
uwsgi_hide_header X-Content-Type-Options;<br />
uwsgi_hide_header X-Robots-Tag;<br />
uwsgi_pass unix:/run/uwsgi/nextcloud.sock;<br />
}<br />
</nowiki>}}<br />
<br />
Then create a config file for ''uWSGI'':<br />
<br />
{{hc|/etc/uwsgi/nextcloud.ini|<nowiki><br />
[uwsgi]<br />
; load the required plugins<br />
plugins = php<br />
; force the sapi name to 'apache', this will enable the opcode cache <br />
php-sapi-name = apache<br />
<br />
; set master process name and socket<br />
; '%n' refers to the name of this configuration file without extension<br />
procname-master = uwsgi %n<br />
master = true<br />
socket = /run/uwsgi/%n.sock<br />
<br />
; drop privileges<br />
uid = http<br />
gid = http<br />
umask = 027<br />
<br />
; run with at least 1 process but increase up to 4 when needed<br />
processes = 4<br />
cheaper = 1<br />
<br />
; reload whenever this config file changes<br />
; %p is the full path of the current config file<br />
touch-reload = %p<br />
<br />
; disable uWSGI request logging<br />
;disable-logging = true<br />
<br />
; enforce a DOCUMENT_ROOT<br />
php-docroot = /usr/share/webapps/%n<br />
; limit allowed extensions<br />
php-allowed-ext = .php<br />
; and search for index.php if required<br />
php-index = index.php<br />
<br />
; set php configuration for this instance of php, no need to edit global php.ini<br />
php-set = date.timezone=Etc/UTC<br />
;php-set = open_basedir=/tmp/:/usr/share/webapps/nextcloud:/etc/webapps/nextcloud:/dev/urandom<br />
php-set = expose_php=false<br />
; avoid security risk of leaving sessions in world-readable /tmp<br />
php-set = session.save_path=/usr/share/webapps/nextcloud/data<br />
<br />
; port of php directives set upstream in /usr/share/webapps/nextcloud/.user.ini for use with PHP-FPM<br />
php-set = upload_max_filesize=513M<br />
php-set = post_max_size=513M<br />
php-set = memory_limit=512M<br />
php-set = output_buffering=off<br />
<br />
; load all extensions only in this instance of php, no need to edit global php.ini<br />
;; required core modules<br />
php-set = extension=gd<br />
php-set = extension=iconv<br />
;php-set = extension=zip # enabled by default in global php.ini<br />
<br />
;; database connectors<br />
;; uncomment your selected driver<br />
;php-set = extension=pdo_sqlite<br />
;php-set = extension=pdo_mysql<br />
;php-set = extension=pdo_pgsql<br />
<br />
;; recommended extensions<br />
;php-set = extension=curl # enabled by default in global php.ini<br />
php-set = extension=bz2<br />
php-set = extension=intl<br />
<br />
;; required for specific apps<br />
;php-set = extension=ldap # for LDAP integration<br />
;php-set = extension=ftp # for FTP storage / external user authentication<br />
;php-set = extension=imap # for external user authentication, requires php-imap<br />
<br />
;; recommended for specific apps<br />
;php-set = extension=exif # for image rotation in pictures app, requires exiv2<br />
;php-set = extension=gmp # for SFTP storage<br />
<br />
;; for preview generation<br />
;; provided by packages in AUR<br />
; php-set = extension=imagick<br />
<br />
; opcache<br />
php-set = zend_extension=opcache<br />
<br />
; user cache<br />
; provided by php-acpu, to be enabled **either** here **or** in /etc/php/conf.d/apcu.ini<br />
php-set = extension=apcu<br />
; per https://github.com/krakjoe/apcu/blob/simplify/INSTALL<br />
php-set = apc.ttl=7200<br />
php-set = apc.enable_cli=1<br />
<br />
cron2 = minute=-15,unique=1 /usr/bin/php -f /usr/share/webapps/nextcloud/cron.php 1>/dev/null<br />
</nowiki>}}<br />
<br />
{{Note|1=<br />
* Do not forget to set your timezone and uncomment the required database connector in the uWSGI config file<br />
* The [[PHP#Configuration|open_basedir]] directive is optional and commented out. You can uncomment to harden security. Be aware that it may [https://github.com/owncloud/core/search?q=open_basedir&type=Issues occasionally break things].<br />
* Use {{ic|1=php-docroot = /usr/share/webapps}} if placing nextcloud in /nextcloud subdirectory. }}<br />
<br />
{{Warning|The way the [https://docs.nextcloud.com/server/12/admin_manual/configuration_server/background_jobs_configuration.html Nextcloud background job] is currently set up with [https://uwsgi-docs.readthedocs.org/en/latest/Cron.html uWSGI cron] will make use of the default global configuration from {{ic|/etc/php/php.ini}}. This means that none of the specific parameters defined (e.g. required modules) will be enabled, [https://github.com/owncloud/core/issues/12678#issuecomment-66114448 leading to various issues]. One solution is to copy {{ic|/etc/php/php.ini}} to e.g. {{ic|/etc/uwsgi/cron-php.ini}}, make the required modifications there (mirroring {{ic|/etc/uwsgi/nextcloud.ini}} parameters) and referencing it in the cron directive by adding the {{ic|-c /etc/uwsgi/cron-php.ini}} option to ''php'' invocation.}}<br />
<br />
==== Activation ====<br />
<br />
[[uWSGI]] provides a [[Systemd#Using_units|template unit]] that allows to start and enable application using their configuration file name as instance identifier. For example:<br />
# systemctl start uwsgi@nextcloud.socket<br />
would start it on demand referencing the configuration file {{ic|/etc/uwsgi/nextcloud.ini}}. <br />
<br />
To enable the uwsgi service by default at start-up, run:<br />
# systemctl enable uwsgi@nextcloud.socket<br />
<br />
{{Note|Here we make use of [http://0pointer.de/blog/projects/socket-activation.html systemd socket activation] to prevent unnecessary resources consumption when no connections are made to the instance. If you would rather have it constantly active, simply remove the {{ic|.socket}} part to start and enable the service instead.}}<br />
<br />
See also [[UWSGI#Starting service]]{{Broken section link}}.<br />
<br />
=== Setting strong permissions for the filesystem ===<br />
<br />
You should set the permissions for {{ic|config/}}, {{ic|data/}} and {{ic|apps/}} as strict as possible. That means that your HTTP user (''http'' in case of {{pkg|apache}}) should own them, and the should have {{ic|700}} permissions. You can use the following script to achieve this.<br />
<br />
{{Style|Complex script for trivial one-time task.}}<br />
<br />
{{hc|oc-perms|2=<nowiki><br />
#!/bin/bash<br />
ocpath='/usr/share/webapps/nextcloud'<br />
htuser='http'<br />
htgroup='http'<br />
rootuser='root'<br />
<br />
printf "Creating possible missing Directories\n"<br />
mkdir -p $ocpath/data<br />
mkdir -p $ocpath/assets<br />
<br />
printf "chmod Files and Directories\n"<br />
find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640<br />
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750<br />
<br />
printf "chown Directories\n"<br />
chown -R ${rootuser}:${htgroup} ${ocpath}/<br />
chown -R ${htuser}:${htgroup} ${ocpath}/apps/<br />
chown -R ${htuser}:${htgroup} ${ocpath}/assets/<br />
chown -R ${htuser}:${htgroup} ${ocpath}/config/<br />
chown -R ${htuser}:${htgroup} ${ocpath}/data/<br />
chown -R ${htuser}:${htgroup} ${ocpath}/themes/<br />
chown -R ${htuser}:${htgroup} ${ocpath}/updater/<br />
<br />
chmod +x ${ocpath}/occ<br />
<br />
printf "chmod/chown .htaccess\n"<br />
if [ -f ${ocpath}/.htaccess ]<br />
then<br />
chmod 0644 ${ocpath}/.htaccess<br />
chown ${rootuser}:${htgroup} ${ocpath}/.htaccess<br />
fi<br />
if [ -f ${ocpath}/data/.htaccess ]<br />
then<br />
chmod 0644 ${ocpath}/data/.htaccess<br />
chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess<br />
fi<br />
</nowiki>}}<br />
<br />
If you have customized your Nextcloud installation and your filepaths are different than the standard installation, then modify this script accordingly.<br />
<br />
== Synchronization ==<br />
<br />
=== Desktop ===<br />
<br />
The official client can be installed with the {{Pkg|owncloud-client}} or {{aur|nextcloud-client}} package.<br />
Alternative versions are available in the [[AUR]]: {{AUR|owncloud-client-git}}.<br />
<br />
==== Calendar ====<br />
<br />
To access your Nextcloud calendars using Mozilla [[Thunderbird]]'s Lightning calendar you would use the following URL:<br />
<br />
<nowiki>https://ADDRESS/remote.php/caldav/calendars/USERNAME/CALENDARNAME</nowiki><br />
<br />
To access your Nextcloud calendars using CalDAV-compatible programs like Kontact or [[Evolution]], you would use the following URL:<br />
<br />
<nowiki>https://ADDRESS/remote.php/caldav</nowiki><br />
<br />
For details see the [https://docs.nextcloud.com/server/12/user_manual/pim/index.html official documentation].<br />
<br />
==== Contacts ====<br />
<br />
To sync contacts with [[Thunderbird]], see [https://docs.nextcloud.com/server/12/user_manual/pim/sync_thunderbird.html these instructions] from the official doc.<br />
<br />
==== Mounting files with davfs2 ====<br />
<br />
If you want to mount your ownCloud permanently install {{Pkg|davfs2}} (as described in [[davfs2]]) first.<br />
<br />
Considering your ownCloud were at {{ic|https://own.example.com}}, your WebDAV URL would be {{ic|https://own.example.com/remote.php/webdav}} (as of ownCloud 6.0).<br />
<br />
To mount your ownCloud, use:<br />
<br />
# mount -t davfs https://own.example.com/remote.php/webdav /path/to/mount<br />
<br />
You can also create an entry for this in {{ic|/etc/fstab}}<br />
<br />
{{hc|/etc/fstab|<br />
https://own.example.com/remote.php/webdav /path/to/mount davfs rw,user,noauto 0 0<br />
}}<br />
<br />
{{Tip|In order to allow automount you can also store your username (and password if you like) in a file as described in [[davfs2#Storing credentials]].}}<br />
<br />
{{Note|If creating/copying files is not possible, while the same operations work on directories, see [[davfs2#Creating/copying files not possible and/or freezes]].}}<br />
<br />
=== Mounting files in GNOME Files (Nautilus) ===<br />
<br />
You can access the files directly in Nautilus ('+ Other Locations') through WebDAV protocol - use the link as shown in your Nextcloud installation Web GUI (typically: https://example.org/remote.php/webdav/) but replace the protocol name from 'https' to 'davs'. Nautilus will ask for user name and password when trying to connect.<br />
<br />
=== Android ===<br />
<br />
Download the official Nextcloud app from [https://play.google.com/store/apps/details?id=com.nextcloud.client Google Play].<br />
<br />
To enable contacts and calendar sync (Android 4+):<br />
# download [https://davdroid.bitfire.at/ DAVdroid] ([https://play.google.com/store/apps/details?id=at.bitfire.davdroid Play Store], [https://f-droid.org/app/at.bitfire.davdroid F-Droid])<br />
# Enable mod_rewrite.so in httpd.conf<br />
# create a new DAVdroid account in the ''Account'' settings, and specify your "short" server address and login/password couple, e.g. {{ic|<nowiki>https://cloud.example.com</nowiki>}} (there is no need for the {{ic|<nowiki>/remote.php/{carddav,webdav}</nowiki>}} part if you configured your web server with the proper redirections, as illustrated previously in the article; ''DAVdroid'' will find itself the right URLs)<br />
<br />
=== iOS ===<br />
<br />
Download the official Nextcloud app from the [https://itunes.apple.com/us/app/nextcloud/id1125420102 App Store].<br />
<br />
=== SABnzbd ===<br />
<br />
When using [[SABnzbd]], you might want to set<br />
folder_rename 0<br />
in your sabnzbd.ini file, because ownCloud will scan the files as soon as they get uploaded, preventing SABnzbd from removing UNPACKING prefixes etc.<br />
<br />
== Troubleshooting ==<br />
{{Out of date|A lot of references to OwnCloud, are these still valid with Nextcloud?}}<br />
<br />
=== Self-signed certificate not accepted ===<br />
<br />
ownCloud uses [[Wikipedia:cURL]] and [[Wikipedia:SabreDAV]] to check if WebDAV is enabled.<br />
If you use SSL/TLS with a self-signed certificate, e.g. as shown in [[LAMP]], and access ownCloud's admin panel, you will see the following error message:<br />
<br />
Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken.<br />
<br />
Assuming that you followed the [[LAMP]] tutorial, execute the following steps:<br />
<br />
Create a local directory for non-distribution certificates and copy [[LAMP]]s certificate there. This will prevent {{ic|ca-certificates}}-updates from overwriting it.<br />
<br />
# cp /etc/httpd/conf/server.crt /usr/share/ca-certificates/''WWW.EXAMPLE.COM.crt''<br />
<br />
Add ''WWW.EXAMPLE.COM.crt'' to {{ic|/etc/ca-certificates.conf}}:<br />
<br />
''WWW.EXAMPLE.COM.crt''<br />
<br />
Now, regenerate your certificate store:<br />
<br />
# update-ca-certificates<br />
<br />
Restart the httpd service to activate your certificate.<br />
<br />
=== Self-signed certificate for Android devices ===<br />
<br />
Once you have followed the setup for SSL, as on [[LAMP#TLS.2FSSL|LAMP]] for example, early versions of DAVdroid will<br />
reject the connection because the certificate is not trusted. A certificate can be made as follows on your server:<br />
<br />
# openssl x509 -req -days 365 -in /etc/httpd/conf/server.csr -signkey /etc/httpd/conf/server.key -extfile android.txt -out CA.crt<br />
# openssl x509 -inform PEM -outform DER -in CA.crt -out CA.der.crt <br />
<br />
The file {{ic|android.txt}} should contain the following:<br />
<br />
basicConstraints=CA:true<br />
<br />
Then import {{ic|CA.der.crt}} to your Android device:<br />
<br />
Put the {{ic|CA.der.crt}} file onto the sdcard of your Android device (usually to the internal one, e.g. save from a mail attachment).<br />
It should be in the root directory. Go to ''Settings > Security > Credential storage'' and select ''Install from device storage''.<br />
The {{ic|.crt}} file will be detected and you will be prompted to enter a certificate name. After importing the certificate,<br />
you will find it in ''Settings > Security > Credential storage > Trusted credentials > User''.<br />
<br />
Thanks to: [http://www.leftbrainthings.com/2013/10/13/creating-and-importing-self-signed-certificate-to-android-device/]<br />
<br />
Another way is to import the certificate directly from your server via [https://play.google.com/store/apps/details?id=at.bitfire.cadroid CAdroid] and follow the instructions there.<br />
<br />
=== Cannot write into config directory! ===<br />
<br />
If you have set {{ic|open_basedir}} in your PHP/web server configuration file (e.g. {{ic|/etc/httpd/conf/extra/nextcloud.conf}}), make sure that it includes {{ic|/etc/webapps}}.<br />
<br />
Restart the web server to apply the change.<br />
<br />
=== Cannot create data directory ===<br />
<br />
If you have set {{ic|open_basedir}} in your PHP/web server configuration file (e.g. {{ic|/etc/httpd/conf/extra/nextcloud.conf}}), make sure that it includes the data directory.<br />
<br />
Restart the web server to apply the change.<br />
<br />
=== CSync failed to find a specific file. ===<br />
<br />
This is most likely a certificate issue. Recreate it, and do not leave the common name empty or you will see the error again.<br />
<br />
# openssl req -new -x509 -nodes -newkey rsa:4096 -keyout server.key -out server.crt<br />
<br />
=== Seeing white page after login ===<br />
<br />
The cause is probably a new app that you installed. To fix that, you can use the occ command as described<br />
[https://docs.nextcloud.com/server/12/admin_manual/configuration_server/occ_command.html here]. So with<br />
sudo -u http php /usr/share/webapps/nextcloud/occ app:list<br />
you can list all apps (if you installed nextcloud in the standard directory), and with <br />
sudo -u http php /usr/share/webapps/nextcloud/occ app:disable <nameOfExtension><br />
you can disable the troubling app.<br />
<br />
Alternatively, you can either use [[phpMyAdmin]] to edit the {{ic|oc_appconfig}} table (if you got lucky and the table has an edit option), or do it by hand with mysql:<br />
<br />
mysql -u root -p owncloud<br />
MariaDB [owncloud]> '''delete from''' oc_appconfig '''where''' appid='<nameOfExtension>' '''and''' configkey='enabled' '''and''' configvalue='yes';<br />
MariaDB [owncloud]> '''insert into''' oc_appconfig (appid,configkey,configvalue) '''values''' ('<nameOfExtension>','enabled','no');<br />
<br />
This should delete the relevant configuration from the table and add it again.<br />
<br />
=== GUI sync client fails to connect ===<br />
<br />
If using HTTP basic authentication, make sure to exclude "status.php", which must be publicly accessible. [https://github.com/owncloud/mirall/issues/734]<br />
<br />
=== Some files upload, but give an error 'Integrity constraint violation...' ===<br />
<br />
You may see the following error in the ownCloud sync client:<br />
<br />
SQLSTATE[23000]: Integrity constraint violation: ... Duplicate entry '...' for key 'fs_storage_path_hash')...<br />
<br />
This is caused by an issue with the File Locking app, which is often not sufficient to keep conflicts from occurring on some webserver configurations.<br />
A more complete [https://docs.nextcloud.com/server/12/admin_manual/configuration_files/files_locking_transactional.html Transactional File Locking]<br />
is available that rids these errors, but you must be using the Redis php-caching method. Install {{Pkg|redis}} and {{AUR|php-redis}}, comment out<br />
your current php-cache mechanism, and then in {{ic|/etc/php/conf.d/redis.ini}} uncomment {{ic|1=extension=redis}}.<br />
Then in {{ic|config.php}} make the following changes:<br />
<br />
'memcache.local' => '\OC\Memcache\Redis',<br />
'filelocking.enabled' => 'true',<br />
'memcache.locking' => '\OC\Memcache\Redis',<br />
'redis' => array(<br />
'host' => 'localhost',<br />
'port' => 6379,<br />
'timeout' => 0.0,<br />
),<br />
<br />
and [[start/enable]] {{ic|redis.service}}.<br />
<br />
Finally, disable the File Locking App, as the Transational File Locking will take care of it (and would conflict).<br />
<br />
If everything is working, you should see 'Transactional File Locking Enabled' under Server Status on the Admin page, and syncs should no longer cause issues.<br />
<br />
=== "Cannot write into apps directory" ===<br />
<br />
As mentioned in the [https://docs.nextcloud.com/server/12/admin_manual/installation/apps_management_installation.html official admin manual],<br />
either you need an apps directory that is writable by the http user, or you need to set {{ic|appstoreenabled}} to {{ic|false}}. <br />
<br />
=== Installed apps get blocked because of MIME type error ===<br />
<br />
If you're putting your apps folder outside of the nextcloud installation directory make sure your webserver serves it properly.<br />
<br />
In nginx this is accomplished by adding a location block to the nginx configuration as the folder will not be included in it by default.<br />
<br />
location ~ /apps2/(.*)$ {<br />
alias /var/www/nextcloud/apps/$1;<br />
}<br />
<br />
=== Security warnings even though the recommended settings have been included in nginx.conf ===<br />
<br />
At the top of the admin page there might be a warning to set the {{ic|Strict-Transport-Security}}, {{ic|X-Content-Type-Options}},<br />
{{ic|X-Frame-Options}}, {{ic|X-XSS-Protection}} and {{ic|X-Robots-Tag}} according to https://docs.nextcloud.com/server/12/admin_manual/configuration_server/harden_server.html<br />
even though they are already set like that.<br />
<br />
A possible cause could be that because owncloud sets those settings, uwsgi passed them along and nginx added them again:<br />
<br />
{{hc|$ curl -I https://domain.tld|<br />
<nowiki>...<br />
X-XSS-Protection: 1; mode=block<br />
X-Content-Type-Options: nosniff<br />
X-Frame-Options: Sameorigin<br />
X-Robots-Tag: none<br />
Strict-Transport-Security: max-age=15768000; includeSubDomains; preload;<br />
X-Content-Type-Options: nosniff<br />
X-Frame-Options: SAMEORIGIN<br />
X-XSS-Protection: 1; mode=block<br />
X-Robots-Tag: none</nowiki>}}<br />
<br />
While the fast_cgi sample config has a parameter to avoid that ( {{ic|fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice}} ), when using uwsgi and nginx the following modification of the uwsgi part in nginx.conf could help:<br />
<br />
{{hc| /etc/nginx/nginx.conf|<br />
<nowiki>...<br />
# pass all .php or .php/path urls to uWSGI<br />
location ~ ^(.+\.php)(.*)$ {<br />
include uwsgi_params;<br />
uwsgi_modifier1 14;<br />
# hode following headers received from uwsgi, because otherwise we would send them twice since we already add them in nginx itself<br />
uwsgi_hide_header X-Frame-Options;<br />
uwsgi_hide_header X-XSS-Protection;<br />
uwsgi_hide_header X-Content-Type-Options;<br />
uwsgi_hide_header X-Robots-Tag;<br />
uwsgi_hide_header X-Frame-Options;<br />
#Uncomment line below if you get connection refused error. Remember to commet out line with "uwsgi_pass 127.0.0.1:3001;" below<br />
uwsgi_pass unix:/run/uwsgi/owncloud.sock;<br />
#uwsgi_pass 127.0.0.1:3001;<br />
}<br />
...</nowiki>}}<br />
<br />
=== "Reading from keychain failed with error: 'No keychain service available'" ===<br />
<br />
Can be fixed for Gnome by installing the following 2 packages, {{Pkg|libgnome-keyring}} and {{Pkg|gnome-keyring}}.<br />
Or the following for KDE, {{Pkg|libgnome-keyring}} and {{Pkg|qtkeychain}}.<br />
<br />
=== FolderSync: "Method Not Allowed" ===<br />
<br />
FolderSync needs access to {{ic|/owncloud/remote.php/webdav}}, so you could create another alias for owncloud in your {{ic|/etc/httpd/conf/extra/nextcloud.conf}}<br />
<IfModule mod_alias.c><br />
Alias /nextcloud /usr/share/webapps/nextcloud/<br />
Alias /owncloud /usr/share/webapps/nextcloud/<br />
</IfModule><br />
<br />
== Tips and tricks ==<br />
<br />
=== Running ownCloud in a subdirectory ===<br />
<br />
By including the default {{ic|owncloud.conf}} in {{ic|httpd.conf}}, ownCloud will take control of port 80 and your localhost domain. <br />
<br />
If you would like to have ownCloud run in a subdirectory, then edit the {{ic|/etc/httpd/conf/extra/owncloud.conf}}<br />
you included and comment out the {{ic|<nowiki><VirtualHost *:80> ... </VirtualHost></nowiki>}} part of the include file.<br />
<br />
You can use the following nginx config when using owncloud with uwsgi:<br />
{{hc|head=/etc/nginx/conf.d/owncloud.conf|output=<nowiki><br />
location = /.well-known/carddav {<br />
return 301 $scheme://$host/owncloud/remote.php/dav;<br />
}<br />
<br />
location = /.well-known/caldav {<br />
return 301 $scheme://$host/owncloud/remote.php/dav;<br />
}<br />
<br />
location /.well-known/acme-challenge { }<br />
<br />
location ^~ /owncloud {<br />
<br />
root /usr/share/webapps;<br />
<br />
# set max upload size<br />
client_max_body_size 512M;<br />
fastcgi_buffers 64 4K;<br />
<br />
# Disable gzip to avoid the removal of the ETag header<br />
gzip off;<br />
<br />
# Uncomment if your server is build with the ngx_pagespeed module<br />
# This module is currently not supported.<br />
#pagespeed off;<br />
<br />
location /owncloud {<br />
rewrite ^ /owncloud/index.php$uri;<br />
}<br />
<br />
location ~ ^/owncloud/(?:build|tests|config|lib|3rdparty|templates|data)/ {<br />
deny all;<br />
}<br />
<br />
location ~ ^/owncloud/(?:\.|autotest|occ|issue|indie|db_|console) {<br />
deny all;<br />
}<br />
<br />
location ~ ^/owncloud/(?:updater|ocs-provider)(?:$|/) {<br />
try_files $uri/ =404;<br />
index index.php;<br />
}<br />
<br />
location ~ ^/owncloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {<br />
include uwsgi_params;<br />
uwsgi_modifier1 14;<br />
# Avoid duplicate headers confusing OC checks<br />
uwsgi_hide_header X-Frame-Options;<br />
uwsgi_hide_header X-XSS-Protection;<br />
uwsgi_hide_header X-Content-Type-Options;<br />
uwsgi_hide_header X-Robots-Tag;<br />
uwsgi_pass unix:/run/uwsgi/owncloud.sock;<br />
}<br />
<br />
# Adding the cache control header for js and css files<br />
# Make sure it is BELOW the PHP block<br />
location ~* \.(?:css|js) {<br />
try_files $uri /owncloud/index.php$uri$is_args$args;<br />
add_header Cache-Control "public, max-age=7200";<br />
# Add headers to serve security related headers (It is intended<br />
# to have those duplicated to the ones above)<br />
# Before enabling Strict-Transport-Security headers please read<br />
# into this topic first.<br />
# add_header Strict-Transport-Security "max-age=15768000;<br />
# includeSubDomains; preload;";<br />
add_header X-Content-Type-Options nosniff;<br />
add_header X-Frame-Options "SAMEORIGIN";<br />
add_header X-XSS-Protection "1; mode=block";<br />
add_header X-Robots-Tag none;<br />
add_header X-Download-Options noopen;<br />
add_header X-Permitted-Cross-Domain-Policies none;<br />
# Optional: Don't log access to assets<br />
access_log off;<br />
}<br />
<br />
location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg) {<br />
try_files $uri /owncloud/index.php$uri$is_args$args;<br />
# Optional: Don't log access to other assets<br />
access_log off;<br />
}<br />
}<br />
</nowiki>}}<br />
<br />
=== Docker ===<br />
See the [https://hub.docker.com/_/owncloud/ ownCloud] or [https://github.com/nextcloud/docker Nextcloud] repository for [[Docker]].<br />
<br />
=== Upload and share from File Manager ===<br />
[https://github.com/schiesbn/shareLinkCreator shareLinkCreator] provides the ability to upload a file to<br />
OwnCloud via a supported file manager and receive a link to the uploaded file which can then be emailed or shared in another way.<br />
<br />
=== Defining Background Jobs ===<br />
<br />
Nextcloud requires scheduled execution of some tasks, and by default it achieves this by using AJAX,<br />
however AJAX is the least reliable method, and it is recommended to use [[Cron]] instead. However,<br />
ArchLinux ships with {{Pkg|systemd}}, so the preferred way of executing scheduled tasks is a [[Systemd#Timers|systemd timer]]. <br />
<br />
First create a service:<br />
<br />
{{hc|/etc/systemd/system/nextcloudcron.service|<nowiki><br />
[Unit]<br />
Description=Nextcloud cron.php job<br />
<br />
[Service]<br />
User=http<br />
ExecStart=/usr/bin/php -f /usr/share/webapps/nextcloud/cron.php<br />
<br />
[Install]<br />
WantedBy=basic.target<br />
</nowiki>}}<br />
<br />
Then create a timer for that service:<br />
<br />
{{hc|/etc/systemd/system/nextcloudcron.timer|<nowiki><br />
[Unit]<br />
Description=Run Nextcloud cron.php every 15 minutes<br />
<br />
[Timer]<br />
OnBootSec=5min<br />
OnUnitActiveSec=15min<br />
Unit=nextcloudcron.service<br />
<br />
[Install]<br />
WantedBy=timers.target<br />
</nowiki>}}<br />
<br />
[[Start/enable]] {{ic|nextcloudcron.timer}}.<br />
<br />
Confirm that it is running by running<br />
# systemctl list-timers<br />
<br />
=== Collabora Online Office integration ===<br />
'''Solution with Docker: ''CODE backend using the official Docker image'''''<br />
<br />
The first, install a {{Pkg|docker}} package to provide collabora files and setup a Collabora server.<br />
<br />
[[Start/enable]] docker.service<br />
<br />
# systemctl enable docker.service<br />
# systemctl start docker.service<br />
<br />
Then, download the required binares :<br />
<br />
# docker pull collabora/code<br />
<br />
And, installing a Collabora server. Make sure {{ic|cloud//.example//.com}} is your nextcloud's domain, not a collabora :<br />
<br />
# docker run -t -d -p 127.0.0.1:9980:9980 -e 'domain=cloud//.example//.com' --restart always --cap-add MKNOD collabora/code<br />
<br />
Also make sure to escape all dots with double backslashes (\), since this string will be evaluated as a regular expression (and your bash 'eats' the first backslash.) If you want to use the docker container with more than one Nextcloud, you'll need to use 'domain=cloud\\.example\\.com\|second\\.example\\.com' instead. (All hosts are separated by \|.) When using `localhost` as domain for testing you need to add {ic|--net host}} to ensure the docker container can access your Nextcloud server. <br />
<br />
If you need to delete or reinstall Collabora server use:<br />
<br />
For recognition CONTAINER_ID of server<br />
# docker ps<br />
<br />
Stop and delete<br />
# docker stop CONTAINER_ID<br />
# docker rm CONTAINER_ID<br />
<br />
Futher, follow the instruction of webserver you are using:<br />
<br />
'''Nginx setup example:'''<br />
<br />
Add following to your nextcloud domain config or add new config file in /etc/nginx/conf.d/ directory, (Don't forget to change {{ic|office.example.com}} and {{ic|ssl_certificate}} to the right values:<br />
<br />
{{hc|/etc/nginx/conf.d/example.conf|<nowiki><br />
upstream office.example.com {<br />
server 127.0.0.1:9980;<br />
}<br />
<br />
server {<br />
listen 443 ssl;<br />
server_name office.example.com;<br />
<br />
ssl_certificate /etc/letsencrypt/live/office.example.com/fullchain.pem;<br />
ssl_certificate_key /etc/letsencrypt/live/office.example.com/privkey.pem;<br />
<br />
# static files<br />
location ^~ /loleaflet {<br />
proxy_pass http://127.0.0.1:9980;<br />
proxy_set_header Host $host;<br />
}<br />
<br />
# WOPI discovery URL<br />
location ^~ /hosting/discovery {<br />
proxy_pass http://127.0.0.1:9980;<br />
proxy_set_header Host $host;<br />
}<br />
<br />
# Main websocket<br />
location ~ /lool/(.*)/ws$ {<br />
proxy_pass http://127.0.0.1:9980;<br />
proxy_set_header Upgrade $http_upgrade;<br />
proxy_set_header Connection "Upgrade";<br />
proxy_set_header Host $host;<br />
proxy_read_timeout 36000s;<br />
}<br />
<br />
# Admin Console websocket<br />
location ^~ /lool/adminws {<br />
proxy_buffering off;<br />
proxy_pass http://127.0.0.1:9980;<br />
proxy_set_header Upgrade $http_upgrade;<br />
proxy_set_header Connection "Upgrade";<br />
proxy_set_header Host $host;<br />
proxy_read_timeout 36000s;<br />
}<br />
<br />
# download, presentation and image upload<br />
location ~ /lool {<br />
proxy_pass http://127.0.0.1:9980;<br />
proxy_set_header Host $host;<br />
}<br />
}<br />
</nowiki>}}<br />
<br />
Restart a nginx:<br />
<br />
# nginx -s reload<br />
or<br />
# systemctl restart nginx.service<br />
<br />
'''Apache setup example:'''<br />
<br />
Add following to nextcloud config file. Don't forget to change to the right values<br />
<br />
{{hc|/etc/httpd/conf/extra/nextcloud.conf|<nowiki><br />
<VirtualHost *:443><br />
ServerName office.nextcloud.com:443<br />
<br />
# SSL configuration, you may want to take the easy route instead and use Lets Encrypt!<br />
SSLEngine on<br />
SSLCertificateFile /path/to/signed_certificate<br />
SSLCertificateChainFile /path/to/intermediate_certificate<br />
SSLCertificateKeyFile /path/to/private/key<br />
SSLProtocol all -SSLv2 -SSLv3<br />
SSLCipherSuite ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS<br />
SSLHonorCipherOrder on<br />
<br />
# Encoded slashes need to be allowed<br />
AllowEncodedSlashes NoDecode<br />
<br />
# Container uses a unique non-signed certificate<br />
SSLProxyEngine On<br />
SSLProxyVerify None<br />
SSLProxyCheckPeerCN Off<br />
SSLProxyCheckPeerName Off<br />
<br />
# keep the host<br />
ProxyPreserveHost On<br />
<br />
# static html, js, images, etc. served from loolwsd<br />
# loleaflet is the client part of LibreOffice Online<br />
ProxyPass /loleaflet https://127.0.0.1:9980/loleaflet retry=0<br />
ProxyPassReverse /loleaflet https://127.0.0.1:9980/loleaflet<br />
<br />
# WOPI discovery URL<br />
ProxyPass /hosting/discovery https://127.0.0.1:9980/hosting/discovery retry=0<br />
ProxyPassReverse /hosting/discovery https://127.0.0.1:9980/hosting/discovery<br />
<br />
# Main websocket<br />
ProxyPassMatch "/lool/(.*)/ws$" wss://127.0.0.1:9980/lool/$1/ws nocanon<br />
<br />
# Admin Console websocket<br />
ProxyPass /lool/adminws wss://127.0.0.1:9980/lool/adminws<br />
<br />
# Download as, Fullscreen presentation and Image upload operations<br />
ProxyPass /lool https://127.0.0.1:9980/lool<br />
ProxyPassReverse /lool https://127.0.0.1:9980/lool<br />
</VirtualHost><br />
</nowiki>}}<br />
<br />
After configuring these do restart your apache:<br />
# systemctl restart httpd<br />
<br />
'''Install the Nextcloud app'''<br />
<br />
Go to the Apps section and choose “Office & Text”, install the “Collabora Online” app. In admin panel select Collabora Online tab and specific the server's domain you have setup before.<br />
<br />
'''Solution without Docker: ''CODE backend using an Archlinux package'''''<br />
<br />
The {{AUR|collabora-online-server-nodocker}} package brings to your Archlinux installation 1º Collabora Office (the desktop suite), and 2º the “CODE” (Collabora Online Development Edition) server, which is based on “lool” (LibreOffice OnLine).<br />
<br />
Alter the `/etc/loolwsd/loolwsd.xml` file, so that:<br />
* `config > server_name` contains the host and port of the public Nextcloud address, separated by a colon (eg. `example.org:443`),<br />
* `config > ssl > enable` is false (ie. web browser —HTTPS→ proxy —HTTP→ loolwsd),<br />
* `config > ssl > termination` is true (I suppose you’ll manage TLS at the proxy level),<br />
* `config > storage > wopi > host` reflects the actual hostname (or pattern) of the proxy server (eg. `(?:.*\.)?example\.org`),<br />
* `config > admin_console > username` and `config > admin_console > password` are set to values of your choice.<br />
<br />
Then:<br />
* start and enable `loolwsd.service`;<br />
* configure Nginx as showed in /usr/share/doc/loolwsd/example.nginx.conf, and restart it.<br />
<br />
== See also ==<br />
* [https://docs.nextcloud.com/ nextcloud official website]<br />
* [https://docs.nextcloud.com/server/12/admin_manual/ nextcloud 12.0 Admin Documentation]</div>Roshlesshttps://wiki.archlinux.org/index.php?title=Talk:Gogs&diff=479692Talk:Gogs2017-06-12T14:53:02Z<p>Roshless: paths</p>
<hr />
<div>Paths should be changed. /srv isn't used, and config is in /etc/gogs [[User:Roshless|Roshless]] ([[User talk:Roshless|talk]]) 16:50, 12 June 2017 (UTC+2)</div>Roshlesshttps://wiki.archlinux.org/index.php?title=Diaspora&diff=456852Diaspora2016-11-15T22:43:56Z<p>Roshless: oh man I spent 3 hours trying to figure this one</p>
<hr />
<div>[[Category:Web server]]<br />
[http://www.diasporafoundation.org/ Diaspora] is the privacy aware, personally controlled, do-it-all, open source social network.<br />
<br />
On November 23, 2010 was [http://blog.joindiaspora.com/2010/11/23/private-alpha-released.html announced] that Diaspora is in [[wikipedia:Software_release_life_cycle#Alpha|private alpha]] phase.<br />
<br />
Since August 27, 2012 Diaspora is ruled by the community ([http://blog.diasporafoundation.org/2012/08/27/announcement-diaspora-will-now-be-a-community-project.html announcement]).<br />
<br />
== Prerequisites ==<br />
<br />
* Since Diaspora can run on [[MySQL]] and [[PostgreSQL]] you need to decide which one you want to use. Install one of them and set it up.<br />
* Diaspora starts a so called appserver, on port 3000 by default, which serves the dynamic contents. You need a reverse proxy to handle the static content and that forwards requests it can't handle to the appserver. Typical tools for that are [[Apache]] or [[Nginx]].<br />
* You'll also need the usual tools to build packages from the AUR.<br />
* And {{AUR|ruby2.2}} and {{AUR|ruby2.2-bundler}} from the AUR.<br />
<br />
== Installation ==<br />
<br />
Install {{AUR|diaspora-mysql}} or {{AUR|diaspora-postgresql}} from the AUR.<br />
<br />
Now edit {{ic|/etc/webapps/diaspora/database.yml}} and fill out the needed values. Then edit {{ic|/etc/webapps/diaspora/diaspora.yml}} and change at least the url setting to the URL your installation will be reachable under (the one served by your reverse proxy). You can change the port the appserver will listen on under the server section. By default Diaspora requires a SSL setup, you can disable that with the require_ssl setting.<br />
<br />
Ensure your database is running and then switch to the diaspora user:<br />
$ su diaspora<br />
$ cd<br />
<br />
Create the database and initialize the schema:<br />
bin/bundle exec rake db:create db:schema:load<br />
If the user you specified in the database.yml file can't create databases leave the 'db:create' out and create a database named diaspora_production by hand.<br />
<br />
You can now switch back to your regular user and start '''diaspora''' [[systemd]] service.<br />
<br />
The static content your reverse proxy needs to serve will be available under {{ic|/usr/share/webapps/diaspora/public/}}<br />
<br />
== Updating ==<br />
<br />
Updating is very analogous. Obtain the newest version of the package and build it, just like in the installation instructions. Watch for .pacnew files and review the changes. Also read the [https://github.com/diaspora/diaspora/blob/master/Changelog.md changelog] over at Diaspora. Then again ensure the database is running and switch to the diaspora user:<br />
$ su diaspora<br />
$ cd<br />
<br />
And update the database schema:<br />
bin/bundle exec rake db:migrate<br />
<br />
Exit and restart '''diaspora''' systemd service.<br />
<br />
If you notice [https://wiki.diasporafoundation.org/FAQ_for_pod_maintainers#I_installed_diaspora.2A_on_my_machine.2C_but_when_I_load_the_site_there_are_no_images_and_the_layout_looks_horrible.21 missing icons or layout issues] after restarting the service, switch to the diaspora user again and run:<br />
<br />
bin/bundle exec rake assets:precompile<br />
<br />
Once more, exit and restart '''diaspora''' systemd service.<br />
<br />
== Add yourself as an admin ==<br />
<br />
Switch to the diaspora user and start the Rails console:<br />
su diaspora<br />
cd<br />
bin/bundle exec rails console production<br />
<br />
Then run the following command, replacing ''user'' with your username (only lowercase characters):<br />
Role.add_admin User.where(username: "user").first.person<br />
<br />
You can exit the Rails console by pressing {{ic|Ctrl+d}}.<br />
<br />
== Troubleshooting ==<br />
<br />
=== GDM login screen with Diaspora ===<br />
<br />
GDM will insert the user diaspora in its login window because it currently considers the id range 500-1000 as normal users while Arch considers this range for system users as defined in /etc/login.defs. GDM does that probably to keep legacy normal users working.<br />
To exclude this user from the login window, add this 'Exclude' line in your /etc/gdm/custom.conf file:<br />
[greeter]<br />
Exclude=diaspora<br />
<br />
== See also ==<br />
<br />
* [http://github.com/diaspora/diaspora Diaspora git]</div>Roshlesshttps://wiki.archlinux.org/index.php?title=Picom&diff=438708Picom2016-06-21T23:17:27Z<p>Roshless: introducing fork with pulls from upstream</p>
<hr />
<div>[[Category:X server]]<br />
[[Category:Eye candy]]<br />
[[ja:Compton]]<br />
[[ru:Compton]]<br />
Compton is a standalone composite manager, suitable for use with [[window managers]] that do not natively provide compositing functionality. Compton is a fork of [http://oliwer.net/xcompmgr-dana/ xcompmgr-dana], which in turn is a fork of [[xcompmgr]]. See the [https://github.com/chjj/compton compton github page] for more information.<br />
<br />
== Installation ==<br />
<br />
Install {{Pkg|compton}} or its [[git]] version, {{AUR|compton-git}}.<br />
<br />
== Use ==<br />
<br />
Compton may be manually enabled or disabled at any time during a session, or autostarted as a background ([[Daemon]]) process for sessions. There are also several optional arguments that may be used to tweak the compositing effects provided. These include:<br />
<br />
* {{ic|-b}}: Run as a background ([[Daemon]]) process for a session (e.g. when autostarting for a [[window manager]] such as [[Openbox]])<br />
* {{ic|-c}}: Enable shadow effects<br />
* {{ic|-C}}: Disable shadow effects on panels and docks<br />
* {{ic|-G}}: Disable shadow effects for application windows and drag-and-drop objects<br />
* {{ic|--config}}: Use a specified configuration file<br />
<br />
Many more options are available, including to set timing, displays to be managed, and the opacity of menus, window borders, and inactive application menus. See the [https://github.com/chjj/compton/blob/master/man/compton.1.asciidoc Compton Man Page] for further information.<br />
<br />
=== Autostarting ===<br />
How compton would be autostarted as a [[Daemon]] process will depend on the [[desktop environment]] or [[window manager]] used. For example, for [[Openbox]] the {{ic|~/.config/openbox/autostart}} file must be edited, while for [[i3]] it would be the {{ic|~/.i3/config}} file. Where necessary, compton may also be autostarted from [[xprofile]] or [[Xinitrc]]. Read the [[startup files]] article for further information.<br />
<br />
=== Command only ===<br />
To manually enable default compositing effects during a session, use the following command:<br />
<br />
$ compton<br />
<br />
Alternatively, to disable all shadowing effects during a session, the {{ic|-C}} and {{ic|-G}} arguments must be added:<br />
<br />
$ compton -CG<br />
<br />
To autostart compton as a background ([[Daemon]]) process for a session, the {{ic|-b}} argument must be used:<br />
<br />
compton -b<br />
<br />
To disable all shadowing effects from the [[Daemon]] process, the {{ic|-C}} and {{ic|-G}} arguments must again be added:<br />
<br />
compton -CGb<br />
<br />
Finally, this is an example where additional arguments that require values to be set have been used:<br />
<br />
compton -cCGfF -o 0.38 -O 200 -I 200 -t 0 -l 0 -r 3 -D2 -m 0.88<br />
<br />
=== Using a configuration file ===<br />
<br />
The default configuration is available in {{ic|/etc/xdg/compton.conf}}. For modifications, it can be copied to {{ic|~/.config/compton.conf}}, or to {{ic|~/.compton.conf}}.<br />
<br />
To use a custom configuration file with compton during a session, use the following command:<br />
<br />
compton --config ''path/to/compton.conf''<br />
<br />
To auto-start compton as a background ([[Daemon]]) process for a session, specify the {{ic|-b}} argument:<br />
<br />
compton --config ''path/to/compton.conf'' -b<br />
<br />
==== Disable shadowing of some windows ====<br />
<br />
Due to the way compton draws its shadows, certain applications will have visual glitches when you have shadows enabled. The {{ic|shadow-exclude}} options could disable compton shadows. <br />
<br />
For example, to disable Compton shadows on all GTK +3 windows, add below setting to {{ic|shadow-exclude}} in {{ic|compton.conf}}:<br />
"_GTK_FRAME_EXTENTS@:c"<br />
<br />
To disable shadows around [[conky]] windows - where used - first amend the conky configuration file {{ic|~/.conkyrc}} as follows:<br />
<br />
own_window_class conky<br />
<br />
Then amend the compton configuration file as follows:<br />
<br />
shadow-exclude = "class_g = 'conky'";<br />
<br />
For currently disabled windows, please see [https://projects.archlinux.org/svntogit/community.git/tree/trunk/compton.conf?h=packages/compton#n80 here].<br />
<br />
== Multihead ==<br />
If a [[multihead]] configuration is used without xinerama - meaning that X server is started with more than one screen - then compton will start on only one screen by default. It can be started on all screens by using the {{ic|-d}} argument. For example, compton can be executed for 4 monitors with the following command:<br />
<br />
seq 0 3 | xargs -l1 -I@ compton -b -d :0.@<br />
<br />
== Troubleshooting ==<br />
The use of compositing effects may on occasion cause issues such as visual glitches when not configured correctly for use with other applications and programs.<br />
<br />
=== slock ===<br />
<br />
Where inactive window transparency has been enabled (the {{ic|-i}} <br />
argument when running as a command), this may provide troublesome <br />
results when also using [[slock]]. One solution is to amend the <br />
transparency to {{ic|0.2}}. For example, where running compton arguments<br />
as a command:<br />
<br />
$ compton <any other arguments> -i 0.2<br />
<br />
Otherwise, where using a configuration file:<br />
<br />
inactive-dim = 0.2;<br />
<br />
Alternatively, you may try to exclude slock by its window id, or by <br />
excluding all windows with no name.<br />
{{note|Some programs change their id for every new instance, but slock's appears to be static. Someone more knowledgeable will have to confirm that slock's id is in fact static- until then, use at your own risk.}}<br />
Exclude all windows with no name from compton using the following <br />
options:<br />
$ compton <other arguments> --focus-exclude "! name~=''"<br />
Find your slock's window id by running the command:<br />
$ xwininfo & slock<br />
Quickly click anywhere on the screen (before slock exits), then type <br />
your password to unlock. You should see the window id in the output:<br />
xwininfo: Window id: 0x1800001 (has no name)<br />
Take the window id and exclude it from compton with:<br />
$ compton <any other arguments> --focus-exclude 'id = 0x1800001'<br />
Otherwise, where using a configuration file:<br />
focus-exclude = "id = 0x1800001";<br />
<br />
=== dwm & dmenu===<br />
dwm's statusbar is not detected by any of compton's functions to automatically exclude window manager elements. Neither dwm statusbar nor dmenu have a static window id. If you want to exclude it from inactive window transparency (or other), you'll have to either patch a window class into the source code of each, or exclude by less precise attributes. I have dmenu and dwm's status on top, which allows me to write a resolution independent location exclusion.<br />
$ compton <any other arguments> --focus-exclude "x = 0 && y = 0 && override_redirect = true"<br />
Otherwise, where using a configuration file:<br />
focus-exclude = "x = 0 && y = 0 && override_redirect = true";<br />
The override redirect property seems to be false for most windows- having this in the exclusion rule prevents other windows drawn in the upper left corner from being excluded (for example, when dwm statusbar is hidden, x0 y0 will match whatever is in dwm's master stack).<br />
<br />
=== Unable to change the background color with xsetroot ===<br />
Currently, compton is incompatible with {{ic|xsetroot}}'s {{ic|-solid}} option, a workaround is to use {{aur|hsetroot}} to set the background color:<br />
<br />
$ hsetroot -solid '#000000'<br />
<br />
For a detailed explaination, please see https://github.com/chjj/compton/issues/162.<br />
<br />
=== Screen artifacts/screenshot issues when using AMD's Catalyst driver ===<br />
Try running compton with<br />
<br />
--backend xrender<br />
<br />
or adding<br />
<br />
backend = "xrender";<br />
<br />
to your compton.conf file.<br />
<br />
For more info, please see https://github.com/chjj/compton/issues/208<br />
<br />
=== High CPU use with nvidia drivers ===<br />
<br />
When facing high CPU use with {{ic|--backend glx}} or tearing with {{ic|--vsync}} enabled, [[install]] {{Pkg|nvidia-libgl}} as described in [[NVIDIA]].<br />
<br />
=== Errors while trying to daemonize with nvidia drivers ===<br />
<br />
If you get error {{ic|main(): Failed to create new session.}} while trying to start compton in background you should try {{AUR|compton-garnetius-git}}. It also provides a few pulls from upstream that aren't merged yet.<br />
<br />
== See also ==<br />
<br />
*[http://ubuntuforums.org/showthread.php?t=2144468&p=12644745#post12644745 Howto: Using Compton for tear-free compositing on XFCE or LXDE]</div>Roshlesshttps://wiki.archlinux.org/index.php?title=Chrome_OS_devices/Custom_firmware&diff=391545Chrome OS devices/Custom firmware2015-08-17T20:51:59Z<p>Roshless: typo</p>
<hr />
<div>[[Category:Laptops]]<br />
{{Related articles start}}<br />
{{Related|Chromebook}}<br />
{{Related articles end}}<br />
{{Warning|This article relies on third-party scripts and modifications, and may irreparably damage your hardware or data. Proceed at your own risk.}}<br />
<br />
{{Poor writing|This topic on this page were moved out from the Chromebook page as it was too bloated, hard to navigate and follow, the page here is still needs a little more work to stand by it own and we can probably move out a little more details from the Chromebook page to avoid duplicates, anyone who create hot links in other pages to specific topics in this page should be aware that some topics' headers might be change.}}<br />
<br />
== Introduction ==<br />
<br />
=== Why flash a custom firmware? ===<br />
<br />
==== Pros ====<br />
<br />
* Adds a much recent version of SeaBIOS<br />
* Adds SeaBIOS payload of coreboot to Chrome OS devices that did not shipped with SeaBIOS.<br />
* Reduce boot time.<br />
* Remove developer Mode screen.<br />
* Enables VMX.<br />
* Fixes some issues (like suspend) without further modifications.<br />
<br />
==== Cons ====<br />
<br />
* Dangerous, might brick your device.<br />
* Cannot boot stock Chrome OS (you can install [http://arnoldthebat.co.uk/wordpress/chromium-os/ Arnold the Bat’s Chromium OS build] and it should be possible upgrade it to full blown Chrome OS with a script).<br />
* It is possible that some quirks will be added, [https://bbs.archlinux.org/viewtopic.php?pid=1460520#p1460520].<br />
<br />
== Flashing the custom firmware ==<br />
<br />
There are several approaches for flashing a custom firmware:<br />
* Use John Lewis' script which will save you time finding the correct firmware.<br />
* Use Matt DeVillier's [http://forum.kodi.tv/showthread.php?tid=194362 ezScript] (currently supports only Chromeboxes).<br />
* Manually with {{ic|flashrom}}, in this case you will need to obtain the firmware by yourself or to compile it from the Coreboot sources ([http://www.coreboot.org/Download_coreboot official] or [https://chromium.googlesource.com/chromiumos/third_party/coreboot/ Chromium OS fork]).<br />
<br />
=== Disable the hardware write protection ===<br />
<br />
See the [[#Disabling the hardware write protection|Disabling the hardware write protection]] at the [[#Firmware write protection|Firmware write protection]].<br />
<br />
=== Flashing with John Lewis' script ===<br />
<br />
{{Warning|Do not run the script before disabling the hardware write protection.}}<br />
<br />
==== Understanding the script ====<br />
<br />
===== What John Lewis' {{ic|getnflash_johnlewis_rom.sh}} script does ? =====<br />
* Automatically downloads Chromium OS 32bit version of {{ic|flashrom}}.<br />
* Backup your current firmware.<br />
* Disables software write protection by running {{ic|# ./flashrom --wp-disable}}.<br />
* Checks the Chromebook product name with {{Pkg|dmidecode}} and download the proper custom firmware.<br />
* Writes the custom firmware.<br />
<br />
===== What the script does not do ? =====<br />
* Does not ask for confirmation.<br />
* Does not check if the hardware write protection is disabled.<br />
* Does not confirm the compatibility of a custom firmware to a specific Chromebook sub-model.<br />
<br />
===== Conclusions ===== <br />
* Make sure you disabled the hardware write protection.<br />
* Read the [https://johnlewis.ie/custom-chromebook-firmware/faq/ FAQ].<br />
* [https://johnlewis.ie/custom-chromebook-firmware/rom-download/ Confirm that your Chromebook model is supported], if your model is untested then visit the [https://plus.google.com/communities/112479827373921524726 coreboot on Chromebooks Google+ community] and ask for advice.<br />
<br />
{{Warning|If you are flashing a custom firmware be prepared to the possibility that you might brick your device and make yourself familiar with the [[#Unbricking_Your_Chromebook|unbricking methods]].}}<br />
<br />
==== Running the script in Chrome OS ====<br />
<br />
* Access your [[#Accessing_the_superuser_shell|superuser shell]].<br />
* Enter the command shown on the [https://johnlewis.ie/custom-chromebook-firmware/rom-download/ Download ROM page at John Lewis site].<br />
<br />
{{Note|The reason for not posting here is to force you to visit the site and read the page before proceeding.}}<br />
<br />
* After the script exited copy the backed up firmware to an external storage before rebooting the system.<br />
<br />
You should now have a custom firmware installed on your device, cross your fingers and reboot.<br />
<br />
If you flashed the firmware as part of the installation process then continue by following [[#Installing_Arch_Linux|Installing Arch Linux]], if the custom firmware boots the installation media correctly then you might want to enable back the hardware write protection.<br />
<br />
==== Running the script in Arch Linux ====<br />
<br />
* In Arch Linux on 64bit environment you will need to enable the Multilib repository (if it is not already enabled) in pacman.conf and install {{Pkg|lib32-glibc}}.<br />
# pacman -S lib32-glibc<br />
<br />
* Install {{Pkg|dmidecode}}.<br />
# pacman -S dmidecode<br />
<br />
* Enter the command shown on the [https://johnlewis.ie/custom-chromebook-firmware/rom-download/ Download ROM page at John Lewis site].<br />
<br />
{{Note|The reason for not posting here is to force you to visit the site and read the page before proceeding.}}<br />
<br />
* After the script exited copy the backed up firmware to an external storage before rebooting the system.<br />
<br />
You should now have a custom firmware installed on your device, cross you fingers and reboot.<br />
<br />
If the custom firmware boots Arch Linux correctly then you might want to enable back the hardware write protection, although [https://blogs.fsfe.org/the_unconventional/2014/09/19/c720-coreboot/ John Lewis states] that it's not necessary and will only make upgrading more difficult later. However, if you do not re-enable it you want to be careful not to use flashrom.<br />
<br />
=== Flashing with ezScript ===<br />
Currently ezScript supports only Intel based Chromeboxes.<br />
<br />
Before installing this custom firmware carefully read instructions at [http://forum.kodi.tv/showthread.php?tid=194362 ezScript official page]. To install firmware only use install option #5 ({{ic|Install/update: custom coreboot Firmware}}).<br />
<br />
=== Manually with flashrom ===<br />
<br />
The use of the upstream {{Pkg|flashrom}} package is discouraged as it's missing operations like {{ic|--wp-disable}}, {{ic|--wp-status}} and it will not write firmware successfully to the ROM of the Chromebook unless it already been programmed externally (i.e. flashing by another device over SPI with SOIC clip), this is why it's recommended to use Chromium OS's {{ic|flashrom}}. <br />
<br />
==== Get flashrom for Arch Linux ====<br />
<br />
* Download a 64-bit statically linked Chromium OS's {{ic|flashrom}} version.<br />
# wget --no-check-certificate https://johnlewis.ie/flashrom<br />
# chmod +x flashrom<br />
Do not forget that {{ic|flashrom}}'s location is not in {{ic|$PATH}}, to execute it you will need to precede the command with {{ic|./}}, e.g. {{ic|# ./flashrom}}.<br />
<br />
==== Get flashrom for Chrome OS ====<br />
<br />
Chrome OS already includes {{ic|flashrom}}.<br />
<br />
==== Basic use of flashrom ====<br />
<br />
* Disable software write protection before writing to the firmware chip.<br />
# flashrom --wp-disable<br />
<br />
* Backup firmware from the firmware chip.<br />
# flashrom -r old_firmware.bin<br />
<br />
* Write firmware to the firmware chip.<br />
# flashrom -w new_firmware.bin<br />
<br />
{{Tip|Find your firmware chip by running the command {{ic|<nowiki>flashrom -V|grep 'Found' |grep 'flash chip'</nowiki>}}}}<br />
<br />
== Flashing back stock firmware ==<br />
<br />
{{Note|The following assumes that your device is not bricked, if it does bricked then jump to [[#Unbricking your Chrome OS device|Unbricking your Chrome OS device]]}}<br />
<br />
[[#Disabling the Hardware Write Protection|Disable the hardware write protection]] and follow the how to [[#Manually_With_flashrom|manually flash firmware with {{ic|flashrom}}]] to flash the backup of your stock firmware.<br />
<br />
== Unbricking your Chrome OS device ==<br />
<br />
{{Note|This does not intended to be a thorough guide but just give you a basic understanding of the process of flashing a firmware to a bricked Chromebook. The ArchWiki is not the place for detailed hardware hacking guides so there is no sense in expanding this topic.}}<br />
<br />
=== Required tools ===<br />
<br />
* Programmer, both the [http://flashrom.org/RaspberryPi Raspberry Pi] and the [http://flashrom.org/Bus_Pirate Bus Pirate] are mentioned as compatible devices on the [http://flashrom.org/ flashrom wiki]. The [http://flashrom.org/Bus_Pirate Bus Pirate] is preferable as it will allow you to use Chromium OS's version of {{ic|flashrom}} that supports {{ic|--wp-disable}} and {{ic|--wp-status}} flags.<br />
* SOIC clip is recommended, see [http://flashrom.org/ISP].<br />
* Female jumper wires.<br />
* If you want to use Chromium OS's {{ic|flashrom}} another Linux machine (32bit or 64bit) is required.<br />
<br />
=== General idea on the unbricking process ===<br />
<br />
* Connect the jumper wires to the programmer and the SOIC clip.<br />
* Connect the SOIC clip to the ROM chip.<br />
* If your programmer is running Linux (Raspberry Pi) then modprobe the spi modules.<br />
* If your programmer is not running Linux then connect it to your Linux machine.<br />
* Write the firmware with {{ic|flashrom}}, you might need to disable software write protection by running {{ic|flashrom}} with the {{ic|--wp-disable}} flag (this is why Chromium OS's {{ic|flashrom}} is handy).<br />
<br />
=== Recommended reading about unbricking ===<br />
<br />
* Flashrom's wiki pages on [http://flashrom.org/ISP ISP], [http://flashrom.org/Bus_Pirate Bus Pirate], [http://flashrom.org/RaspberryPi Raspberry Pi] and [http://flashrom.org/Technology#SO8.2FSOIC8:_Small-Outline_Integrated_Circuit.2C_8_pins SOIC8].<br />
* [http://www.coreboot.org/Chromebooks Coreboot's wiki page on Chromebooks].<br />
* Examples of unbricking the C720: [http://www.tnhh.net/2014/08/25/unbricking-chromebook-with-beaglebone.html guide], [https://drive.google.com/folderview?id=0B9f62MH0umbmRTA2Xzd5WHhjWEU&usp=sharing pictures].<br />
* Example of unbricking HP Chromebox: [https://pomozok.wordpress.com/2015/01/10/chromebook-vivisection-readingwriting-rom-chip-data/ guide]<br />
<br />
== Firmware write protection ==<br />
<br />
{{Note|The information on this topic only intended to give you the basic understanding on the write protection feature in your Chromebook. The ArchWiki is not the place for detailed hardware hacking guides so there is no sense in expanding this topic.}}<br />
<br />
The firmware (Coreboot and its payloads) stored on a SPI chip (usually SOIC8) that some of its storage is protected from writing (mostly Coreboot).<br />
<br />
As long as the write protection was not disabled or the protected range was not set to (0,0) any change made to the unprotected part of the firmware (mainly SeaBIOS) should be recoverable with Chrome OS recovery media.<br />
<br />
There are two parts of the write protection: hardware and software.<br />
<br />
=== Hardware write protection ===<br />
<br />
The hardware write protection is an electrical circuit that when it's closed or open it prevent writing to the software protection special registers, thus the hardware write protection only protect directly these special registers but indirectly also the data in the firmware chip.<br />
<br />
To disable the hardware write protection you may need to remove a screw, press a switch or short a jumper.<br />
<br />
=== Software write protection ===<br />
<br />
The software write protection are special registers which determining if the data stored in the firmware chip is protected and also holds the range of addresses of the protected data.<br />
<br />
=== Understanding the Process of Disabling the Write Protection ===<br />
<br />
To disable the write protection one would need to:<br />
* Disable the hardware write protection of the special software register.<br />
* Change the value of the special software register to disable software write protection or change the range of the protected addresses so no data will be protected (start and end at 0).<br />
Conclusion: If we will disable the software write protection and will not enable it back, then even if we will enable the hardware write protection the firmware chip will stay unprotected.<br />
<br />
==== Disabling the hardware write protection ====<br />
<br />
To find the location of the hardware write-protect screw/switch/jumper and how to disable it visit the ArchWiki page for your Chromebook model (see [[Chromebook#Chromebook_Models|Chromebook Models]]). If there is no information about your device on the ArchWiki then turn to [http://www.chromium.org/chromium-os/developer-information-for-chrome-os-devicesDeveloper Information for Chrome OS Devices] and [http://www.coreboot.org/Chromebooks Coreboot's Chromebooks page].<br />
<br />
==== Disabling the software write protection ====<br />
<br />
Chromium OS's {{ic|flashrom}} can manipulate the software write protection special registers.<br />
* Read the status of the software write protection special registers.<br />
# flashrom --wp-status<br />
* Disable or enable the software write protection.<br />
# flashrom --wp-disable<br />
* Change software write protection addresses range.<br />
# flashrom --wp-range 0 0<br />
<br />
For more details on Chromium OS's {{ic|flashrom}} and how to obtain it, see [[#Manually_With_flashrom|Manually Flash Custom Firmware with {{ic|flashrom}}]].</div>Roshlesshttps://wiki.archlinux.org/index.php?title=Touchpad_Synaptics&diff=311580Touchpad Synaptics2014-04-23T17:19:28Z<p>Roshless: software toggle script wasnt working, added addictional information about ~/.xbindkeys</p>
<hr />
<div>[[de:Synaptics Touchpad Treiber]]<br />
[[es:Touchpad Synaptics]]<br />
[[fr:Touchpad Synaptics]]<br />
[[it:Touchpad Synaptics]]<br />
[[ja:Touchpad Synaptics]]<br />
[[ru:Touchpad Synaptics]]<br />
[[zh-CN:Touchpad Synaptics]]<br />
[[Category:Input devices]]<br />
{{Related articles start}}<br />
{{Related|Xorg}}<br />
{{Related|Touchpad Synaptics/10-synaptics.conf example}}<br />
{{Related articles end}}<br />
This article details the installation and configuration process of the '''''Synaptics input driver''''' for Synaptics (and ALPS) touchpads found on most notebooks.<br />
<br />
== Installation ==<br />
<br />
The Synaptics driver can be [[pacman|installed]] with the package {{Pkg|xf86-input-synaptics}}, available in the [[official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The primary method of configuration for the touchpad is through an [[Xorg]] server configuration file. After installation of {{ic|xf86-input-synaptics}}, a default configuration file is located at {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}.<br />
<br />
Users can edit this file to configure the various driver options available, for a complete list of all available options users should refer to the synaptics manual page:<br />
<br />
$ man synaptics<br />
<br />
=== Frequently used options ===<br />
<br />
The following lists options that many users may wish to configure. Note that all these options can simply be added to the main configuration file in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}, as shown in this example configuration file where we have enabled vertical, horizontal and circular scrolling:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/50-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
Identifier "touchpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "2"<br />
Option "TapButton3" "3"<br />
Option "VertEdgeScroll" "on"<br />
Option "VertTwoFingerScroll" "on"<br />
Option "HorizEdgeScroll" "on"<br />
Option "HorizTwoFingerScroll" "on"<br />
Option "CircularScrolling" "on"<br />
Option "CircScrollTrigger" "2"<br />
Option "EmulateTwoFingerMinZ" "40"<br />
Option "EmulateTwoFingerMinW" "8"<br />
Option "CoastingSpeed" "0"<br />
...<br />
EndSection<br />
</nowiki>}}<br />
<br />
; '''TapButton1''': (integer) configures which mouse-button is reported on a non-corner, one finger tap.<br />
; '''TapButton2''': (integer) configures which mouse-button is reported on a non-corner, two finger tap<br />
; '''TapButton3''': (integer) configures which mouse-button is reported on a non-corner, three finger tap<br />
; '''RBCornerButton''': (integer) configures which mouse-button is reported on a right bottom corner, one finger tap (use {{ic|Option "RBCornerButton" "3"}} to achieve Ubuntu style tap behaviour for right mouse button in lower right corner)<br />
; '''RTCornerButton''': (integer) as above, but for top right corner, one finger tap.<br />
; '''VertEdgeScroll''': (boolean) enables vertical scrolling while dragging across the right edge of the touch pad.<br />
; '''HorizEdgeScroll''': (boolean) enables horizontal scrolling while dragging across the bottom edge of the touch pad.<br />
; '''VertTwoFingerScroll''': (boolean) enables vertical scrolling using two fingers.<br />
; '''HorizTwoFingerScroll''': (boolean) enables horizontal scrolling using two fingers.<br />
; '''EmulateTwoFingerMinZ/W''': (integer) play with this value to set the precision of two finger scroll.<br />
<br />
[[Touchpad Synaptics/10-synaptics.conf example|An example]] with a brief description of all options. As usual settings will vary between machines. It is recommended that you discover your own options using [[Touchpad_Synaptics#Synclient|synclient]].<br />
<br />
{{Note|<br />
* If you find that your hand frequently brushes your touchpad, causing the TapButton2 option to be triggered (which will more than likely paste from your clipboard), and you do not mind losing two-finger-tap functionality, set {{ic|TapButton2}} to -1.<br />
* Recent versions include a "Coasting" feature, enabled by default, which may have the undesired effect of continuing almost any scrolling until the next tap or click, even if you are no longer touching the touchpad. This means that to scroll just a bit, you need to scroll (by using the edge, or a multitouch option) and then almost immediately tap the touchpad, otherwise scrolling will continue forever. If wish to avoid this, set {{ic|CoastingSpeed}} to 0.<br />
}}<br />
<br />
=== Other options ===<br />
<br />
; '''VertScrollDelta''' and '''HorizScrollDelta''': (integer) configures the speed of scrolling, it's a bit counter-intuitive because higher values produce greater precision and thus slower scrolling. Negative values cause natural scrolling like in OS X.<br />
<br />
=== GNOME/Cinnamon ===<br />
<br />
Users of [[GNOME]] may have to edit its configuration as well, because in default it is set to disable tapping to click, horizontal scrolling and not to allow touchpad disabling while typing.<br />
<br />
To change these settings in '''Gnome 2''':<br />
# Run {{ic|gconf-editor}}<br />
# Edit the keys in the {{ic|/desktop/gnome/peripherals/touchpad/}} folder.<br />
<br />
To change these settings in '''Gnome 3''':<br />
# Open ''System Settings''.<br />
# Click ''Mouse and Touchpad''.<br />
# Change the settings on the ''Touchpad'' tab.<br />
<br />
To change these settings in '''Cinnamon''':<br />
# Open ''Cinnamon System Settings''.<br />
# Click ''Mouse and Touchpad''.<br />
# Change the settings on the ''Touchpad'' tab.<br />
<br />
Gnome settings daemon may override existing settings (for example ones set in {{ic|xorg.conf.d}}) for which there is no equivalent in any of the graphical configuration utilities. It is possible to stop gnome from touching mouse settings at all:<br />
# Run {{ic|dconf-editor}}<br />
# Edit {{ic|/org/gnome/settings-daemon/plugins/mouse/}} (or {{ic|/org/cinnamon/settings-daemon/plugins/mouse/}} for cinnamon)<br />
# Uncheck the '''active''' setting<br />
It will now respect your system's existing synaptics configuration.<br />
<br />
'''Remember''': Since Gnome works on a user by user basis, when you run dconf-editor or gconf-editor, this should be done in your current user session. Repeat this procedure for each and every user you have for this computer.<br />
<br />
=== MATE ===<br />
<br />
As with [[GNOME]], it is possible configure the way MATE handles the touchpad:<br />
<br />
# Run {{ic|dconf-editor}}<br />
# Edit the keys in the {{ic|org.mate.peripherals-touchpad}} folder.<br />
<br />
To prevent Mate settings daemon from overriding existing settings, do as follows:<br />
# Run {{ic|dconf-editor}}<br />
# Edit {{ic|org.mate.SettingsDaemon.plugins.mouse}}<br />
# Uncheck the '''active''' setting.<br />
<br />
=== Configuration on the fly ===<br />
<br />
Next to the traditional method of configuration, the Synaptics driver also supports on the fly configuration. This means that users can set certain options through a software application, these options are applied immediately without needing a restart of Xorg. This is useful to test configuration options before you include them in the configuration file.<br />
<br />
{{Warning|On-the-fly configuration is non-permanent and will not remain active through a reboot, suspend/resume, or restart of Xorg. This should only be used to test, fine-tune or script configuration features.}}<br />
<br />
==== Console tools ====<br />
<br />
* {{App|[[Touchpad_Synaptics#Synclient|Synclient]] (Recommended)|command line utility to configure and query Synaptics driver settings on a live system, the tool is developed by the synaptics driver maintainers and is provided with the synaptics driver|http://xorg.freedesktop.org/|{{Pkg|xf86-input-synaptics}}}}<br />
* {{App|[[Touchpad_Synaptics#xinput|xinput]]|small general-purpose CLI tool to configure devices|http://xorg.freedesktop.org/|{{Pkg|xorg-xinput}}}}<br />
<br />
==== Graphical tools ====<br />
<br />
{{Warning|Some of the tools below still require the obsolete {{ic|SHMConfig}} mode, and will not work with current {{Pkg|xf86-input-synaptics}} driver. Please remove outdated tools from the list.}}<br />
<br />
* {{App|GPointing Device Settings|provides graphical on the fly configuration for several pointing devices connected to the system, including your synaptics touch pad. This application replaces GSynaptics as the preferred tool for graphical touchpad configuration through the synaptics driver|http://live.gnome.org/GPointingDeviceSettings|{{Pkg|gpointing-device-settings}}}}<br />
:{{Note|For GPointingDeviceSettings to work with Synaptics touchpads both {{Pkg|xf86-input-synaptics}} and {{Pkg|libsynaptics}} have to be installed.}}<br />
<br />
* {{App|Synaptiks (unmaintained)|touchpad configuration and management tool for [[KDE]]. It provides a System Settings module to configure basic and advanced features of the touchpad. Additionally it comes with a little system tray application, which can switch the touchpad automatically off, while an external mouse is plugged or while you are typing. This utility is currently unmaintained; moreover it seems to crash under KDE 4.11.|https://github.com/synaptiks/synaptiks|{{AUR|synaptiks}}}}<br />
<br />
* {{App|kcm_touchpad|touchpad configuration tool for [[KDE]]. It provides a System Settings module to configure basic and advanced features of the touchpad. Additionally it comes with a little system tray application (plasmoid), which can switch the touchpad manual or automatically off, while an external mouse is plugged or while you are typing. Received a major update in February 2014, works under KDE SC 4.12+|https://projects.kde.org/projects/playground/utils/kcm-touchpad/repository|{{AUR|kcm_touchpad}}}}<br />
<br />
== Advanced configuration ==<br />
<br />
=== Using xinput to determine touchpad capabilities ===<br />
<br />
Depending on your model, synaptic touchpads may have or lack capabilities. We can determine which capabilities your hardware supports by using {{ic|xinput}}.<br />
* left, middle and right hardware buttons<br />
* two finger detection<br />
* three finger detection<br />
* configurable resolution<br />
<br />
First, find the name of your touchpad:<br />
<br />
$ xinput -list<br />
<br />
You can now use {{ic|xinput}} to find your touchpad's capabilities:<br />
<br />
$ xinput list-props "SynPS/2 Synaptics TouchPad" | grep Capabilities<br />
<br />
Synaptics Capabilities (309): 1, 0, 1, 0, 0, 1, 1<br />
<br />
From left to right, this shows:<br />
* (1) device has a physical left button<br />
* (0) device does not have a physical middle button<br />
* (1) device has a physical right button<br />
* (0) device does not support two-finger detection<br />
* (0) device does not support three-finger detection<br />
* (1) device can configure vertical resolution<br />
* (1) device can configure horizontal resolution<br />
<br />
Use {{ic|xinput list-props "SynPS/2 Synaptics TouchPad"}} to list all device properties.<br />
<br />
=== Synclient ===<br />
<br />
Synclient can configure every option available to the user as documented in {{ic|$ man synaptics}}. A full list of the current user settings can be brought up:<br />
<br />
$ synclient -l<br />
<br />
Every listed configuration option can be controlled through synclient, for example:<br />
<br />
$ synclient PalmDetect=1 (to enable palm detection)<br />
$ synclient TapButton1=1 (configure button events)<br />
$ synclient TouchpadOff=1 (disable the touchpad)<br />
<br />
After you have successfully tried and tested your options through synclient, you can make these changes permanent by adding them to {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}.<br />
<br />
=== evtest ===<br />
<br />
The tool {{AUR|evtest}} can display pressure and placement on the touchpad in real-time, allowing further refinement of the default Synaptics settings. The evtest monitoring can be started with:<br />
<br />
$ evtest /dev/input/event''X''<br />
<br />
''X'' denotes the touchpad's ID. It can be found by looking at the output of {{ic|cat /proc/bus/input/devices}}.<br />
<br />
evtest needs exclusive access to the device which means it cannot be run together with an X server instance. You can either kill the X server or run evtest from a different virtual terminal (e.g., by pressing {{ic|Ctrl+Alt+2}}).<br />
<br />
=== Circular Scrolling ===<br />
<br />
Circular scrolling is a feature that Synaptics offers which closely resembles the behaviour of iPods. Instead of (or additional to) scrolling horizontally or vertically, you can scroll circularly. Some users find this faster and more precise.<br />
To enable circular scrolling, add the following options to the touchpad device section of {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
{{hc|/etc/X11/xorg.conf.d/50-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
...<br />
Option "CircularScrolling" "on"<br />
Option "CircScrollTrigger" "0"<br />
...<br />
EndSection<br />
</nowiki>}}<br />
<br />
The option '''CircScrollTrigger''' may be one of the following values, determining which edge circular scrolling should start:<br />
<br />
0 All Edges<br />
1 Top Edge<br />
2 Top Right Corner<br />
3 Right Edge<br />
4 Bottom Right Corner<br />
5 Bottom Edge<br />
6 Bottom Left Corner<br />
7 Left Edge<br />
8 Top Left Corner<br />
<br />
Specifying something different from zero may be useful if you want to use circular scrolling in conjunction with horizontal and/or vertical scrolling. If you do so, the type of scrolling is determined by the edge you start from.<br />
<br />
To scroll fast, draw small circles in the center of your touchpad. To scroll slowly and more precise, draw large circles.<br />
<br />
=== Natural scrolling ===<br />
<br />
It is possible to enable natural scrolling through synaptics. Simply use negative values for {{ic|VertScrollDelta}} and {{ic|HorizScrollDelta}} like so:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/50-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
...<br />
Option "VertScrollDelta" "-111"<br />
Option "HorizScrollDelta" "-111"<br />
...<br />
EndSection<br />
</nowiki>}}<br />
<br />
=== Software toggle ===<br />
<br />
You may find it useful to have a software toggle that will turn on or off your touchpad, especially if it is extremely sensitive and you are doing a lot of typing. Please also see [[#Disable touchpad upon external mouse detection]] as that may be better solution, a matter of choice. The advantage here is you have the control, while the other solution has a daemon determine when to turn off the trackpad.<br />
<br />
You will want to grab [[xbindkeys]] if you do not already have key binding software.<br />
<br />
Then save this script to something such as {{ic|/usr/bin/trackpad-toggle.sh}}:<br />
<br />
{{hc|/usr/bin/trackpad-toggle.sh|<nowiki><br />
#!/bin/bash<br />
<br />
synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')<br />
</nowiki>}}<br />
<br />
Then finally add a key binding to use the script. It is best to call with xbindkeys like so (file {{ic|~/.xbindkeysrc}}):<br />
<br />
{{hc|~/.xbindkeysrc|<nowiki><br />
"/usr/bin/trackpad-toggle.sh"<br />
m:0x5 + c:65<br />
Control+Shift + space<br />
</nowiki>}}<br />
<br />
Copy ''either one of the last two lines'', do not copy both. Now just (re)start {{ic|xbindkeys}} and {{ic|Ctrl+Shift+Space}} will now toggle your trackpad.<br />
<br />
Of course you could easily use any other keybinding software, such as the ones provided by Xfce4 and GNOME.<br />
<br />
=== Disable trackpad while typing ===<br />
<br />
==== Using automatic palm detection ====<br />
<br />
First of all you should test if it works properly for your trackpad and if the settings are accurate:<br />
<br />
$ synclient PalmDetect=1<br />
<br />
Then test the typing. You can tweak the detection with:<br />
<br />
$ synclient PalmMinWidth=<br />
<br />
which is the width of the area your hand touches, and<br />
<br />
$ synclient PalmMinZ=<br />
<br />
which is the minimum Z distance at which the detection is performed.<br />
<br />
Once you have found the correct settings, save them into {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}} like this:<br />
<br />
{{bc|<nowiki><br />
#synclient PalmDetect=1<br />
Option "PalmDetect" "1"<br />
#synclient PalmMinWidth=10<br />
Option "PalmMinWidth" "10"<br />
#synclient PalmMinZ=200<br />
Option "PalmMinZ" "200"<br />
</nowiki>}}<br />
<br />
==== Using .xinitrc ====<br />
<br />
To have the touchpad disabled automatically when you begin typing, add the following line to your {{ic|~/.xinitrc}} (before any line starting with {{ic|exec}}, otherwise the command will not be executed):<br />
<br />
$ syndaemon -t -k -i 2 &<br />
<br />
; '''-i 2''': sets the idle time to 2 seconds. The idle time specifies how many seconds to wait after the last key-press before enabling the touchpad again.<br />
; '''-t''': tells the daemon not to disable mouse movement when typing and only disable tapping and scrolling.<br />
; '''-k''': tells the daemon to ignore modifier keys when monitoring keyboard activity (e.g.: allows Ctrl+Left Click).<br />
<br />
More details are available in the man page:<br />
<br />
$ man syndaemon<br />
<br />
If you are using a login manager, you will need to specify the command where your DE allows you to do so.<br />
<br />
==== Using a login manager ====<br />
<br />
The {{ic|-d}} option is necessary to start syndaemon as a background process for post Login instructions.<br />
<br />
'''For GNOME: (GDM)'''<br />
<br />
To start syndaemon you need to use Gnome's Startup Applications Preferences program. Login to Gnome and go to '''System > Preferences > Startup Applications'''. In the Startup Programs tab click the '''Add''' button. Name the Startup Program whatever you like and input any comments you like (or leave this field blank). In the command field add:<br />
<br />
In Gnome 3 run gnome-session-properties to access startup applications.<br />
<br />
$ syndaemon -t -k -i 2 -d &<br />
<br />
When you are done, click the '''Add''' button in the '''Add Startup Program''' dialogue. Make sure the check box next to the startup program you have created is checked, in the list of additional startup programs. Close the '''Startup Applications Preferences''' window and you are done.<br />
<br />
'''For KDE: (KDM)'''<br />
<br />
Goto '''System Settings > Startup and Shutdown > Autostart''', then click '''Add Program''', enter:<br />
<br />
$ syndaemon -t -k -i 2 -d &<br />
<br />
Then check '''Run in terminal'''.<br />
<br />
=== Disable touchpad upon external mouse detection ===<br />
<br />
With the assistance of [[udev]], it is possible to automatically disable the touchpad if an external mouse has been plugged in. To achieve this, add the following udev rules:<br />
<br />
{{hc|/etc/udev/rules.d/01-touchpad.rules|2=<br />
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="add", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/''username''/.Xauthority", RUN+="/usr/bin/synclient TouchpadOff=1"<br />
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="remove", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/''username''/.Xauthority", RUN+="/usr/bin/synclient TouchpadOff=0"<br />
}}<br />
<br />
GDM stores Xauthority files in {{ic|/var/run/gdm}} in a randomly-named directory. For some reason also multiple authority files may appear for a user. So you need udev rules like these:<br />
<br />
{{hc|/etc/udev/rules.d/01-touchpad.rules|2=<br />
SUBSYSTEM=="input", KERNEL=="mouse[0-9]", ACTION=="add", PROGRAM="/usr/bin/find /var/run/gdm -name ''username'' -print -quit", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="$result/database", RUN+="/usr/bin/synclient TouchpadOff=1"<br />
SUBSYSTEM=="input", KERNEL=="mouse[0-9]", ACTION=="remove", PROGRAM="/usr/bin/find /var/run/gdm -name ''username'' -print -quit", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="$result/database", RUN+="/usr/bin/synclient TouchpadOff=0"<br />
}}<br />
<br />
However, these udev rules conflict with [[#Using .xinitrc|syndaemon]]. To disable touchpad and simultaneously kill ''syndaemon'', you can use a rule like this:<br />
<br />
{{hc|/etc/udev/rules.d/01-touchpad.rules|2=<br />
SUBSYSTEM=="input", KERNEL=="mouse[0-9]", ACTION=="add", PROGRAM="/usr/bin/find /var/run/gdm -name ''username'' -print -quit", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="$result/database", RUN+="/bin/sh -c '/usr/bin/synclient TouchpadOff=1 ; sleep 1; /bin/killall syndaemon; '"<br />
}}<br />
<br />
If ''syndaemon'' starts automatically with mouse removal, then you can combine this with the remove rule above. If you need to start ''syndaemon'' yourself, then alter the command accordingly with your favourite ''syndaemon'' options.<br />
<br />
==== System with multiple X sessions ====<br />
<br />
For an environment where multiple users are present, a slightly different approach is needed to detect the current users X environment. This script will help achieving this:<br />
<br />
{{hc|/usr/bin/mouse-pnp-event-handler.sh|<nowiki><br />
#!/bin/sh<br />
## $1 = "add" / "remove"<br />
## $2 = %k from udev <br />
<br />
## Set TRACKPAD_NAME according to your configuration. <br />
## Check your trackpad name with: <br />
## find /sys/class/input/ -name mouse* -exec udevadm info -a {} \; | grep 'ATTRS{name}'<br />
TRACKPAD_NAME="SynPS/2 Synaptics TouchPad"<br />
<br />
<br />
USERLIST=$(w -h | cut -d' ' -f1 | sort | uniq)<br />
MOUSELIST=$(find /sys/class/input/ -name mouse*)<br />
<br />
for CUR_USER in ${USERLIST}; do<br />
CUR_USER_XAUTH="$(sudo -Hiu ${CUR_USER} env | grep -e "^HOME=" | cut -d'=' -f2)/.Xauthority"<br />
<br />
<br />
## Can't find a way to get another users DISPLAY variable from an isolated root environment. Have to set it manually.<br />
#CUR_USER_DISPL="$(sudo -Hiu ${CUR_USER} env | grep -e "^DISPLAY=" | cut -d'=' -f2)"<br />
CUR_USER_DISPL=":0"<br />
<br />
export XAUTHORITY="${CUR_USER_XAUTH}"<br />
export DISPLAY="${CUR_USER_DISPL}"<br />
<br />
if [ -f "${CUR_USER_XAUTH}" ]; then<br />
case "$1" in<br />
"add")<br />
/usr/bin/synclient TouchpadOff=1<br />
/usr/bin/logger "USB mouse plugged. Disabling touchpad for $CUR_USER. ($XAUTHORITY - $DISPLAY)"<br />
;;<br />
"remove")<br />
## Only execute synclient if there are no external USB mice connected to the system.<br />
EXT_MOUSE_FOUND="0"<br />
for CUR_MOUSE in ${MOUSELIST}; do<br />
if [ "$(cat ${CUR_MOUSE}/device/name)" != "${TRACKPAD_NAME}" ]; then<br />
EXT_MOUSE_FOUND="1"<br />
fi<br />
done<br />
if [ "${EXT_MOUSE_FOUND}" == "0" ]; then<br />
/usr/bin/synclient TouchpadOff=0<br />
/usr/bin/logger "No additional external mice found. Enabling touchpad for $CUR_USER."<br />
else<br />
logger "Additional external mice found. Won't enable touchpad yet for $CUR_USER."<br />
fi<br />
;;<br />
esac<br />
fi<br />
done<br />
</nowiki>}}<br />
<br />
Update the {{ic|TRACKPAD_NAME}} variable for your system configuration.<br />
Run {{ic|<nowiki>find /sys/class/input/ -name mouse* -exec udevadm info -a {} \; | grep 'ATTRS{name}'</nowiki>}} to get a list of useful mice-names. Choose the one for your trackpad.<br />
<br />
Then have udev run this script when USB mices are plugged in or out, with these udev rules:<br />
<br />
{{hc|/etc/udev/rules.d/01-touchpad.rules|2=<br />
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="add", RUN+="/usr/bin/mouse-pnp-event-handler.sh add %k"<br />
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="remove", RUN+="/usr/bin/mouse-pnp-event-handler.sh remove %k"<br />
}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Touchpad does not work after resuming from hibernate/suspend ===<br />
Occasionally touchpads will fail to work when the computer resumes from sleep or hibernation. This can often be corrected without rebooting by<br />
* Switching to a console and back again,<br />
* entering sleep mode again, and resuming again, or<br />
* locating the correct kernel module, then removing it and inserting it again. <br />
{{Note|You can use Ctrl-Alt-F1 through F8 to switch to a console without using the mouse.}}<br />
modprobe -r psmouse #psmouse happens to be the kernel module for my touchpad (Alps DualPoint)<br />
modprobe psmouse<br />
Now switch back to the tty that X is running on. If you chose the right module, your touchpad should be working again.<br />
<br />
=== Emulate middle (3rd) mouse button ===<br />
Add this:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/10-evdev.conf|<nowiki><br />
Section "InputClass"<br />
Identifier "Emulate Middle Butten"<br />
MatchIsPointer "on"<br />
Option "Emulate3Buttons" "on"<br />
EndSection<br />
</nowiki>}}<br />
<br />
to your /etc/X11/xorg.conf.d/10-evdev.conf (or any Xorg conf you want) and you will have middle click emulation.<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?pid=847309#p847309 Thx to augegr]<br />
=== xorg.conf.d/50-synaptics.conf doesn't seem to apply under GNOME and MATE ===<br />
<br />
[[GNOME]] and [[MATE]], by default, will overwrite various options for your touch-pad. This includes configurable features for which there is no graphical configuration within GNOME's system control panel. This may cause it to appear that {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}} isn't applied. Please refer to the GNOME section in this article to prevent this behavior.<br />
<br />
* [[Touchpad_Synaptics#GNOME]]<br />
<br />
=== ALPS Touchpads ===<br />
<br />
{{Expansion}}<br />
{{Out of date|needs to be rewritten for udev}}<br />
<br />
For ALPS Touchpads, if the above configuration does not provide the desired results, try the following configuration instead:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/50-synaptics.conf|<br />
Section "ServerLayout"<br />
...<br />
InputDevice "USB Mouse" "CorePointer"<br />
InputDevice "Touchpad" "SendCoreEvents"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Touchpad"<br />
Driver "synaptics"<br />
Option "Device" "/dev/input/mouse0"<br />
Option "Protocol" "auto-dev"<br />
Option "LeftEdge" "130"<br />
Option "RightEdge" "840"<br />
Option "TopEdge" "130"<br />
Option "BottomEdge" "640"<br />
Option "FingerLow" "7"<br />
Option "FingerHigh" "8"<br />
Option "MaxTapTime" "180"<br />
Option "MaxTapMove" "110"<br />
Option "EmulateMidButtonTime" "75"<br />
Option "VertScrollDelta" "20"<br />
Option "HorizScrollDelta" "20"<br />
Option "MinSpeed" "0.25"<br />
Option "MaxSpeed" "0.50"<br />
Option "AccelFactor" "0.010"<br />
Option "EdgeMotionMinSpeed" "200"<br />
Option "EdgeMotionMaxSpeed" "200"<br />
Option "UpDownScrolling" "1"<br />
Option "CircularScrolling" "1"<br />
Option "CircScrollDelta" "0.1"<br />
Option "CircScrollTrigger" "2"<br />
Option "Emulate3Buttons" "on"<br />
EndSection<br />
}}<br />
<br />
=== The touchpad is not working, Xorg.0.log shows "Query no Synaptics: 6003C8" ===<br />
<br />
Due to the way synaptics is currently set-up, 2 instances of the synaptics module are loaded. We can recognize this situation by opening the xorg log file ({{ic|/var/log/Xorg.0.log}}) and noticing this:<br />
<br />
{{hc|/var/log/Xorg.0.log|<nowiki><br />
[ 9304.803] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "evdev touchpad catchall"<br />
[ 9304.803] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "touchpad catchall"<br />
</nowiki>}}<br />
<br />
Notice how 2 differently named instances of the module are being loaded. In some cases, this causes the touchpad to become nonfunctional.<br />
<br />
We can prevent this double loading by adding {{ic|MatchDevicePath "/dev/input/event*"}} to our {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}} file:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/50-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "2"<br />
Option "TapButton3" "3"<br />
EndSection <br />
</nowiki>}}<br />
<br />
Restart X and check xorg logs again, the error should be gone and the touchpad should be functional.<br />
<br />
related bugreport: {{Bug|20830}}<br />
<br />
related forum topics:<br />
* https://bbs.archlinux.org/viewtopic.php?id=104769<br />
* https://bbs.archlinux.org/viewtopic.php?pid=825690<br />
<br />
=== Touchpad detected as "PS/2 Generic Mouse" or "Logitech PS/2 mouse" ===<br />
<br />
This is caused by a [https://bugzilla.kernel.org/show_bug.cgi?id=27442 kernel bug] which was fixed in kernel version 3.3. Wrongly detected touchpads cannot be configured with the Synaptic input driver. To fix this, simply install the [[AUR]] package {{AUR|psmouse-alps-driver}}.<br />
<br />
Among the affected notebooks are the following models:<br />
<br />
* Acer Aspire 7750G<br />
* Dell Latitude E6230, E6520, E6430 and E6530 (ALPS DualPoint TouchPad), Inspiron N5110 (ALPS GlidePoint), Inspiron 14R 5420/Turbo SE7420/SE7520 (ALPS GlidePoint)<br />
* Samsung NC110/NF210/QX310/QX410/QX510/SF310/SF410/SF510/RF410/RF510/RF710/RV515<br />
<br />
You can check whether your touchpad is correctly detected by running:<br />
<br />
$ xinput list<br />
<br />
More information can be found in [https://bbs.archlinux.org/viewtopic.php?id=117109 this thread].<br />
<br />
=== Non-functional Synaptics special abilities (multi-tap, scrolling, etc.) ===<br />
<br />
In some cases Synaptics touchpads only work partially. Features like two-finger scrolling or two-finger middle-click do not work even if properly enabled. This is probably related to the [[#The_touchpad_is_not_working.2C_Xorg.0.log_shows_.22Query_no_Synaptics:_6003C8.22|The touchpad is not working]] problem mentioned above. Fix is the same, prevent double module loading.<br />
<br />
If preventing the module from loading twice does not solve your issue, try commenting out the toggle "MatchIsTouchpad" (which is now included by default in the synaptics config).<br />
<br />
If clicking with either 2 or 3 fingers is interpreted as a right-click, so you cannot get a middle click either way regardless of configuration, this bug is probably the culprit: https://bugs.freedesktop.org/show_bug.cgi?id=55365<br />
<br />
=== Cursor jump ===<br />
<br />
Some users have their cursor inexplicably ''jump'' around the screen. There currently no patch for this, but the developers are aware of the problem and are working on it.<br />
<br />
Another posibility is that you're experiencing ''IRQ losses'' related to the i8042 controller (this device handles the keyboard and the touchpad of many laptops), so you have two posibilities here:<br />
<br />
1. rmmod && insmod the psmouse module.<br />
2. append i8042.nomux=1 to the boot line and reboot your machine.<br />
<br />
=== Touchpad device is not located at {{ic|/dev/input/*}} ===<br />
<br />
If that is the case, you can use this command to display information about your input devices:<br />
<br />
$ cat /proc/bus/input/devices<br />
<br />
Search for an input device which has the name "SynPS/2 Synaptics TouchPad". The "Handlers" section of the output specifies what device you need to specify.<br />
<br />
'''Example output:'''<br />
<br />
{{hc|$ cat /proc/bus/input/devices|<nowiki><br />
I: Bus=0011 Vendor=0002 Product=0007 Version=0000<br />
N: Name="SynPS/2 Synaptics TouchPad"<br />
P: Phys=isa0060/serio4/input0<br />
S: Sysfs=/class/input/input1<br />
H: Handlers=mouse0 event1<br />
B: EV=b<br />
B: KEY=6420 0 7000f 0<br />
</nowiki>}}<br />
<br />
In this case, the {{ic|Handlers}} are {{ic|mouse0}} and {{ic|event1}}, so {{ic|/dev/input/mouse0}} would be used.<br />
<br />
{{Expansion|TODO: explain how to apply this in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}}}<br />
<br />
=== Firefox and special touchpad events ===<br />
<br />
You can enable/disable some special events that Firefox handles upon tapping or scrolling certain parts of your touchpad by editing the settings of those actions.<br />
Type '''about:config''' in your Firefox address bar.<br />
To alter options, double-click on the line in question.<br />
<br />
==== Firefox 16.0 and earlier ====<br />
<br />
To prevent Firefox from scrolling (backward/forward) through browser history and instead scroll through pages, edit these settings as shown:<br />
<br />
mousewheel.horizscroll.withnokey.action = 1<br />
mousewheel.horizscroll.withnokey.sysnumlines = true<br />
<br />
To prevent Firefox from redirecting you to URLs formed from your clipboard content upon tapping the upper-right corner of your touchpad (or middle mouse button), set the following option to "false":<br />
middlemouse.contentLoadURL = false<br />
<br />
==== Firefox 17.0 and later ====<br />
<br />
Horizontal scrolling will now by default scroll through pages and not through your history. To reenable Mac-style forward/backward with two-finger swiping, edit:<br />
<br />
mousewheel.default.action.override_x = 2<br />
<br />
You may encounter accidental forwards/backwards while scrolling vertically. To change Firefox's sensitivity to horizontal swipes, edit:<br />
<br />
mousewheel.default.delta_multiplier_x<br />
<br />
The optimum value will depend on your touchpad and how you use it, try starting with <code>10</code>. A negative value will reverse the swipe directions.<br />
<br />
=== Opera: horizontal scrolling issues ===<br />
<br />
Same as above.<br />
To fix it, go to ''Tools > Preferences > Advanced > Shortcuts''. Select "Opera Standard" mouse setup and click "Edit". In "Application" section:<br />
{{Accuracy|Description here is not so clear and i don't use Opera,Please make it clear :)}}<br />
* assign key "Button 6" to command "Scroll left"<br />
* assign key "Button 7" to command "Scroll right"<br />
<br />
=== Scrolling and multiple actions with Synaptics on LG laptops ===<br />
<br />
These problems seem to be occurring on several models of LG laptops.<br />
Symptoms include: when pressing Mouse Button 1, Synaptics interprets it as ScrollUP and a regular button 1 click; same goes for button 2.<br />
<br />
The scrolling issue can be resolved by entering in {{ic|xorg.conf}}:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|Option "UpDownScrolling" "0"}}<br />
<br />
{{Note|This will make Synaptics interpret one button push as three. There is a patch written by Oskar Sandberg[http://www.math.chalmers.se/~ossa/linux/lg_tx_express.html] that removes these clicks.}}<br />
<br />
Apparently, when trying to compile this against the latest version of Synaptics it fails. The solution to this is using the GIT repository for Synaptics[http://web.telia.com/~u89404340/touchpad/synaptics/.git].<br />
<br />
There is also a package build file in the AUR to automate this: {{AUR|xf86-input-synaptics-lg}}.<br />
<br />
To build the package after downloading the tarball and unpacking it, execute:<br />
<br />
$ cd synaptics-git<br />
$ makepkg<br />
<br />
=== Other external mouse issues ===<br />
<br />
First, make sure your section describing the external mouse contains this line (or that the line looks like this):<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|Option "Device" "/dev/input/mice"}}<br />
<br />
If the "Device" line is different, change it to the above and try to restart X. If this does not solve your problem, make your '''touchpad''' is the CorePointer in the "Server Layout" section:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|InputDevice "Touchpad" "CorePointer"}}<br />
<br />
and make your external device "SendCoreEvents":<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|InputDevice "USB Mouse" "SendCoreEvents"}}<br />
<br />
finally add this to your external device's section:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|Option "SendCoreEvents" "true"}}<br />
<br />
If all of the above does not work for you, please check relevant bug trackers for possible bugs, or go through the forums to see if anyone has found a better solution.<br />
<br />
=== Touchpad synchronization issues ===<br />
<br />
Sometimes the cursor may freeze for several seconds or start acting on its own for no apparent reason. This behavior is accompanied by records in {{ic|/var/log/messages.log}}<br />
<br />
{{hc|/var/log/messages.log|psmouse.c: TouchPad at isa0060/serio1/input0 lost synchronization, throwing 3 bytes away}}<br />
<br />
This problem has no general solution, but there are several possible workarounds.<br />
* If you use CPU frequency scaling, avoid using the "ondemand" governor and use the "performance" governor when possible, as the touchpad may lose sync when the CPU frequency changes.<br />
* Avoid using an ACPI battery monitor.<br />
* Attempt to load psmouse with "proto=imps" option. To do that, add this line to your {{ic|/etc/modprobe.d/modprobe.conf}}:<br />
<br />
{{hc|/etc/modprobe.d/modprobe.conf|2=options psmouse proto=imps}}<br />
<br />
* Try another desktop environment. Some users report that this problem only occurs when using XFCE or GNOME, for whatever reason<br />
<br />
=== Delay between a button tap and the actual click ===<br />
<br />
{{Out of date|On Synaptics Driver 1.7.1, the {{ic|FastTaps}} option has been removed.}}<br />
<br />
If you experience a delay between the tap on the touchpad and the actual click that is registered you need to enable FastTaps:<br />
<br />
To do so, you should add '''Option "FastTaps" "1"''' to {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}} so that you have:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/50-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
Identifier "Synaptics Touchpad"<br />
Driver "synaptics"<br />
...<br />
Option "FastTaps" "1"<br />
...<br />
EndSection<br />
</nowiki>}}<br />
<br />
===Xorg.log.0 shows SynPS/2 Synaptics touchpad can not grab event device, errno=16 ===<br />
<br />
If you are using Xorg 7.4, you may get a warning like this from {{ic|/var/log/Xorg.0.log}}, thais is because the driver will grab the event device for exclusive use when using the Linux 2.6 event protocol. When it fails, X will return this error message.<br />
<br />
Grabbing the event device means that no other user space or kernel space program sees the touchpad events. This is desirable if the X config file includes {{ic|/dev/input/mice}} as an input device, but is undesirable if you want to monitor the device from user space.<br />
<br />
If you want to control it, add or modify the "GrabEventDevice" option in you touchpad section in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/50-synaptics.conf|2=<br />
...<br />
Option "GrabEventDevice" "''boolean''"<br />
...<br />
}}<br />
<br />
This will come into effect when X is restarted, though you can also change it by using synclient. When changing this parameter with the synclient program, the change will not take effect until the Synaptics driver is disabled and re-enabled. This can be achieved by switching to a text console and then switching back to X.<br />
<br />
=== Synaptics loses multitouch detection after rebooting from Windows ===<br />
<br />
Many drivers include a firmware that is loaded into flash memory when the computer boots. This firmware is not necessarily cleared upon shutdown, and is not always compatible with Linux drivers. The only way to clear the flash memory is to shutdown completely rather than using reboot. It is generally considered best practice to never use reboot when switching between operating systems.<br />
<br />
=== Buttonless touchpads (aka ClickPads) ===<br />
<br />
Some laptops have a special kind of touchpad which has the mouse buttons as part of the tracking plate, instead of being external buttons. For example HP series 4500 ProBooks, ThinkPad X220 and X1 ThinkPad series have this kind of a touchpad. By default whole button area is detected as a left button resulting in the second mouse button being unusable and click + drag will not work. Previously support for such devices was achieved by using third party patches, but from version 1.6.0 the synaptics driver has native multitouch support (using the ''mtdev'' library). Note that although the driver registers multiple touches, it does not track individual fingers (as of version 1.7.1) which results in confusing behavior when using physical buttons of a clickpad for drag-and-drop and other gestures. You can look into the {{AUR|xf86-input-mtrack}} driver for better multitouch support.<br />
<br />
To enable other buttons modify the touchpad section in {{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}} (or better, of your custom synaptics configuration file prefixed with a higher number):<br />
<br />
{{hc|/etc/X11/xorg.conf.d/50-synaptics.conf|<nowiki><br />
...<br />
Option "ClickPad" "true"<br />
Option "EmulateMidButtonTime" "0"<br />
Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"<br />
...<br />
</nowiki>}}<br />
<br />
These three options are the key, first one will enable multitouch support, second will disable middle button emulation (not supported for ClickPads), and third will define the button areas. <br />
<br />
Format for the SoftButtonAreas option is (from {{ic|man 4 synaptics}}):<br />
{{bc|RightButtonAreaLeft RightButtonAreaRight RightButtonAreaTop RightButtonAreaBottom MiddleButtonAreaLeft MiddleButtonAreaRight MiddleButtonAreaTop MiddleButtonAreaBottom}}<br />
<br />
The above example is commonly found in documentation or synaptics packages, and it translates to right half of the bottom 18% of the touchpad to be a right button. There is '''no middle button''' defined. If you want to define a middle button remember one key piece of information from the manual; '''edge set to 0 extends to infinity in that direction.'''<br />
<br />
In the following example right button will occupy 40% of the rightmost part of the button area. We then proceed to setup the middle button to occupy 20% of the touchpad in a small area in the center.<br />
<br />
...<br />
Option "SoftButtonAreas" "60% 0 82% 0 40% 59% 82% 0"<br />
...<br />
<br />
You can use {{ic|<nowiki>synclient</nowiki>}} to check the new soft button areas: <br />
<br />
{{hc|<nowiki>$ synclient -l | grep -i ButtonArea</nowiki>|<nowiki><br />
RightButtonAreaLeft = 3914<br />
RightButtonAreaRight = 0<br />
RightButtonAreaTop = 3918<br />
RightButtonAreaBottom = 0<br />
MiddleButtonAreaLeft = 3100<br />
MiddleButtonAreaRight = 3873<br />
MiddleButtonAreaTop = 3918<br />
MiddleButtonAreaBottom = 0<br />
</nowiki>}}<br />
<br />
If your buttons aren't working, soft button areas are not changing, ensure you do not have a synaptics configuration file distributed by a package which is overriding your custom settings (ie. some AUR packages distribute configurations prefixed with very high numbers).<br />
<br />
These settings cannot be modified on the fly with {{ic|<nowiki>synclient</nowiki>}}, however, {{ic|<nowiki>xinput</nowiki>}} works:<br />
<br />
xinput set-prop "SynPS/2 Synaptics TouchPad" "Synaptics Soft Button Areas" 4000 0 4063 0 3000 4000 4063 0<br />
<br />
You cannot use percentages with this command, so look at {{ic|/var/log/Xorg.0.log}} to figure out the touchpad x and y-axis ranges.<br />
<br />
=== Touchpad detected as mouse ===<br />
<br />
''Elantech touchpads:''<br />
<br />
This can happen with some laptops with an Elantech touchpad, for example the ASUS x53s. In this situation you need {{AUR|psmouse-elantech}} package from [[AUR]].<br />
<br />
''ALPS touchpads:''<br />
<br />
It can also happen with some newer ALPS touchpads. Run the following to see if you have a newer<br />
ALPS touchpad:<br />
<br />
$ dmesg | grep "Unknown ALPS" <br />
[ 569.861053] psmouse serio1: alps: Unknown ALPS touchpad: E7=73 03 0a, EC=88 b6 06<br />
<br />
If you get the Unknown ALPS touchpad line, then you need to install a patched psmouse module which you can find at https://github.com/he1per/psmouse-dkms-alpsv7 <br />
{{Note|the patch comes from developers at the linux-input@vger.kernel.org mailing list, it was packaged and posted to github.}}<br />
<br />
== See also ==<br />
<br />
* [http://cgit.freedesktop.org/xorg/driver/xf86-input-synaptics/ Synaptics touchpad driver]</div>Roshlesshttps://wiki.archlinux.org/index.php?title=Virtual_user_mail_system_with_Postfix,_Dovecot_and_Roundcube&diff=304155Virtual user mail system with Postfix, Dovecot and Roundcube2014-03-12T13:54:06Z<p>Roshless: dead link, replacing with gentoo archive</p>
<hr />
<div>[[Category:Mail Server]]<br />
{{merge|Postfix|both articles cover the exact same setup}}<br />
This article describes how to set up a complete virtual user mail system on an Arch Linux system in the simplest manner possible. However, since a mail system consists of many complex components, quite a bit of configuration will still be necessary. Roughly, the components used in this article are Postfix, Dovecot, PostfixAdmin and Roundcube.<br />
<br />
In the end, the provided solution will allow you to use the best currently available security mechanisms, you will be able to send mails using SMTP and SMTPS and receive mails using POP3, POP3S, IMAP and IMAPS. Additionally, configuration will be easy thanks to PostfixAdmin and users will be able to login using Roundcube. What a deal!<br />
<br />
This article assumes that you have a working [[LAMP]] setup as we will need a working Apache2 as well as MYSQL database. Of course, with a few changes to these instructions you could easily use another httpd and database. For the purposes of this tutorial, however, the choice made above will be used. Additionally, the article assumes all-default settings for every package installed below. No changes except for those mentioned will be required.<br />
<br />
Should any unforeseen problems occur, feel free to use the discussion page to voice your problems and I will try to answer.<br />
<br />
== Installation ==<br />
# pacman -S dovecot postfix<br />
<br />
== Configuration ==<br />
=== User ===<br />
For security reasons, a new user should be created to store the mails:<br />
groupadd -g 5000 vmail<br />
useradd -u 5000 -g vmail -s /sbin/nologin -d /home/vmail -m vmail<br />
A gid and uid of 5000 is used in both cases so that we do not run into conflicts with regular users. All your mail will then be stored in '''/home/vmail'''. You could change the home dir to something like '''/var/mail/vmail''' but careful to change this in any configuration below as well.<br />
<br />
=== Database ===<br />
You will need to create an empty database and corresponding user. We will be using PostfixAdmin's tables to fill the database later on. In this article, ''postfix_user'' will have read/write access to ''postfix_db'' using ''hunter2'' for a password. You are expected to create your database and user yourself as shown in the following code. Make sure to assign proper permissions.<br />
<br />
{{hc|$> mysql -u root -p|password:}}<br />
{{bc|<br />
CREATE SCHEMA `postfix_db` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;<br />
CREATE USER 'postfix_user'@'localhost' IDENTIFIED BY 'hunter2';<br />
GRANT ALL ON `postfix_db`.* TO `postfix_user`@`localhost`;<br />
}}<br />
<br />
=== Postfix ===<br />
There are basically 2 ways of doing SMTPS. <br />
<br />
One is using the wrapper mode which enables even old/odd clients like Outlook to use TLS. The wrapper mode uses the system service "smtps" which is a non-standard service and runs on port 465. <br />
<br />
The other, more proper method is to use a port that simply enforces TLS without any wrapping. The system service for this is "submission" which is standard and uses port 587.<br />
<br />
For the improper variant uncomment this in {{ic|/etc/postfix/master.cf}}:<br />
smtps inet n - n - - smtpd<br />
-o smtpd_tls_wrappermode=yes<br />
-o smtpd_sasl_auth_enable=yes<br />
<br />
And verify that these lines are in {{ic|/etc/services}}:<br />
smtps 465/tcp # Secure SMTP<br />
smtps 465/udp # Secure SMTP<br />
<br />
otherwise posfix won't start :<br />
<br />
''postfix/master[5309]: fatal: 0.0.0.0:smtps: Servname not supported for ai_socktype''<br />
<br />
For the proper variant uncomment this in {{ic|/etc/postfix/master.cf}}:<br />
smtp inet n - n - - smtpd<br />
submission inet n - n - - smtpd<br />
-o smtpd_tls_security_level=encrypt<br />
-o smtpd_sasl_auth_enable=yes<br />
<br />
To {{ic|/etc/postfix/main.cf}} append:<br />
relay_domains = *<br />
virtual_alias_maps = proxy:mysql:/etc/postfix/virtual_alias_maps.cf<br />
virtual_mailbox_domains = proxy:mysql:/etc/postfix/virtual_domains_maps.cf<br />
virtual_mailbox_maps = proxy:mysql:/etc/postfix/virtual_mailbox_maps.cf<br />
virtual_mailbox_base = /home/vmail<br />
virtual_mailbox_limit = 512000000<br />
virtual_minimum_uid = 5000<br />
virtual_transport = virtual<br />
virtual_uid_maps = static:5000<br />
virtual_gid_maps = static:5000<br />
local_transport = virtual<br />
local_recipient_maps = $virtual_mailbox_maps<br />
transport_maps = hash:/etc/postfix/transport<br />
<br />
smtpd_sasl_auth_enable = yes<br />
smtpd_sasl_type = dovecot<br />
smtpd_sasl_path = /var/run/dovecot/auth-client<br />
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination<br />
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination<br />
smtpd_sasl_security_options = noanonymous<br />
smtpd_sasl_tls_security_options = $smtpd_sasl_security_options<br />
smtpd_tls_auth_only = yes<br />
smtpd_tls_cert_file = /etc/ssl/private/server.crt<br />
smtpd_tls_key_file = /etc/ssl/private/server.key<br />
smtpd_sasl_local_domain = $mydomain<br />
broken_sasl_auth_clients = yes<br />
smtpd_tls_loglevel = 1<br />
<br />
{{Warning|{{ic|<nowiki>relay_domains = *</nowiki>}} might be a bad idea (see http://www.postfix.org/BASIC_CONFIGURATION_README.html#relay_to). You usually do not want postfix to forward mail from strangers.}} <br />
<br />
This references a lot of files that do not even exist yet. Let's create them.<br />
<br />
Edit {{ic|/etc/postfix/virtual_alias_maps.cf}} as new and add:<br />
user = postfix_user<br />
password = hunter2<br />
hosts = localhost<br />
dbname = postfix_db<br />
query = SELECT goto FROM alias WHERE address='%s' AND active = true<br />
<br />
Edit {{ic|/etc/postfix/virtual_domains_maps.cf}} as new and add:<br />
user = postfix_user<br />
password = hunter2<br />
hosts = localhost<br />
dbname = postfix_db<br />
query = SELECT domain FROM domain WHERE domain='%s' AND backupmx = false AND active = true<br />
<br />
Edit {{ic|/etc/postfix/virtual_mailbox_limits.cf}} as new and add:<br />
user = postfix_user<br />
password = hunter2<br />
hosts = localhost<br />
dbname = postfix_db<br />
query = SELECT quota FROM mailbox WHERE username='%s'<br />
<br />
Edit {{ic|/etc/postfix/virtual_mailbox_maps.cf}} as new and add:<br />
user = postfix_user<br />
password = hunter2<br />
hosts = localhost<br />
dbname = postfix_db<br />
query = SELECT maildir FROM mailbox WHERE username='%s' AND active = true<br />
<br />
Run ''postmap'' on ''transport'' to generate its db:<br />
postmap /etc/postfix/transport<br />
<br />
We still need the SSL cert and private key:<br />
cd /etc/ssl/certs<br />
openssl req -new -x509 -newkey rsa:1024 -days 365 -keyout server.key -out server.crt<br />
openssl rsa -in server.key -out server.key<br />
chown nobody:nobody server.key server.crt<br />
chmod 400 server.key<br />
chmod 444 server.crt<br />
mv server.key /etc/ssl/private/<br />
mv server.crt /etc/ssl/private/<br />
<br />
=== Dovecot ===<br />
Start by getting a fresh config file from the pre-existing sample config:<br />
cp /etc/dovecot/dovecot.conf.sample /etc/dovecot/dovecot.conf<br />
<br />
In {{ic|/etc/dovecot/dovecot.conf}} we'll need to do quite some configuration:<br />
protocols = imap pop3<br />
auth_mechanisms = plain<br />
passdb {<br />
driver = sql<br />
args = /etc/dovecot/dovecot-sql.conf<br />
}<br />
userdb {<br />
driver = sql<br />
args = /etc/dovecot/dovecot-sql.conf<br />
}<br />
<br />
service auth {<br />
unix_listener auth-client {<br />
group = postfix<br />
mode = 0660<br />
user = postfix<br />
}<br />
user = root<br />
}<br />
<br />
mail_home = /home/vmail/%d/%u<br />
mail_location = maildir:~<br />
<br />
ssl_cert = </etc/ssl/private/server.crt<br />
ssl_key = </etc/ssl/private/server.key<br />
<br />
Note: you may want to replace the whole content of the file with this one since the default configuration file imports the content of conf.d/*.conf. Those files call other files that aren't present in our configuration. You can alternatively remove conf.d/.<br />
<br />
See http://wiki2.dovecot.org/Variables for the docevot variables %d and %u.<br />
<br />
Now obviously we also need the {{ic|/etc/dovecot/dovecot-sql.conf}} we just referenced in the config above. Go ahead and create a {{ic|/etc/dovecot/dovecot-sql.conf}} with these contents:<br />
driver = mysql<br />
connect = host=localhost dbname=postfix_db user=postfix_user password=hunter2<br />
# The new name for MD5 is MD5-CRYPT so you might need to change this depending on version<br />
default_pass_scheme = MD5-CRYPT<br />
# Get the mailbox<br />
user_query = SELECT '/home/vmail/%d/%u' as home, 'maildir:/home/vmail/%d/%u' as mail, 5000 AS uid, 5000 AS gid, concat('dirsize:storage=', quota) AS quota FROM mailbox WHERE username = '%u' AND active = '1'<br />
# Get the password<br />
password_query = SELECT username as user, password, '/home/vmail/%d/%u' as userdb_home, 'maildir:/home/vmail/%d/%u' as userdb_mail, 5000 as userdb_uid, 5000 as userdb_gid FROM mailbox WHERE username = '%u' AND active = '1'<br />
# If using client certificates for authentication, comment the above and uncomment the following<br />
#password_query = SELECT null AS password, ‘%u’ AS user<br />
<br />
=== PostfixAdmin ===<br />
To install PostfixAdmin, we can use the {{Pkg|postfixadmin}} package from the [[official repositories]].<br />
<br />
Next, PostfixAdmin needs to be configured. First edit the /etc/webapps/postfixadmin/config.inc.php file:<br />
$CONF['configured'] = true;<br />
// correspond to dovecot maildir path /home/vmail/%d/%u <br />
$CONF['domain_path'] = 'YES';<br />
$CONF['domain_in_mailbox'] = 'YES';<br />
$CONF['database_type'] = 'mysql';<br />
$CONF['database_host'] = 'localhost';<br />
$CONF['database_user'] = 'postfix_user';<br />
$CONF['database_password'] = 'hunter2';<br />
$CONF['database_name'] = 'postfix_db';<br />
<br />
Then assuming localhost is the hostname of the machine you are installing this on, navigate to ''http://localhost/postfixAdmin/setup.php''. The setup will guide you through the remaining steps to set up PostfixAdmin.<br />
<br />
{{Note|For a detailed section on setting up domains and mailboxes in PostfixAdmin see the related [[http://www.gentoo-wiki.info/Mail_server_using_Postfix_and_Dovecot#Setting_up_Mailboxes Gentoo wiki article]] }}<br />
<br />
=== Roundcube ===<br />
Roundcube is available in the community repo.<br />
pacman -S roundcubemail<br />
<br />
The post install process is similar to any other webapps like [[PhpMyAdmin]] or PostFixAdmin. Copy the example configuration file to your webserver configuration directory. If you are using Apache do:<br />
cp /etc/webapps/roundcubemail/apache.conf /etc/httpd/conf/extra/httpd-roundcubemail.conf<br />
Add the include line in /etc/httpd/conf/httpd.conf<br />
Include conf/extra/httpd-roundcubemail.conf<br />
Make some directories writable by the webserver in /usr/share/webapps/roundcubemail/:<br />
chown -R http:http temp logs<br />
Roundcube now requires the pdo_mysql.so extension, make sure this extension is un-commented in your php.ini file. Also check .htaccess for access restrictions. Assuming that localhost is your current host, navigate a browser to ''http://localhost/roundcubemail/installer/'' and follow the instructions. You could use the same database for Roundcube that you already used for PostfixAdmin though you shouldn't. For a proper setup, create a second database "roundcube_db" and a "roundcube_user" for use with Roundcube. Update this info in db.inc.php.<br />
<br />
While running the installer, make sure to address the IMAP host with '''ssl://localhost/''' or '''tls://localhost/''' instead of just '''localhost'''. Use port 993. Likewise with SMTP, make sure to provide '''ssl://localhost/''' on port 465 if you used the wrapper mode and '''tls://localhost/''' on port 587 if you used the proper TLS mode. See [[#Postfix|here]] for an explanation on that.<br />
<br />
=== systemd ===<br />
Make sure your daemons start on boot:<br />
systemctl enable dovecot postfix<br />
<br />
== Fire it up ==<br />
Since now hopefully everything is set up correctly, all necessary daemons should be started for a test run:<br />
systemctl start postfix dovecot<br />
<br />
Now for testing purposes, create a domain and mail account in PostfixAdmin. Try to login to this account using Roundcube. Now send yourself a mail.<br />
<br />
== Optional Items ==<br />
Although these items are not required, they definitely add more completeness to your setup<br />
<br />
=== SpamAssassin ===<br />
Is available in the extra repo. Following steps borrowed from [[SOHO_Postfix#Spamassassin]]<br />
pacman -S spamassassin<br />
Go over /etc/mail/spamassassin/local.cf and configure it to your needs. Create Spamassassin user/group and folder.<br />
groupadd -g 5001 spamd<br />
useradd -u 5001 -g spamd -s /sbin/nologin -d /var/lib/spamassassin -m spamd<br />
chown spamd:spamd /var/lib/spamassassin<br />
<br />
Make sure /etc/conf.d/spamd look like following.<br />
SAHOME="/var/lib/spamassassin/"<br />
SPAMD_OPTS="--create-prefs --max-children 5 --username spamd --helper-home-dir ${SAHOME} -s ${SAHOME}spamd.log --pidfile /var/run/spamd.pid"<br />
<br />
To leave the service ready to run, let's update the spamassassin matching patterns.<br />
/usr/bin/vendor_perl/sa-update<br />
<br />
{{Note| If you want to combine Spamassassin and Dovecot Mail Filtering you have to ignore the next two lines and continue further down instead.}}<br />
<br />
Edit /etc/postfix/master.cf and add the content filter under smtp. <br />
smtp inet n - n - - smtpd<br />
-o content_filter=spamassassin<br />
<br />
Also add the following service entry for spamassassin<br />
spamassassin unix - n n - - pipe<br />
user=spamd argv=/usr/bin/vendor_perl/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}<br />
<br />
===== SpamAssassin combined with Dovecot LDA / Sieve (Mailfiltering) =====<br />
* Set up LDA and the Sieve-Plugin which is descriped in [[Dovecot#Sieve]]. But ignore the last line {{ic|mailbox_command... }}<br />
* Instead add a pipe in /etc/postfix/master.cf<br />
dovecot unix - n n - - pipe<br />
flags=DRhu user=vmail:vmail argv=/usr/bin/vendor_perl/spamc -f -u spamd -e /usr/lib/dovecot/dovecot-lda -f ${sender} -d ${recipient}<br />
* And activate it in Postfix main.cf<br />
virtual_transport = dovecot<br />
<br />
Enable and start the service with systemctl <br />
systemctl enable spamassassin<br />
systemctl start spamassassin<br />
<br />
== Troubleshooting ==<br />
If you get errors like your imap/pop3 client failing to receive mails, take a look into your /var/log/mail.log file.<br />
It turned out that the maildir /home/vmail/mail@domain.tld is just being created if there is at least one email waiting. Otherwise there wouldn't be any need for the directory.<br />
<br />
== Tips and Tricks ==<br />
===When sending email with Postfix, how can I hide the sender’s IP and username in the Received header===<br />
This is a privacy concern mostly, if you use Thunderbird and send an email. The received header will contain your LAN and WAN IP and info about the email client you used.<br />
(Original source: [http://askubuntu.com/questions/78163/when-sending-email-with-postfix-how-can-i-hide-the-senders-ip-and-username-in AskUbuntu])<br />
What we want to do is remove the Received header from outgoing emails. This can be done by applying header_checks exclusively to the submission port. What we need to do is pass the cleanup_service_name option to the submission service so that we can set up a new cleanup service, “subcleanup.” The relevant section of /etc/postfix/master.cf might look like this:<br />
<br />
submission inet n - - - - smtpd<br />
-o smtpd_tls_security_level=encrypt<br />
-o smtpd_sasl_auth_enable=yes<br />
-o smtpd_client_restrictions=permit_sasl_authenticated,reject<br />
-o milter_macro_daemon_name=ORIGINATING<br />
-o cleanup_service_name=subcleanup<br />
Now we can pass the header_checks option to the new cleanup service. That part of /etc/postfix/master.cf might look like this:<br />
<br />
cleanup unix n - - - 0 cleanup<br />
subcleanup unix n - - - 0 cleanup<br />
-o header_checks=regexp:/etc/postfix/submission_header_checks<br />
Finally, we need to create the file /etc/postfix/submission_header_checks, which will contain the regex that filters offending Received header lines:<br />
<br />
/^Received:/ IGNORE<br />
/^User-Agent:/ IGNORE<br />
==See also==<br />
*[[Courier MTA]]<br />
*[[Postfix]]<br />
*[[SOHO Postfix]]<br />
*[[OpenDKIM]]</div>Roshlesshttps://wiki.archlinux.org/index.php?title=Benchmarking/Data_storage_devices&diff=295113Benchmarking/Data storage devices2014-01-31T03:37:41Z<p>Roshless: added one space betwen GB and capacity</p>
<hr />
<div>[[Category:Storage]]<br />
{{Article summary start}}<br />
{{Article summary text|This article covers several Linux-native apps that benchmark I/O devices such as HDDs, SSDs, USB thumb drives, etc. There is also a "database" section specific to SSDs meant to capture user-entered benchmark results.}}<br />
{{Article summary heading|Related Articles}}<br />
{{Article summary wiki|Solid State Drives}}<br />
{{Article summary wiki|Benchmarking}}<br />
{{Article summary end}}<br />
<br />
==Introduction==<br />
Several I/O benchmark options exist under Linux.<br />
<br />
* Using hddparm with the -Tt switch, one can time sequential reads. This method is '''independent''' of partition alignment!<br />
* There is a graphical benchmark called gnome-disks contained in the {{pkg|gnome-disk-utility}} package that will give min/max/ave reads along with ave access time and a nice graphical display. This method is '''independent''' of partition alignment!'''<br />
* The dd utility can be used to measure both reads and writes. This method is '''dependent''' on partition alignment! In other words, if you failed to properly align your partitions, this fact will be seen here since you're writing and reading to a mounted filesystem.<br />
* [[Benchmarking#Bonnie.2B.2B|Bonnie++]]<br />
<br />
=== Using hdparm ===<br />
<br />
# hdparm -Tt /dev/sdX<br />
/dev/sdX:<br />
Timing cached reads: x MB in y seconds = z MB/sec<br />
Timing buffered disk reads: x MB in y seconds = z MB/sec<br />
<br />
{{Note|One should run the above command 4-5 times and manually average the results for an accurate evaluation of read speed per the hddparm man page.}}<br />
<br />
=== Using gnome-disks ===<br />
<br />
# gnome-disks<br />
<br />
Users will need to navigate through the GUI to the benchmark button ("More actions..." => "Benchmark Volume..."). [http://imgur.com/Ayv1B Example]<br />
<br />
=== Using systemd-analyze ===<br />
<br />
systemd-analyze plot > boot.svg<br />
<br />
Will plot a detailed graphic with the boot sequence: kernel time, userspace time, time taken by each service. [http://imgur.com/4ywt1 Example]<br />
<br />
=== Using dd ===<br />
<br />
{{Note|This method requires the command to be executed from a mounted partition on the device of interest!}}<br />
<br />
First, enter a directory on the SSD with at least 1.1 GB of free space (and one that obviously gives your user wrx permissions) and write a test file to measure write speeds and to give the device something to read:<br />
<br />
$ cd /path/to/SSD<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
w bytes (x GB) copied, y s, z MB/s<br />
<br />
Next, clear the buffer-cache to accurately measure read speeds directly from the device:<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
w bytes (x GB) copied, y s, z MB/s<br />
<br />
Now that the last file is in the buffer, repeat the command to see the speed of the buffer-cache:<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
w bytes (x GB) copied, y s, z GB/s<br />
<br />
{{Note|One should run the above command 4-5 times and manually average the results for an accurate evaluation of the buffer read speed.}}<br />
<br />
Finally, delete the temp file<br />
$ rm tempfile<br />
==== Caveats ====<br />
Some SSD controllers have compression hardware, which may skew benchmark results. See http://www.pugetsystems.com/labs/articles/SSDs-Advertised-vs-Actual-Performance-179/<br />
=== Model Specific Data ===<br />
Please contribute to this section using the template below to post results obtained.<br />
<br />
See [http://www.anandtech.com/bench/SSD/65 here] for a nice database of benchmarks.<br />
<br />
=== Template ===<br />
*SSD:<br />
*Model Number:<br />
*Firmware Version:<br />
*Capacity: x GB<br />
*Controller:<br />
*User:<br />
*Kernel:<br />
[*Filesystem: write something about your FS, optional]<br />
[*Notes: additional Notes, optional]<br />
<br />
# hdparm -Tt /dev/sdx<br />
<br />
Minimum Read Rate: x MB/s<br />
Maximum Read Rate: x MB/s<br />
Average Read Rate: x MS/s<br />
Average Access Time x ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
<br />
== Results ==<br />
<br />
=== Table ===<br />
<br />
All values are taken from the [https://wiki.archlinux.org/index.php/SSD_Benchmarking#Using_dd ''dd'' benchmark]. This is just an overview and has no scientific use.<br />
<br />
{| class="wikitable" border="1" cellpadding="5" cellspacing="0"<br />
! User !! Vendor !! Model !! Capacity [GB] !! Write [MB/sec] !! Read [MB/sec] !! Re-Read [MB/sec]<br />
|-<br />
| jac || Crucial || C300 || 128 || 138 || 372 || 6500<br />
|-<br />
| Fraoch || Crucial || M4 || 64 || 114 || 445 || 3800<br />
|-<br />
| lynix || Crucial || M4 || 128 || 193 || 268 || 6800<br />
|-<br />
| wzyboy || Crucial || M4 || 64 || 113 || 276 || 3400<br />
|-<br />
| dundee || Intel || 310 Soda Creek || 40 || 44.2 || 197 || 4200<br />
|-<br />
| bugflux || Intel || 330 || 120 || 44.2 || 242 || 4500<br />
|-<br />
| Cirk || Intel || X18-M (G2) || 160 || 103 || 263 || 2700<br />
|-<br />
| Graysky || Intel || X25-M (G2) || 80 || 80.6 || 268 || 6300<br />
|-<br />
| fackamato || Intel || X25-M (G2) || 160 || 98 || 262 || 3000<br />
|-<br />
| Cirk || Intel || X25-M (G2) || 80 || 70 || 208 || 4200<br />
|-<br />
| timo.hardebusch || Intel || X25-M (G2) || 120 || 106 || 265 || 2900<br />
|-<br />
| Musikolo || OCZ || Vertex 4 SATA 3 || 128 || 233 || 392 || 3600<br />
|-<br />
| Graysky || OCZ || Vertex 4 SATA 3 || 128 || 228 || 394 || -<br />
|-<br />
| Graysky || OCZ || Vertex 4 SATA 2 || 128 || 251 || 284 || -<br />
|-<br />
| Surfed || OCZ || Vertex || 60 || 142 || 236 || 5200<br />
|-<br />
| Sputnick || OCZ || Vertex 3 || 120 || 245 || 225 || 4600<br />
|-<br />
| ScottKidder || OCZ || Vertex Turbo || 30 || 49 || 115 || 2600<br />
|-<br />
| longint || OCZ || Vertex 2 || 240 || 852? || 241 || 3400<br />
|-<br />
| muflone || OCZ || Vertex 3 || 120 || 377 || 291 || 10300<br />
|-<br />
| bardo || OCZ || Agility 3 || 120 || 445 || 455 || 8200<br />
|-<br />
| Cirk || Samsung || MMCQE28GFMUP-MVA || 128 || 45 || 99 || 2300<br />
|-<br />
| skylinux || Samsung || 470 || 64 || 188 || 204 || 1000<br />
|-<br />
| kevincodux || Samsung || 830 || 128 || 313 || 525 || 9000<br />
|-<br />
| Earlz || Samsung || 840 || 250 || 242 || 282 || 9800<br />
|-<br />
| Dani || Sandisk || Extreme || 240 || 481 || 414 || 6000<br />
|-<br />
| kozaki || Sandisk || Extreme || 120 || 458 || 403 || 8200<br />
|-<br />
| Roshless || Sandisk || Ultra Plus || 64 || 150 || 193 || 1500<br />
|- <br />
| Fraoch || Seagate || 600 || 240 || 432 || 526 || 3700<br />
|-<br />
| Artsibash || Kingston || HyperX || 120 || 451 || 431 || 8600<br />
|- <br />
| WonderWoofy || Kingston || HyperX 3k || 120 || 518 || 316 || 7200<br />
|-<br />
| Tuxe || Kingston || SSDNow V+100 || 128 || 110 || 232 || 3300<br />
|-<br />
| thof || Kingston || SNV425-S2BD || 128 || 164 || 260 || 3000<br />
|-<br />
| WonderWoofy || Mushkin || Atlas (mSATA II) || 128 || 262 || 242 || 7300<br />
|-<br />
| AleksMK || Liteon || M3S || 256 || 336 || 432 || 4200<br />
|-<br />
| AsmundEr || WD mechanical drive || over gigE network (NFS) || 3000 || 48 || 117 || 7700<br />
|}<br />
<br />
=== Baseline: mechanical drive over ethernet ===<br />
*HDD: WD AV-GP 3TB (SATA 2)<br />
*Model number: WD30EURS<br />
*Firmware version: ?<br />
*Capacity: 2.7 TB<br />
*User: AsmundEr<br />
*Kernel: 3.9.9<br />
*Filesystem: ZFS (native) with mirroring onto two drives (i.e. RAID-1)<br />
*Notes: filesystem mounted over gigabit LAN network using NFSv4.<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 22.2138 s, 48.3 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 9.20926 s, 117 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.13901 s, 7.7 GB/s<br />
<br />
=== Corsair ===<br />
==== Corsair Force 3 ====<br />
*SSD: Corsair Force 3 120gb (SATA 3)<br />
*Model Number: Corsair Force 3 SSD<br />
*Firmware Version: 1.3.3 <br />
*Capacity: 120 GB<br />
*User: bserem<br />
*Kernel: 3.4.9<br />
*Filesystem: BTRFS<br />
*Notes: , Systemd, UEFI (with a small FAT uefi partition at the beggining of the disk)<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 28232 MB in 2.00 seconds = 14137.02 MB/sec<br />
Timing buffered disk reads: 1164 MB in 3.01 seconds = 387.33 MB/sec<br />
<br />
Minimum Read Rate: 388.04 MB/s<br />
Maximum Read Rate: 387.13 MB/s<br />
Average Read Rate: 387.252 MS/s<br />
<br />
<br />
=== Crucial ===<br />
==== Crucial C300 ====<br />
*SSD: Crucial C300 (SATA 3: 6Gb/s)<br />
*Model Number: CTFDDAC128MAG-1G1<br />
*Capacity: 128 GB<br />
*User: jac<br />
<br />
# hdparm -Tt /dev/sdb<br />
/dev/sda:<br />
Timing cached reads: 24112 MB in 2.00 seconds = 12072.84 MB/sec<br />
Timing buffered disk reads: 1056 MB in 3.00 seconds = 351.58 MB/sec<br />
<br />
Minimum Read Rate: 350.88 MB/s<br />
Maximum Read Rate: 351.58 MB/s<br />
Average Read Rate: 351.264 MB/s<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 7.77883 s, 138 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.88752 s, 372 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.164471 s, 6.5 GB/s<br />
<br />
==== Crucial M4 ====<br />
*SSD: Crucial M4 (SATA 3: 6Gb/s)<br />
*Model Number: M4-CT128M4SSD2 (Firmware: 0009)<br />
*Capacity: 128 GB<br />
*User: lynix<br />
*Filesystem: ext4 on LVM<br />
*Notes: connected to SATAII 3Gb/s port while benchmarking. firmware matters!<br />
<br />
# hdparm -Tt /dev/sde<br />
/dev/sde:<br />
Timing cached reads: 19094 MB in 2.00 seconds = 9559.40 MB/sec<br />
Timing buffered disk reads: 786 MB in 3.00 seconds = 261.63 MB/sec<br />
<br />
Minimum Read Rate: 271.7 MB/s<br />
Maximum Read Rate: 381.7 MB/s<br />
Average Read Rate: 279.0 MB/s<br />
<br />
Minimum Write Rate: 58.6 MB/s<br />
Maximum Write Rate: 258.9 MB/s<br />
Average Write Rate: 194.8 MB/s<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 5.57478 s, 193 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.00688 s, 268 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.157567 s, 6.8 GB/s<br />
<br />
*SSD: Crucial M4 (SATA III)<br />
*Model Number: M4-CT064M4SSD2<br />
*Firmware Version: 070H<br />
*Capacity: 64 GB<br />
*Controller: AMD SB950<br />
*User: Fraoch<br />
*Kernel: 3.8.0<br />
*Filesystem: ext4<br />
<br />
# hdparm -Tt /dev/sdb<br />
Timing cached reads: 7532 MB in 2.00 seconds = 3767.26 MB/sec<br />
Timing buffered disk reads: 1294 MB in 3.00 seconds = 431.20 MB/sec<br />
<br />
Average Read Rate: 506.9 MB/s<br />
Average Access Time: 0.08 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 9.44004 s, 114 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.41524 s, 445 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.295721 s, 3.6 GB/s<br />
<br />
=== Intel ===<br />
==== Intel 310 Soda Creek ====<br />
*SSD: Intel 310 Soda Creek<br />
*Model Number: SSDMAEMC040G2<br />
*Firmware Version: 2CV1023M<br />
*Capacity: 40 GB<br />
*User: dundee<br />
*Filesystem: ext4<br />
<br />
# hdparm -Tt /dev/sdb<br />
/dev/sdb:<br />
Timing cached reads: 6278 MB in 2.00 seconds = 3141.39 MB/sec<br />
Timing buffered disk reads: 784 MB in 3.00 seconds = 260.96 MB/sec<br />
<br />
Minimum Read Rate: 189.7 MB/s<br />
Maximum Read Rate: 281.1 MB/s<br />
Average Read Rate: 277.1 MS/s<br />
Minimum Write Rate: 30.3 MB/s<br />
Maximum Write Rate: 44.6 MB/s<br />
Average Write Rate: 43.8 MS/s<br />
<br />
Average Access Time 0.1 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 24.3013 s, 44.2 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 5.45325 s, 197 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.255569 s, 4.2 GB/s<br />
<br />
==== Intel 330 ====<br />
*SSD: Intel 330<br />
*Model Number: SSDSC2CT120A3<br />
*Firmware Version: 300i<br />
*Capacity: 120 GB<br />
*User: bugflux<br />
*Filesystem: ext4<br />
*'''Note''': Sata II computer<br />
<br />
# hdparm -tT /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 9222 MB in 2.00 seconds = 4612.61 MB/sec<br />
Timing buffered disk reads: 672 MB in 3.01 seconds = 223.40 MB/sec<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 24.3013 s, 44.2 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.43827 s, 242 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.240778 s, 4.5 GB/s<br />
<br />
==== Intel X18-M (G2) ====<br />
*SSD: Intel X18-M Generation 2<br />
*Model Number: SSDSA1M1602GN<br />
*Capacity: 160 GB<br />
*User: Cirk<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 2826 MB in 2.00 seconds = 1414.39 MB/sec<br />
Timing buffered disk reads: 694 MB in 3.00 seconds = 231.14 MB/sec<br />
<br />
Minimum Read Rate: 216.1 MB/s<br />
Maximum Read Rate: 283.5 MB/s<br />
Average Read Rate: 271.2 MB/s<br />
Average Access Time 0.1 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 10.4608 s, 103 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.0866 s, 263 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.403244 s, 2.7 GB/s<br />
<br />
==== Intel X25-M (G2) ====<br />
*SSD: Intel X25-M Generation 2<br />
*Model Number: SSDSA2MH080G2R5<br />
*Capacity: 80 GB<br />
*User: Graysky<br />
<br />
# hdparm -Tt /dev/sdb<br />
/dev/sdb:<br />
Timing cached reads: 15644 MB in 1.99 seconds = 7845.48 MB/sec<br />
Timing buffered disk reads: 788 MB in 3.00 seconds = 262.52 MB/sec<br />
<br />
Minimum Read Rate: 253.6 MB/s<br />
Maximum Read Rate: 286.1 MB/s<br />
Average Read Rate: 282.6 MB/s<br />
Average Access Time 0.1 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 13.3236 s, 80.6 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.00297 s, 268 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.169713 s, 6.3 GB/s<br />
<br />
==== Intel X25-M (G2) ====<br />
*SSD: Intel X25-M Generation 2<br />
*Model Number: SSDSA2M160G2GC<br />
*Capacity: 160 GB<br />
*User: fackamato<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 2890 MB in 2.00 seconds = 1445.86 MB/sec<br />
Timing buffered disk reads: 738 MB in 3.00 seconds = 245.69 MB/sec<br />
<br />
Minimum Read Rate: 244.3 MB/s<br />
Maximum Read Rate: 278.6 MB/s<br />
Average Read Rate: 273.3 MB/s<br />
Average Access Time 0.1 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 10.8582 s, 98.9 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.09679 s, 262 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.363709 s, 3.0 GB/s<br />
<br />
==== Intel X25-M (G2) ====<br />
*SSD: Intel X25-M Generation 2<br />
*Model Number: SSDSA2M080G2C<br />
*Capacity: 80 GB<br />
*User: Cirk<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 9384 MB in 2.00 seconds = 4694.29 MB/sec<br />
Timing buffered disk reads: 808 MB in 3.01 seconds = 268.64 MB/sec<br />
<br />
Minimum Read Rate: 229.9 MB/s<br />
Maximum Read Rate: 281.6 MB/s<br />
Average Read Rate: 272.4 MB/s<br />
Average Access Time 0.1 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 15.1671 s, 70.8 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 5.15237 s, 208 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.256211 s, 4.2 GB/s<br />
<br />
==== Intel X25-M (G2) ====<br />
*SSD: Intel X25-M Generation 2<br />
*Model Number: SSDSA2MH120G2K5<br />
*Capacity: 120 GB<br />
*User: timo.hardebusch<br />
<br />
# hdparm -Tt /dev/sdb<br />
/dev/sdb:<br />
Timing cached reads: 4358 MB in 2.00 seconds = 2178.89 MB/sec<br />
Timing buffered disk reads: 752 MB in 3.01 seconds = 250.07 MB/sec<br />
<br />
Minimum Read Rate: 259.1 MB/s<br />
Maximum Read Rate: 283.3 MB/s<br />
Average Read Rate: 280.6 MB/s<br />
Average Access Time 0.1 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 10.1452 s, 106 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.05181 s, 265 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.369308 s, 2.9 GB/s<br />
<br />
=== OCZ ===<br />
==== OCZ-VERTEX 4 128 GB ====<br />
*SSD:OCZ Vertex 4<br />
*Model Number: VTX4-25SAT3<br />
*Firmware Version: 1.5<br />
*Capacity: 128 GB<br />
*Controller: Marvell Technology Group Ltd. 88SE9128 PCIe SATA 6 Gb/s RAID controller (rev 11)<br />
*Kernel: 3.6.11-1<br />
*User: Musikolo<br />
*Notes: <br />
** Filesystem: ext4 with options ''defaults,relatime,discard''. <br />
** Partition: aligned (fist sector 2048 / 1MiB free space at the beginning). Additional info [https://bbs.archlinux.org/viewtopic.php?pid=1211245#p1211245 here].<br />
** Scheduler: deadline. Additional info [https://wiki.archlinux.org/index.php/Solid_State_Drives#Using_udev_for_one_device_or_HDD.2FSSD_mixed_environment here].<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 7752 MB in 2.00 seconds = 3877.19 MB/sec<br />
Timing buffered disk reads: 1122 MB in 3.00 seconds = 373.78 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.60766 s, 233 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.74071 s, 392 MB/s<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.302118 s, 3.6 GB/s<br />
<br />
==== OCZ-VERTEX 4 128 GB ====<br />
*SSD:OCZ Vertex 4<br />
*Model Number: VTX4-25SAT3 - '''firmware 1.5'''<br />
*Capacity: 128 GB<br />
*User: [[User:Graysky]]<br />
===== In SATA 6.0 Gb/s Controller =====<br />
# hdparm -Tt /dev/sda<br />
<br />
/dev/sda:<br />
Timing cached reads: 33756 MB in 2.00 seconds = 16902.49 MB/sec<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.9279 s, 367 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.49942 s, 430 MB/s<br />
<br />
===== In SATA 3.0 Gb/s Controller =====<br />
# hdparm -Tt /dev/sda<br />
<br />
/dev/sda:<br />
Timing cached reads: 15842 MB in 2.00 seconds = 7930.79 MB/sec<br />
Timing buffered disk reads: 814 MB in 3.00 seconds = 271.02 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.28493 s, 251 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.78546 s, 284 MB/s<br />
<br />
==== OCZ-VERTEX 60gb ====<br />
*SSD:OCZ-VERTEX<br />
*Model Number:Firmware 1.5<br />
*Capacity: 60 GB<br />
*User:Surfed<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 16306 MB in 2.00 seconds = 8162.55 MB/sec<br />
Timing buffered disk reads: 646 MB in 3.00 seconds = 215.09 MB/sec<br />
<br />
<br />
Minimum Read Rate: 226.7 MB/s<br />
Maximum Read Rate: 275.2 MB/s<br />
Average Read Rate: 256.9 MB/s<br />
Average Access Time 0.1 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 7.5581 s, 142 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.55881 s, 236 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.205299 s, 5.2 GB/s<br />
<br />
==== OCZ-VERTEX3 120 ====<br />
*SSD:OCZ-VERTEX3<br />
*Firmware Version:<br />
*Capacity: 6Gb/s SATA III<br />
*User:[[User:pingpong]]<br />
<br />
# hdpram -Tt /dev/sda<br />
<br />
/dev/sda:<br />
Timing cached reads: 11180 MB in 2.00 seconds = 5594.15 MB/sec<br />
Timing buffered disk reads: 736 MB in 3.00 seconds = 245.27 MB/sec<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.20024 s, 256 MB/s<br />
<br />
#echo 3 > /proc/sys/vm/drop_caches<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.12454 s, 260 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.172948 s, 6.2 GB/s<br />
<br />
==== OCZ-VERTEX3 120GO ====<br />
*SSD:OCZ-VERTEX3<br />
*Firmware Version:2.06<br />
*Capacity: 6Gb/s SATA III<br />
*User:[[User:Sputnick]]<br />
*Notes: tested on '''SATA II 3Gb/s Dell Optiplex 780 motherboard''' 0C27VV <br />
<br />
# hdparm -Tt /dev/sdc<br />
<br />
/dev/sdc:<br />
Timing cached reads: 13702 MB in 2.00 seconds = 6859.89 MB/sec<br />
Timing buffered disk reads: 644 MB in 3.00 seconds = 214.40 MB/sec<br />
<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 enregistrements lus<br />
1024+0 enregistrements écrits<br />
1073741824 octets (1,1 GB) copiés, 4,37831 s, 245 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 enregistrements lus<br />
1024+0 enregistrements écrits<br />
1073741824 octets (1,1 GB) copiés, 4,76932 s, 225 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 enregistrements lus<br />
1024+0 enregistrements écrits<br />
1073741824 octets (1,1 GB) copiés, 0,234682 s, 4,6 GB/s<br />
<br />
==== OCZ-VERTEX-TURBO 30gb ====<br />
*SSD:OCZ-VERTEX-TURBO<br />
*Model Number:Firmware 1.5<br />
*Capacity: 30 GB<br />
*User:ScottKidder<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 6286 MB in 2.00 seconds = 3149.62 MB/sec<br />
Timing buffered disk reads: 630 MB in 3.01 seconds = 209.10 MB/sec<br />
<br />
Minimum Read Rate: 211.8 MB/s<br />
Maximum Read Rate: 254.1 MB/s<br />
Average Read Rate: 249.2 MB/s<br />
Average Access Time 0.1 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 21.5437 s, 49.8 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 9.34704 s, 115 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.40667 s, 2.6 GB/s<br />
<br />
==== OCZ-VERTEX2 240GB ====<br />
*SSD: OCZ<br />
*Model Number: Vertex2<br />
*Capacity: 240GB<br />
*User: longint<br />
*Filesystem: btrfs compression=lzo,space_cache<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 10972 MB in 2.00 seconds = 5489.70 MB/sec<br />
Timing buffered disk reads: 648 MB in 3.00 seconds = 215.96 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 1.26013 s, 852 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.45112 s, 241 MB/s<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.320492 s, 3.4 GB/s<br />
<br />
==== OCZ-VERTEX3 120GB ====<br />
*SSD:OCZ-VERTEX3 SATA III<br />
*Firmware Version:2.13<br />
*Capacity: 120 GB<br />
*Filesystem: ext4 with discard and commit=60<br />
*[[User:muflone]]<br />
<br />
# hdparm -Tt /dev/sdc<br />
/dev/sdc:<br />
Timing cached reads: 23870 MB in 2.00 seconds = 11950.12 MB/sec<br />
Timing buffered disk reads: 866 MB in 3.00 seconds = 288.36 MB/sec<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.85159 s, 377 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.6931 s, 291 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.10383 s, 10.3 GB/s<br />
<br />
==== OCZ-AGILITY3 120GB ====<br />
*SSD:OCZ-AGILITY3 SATA III<br />
*Firmware Version:2.15<br />
*Capacity: 120 GB<br />
*Filesystem: ext4 with discard<br />
*[[User:bardo]]<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 27738 MB in 2.00 seconds = 13889.38 MB/sec<br />
Timing buffered disk reads: 1158 MB in 3.01 seconds = 385.08 MB/sec<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.41537 s, 445 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.35961 s, 455 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.130664 s, 8.2 GB/s<br />
<br />
=== Samsung ===<br />
==== SAMSUNG 128GB / SATAII ====<br />
*SSD: SAMSUNG 128GB / SATAII<br />
*Model Number: MMCQE28GFMUP-MVA<br />
*Capacity: 128 GB<br />
*User: Cirk<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 2612 MB in 2.00 seconds = 1307.40 MB/sec<br />
Timing buffered disk reads: 294 MB in 3.01 seconds = 97.67 MB/sec<br />
<br />
Minimum Read Rate: 108.7 MB/s<br />
Maximum Read Rate: 114.5 MB/s<br />
Average Read Rate: 113.7 MB/s<br />
Average Access Time 0.2 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 23.7352 s, 45.2 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 10.7563 s, 99.8 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.464824 s, 2.3 GB/s<br />
<br />
==== SAMSUNG 470 64GB ====<br />
*SSD: SAMSUNG 470 64GB<br />
*Model Number: MZ-5PA064/US<br />
*Firmware: AXM070Q1<br />
*Capacity: 64 GB<br />
*User: skylinux<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 1736 MB in 2.00 seconds = 868.62 MB/sec<br />
Timing buffered disk reads: 516 MB in 3.00 seconds = 171.87 MB/sec<br />
<br />
Minimum Read Rate: 276.5 MB/s<br />
Maximum Read Rate: 278.8 MB/s<br />
Average Read Rate: 278.2 MB/s<br />
Average Access Time 0.2 ms<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 5.69714 s, 188 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 5.25116 s, 204 MB/s<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 1.05824 s, 1.0 GB/s<br />
<br />
==== SAMSUNG 830 128GB SATAII ====<br />
*SSD: SAMSUNG 830 128GB<br />
*Model Number: MZ-7PC128D<br />
*Firmware: CXM03B1Q<br />
*Capacity: 128 GB<br />
*[[User: lockheed]]<br />
*Filesystem: ext4 defaults,noatime,commit=60<br />
*Notes: SATA II, partitions aligned, with swap, C2D 2.5 GHz<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 12616 MB in 1.99 seconds = 6334.84 MB/sec<br />
Timing buffered disk reads: 802 MB in 3.01 seconds = 266.78 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.82496 s, 226 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.84014 s, 280 MB/s<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.300189 s, 3.6 GB/s<br />
<br />
==== SAMSUNG 830 128GB ====<br />
*SSD: SAMSUNG 830 128GB<br />
*Model Number: MZ-7PC128D<br />
*Firmware: CXM03B1Q<br />
*Capacity: 128 GB<br />
*[[User: kevincodux]]<br />
*Filesystem: ext4,discard,noatime<br />
*Notes: SATAIII, partitions aligned and no swap<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 22130 MB in 2.00 seconds = 11080.54 MB/sec<br />
Timing buffered disk reads: 1500 MB in 3.00 seconds = 499.38 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.42567 s, 313 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.04691 s, 525 MB/s<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.119695 s, 9.0 GB/s<br />
<br />
==== SAMSUNG 830 256GB ====<br />
*SSD: SAMSUNG 830 256GB<br />
*Model Number: MZ-7PC256<br />
*Firmware Version: CXM03B1Q<br />
*Capacity: 256 GB<br />
*User: Revelation<br />
*Kernel: 3.5.4<br />
*Filesystem: ext4<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 15888 MB in 2.00 seconds = 7952.13 MB/sec<br />
Timing buffered disk reads: 1464 MB in 3.00 seconds = 488.00 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3,15782 s, 340 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2,08421 s, 515 MB/s<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.119695 s, 6.2 GB/s<br />
<br />
====SAMSUNG 840 120GB ====<br />
<br />
*SSD: Samsung SSD 840 Series<br />
*Model Number: 840 (non Pro)<br />
*Firmware Version: DXT08B0Q<br />
*Capacity: 120 GB<br />
*User: willybilly0101<br />
*Kernel: 3.10.10-1-ARCH #1 SMP PREEMPT<br />
*Filesystem: Btrfs - defaults,noatime,compress=lzo<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 11346 MB in 2.00 seconds = 5677.40 MB/sec<br />
Timing buffered disk reads: 1534 MB in 3.00 seconds = 511.24 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.05137 s, 523 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 1.08204 s, 992 MB/s<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.232285 s, 4.6 GB/s<br />
<br />
<br />
==== SAMSUNG 840 250GB ====<br />
<br />
*SSD: SAMSUNG 840 250GB<br />
*Firmware: DXT07B0Q<br />
*Capacity: 250 GB<br />
*Filesystem: XFS(defaults,relatime,discard)<br />
*Kernel: 3.7.7-1-ARCH<br />
*Other details: SATA3 motherboard and hookups. Configured with hdparm to reserve 20% of the drive for over-provisioning<br />
*[[User: Earlz]]<br />
<br />
# hdparm -Tt /dev/sdc<br />
/dev/sdc:<br />
Timing cached reads: 21380 MB in 2.00 seconds = 10703.38 MB/sec<br />
Timing buffered disk reads: 810 MB in 3.00 seconds = 269.74 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.44147 s, 242 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.80874 s, 282 MB/s<br />
<br />
Notes:<br />
Firmware updating was a pain because they don't make it obvious you can update without using their Windows-only magician software. Go [http://www.samsung.com/global/business/semiconductor/samsungssd/downloads.html here] for ISO images of the updates pre-made and ready to download.<br />
<br />
=== Sandisk ===<br />
==== Sandisk Extreme 240 GB ====<br />
*SSD: Sandisk Extreme (SATA 3: 6Gb/s)<br />
*Model Number: SDSSDX240GG25<br />
*Capacity: 240 GB<br />
*User: Dani<br />
<br />
# sudo hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 11596 MB in 2.00 seconds = 5802.26 MB/sec<br />
Timing buffered disk reads: 1190 MB in 3.00 seconds = 396.16 MB/sec<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.23003 s, 481 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.5909 s, 414 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.177952 s, 6.0 GB/s<br />
<br />
==== Sandisk Extreme 120 GB ====<br />
* SSD: Sandik Extreme 120 GB (SATA 3: 6 GB/s)<br />
* Model Number: SDSSDX-120G-G25<br />
* Firmware Version: R201<br />
* Capacity: 120 GB<br />
* User: ''hsngrms''<br />
* Kernel: 3.6.3-1-ARCH x86_64<br />
* Filesystem: EXT4<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 6824 MB in 2.00 seconds = 3413.53 MB/sec<br />
Timing buffered disk reads: 1332 MB in 3.00 seconds = 443.99 MB/sec <br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1,1 GB) copied, 2,44496 s, 439 MB/s <br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1,1 GB) copied, 2,64944 s, 405 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1,1 GB) copied, 0,163495 s, 6,6 GB/s<br />
<br />
* SSD: Sandik Extreme 120 GB<br />
* Model Number: SDSSDX-120G-G25<br />
* Firmware Version: R211<br />
* Capacity: 120 GB<br />
* Controller: SATA controller: Intel Corporation 7 Series/C210 Series Chipset Family 6-port [AHCI mode] (rev 04)<br />
* User: kozaki<br />
* Kernel: 3.7.4-1-ARCH x86_64<br />
* Filesystem: EXT4 (Arch 201301 Default: fstab: default)<br />
* Notes: SataIII, GPT partitions aligned on sectors, LVM2 (--dataalignment 1m), cfq I/O scheduler, Asrock B75Pro mobo<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 16913 MB in 2.00 seconds = 8464.76 MB/sec<br />
Timing buffered disk reads: 1414 MB in 3.00 seconds = 470.85 MB/sec <br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1,1 GB) copied, 2.3301 s, 461.33 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1,1 GB) copied, 2.65322 s, 403.67 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1,1 GB) copied, 0.137885 s, 7.87 GB/s<br />
<br />
* Note: Same model and config, but with the Filesystem mount options and the deadline I/O scheduler<br />
* Filesystem: EXT4 (fstab: noatime,discard)<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 17162 MB in 2.00 seconds = 8588.88 MB/sec<br />
Timing buffered disk reads: 1416 MB in 3.00 seconds = 471.76 MB/sec <br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1,1 GB) copied, 2.3486 s, 458 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1,1 GB) copied, 2.6593 s, 403.33 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1,1 GB) copied, 0.1312 s, 8.2 GB/sec<br />
<br />
====Sandisk Ultra Plus 64 GB====<br />
<br />
*SSD: Sandisk Ultra Plus 64GB SATA3<br />
*Model Number: SDSSDHP-064G-G25<br />
*Capacity: 64 GB<br />
*User: Roshless<br />
*Kernel: 3.12.9-2-ck<br />
*Filesystem: ext4 - defaults,noatime,discard<br />
*Notes: deadline scheduler, Dell 0M7CYJ mobo, notebook<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 2116 MB in 2.00 seconds = 1058.95 MB/sec<br />
Timing buffered disk reads: 582 MB in 3.00 seconds = 193.84 MB/sec<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 7.17104 s, 150 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 5.5608 s, 193 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.707444 s, 1.5 GB/s<br />
<br />
=== Seagate ===<br />
==== 600 ====<br />
<br />
* SSD: Seagate 600<br />
* Model Number: ST240HM000<br />
* Firmware Version: C675<br />
* Capacity: 240 GB<br />
* Controller: AMD SB950<br />
* User: Fraoch<br />
* Kernel: 3.11.0<br />
* Filesystem: ext4<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 7436 MB in 2.00 seconds = 3719.76 MB/sec<br />
Timing buffered disk reads: 1526 MB in 3.00 seconds = 508.66 MB/sec<br />
<br />
Average read rate: 506.6 MB/s<br />
Average write rate: 299.3 MB/s<br />
Average access time: 0.13 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.48651 s, 432 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.03941 s, 526 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.308517 s, 3.5 GB/s<br />
<br />
=== Kingston ===<br />
==== Kingston HyperX 120 GB ====<br />
*SSD: Kingston HyperX 120 GB<br />
*Model Number: SH100S3120G<br />
*Firmware: 320ABBF0<br />
*Capacity: 120 GB<br />
*User: Artsibash<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 26564 MB in 2.00 seconds = 13296.53 MB/sec<br />
Timing buffered disk reads: 1130 MB in 3.00 seconds = 376.16 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.37858 s, 451 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches <br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.48961 s, 431 MB/s<br />
<br />
# dd if=/tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.125463 s, 8.6 GB/s<br />
<br />
==== Kingston HyperX 3K 120GB ====<br />
*SSD: Kingston HyperX 3K 120GB (MLC/Intel synchronous ONFi NAND/LSI SandForce SF-2281 25nm controller/SATA3/2.5")<br />
*Model Number: SH103S3120G<br />
*Firmware: 501ABBF0<br />
*Capacity: 120 GB<br />
*Misc: Intel DQ77MK mobo SATA3 port, linux 3.5.4-1, ext4 (has_journal + discard,noatime)<br />
*[[User: MajorTom]]<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 15382 MB in 2.00 seconds = 7702.01 MB/sec<br />
Timing buffered disk reads: 1442 MB in 3.00 seconds = 480.39 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.06937 s, 519 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches <br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.58996 s, 415 MB/s<br />
<br />
# dd if=/tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.207434 s, 5.2 GB/s<br />
<br />
==== Kingston HyperX 3K 120GB ====<br />
*SSD: Kingston HyperX 3K 120GB<br />
*Model Number: SH103S3120G<br />
*Firmware: 503ABBF0<br />
*Capacity: 120 GB<br />
*Misc: SATA3 port, linux 3.6.4-1-ck, ext4 <br />
*User: WonderWoofy<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 16562 MB in 2.00 seconds = 8289.47 MB/sec<br />
Timing buffered disk reads: 1078 MB in 3.01 seconds = 358.53 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.07445 s, 518 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches <br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.40264 s, 316 MB/s<br />
<br />
# dd if=/tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.149056 s, 7.2 GB/s<br />
<br />
==== Kingston SSDNow V+100 128 GB ====<br />
*SSD: Kingston SSDNow v+100 128 GB<br />
*Model Number: SVP100S2128G<br />
*Firmware: CJRA0202<br />
*Capacity: 128 GB<br />
*User: Tuxe<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 11598 MB in 1.99 seconds = 5822.73 MB/sec<br />
Timing buffered disk reads: 598 MB in 3.01 seconds = 198.90 MB/sec<br />
<br />
Minimum Read Rate: 145.8 MB/s<br />
Maximum Read Rate: 259.2 MB/s<br />
Average Read Rate: 243.5 MB/s<br />
Average Access Time 0.1 ms<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 9.74199 s, 110 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches <br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.62165 s, 232 MB/s<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.330142 s, 3.3 GB/s<br />
<br />
==== Kingston SNV425-S2BD 128GB ====<br />
*SSD: Kingston SNV425-S2BD/128GB<br />
*Model Number: SNV425S2128GB<br />
*Firmware: C09112a6<br />
*Capacity: 128 GB<br />
*User: thof<br />
*Filesystem: ext4<br />
*Kernel: 3.3.4<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 3614 MB in 2.00 seconds = 1808.83 MB/sec<br />
Timing buffered disk reads: 736 MB in 3.01 seconds = 244.91 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 6.5301 s, 164 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches <br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.1377 s, 260 MB/s<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.363142 s, 3.0 GB/s<br />
<br />
===Mushkin===<br />
==== Mushkin mSATA Atlas 128GB ====<br />
*SSD: Mushkin Atlas 128GB SATA III<br />
*Model Number: MKNSSDAT120GB-DX <br />
*Firmware: 504ABBF0<br />
*Capacity: 120 GB<br />
*Misc: SATA II Port (mSATA), linux 3.6.4-1-ck, ext4, Sandforce, <br />
*User: WonderWoofy<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sdb:<br />
Timing cached reads: 16116 MB in 2.00 seconds = 8065.82 MB/sec<br />
Timing buffered disk reads: 458 MB in 3.00 seconds = 152.53 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.09965 s, 262 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches <br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.4438 s, 242 MB/s<br />
<br />
# dd if=/tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.143544 s, 7.5 GB/s<br />
<br />
===Liteon===<br />
====Liteon M3S====<br />
*SSD: Liteon M3S 256GB SATA III<br />
*Model Number: LCT-256M3S <br />
*Firmware: VRDC<br />
*Capacity: 256 GB<br />
*User: AleksMK<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 8406 MB in 2.00 seconds = 4206.12 MB/sec<br />
Timing buffered disk reads: 1212 MB in 3.00 seconds = 403.81 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.2338 s, 332 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches <br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.48531 s, 432 MB/s<br />
<br />
# dd if=/tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.24457 s, 4.4 GB/s<br />
<br />
<br />
===IBM===<br />
==== IBM MLC 128GB ====<br />
*[[User: darkol]]<br />
*SSD: IBM 128GB SATA 2.5" MLC HS Enterprise Value SSD<br />
*Model Number: 90Y8648<br />
*Firmware Version: <br />
*Capacity: 128 GB<br />
*User: darkol<br />
*Kernel:<br />
*Filesystem: ext4<br />
*System: IBM x3650 M4<br />
<br />
# RAID1<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 17260 MB in 2.00 seconds = 8642.01 MB/sec<br />
Timing buffered disk reads: 1262 MB in 3.00 seconds = 420.27 MB/sec<br />
<br />
# RAID5<br />
# hdparm -Tt /dev/sdb<br />
/dev/sda:<br />
Timing cached reads: 17108 MB in 2.00 seconds = 8565.69 MB/sec<br />
Timing buffered disk reads: 3986 MB in 3.00 seconds = 1328.38 MB/sec<br />
<br />
= Encrypted Partitions =<br />
<br />
This section should show some data for encrypted partitions.<br />
<br />
== dm-crypt with AES ==<br />
<br />
Please list your CPU and if you are using AES-NI. Without AES-NI support in the CPU, the processor will be the bottleneck long before you touch the >500MB/s SSD speeds. <br />
<br />
'''i7-620M Benchmark'''<br />
*~570 MB/s :With AES-NI<br />
*~100 MB/s :Without AES-NI<br />
<br />
'''i5-3210M'''<br />
*~500 MB/s :With AES-NI<br />
*~200 MB/s :Without AES-NI<br />
<br />
=== Crucial ===<br />
<br />
The crucial drive does not use any compression to reach its speeds, so it is expected to be fast.<br />
<br />
==== Crucial M4 256 Gb ====<br />
<br />
* User: crobe<br />
* Filesystem: ext4 on dm-crypt<br />
* Running Sata 6 Gbit/s on an older 3 Gbit/s controller<br />
* Comment: The drive is faster on writing ( on fresh space ), which has been observed on the internet. Maybe this is the maximum of my machine.<br />
<br />
# cryptsetup status<br />
type: LUKS1<br />
cipher: aes-xts-plain<br />
keysize: 256 bits<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 3012 MB in 2.00 seconds = 1507.62 MB/sec<br />
Timing buffered disk reads: 558 MB in 3.00 seconds = 185.93 MB/sec<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 Datensätze ein<br />
1024+0 Datensätze aus<br />
1073741824 Bytes (1,1 GB) kopiert, 7,86539 s, 137 MB/s<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 Datensätze ein<br />
1024+0 Datensätze aus<br />
1073741824 Bytes (1,1 GB) kopiert, 9,78325 s, 110 MB/s<br />
<br />
=== OCZ ===<br />
<br />
The OCZ Drives use compression on Data, so with uncompressible encrypted Data, speeds are expected to be way lower. Still, seek times should be as low as ever and the drive shouldn't get slower when it gets full, so there should be enough speed.<br />
<br />
==== OCZ-VERTEX2 180GB ====<br />
<br />
* SSD: OCZ <br />
* Model Number: Vertex2 <br />
* Capacity: 180Gb <br />
* User: crobe<br />
* Filesystem: ext4 on dm-crypt with AES, essiv, sha256<br />
* The bottleneck for the read/write speeds is definately the drive<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 2842 MB in 2.00 seconds = 1422.61 MB/sec<br />
Timing buffered disk reads: 550 MB in 3.00 seconds = 183.26 MB/sec<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 Datensätze ein<br />
1024+0 Datensätze aus<br />
1073741824 Bytes (1,1 GB) kopiert, 16,9194 s, 63,5 MB/s<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 Datensätze ein<br />
1024+0 Datensätze aus<br />
1073741824 Bytes (1,1 GB) kopiert, 14,5509 s, 73,8 MB/s<br />
<br />
Same values for bonnie++.<br />
<br />
=== Samsung ===<br />
<br />
==== SAMSUNG 470 128GB ====<br />
<br />
*SSD: SAMSUNG 470 128GB<br />
*Firmware: AXM09B1Q<br />
*Capacity: 128 GB<br />
*User: FredericChopin<br />
<br />
# cryptsetup status<br />
type: LUKS1<br />
cipher: aes-xts-plain<br />
keysize: 512 bits<br />
offset: 8192 sectors<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 3226 MB in 2.00 seconds = 1614.42 MB/sec<br />
Timing buffered disk reads: 570 MB in 3.00 seconds = 189.84 MB/sec<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 9.62518 s, 112 MB/s<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 9.34282 s, 115 MB/s<br />
<br />
==== SAMSUNG 830 256GB ====<br />
<br />
*SSD: Samsung 830 256GB<br />
*Model Number: MZ-7PC256B/WW<br />
*Firmware Version: CXM03BQ1<br />
*Capacity: 256 GB<br />
*User: stefseel<br />
*Kernel: 3.4.6-1-ARCH (with aesni_intel module)<br />
*Filesystem: ext4 (relatime,discard) over LVM2 over dm-crypt/LUKS (allow-discards)<br />
*System: Lenovo ThinkPad T430 (i5-3210M)<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 15000 MB in 2.00 seconds = 7500 MB/sec<br />
Timing buffered disk reads: 1470 MB in 3.00 seconds = 490 MB/sec<br />
<br />
With default Arch settings with installed pm-utils: JOURNAL_COMMIT_TIME_AC=0, DRIVE_READAHEAD_AC=256<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.62668 s, 300 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.07337 s, 170 MB/s<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.154298 s, 7.0 GB/s<br />
<br />
What annoyed me was the poor read performance. I observed that in battery mode with unplugged AC the read rate was 500 MB/s. I did some research and found out that pm-utils is to blame. In AC mode it sets journal commit time to zero and readahead to 256 whereas in battery mode it sets journal commit time to 600 and readahead to 3072. See scripts /usr/lib/pm-utils/power.d/journal-commit and /usr/lib/pm-utils/power.d/readahead. So I added a custom config to set journal commit time always to 600 and readahead always to 4096, the result made me happy :)<br />
<br />
# cat /etc/pm/config.d/config<br />
DRIVE_READAHEAD_AC=4096<br />
DRIVE_READAHEAD_BAT=4096<br />
JOURNAL_COMMIT_TIME_AC=600<br />
JOURNAL_COMMIT_TIME_BAT=600<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.15534 s, 500 MB/s<br />
<br />
However there is still an issue: after resuming from suspend read rate goes down to 270 MB/s.<br />
<br />
<br />
==== SAMSUNG 830 256GB ====<br />
*[[User: hunterthompson]]<br />
*SSD: SAMSUNG 830 256GB<br />
*Firmware: CXM03B1Q<br />
*Capacity: 256 GB<br />
*System: Thinkpad X230, 16GB PC-1600 CL9 Kingston HyperX<br />
*CPU: i7-3520M, AES-NI, Hyper-Threaded, 2.9GHz-3.6GHz, Steady 3.4GHz with all 4 threads 100%<br />
*Kernel: x86_64 linux-grsec 3.5.4-1-grsec (Desktop, Virt, Host, KVM, Security)<br />
*Encryption: Full Disk, LVM2 on LUKS dm-crypt, Allow-Discards<br />
*Cryptsetup: -h sha512 -c aes-xts-plain64 -y -s 512 luksFormat --align-payload=8192<br />
*Filesystem: mkfs.ext4 -b 4096 -E stride=128,stripe-width=128 /dev/mapper/VolGroup00-lvolhome<br />
*fstab: ext4,rw,noatime,nodiratime,discard,stripe=128,data=ordered,errors=remount-ro<br />
*Notes: SATAIII, partitions aligned and no swap<br />
<br />
% dd bs=1M count=1024 if=7600_Retail_Ultimate_DVD.iso of=/dev/null conv=fdatasync<br />
dd: fsync failed for ‘/dev/null’: Invalid argument<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.42075 s, 314 MB/s<br />
<br />
% dd bs=1M count=1024 if=/dev/zero of=test conv=fdatasync<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.48574 s, 308 MB/s<br />
<br />
% dd bs=1M count=1024 if=/dev/zero of=test conv=fdatasync<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.45361 s, 311 MB/s<br />
<br />
% dd bs=1M count=1024 if=/dev/zero of=test conv=fdatasync<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.44276 s, 312 MB/s<br />
<br />
== Truecrypt ==<br />
<br />
= Comparison - high end SCSI RAID 0 hard drive benchmark =<br />
== LSI 320-2X Megaraid SCSI == <br />
<br />
* SSD: N/A<br />
* Model Number: LSI MegaRAID 320-2x RAID 0 x 2 Seagate Cheetah ST373455LC 15,000 RPM 146GB drives<br />
* Capacity: 292Gb <br />
* User: rabinnh<br />
* Filesystem: ext4 on x86_64<br />
* Comment: No, this is not an SSD, but Googlers should have a reasonable basis for comparison to a high end hard drive system, and you won't get much higher end for an individual workstation. The cost of this disk subsystem is conservatively $760, and it gives at best half the performance of most SSDs.<br />
<br />
<pre>$sudo hdparm -Tt /dev/sda2<br />
/dev/sda2:<br />
Timing cached reads: 6344 MB in 2.00 seconds = 3174.02 MB/sec<br />
Timing buffered disk reads: 442 MB in 3.01 seconds = 146.97 MB/sec</pre><br />
<br />
<pre>$dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 7.13482 s, 150 MB/s<br />
</pre><br />
<pre><br />
$echo 3 > /proc/sys/vm/drop_caches<br />
$dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 7.24267 s, 148 MB/s</pre><br />
<br />
<pre>$dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.459814 s, 2.3 GB/s</pre></div>Roshlesshttps://wiki.archlinux.org/index.php?title=Benchmarking/Data_storage_devices&diff=295112Benchmarking/Data storage devices2014-01-31T03:34:02Z<p>Roshless: added sandisk ultra plus</p>
<hr />
<div>[[Category:Storage]]<br />
{{Article summary start}}<br />
{{Article summary text|This article covers several Linux-native apps that benchmark I/O devices such as HDDs, SSDs, USB thumb drives, etc. There is also a "database" section specific to SSDs meant to capture user-entered benchmark results.}}<br />
{{Article summary heading|Related Articles}}<br />
{{Article summary wiki|Solid State Drives}}<br />
{{Article summary wiki|Benchmarking}}<br />
{{Article summary end}}<br />
<br />
==Introduction==<br />
Several I/O benchmark options exist under Linux.<br />
<br />
* Using hddparm with the -Tt switch, one can time sequential reads. This method is '''independent''' of partition alignment!<br />
* There is a graphical benchmark called gnome-disks contained in the {{pkg|gnome-disk-utility}} package that will give min/max/ave reads along with ave access time and a nice graphical display. This method is '''independent''' of partition alignment!'''<br />
* The dd utility can be used to measure both reads and writes. This method is '''dependent''' on partition alignment! In other words, if you failed to properly align your partitions, this fact will be seen here since you're writing and reading to a mounted filesystem.<br />
* [[Benchmarking#Bonnie.2B.2B|Bonnie++]]<br />
<br />
=== Using hdparm ===<br />
<br />
# hdparm -Tt /dev/sdX<br />
/dev/sdX:<br />
Timing cached reads: x MB in y seconds = z MB/sec<br />
Timing buffered disk reads: x MB in y seconds = z MB/sec<br />
<br />
{{Note|One should run the above command 4-5 times and manually average the results for an accurate evaluation of read speed per the hddparm man page.}}<br />
<br />
=== Using gnome-disks ===<br />
<br />
# gnome-disks<br />
<br />
Users will need to navigate through the GUI to the benchmark button ("More actions..." => "Benchmark Volume..."). [http://imgur.com/Ayv1B Example]<br />
<br />
=== Using systemd-analyze ===<br />
<br />
systemd-analyze plot > boot.svg<br />
<br />
Will plot a detailed graphic with the boot sequence: kernel time, userspace time, time taken by each service. [http://imgur.com/4ywt1 Example]<br />
<br />
=== Using dd ===<br />
<br />
{{Note|This method requires the command to be executed from a mounted partition on the device of interest!}}<br />
<br />
First, enter a directory on the SSD with at least 1.1 GB of free space (and one that obviously gives your user wrx permissions) and write a test file to measure write speeds and to give the device something to read:<br />
<br />
$ cd /path/to/SSD<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
w bytes (x GB) copied, y s, z MB/s<br />
<br />
Next, clear the buffer-cache to accurately measure read speeds directly from the device:<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
w bytes (x GB) copied, y s, z MB/s<br />
<br />
Now that the last file is in the buffer, repeat the command to see the speed of the buffer-cache:<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
w bytes (x GB) copied, y s, z GB/s<br />
<br />
{{Note|One should run the above command 4-5 times and manually average the results for an accurate evaluation of the buffer read speed.}}<br />
<br />
Finally, delete the temp file<br />
$ rm tempfile<br />
==== Caveats ====<br />
Some SSD controllers have compression hardware, which may skew benchmark results. See http://www.pugetsystems.com/labs/articles/SSDs-Advertised-vs-Actual-Performance-179/<br />
=== Model Specific Data ===<br />
Please contribute to this section using the template below to post results obtained.<br />
<br />
See [http://www.anandtech.com/bench/SSD/65 here] for a nice database of benchmarks.<br />
<br />
=== Template ===<br />
*SSD:<br />
*Model Number:<br />
*Firmware Version:<br />
*Capacity: x GB<br />
*Controller:<br />
*User:<br />
*Kernel:<br />
[*Filesystem: write something about your FS, optional]<br />
[*Notes: additional Notes, optional]<br />
<br />
# hdparm -Tt /dev/sdx<br />
<br />
Minimum Read Rate: x MB/s<br />
Maximum Read Rate: x MB/s<br />
Average Read Rate: x MS/s<br />
Average Access Time x ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
<br />
== Results ==<br />
<br />
=== Table ===<br />
<br />
All values are taken from the [https://wiki.archlinux.org/index.php/SSD_Benchmarking#Using_dd ''dd'' benchmark]. This is just an overview and has no scientific use.<br />
<br />
{| class="wikitable" border="1" cellpadding="5" cellspacing="0"<br />
! User !! Vendor !! Model !! Capacity [GB] !! Write [MB/sec] !! Read [MB/sec] !! Re-Read [MB/sec]<br />
|-<br />
| jac || Crucial || C300 || 128 || 138 || 372 || 6500<br />
|-<br />
| Fraoch || Crucial || M4 || 64 || 114 || 445 || 3800<br />
|-<br />
| lynix || Crucial || M4 || 128 || 193 || 268 || 6800<br />
|-<br />
| wzyboy || Crucial || M4 || 64 || 113 || 276 || 3400<br />
|-<br />
| dundee || Intel || 310 Soda Creek || 40 || 44.2 || 197 || 4200<br />
|-<br />
| bugflux || Intel || 330 || 120 || 44.2 || 242 || 4500<br />
|-<br />
| Cirk || Intel || X18-M (G2) || 160 || 103 || 263 || 2700<br />
|-<br />
| Graysky || Intel || X25-M (G2) || 80 || 80.6 || 268 || 6300<br />
|-<br />
| fackamato || Intel || X25-M (G2) || 160 || 98 || 262 || 3000<br />
|-<br />
| Cirk || Intel || X25-M (G2) || 80 || 70 || 208 || 4200<br />
|-<br />
| timo.hardebusch || Intel || X25-M (G2) || 120 || 106 || 265 || 2900<br />
|-<br />
| Musikolo || OCZ || Vertex 4 SATA 3 || 128 || 233 || 392 || 3600<br />
|-<br />
| Graysky || OCZ || Vertex 4 SATA 3 || 128 || 228 || 394 || -<br />
|-<br />
| Graysky || OCZ || Vertex 4 SATA 2 || 128 || 251 || 284 || -<br />
|-<br />
| Surfed || OCZ || Vertex || 60 || 142 || 236 || 5200<br />
|-<br />
| Sputnick || OCZ || Vertex 3 || 120 || 245 || 225 || 4600<br />
|-<br />
| ScottKidder || OCZ || Vertex Turbo || 30 || 49 || 115 || 2600<br />
|-<br />
| longint || OCZ || Vertex 2 || 240 || 852? || 241 || 3400<br />
|-<br />
| muflone || OCZ || Vertex 3 || 120 || 377 || 291 || 10300<br />
|-<br />
| bardo || OCZ || Agility 3 || 120 || 445 || 455 || 8200<br />
|-<br />
| Cirk || Samsung || MMCQE28GFMUP-MVA || 128 || 45 || 99 || 2300<br />
|-<br />
| skylinux || Samsung || 470 || 64 || 188 || 204 || 1000<br />
|-<br />
| kevincodux || Samsung || 830 || 128 || 313 || 525 || 9000<br />
|-<br />
| Earlz || Samsung || 840 || 250 || 242 || 282 || 9800<br />
|-<br />
| Dani || Sandisk || Extreme || 240 || 481 || 414 || 6000<br />
|-<br />
| kozaki || Sandisk || Extreme || 120 || 458 || 403 || 8200<br />
|-<br />
| Roshless || Sandisk || Ultra Plus || 64 || 150 || 193 || 1500<br />
|- <br />
| Fraoch || Seagate || 600 || 240 || 432 || 526 || 3700<br />
|-<br />
| Artsibash || Kingston || HyperX || 120 || 451 || 431 || 8600<br />
|- <br />
| WonderWoofy || Kingston || HyperX 3k || 120 || 518 || 316 || 7200<br />
|-<br />
| Tuxe || Kingston || SSDNow V+100 || 128 || 110 || 232 || 3300<br />
|-<br />
| thof || Kingston || SNV425-S2BD || 128 || 164 || 260 || 3000<br />
|-<br />
| WonderWoofy || Mushkin || Atlas (mSATA II) || 128 || 262 || 242 || 7300<br />
|-<br />
| AleksMK || Liteon || M3S || 256 || 336 || 432 || 4200<br />
|-<br />
| AsmundEr || WD mechanical drive || over gigE network (NFS) || 3000 || 48 || 117 || 7700<br />
|}<br />
<br />
=== Baseline: mechanical drive over ethernet ===<br />
*HDD: WD AV-GP 3TB (SATA 2)<br />
*Model number: WD30EURS<br />
*Firmware version: ?<br />
*Capacity: 2.7 TB<br />
*User: AsmundEr<br />
*Kernel: 3.9.9<br />
*Filesystem: ZFS (native) with mirroring onto two drives (i.e. RAID-1)<br />
*Notes: filesystem mounted over gigabit LAN network using NFSv4.<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 22.2138 s, 48.3 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 9.20926 s, 117 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.13901 s, 7.7 GB/s<br />
<br />
=== Corsair ===<br />
==== Corsair Force 3 ====<br />
*SSD: Corsair Force 3 120gb (SATA 3)<br />
*Model Number: Corsair Force 3 SSD<br />
*Firmware Version: 1.3.3 <br />
*Capacity: 120 GB<br />
*User: bserem<br />
*Kernel: 3.4.9<br />
*Filesystem: BTRFS<br />
*Notes: , Systemd, UEFI (with a small FAT uefi partition at the beggining of the disk)<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 28232 MB in 2.00 seconds = 14137.02 MB/sec<br />
Timing buffered disk reads: 1164 MB in 3.01 seconds = 387.33 MB/sec<br />
<br />
Minimum Read Rate: 388.04 MB/s<br />
Maximum Read Rate: 387.13 MB/s<br />
Average Read Rate: 387.252 MS/s<br />
<br />
<br />
=== Crucial ===<br />
==== Crucial C300 ====<br />
*SSD: Crucial C300 (SATA 3: 6Gb/s)<br />
*Model Number: CTFDDAC128MAG-1G1<br />
*Capacity: 128 GB<br />
*User: jac<br />
<br />
# hdparm -Tt /dev/sdb<br />
/dev/sda:<br />
Timing cached reads: 24112 MB in 2.00 seconds = 12072.84 MB/sec<br />
Timing buffered disk reads: 1056 MB in 3.00 seconds = 351.58 MB/sec<br />
<br />
Minimum Read Rate: 350.88 MB/s<br />
Maximum Read Rate: 351.58 MB/s<br />
Average Read Rate: 351.264 MB/s<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 7.77883 s, 138 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.88752 s, 372 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.164471 s, 6.5 GB/s<br />
<br />
==== Crucial M4 ====<br />
*SSD: Crucial M4 (SATA 3: 6Gb/s)<br />
*Model Number: M4-CT128M4SSD2 (Firmware: 0009)<br />
*Capacity: 128 GB<br />
*User: lynix<br />
*Filesystem: ext4 on LVM<br />
*Notes: connected to SATAII 3Gb/s port while benchmarking. firmware matters!<br />
<br />
# hdparm -Tt /dev/sde<br />
/dev/sde:<br />
Timing cached reads: 19094 MB in 2.00 seconds = 9559.40 MB/sec<br />
Timing buffered disk reads: 786 MB in 3.00 seconds = 261.63 MB/sec<br />
<br />
Minimum Read Rate: 271.7 MB/s<br />
Maximum Read Rate: 381.7 MB/s<br />
Average Read Rate: 279.0 MB/s<br />
<br />
Minimum Write Rate: 58.6 MB/s<br />
Maximum Write Rate: 258.9 MB/s<br />
Average Write Rate: 194.8 MB/s<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 5.57478 s, 193 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.00688 s, 268 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.157567 s, 6.8 GB/s<br />
<br />
*SSD: Crucial M4 (SATA III)<br />
*Model Number: M4-CT064M4SSD2<br />
*Firmware Version: 070H<br />
*Capacity: 64 GB<br />
*Controller: AMD SB950<br />
*User: Fraoch<br />
*Kernel: 3.8.0<br />
*Filesystem: ext4<br />
<br />
# hdparm -Tt /dev/sdb<br />
Timing cached reads: 7532 MB in 2.00 seconds = 3767.26 MB/sec<br />
Timing buffered disk reads: 1294 MB in 3.00 seconds = 431.20 MB/sec<br />
<br />
Average Read Rate: 506.9 MB/s<br />
Average Access Time: 0.08 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 9.44004 s, 114 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.41524 s, 445 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.295721 s, 3.6 GB/s<br />
<br />
=== Intel ===<br />
==== Intel 310 Soda Creek ====<br />
*SSD: Intel 310 Soda Creek<br />
*Model Number: SSDMAEMC040G2<br />
*Firmware Version: 2CV1023M<br />
*Capacity: 40 GB<br />
*User: dundee<br />
*Filesystem: ext4<br />
<br />
# hdparm -Tt /dev/sdb<br />
/dev/sdb:<br />
Timing cached reads: 6278 MB in 2.00 seconds = 3141.39 MB/sec<br />
Timing buffered disk reads: 784 MB in 3.00 seconds = 260.96 MB/sec<br />
<br />
Minimum Read Rate: 189.7 MB/s<br />
Maximum Read Rate: 281.1 MB/s<br />
Average Read Rate: 277.1 MS/s<br />
Minimum Write Rate: 30.3 MB/s<br />
Maximum Write Rate: 44.6 MB/s<br />
Average Write Rate: 43.8 MS/s<br />
<br />
Average Access Time 0.1 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 24.3013 s, 44.2 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 5.45325 s, 197 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.255569 s, 4.2 GB/s<br />
<br />
==== Intel 330 ====<br />
*SSD: Intel 330<br />
*Model Number: SSDSC2CT120A3<br />
*Firmware Version: 300i<br />
*Capacity: 120 GB<br />
*User: bugflux<br />
*Filesystem: ext4<br />
*'''Note''': Sata II computer<br />
<br />
# hdparm -tT /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 9222 MB in 2.00 seconds = 4612.61 MB/sec<br />
Timing buffered disk reads: 672 MB in 3.01 seconds = 223.40 MB/sec<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 24.3013 s, 44.2 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.43827 s, 242 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.240778 s, 4.5 GB/s<br />
<br />
==== Intel X18-M (G2) ====<br />
*SSD: Intel X18-M Generation 2<br />
*Model Number: SSDSA1M1602GN<br />
*Capacity: 160 GB<br />
*User: Cirk<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 2826 MB in 2.00 seconds = 1414.39 MB/sec<br />
Timing buffered disk reads: 694 MB in 3.00 seconds = 231.14 MB/sec<br />
<br />
Minimum Read Rate: 216.1 MB/s<br />
Maximum Read Rate: 283.5 MB/s<br />
Average Read Rate: 271.2 MB/s<br />
Average Access Time 0.1 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 10.4608 s, 103 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.0866 s, 263 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.403244 s, 2.7 GB/s<br />
<br />
==== Intel X25-M (G2) ====<br />
*SSD: Intel X25-M Generation 2<br />
*Model Number: SSDSA2MH080G2R5<br />
*Capacity: 80 GB<br />
*User: Graysky<br />
<br />
# hdparm -Tt /dev/sdb<br />
/dev/sdb:<br />
Timing cached reads: 15644 MB in 1.99 seconds = 7845.48 MB/sec<br />
Timing buffered disk reads: 788 MB in 3.00 seconds = 262.52 MB/sec<br />
<br />
Minimum Read Rate: 253.6 MB/s<br />
Maximum Read Rate: 286.1 MB/s<br />
Average Read Rate: 282.6 MB/s<br />
Average Access Time 0.1 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 13.3236 s, 80.6 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.00297 s, 268 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.169713 s, 6.3 GB/s<br />
<br />
==== Intel X25-M (G2) ====<br />
*SSD: Intel X25-M Generation 2<br />
*Model Number: SSDSA2M160G2GC<br />
*Capacity: 160 GB<br />
*User: fackamato<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 2890 MB in 2.00 seconds = 1445.86 MB/sec<br />
Timing buffered disk reads: 738 MB in 3.00 seconds = 245.69 MB/sec<br />
<br />
Minimum Read Rate: 244.3 MB/s<br />
Maximum Read Rate: 278.6 MB/s<br />
Average Read Rate: 273.3 MB/s<br />
Average Access Time 0.1 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 10.8582 s, 98.9 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.09679 s, 262 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.363709 s, 3.0 GB/s<br />
<br />
==== Intel X25-M (G2) ====<br />
*SSD: Intel X25-M Generation 2<br />
*Model Number: SSDSA2M080G2C<br />
*Capacity: 80 GB<br />
*User: Cirk<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 9384 MB in 2.00 seconds = 4694.29 MB/sec<br />
Timing buffered disk reads: 808 MB in 3.01 seconds = 268.64 MB/sec<br />
<br />
Minimum Read Rate: 229.9 MB/s<br />
Maximum Read Rate: 281.6 MB/s<br />
Average Read Rate: 272.4 MB/s<br />
Average Access Time 0.1 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 15.1671 s, 70.8 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 5.15237 s, 208 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.256211 s, 4.2 GB/s<br />
<br />
==== Intel X25-M (G2) ====<br />
*SSD: Intel X25-M Generation 2<br />
*Model Number: SSDSA2MH120G2K5<br />
*Capacity: 120 GB<br />
*User: timo.hardebusch<br />
<br />
# hdparm -Tt /dev/sdb<br />
/dev/sdb:<br />
Timing cached reads: 4358 MB in 2.00 seconds = 2178.89 MB/sec<br />
Timing buffered disk reads: 752 MB in 3.01 seconds = 250.07 MB/sec<br />
<br />
Minimum Read Rate: 259.1 MB/s<br />
Maximum Read Rate: 283.3 MB/s<br />
Average Read Rate: 280.6 MB/s<br />
Average Access Time 0.1 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 10.1452 s, 106 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.05181 s, 265 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.369308 s, 2.9 GB/s<br />
<br />
=== OCZ ===<br />
==== OCZ-VERTEX 4 128 GB ====<br />
*SSD:OCZ Vertex 4<br />
*Model Number: VTX4-25SAT3<br />
*Firmware Version: 1.5<br />
*Capacity: 128 GB<br />
*Controller: Marvell Technology Group Ltd. 88SE9128 PCIe SATA 6 Gb/s RAID controller (rev 11)<br />
*Kernel: 3.6.11-1<br />
*User: Musikolo<br />
*Notes: <br />
** Filesystem: ext4 with options ''defaults,relatime,discard''. <br />
** Partition: aligned (fist sector 2048 / 1MiB free space at the beginning). Additional info [https://bbs.archlinux.org/viewtopic.php?pid=1211245#p1211245 here].<br />
** Scheduler: deadline. Additional info [https://wiki.archlinux.org/index.php/Solid_State_Drives#Using_udev_for_one_device_or_HDD.2FSSD_mixed_environment here].<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 7752 MB in 2.00 seconds = 3877.19 MB/sec<br />
Timing buffered disk reads: 1122 MB in 3.00 seconds = 373.78 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.60766 s, 233 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.74071 s, 392 MB/s<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.302118 s, 3.6 GB/s<br />
<br />
==== OCZ-VERTEX 4 128 GB ====<br />
*SSD:OCZ Vertex 4<br />
*Model Number: VTX4-25SAT3 - '''firmware 1.5'''<br />
*Capacity: 128 GB<br />
*User: [[User:Graysky]]<br />
===== In SATA 6.0 Gb/s Controller =====<br />
# hdparm -Tt /dev/sda<br />
<br />
/dev/sda:<br />
Timing cached reads: 33756 MB in 2.00 seconds = 16902.49 MB/sec<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.9279 s, 367 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.49942 s, 430 MB/s<br />
<br />
===== In SATA 3.0 Gb/s Controller =====<br />
# hdparm -Tt /dev/sda<br />
<br />
/dev/sda:<br />
Timing cached reads: 15842 MB in 2.00 seconds = 7930.79 MB/sec<br />
Timing buffered disk reads: 814 MB in 3.00 seconds = 271.02 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.28493 s, 251 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.78546 s, 284 MB/s<br />
<br />
==== OCZ-VERTEX 60gb ====<br />
*SSD:OCZ-VERTEX<br />
*Model Number:Firmware 1.5<br />
*Capacity: 60 GB<br />
*User:Surfed<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 16306 MB in 2.00 seconds = 8162.55 MB/sec<br />
Timing buffered disk reads: 646 MB in 3.00 seconds = 215.09 MB/sec<br />
<br />
<br />
Minimum Read Rate: 226.7 MB/s<br />
Maximum Read Rate: 275.2 MB/s<br />
Average Read Rate: 256.9 MB/s<br />
Average Access Time 0.1 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 7.5581 s, 142 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.55881 s, 236 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.205299 s, 5.2 GB/s<br />
<br />
==== OCZ-VERTEX3 120 ====<br />
*SSD:OCZ-VERTEX3<br />
*Firmware Version:<br />
*Capacity: 6Gb/s SATA III<br />
*User:[[User:pingpong]]<br />
<br />
# hdpram -Tt /dev/sda<br />
<br />
/dev/sda:<br />
Timing cached reads: 11180 MB in 2.00 seconds = 5594.15 MB/sec<br />
Timing buffered disk reads: 736 MB in 3.00 seconds = 245.27 MB/sec<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.20024 s, 256 MB/s<br />
<br />
#echo 3 > /proc/sys/vm/drop_caches<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.12454 s, 260 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.172948 s, 6.2 GB/s<br />
<br />
==== OCZ-VERTEX3 120GO ====<br />
*SSD:OCZ-VERTEX3<br />
*Firmware Version:2.06<br />
*Capacity: 6Gb/s SATA III<br />
*User:[[User:Sputnick]]<br />
*Notes: tested on '''SATA II 3Gb/s Dell Optiplex 780 motherboard''' 0C27VV <br />
<br />
# hdparm -Tt /dev/sdc<br />
<br />
/dev/sdc:<br />
Timing cached reads: 13702 MB in 2.00 seconds = 6859.89 MB/sec<br />
Timing buffered disk reads: 644 MB in 3.00 seconds = 214.40 MB/sec<br />
<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 enregistrements lus<br />
1024+0 enregistrements écrits<br />
1073741824 octets (1,1 GB) copiés, 4,37831 s, 245 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 enregistrements lus<br />
1024+0 enregistrements écrits<br />
1073741824 octets (1,1 GB) copiés, 4,76932 s, 225 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 enregistrements lus<br />
1024+0 enregistrements écrits<br />
1073741824 octets (1,1 GB) copiés, 0,234682 s, 4,6 GB/s<br />
<br />
==== OCZ-VERTEX-TURBO 30gb ====<br />
*SSD:OCZ-VERTEX-TURBO<br />
*Model Number:Firmware 1.5<br />
*Capacity: 30 GB<br />
*User:ScottKidder<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 6286 MB in 2.00 seconds = 3149.62 MB/sec<br />
Timing buffered disk reads: 630 MB in 3.01 seconds = 209.10 MB/sec<br />
<br />
Minimum Read Rate: 211.8 MB/s<br />
Maximum Read Rate: 254.1 MB/s<br />
Average Read Rate: 249.2 MB/s<br />
Average Access Time 0.1 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 21.5437 s, 49.8 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 9.34704 s, 115 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.40667 s, 2.6 GB/s<br />
<br />
==== OCZ-VERTEX2 240GB ====<br />
*SSD: OCZ<br />
*Model Number: Vertex2<br />
*Capacity: 240GB<br />
*User: longint<br />
*Filesystem: btrfs compression=lzo,space_cache<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 10972 MB in 2.00 seconds = 5489.70 MB/sec<br />
Timing buffered disk reads: 648 MB in 3.00 seconds = 215.96 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 1.26013 s, 852 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.45112 s, 241 MB/s<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.320492 s, 3.4 GB/s<br />
<br />
==== OCZ-VERTEX3 120GB ====<br />
*SSD:OCZ-VERTEX3 SATA III<br />
*Firmware Version:2.13<br />
*Capacity: 120 GB<br />
*Filesystem: ext4 with discard and commit=60<br />
*[[User:muflone]]<br />
<br />
# hdparm -Tt /dev/sdc<br />
/dev/sdc:<br />
Timing cached reads: 23870 MB in 2.00 seconds = 11950.12 MB/sec<br />
Timing buffered disk reads: 866 MB in 3.00 seconds = 288.36 MB/sec<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.85159 s, 377 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.6931 s, 291 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.10383 s, 10.3 GB/s<br />
<br />
==== OCZ-AGILITY3 120GB ====<br />
*SSD:OCZ-AGILITY3 SATA III<br />
*Firmware Version:2.15<br />
*Capacity: 120 GB<br />
*Filesystem: ext4 with discard<br />
*[[User:bardo]]<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 27738 MB in 2.00 seconds = 13889.38 MB/sec<br />
Timing buffered disk reads: 1158 MB in 3.01 seconds = 385.08 MB/sec<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.41537 s, 445 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.35961 s, 455 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.130664 s, 8.2 GB/s<br />
<br />
=== Samsung ===<br />
==== SAMSUNG 128GB / SATAII ====<br />
*SSD: SAMSUNG 128GB / SATAII<br />
*Model Number: MMCQE28GFMUP-MVA<br />
*Capacity: 128 GB<br />
*User: Cirk<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 2612 MB in 2.00 seconds = 1307.40 MB/sec<br />
Timing buffered disk reads: 294 MB in 3.01 seconds = 97.67 MB/sec<br />
<br />
Minimum Read Rate: 108.7 MB/s<br />
Maximum Read Rate: 114.5 MB/s<br />
Average Read Rate: 113.7 MB/s<br />
Average Access Time 0.2 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 23.7352 s, 45.2 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 10.7563 s, 99.8 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.464824 s, 2.3 GB/s<br />
<br />
==== SAMSUNG 470 64GB ====<br />
*SSD: SAMSUNG 470 64GB<br />
*Model Number: MZ-5PA064/US<br />
*Firmware: AXM070Q1<br />
*Capacity: 64 GB<br />
*User: skylinux<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 1736 MB in 2.00 seconds = 868.62 MB/sec<br />
Timing buffered disk reads: 516 MB in 3.00 seconds = 171.87 MB/sec<br />
<br />
Minimum Read Rate: 276.5 MB/s<br />
Maximum Read Rate: 278.8 MB/s<br />
Average Read Rate: 278.2 MB/s<br />
Average Access Time 0.2 ms<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 5.69714 s, 188 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 5.25116 s, 204 MB/s<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 1.05824 s, 1.0 GB/s<br />
<br />
==== SAMSUNG 830 128GB SATAII ====<br />
*SSD: SAMSUNG 830 128GB<br />
*Model Number: MZ-7PC128D<br />
*Firmware: CXM03B1Q<br />
*Capacity: 128 GB<br />
*[[User: lockheed]]<br />
*Filesystem: ext4 defaults,noatime,commit=60<br />
*Notes: SATA II, partitions aligned, with swap, C2D 2.5 GHz<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 12616 MB in 1.99 seconds = 6334.84 MB/sec<br />
Timing buffered disk reads: 802 MB in 3.01 seconds = 266.78 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.82496 s, 226 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.84014 s, 280 MB/s<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.300189 s, 3.6 GB/s<br />
<br />
==== SAMSUNG 830 128GB ====<br />
*SSD: SAMSUNG 830 128GB<br />
*Model Number: MZ-7PC128D<br />
*Firmware: CXM03B1Q<br />
*Capacity: 128 GB<br />
*[[User: kevincodux]]<br />
*Filesystem: ext4,discard,noatime<br />
*Notes: SATAIII, partitions aligned and no swap<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 22130 MB in 2.00 seconds = 11080.54 MB/sec<br />
Timing buffered disk reads: 1500 MB in 3.00 seconds = 499.38 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.42567 s, 313 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.04691 s, 525 MB/s<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.119695 s, 9.0 GB/s<br />
<br />
==== SAMSUNG 830 256GB ====<br />
*SSD: SAMSUNG 830 256GB<br />
*Model Number: MZ-7PC256<br />
*Firmware Version: CXM03B1Q<br />
*Capacity: 256 GB<br />
*User: Revelation<br />
*Kernel: 3.5.4<br />
*Filesystem: ext4<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 15888 MB in 2.00 seconds = 7952.13 MB/sec<br />
Timing buffered disk reads: 1464 MB in 3.00 seconds = 488.00 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3,15782 s, 340 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2,08421 s, 515 MB/s<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.119695 s, 6.2 GB/s<br />
<br />
====SAMSUNG 840 120GB ====<br />
<br />
*SSD: Samsung SSD 840 Series<br />
*Model Number: 840 (non Pro)<br />
*Firmware Version: DXT08B0Q<br />
*Capacity: 120 GB<br />
*User: willybilly0101<br />
*Kernel: 3.10.10-1-ARCH #1 SMP PREEMPT<br />
*Filesystem: Btrfs - defaults,noatime,compress=lzo<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 11346 MB in 2.00 seconds = 5677.40 MB/sec<br />
Timing buffered disk reads: 1534 MB in 3.00 seconds = 511.24 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.05137 s, 523 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 1.08204 s, 992 MB/s<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.232285 s, 4.6 GB/s<br />
<br />
<br />
==== SAMSUNG 840 250GB ====<br />
<br />
*SSD: SAMSUNG 840 250GB<br />
*Firmware: DXT07B0Q<br />
*Capacity: 250 GB<br />
*Filesystem: XFS(defaults,relatime,discard)<br />
*Kernel: 3.7.7-1-ARCH<br />
*Other details: SATA3 motherboard and hookups. Configured with hdparm to reserve 20% of the drive for over-provisioning<br />
*[[User: Earlz]]<br />
<br />
# hdparm -Tt /dev/sdc<br />
/dev/sdc:<br />
Timing cached reads: 21380 MB in 2.00 seconds = 10703.38 MB/sec<br />
Timing buffered disk reads: 810 MB in 3.00 seconds = 269.74 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.44147 s, 242 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.80874 s, 282 MB/s<br />
<br />
Notes:<br />
Firmware updating was a pain because they don't make it obvious you can update without using their Windows-only magician software. Go [http://www.samsung.com/global/business/semiconductor/samsungssd/downloads.html here] for ISO images of the updates pre-made and ready to download.<br />
<br />
=== Sandisk ===<br />
==== Sandisk Extreme 240 GB ====<br />
*SSD: Sandisk Extreme (SATA 3: 6Gb/s)<br />
*Model Number: SDSSDX240GG25<br />
*Capacity: 240 GB<br />
*User: Dani<br />
<br />
# sudo hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 11596 MB in 2.00 seconds = 5802.26 MB/sec<br />
Timing buffered disk reads: 1190 MB in 3.00 seconds = 396.16 MB/sec<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.23003 s, 481 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.5909 s, 414 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.177952 s, 6.0 GB/s<br />
<br />
==== Sandisk Extreme 120 GB ====<br />
* SSD: Sandik Extreme 120 GB (SATA 3: 6 GB/s)<br />
* Model Number: SDSSDX-120G-G25<br />
* Firmware Version: R201<br />
* Capacity: 120 GB<br />
* User: ''hsngrms''<br />
* Kernel: 3.6.3-1-ARCH x86_64<br />
* Filesystem: EXT4<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 6824 MB in 2.00 seconds = 3413.53 MB/sec<br />
Timing buffered disk reads: 1332 MB in 3.00 seconds = 443.99 MB/sec <br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1,1 GB) copied, 2,44496 s, 439 MB/s <br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1,1 GB) copied, 2,64944 s, 405 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1,1 GB) copied, 0,163495 s, 6,6 GB/s<br />
<br />
* SSD: Sandik Extreme 120 GB<br />
* Model Number: SDSSDX-120G-G25<br />
* Firmware Version: R211<br />
* Capacity: 120 GB<br />
* Controller: SATA controller: Intel Corporation 7 Series/C210 Series Chipset Family 6-port [AHCI mode] (rev 04)<br />
* User: kozaki<br />
* Kernel: 3.7.4-1-ARCH x86_64<br />
* Filesystem: EXT4 (Arch 201301 Default: fstab: default)<br />
* Notes: SataIII, GPT partitions aligned on sectors, LVM2 (--dataalignment 1m), cfq I/O scheduler, Asrock B75Pro mobo<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 16913 MB in 2.00 seconds = 8464.76 MB/sec<br />
Timing buffered disk reads: 1414 MB in 3.00 seconds = 470.85 MB/sec <br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1,1 GB) copied, 2.3301 s, 461.33 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1,1 GB) copied, 2.65322 s, 403.67 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1,1 GB) copied, 0.137885 s, 7.87 GB/s<br />
<br />
* Note: Same model and config, but with the Filesystem mount options and the deadline I/O scheduler<br />
* Filesystem: EXT4 (fstab: noatime,discard)<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 17162 MB in 2.00 seconds = 8588.88 MB/sec<br />
Timing buffered disk reads: 1416 MB in 3.00 seconds = 471.76 MB/sec <br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1,1 GB) copied, 2.3486 s, 458 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1,1 GB) copied, 2.6593 s, 403.33 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1,1 GB) copied, 0.1312 s, 8.2 GB/sec<br />
<br />
====Sandisk Ultra Plus 64GB====<br />
<br />
*SSD: Sandisk Ultra Plus 64GB SATA3<br />
*Model Number: SDSSDHP-064G-G25<br />
*Capacity: 64 GB<br />
*User: Roshless<br />
*Kernel: 3.12.9-2-ck<br />
*Filesystem: ext4 - defaults,noatime,discard<br />
*Notes: deadline scheduler, Dell 0M7CYJ mobo, notebook<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 2116 MB in 2.00 seconds = 1058.95 MB/sec<br />
Timing buffered disk reads: 582 MB in 3.00 seconds = 193.84 MB/sec<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 7.17104 s, 150 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 5.5608 s, 193 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.707444 s, 1.5 GB/s<br />
<br />
=== Seagate ===<br />
==== 600 ====<br />
<br />
* SSD: Seagate 600<br />
* Model Number: ST240HM000<br />
* Firmware Version: C675<br />
* Capacity: 240 GB<br />
* Controller: AMD SB950<br />
* User: Fraoch<br />
* Kernel: 3.11.0<br />
* Filesystem: ext4<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 7436 MB in 2.00 seconds = 3719.76 MB/sec<br />
Timing buffered disk reads: 1526 MB in 3.00 seconds = 508.66 MB/sec<br />
<br />
Average read rate: 506.6 MB/s<br />
Average write rate: 299.3 MB/s<br />
Average access time: 0.13 ms<br />
<br />
$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.48651 s, 432 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.03941 s, 526 MB/s<br />
<br />
$ dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.308517 s, 3.5 GB/s<br />
<br />
=== Kingston ===<br />
==== Kingston HyperX 120 GB ====<br />
*SSD: Kingston HyperX 120 GB<br />
*Model Number: SH100S3120G<br />
*Firmware: 320ABBF0<br />
*Capacity: 120 GB<br />
*User: Artsibash<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 26564 MB in 2.00 seconds = 13296.53 MB/sec<br />
Timing buffered disk reads: 1130 MB in 3.00 seconds = 376.16 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.37858 s, 451 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches <br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.48961 s, 431 MB/s<br />
<br />
# dd if=/tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.125463 s, 8.6 GB/s<br />
<br />
==== Kingston HyperX 3K 120GB ====<br />
*SSD: Kingston HyperX 3K 120GB (MLC/Intel synchronous ONFi NAND/LSI SandForce SF-2281 25nm controller/SATA3/2.5")<br />
*Model Number: SH103S3120G<br />
*Firmware: 501ABBF0<br />
*Capacity: 120 GB<br />
*Misc: Intel DQ77MK mobo SATA3 port, linux 3.5.4-1, ext4 (has_journal + discard,noatime)<br />
*[[User: MajorTom]]<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 15382 MB in 2.00 seconds = 7702.01 MB/sec<br />
Timing buffered disk reads: 1442 MB in 3.00 seconds = 480.39 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.06937 s, 519 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches <br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.58996 s, 415 MB/s<br />
<br />
# dd if=/tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.207434 s, 5.2 GB/s<br />
<br />
==== Kingston HyperX 3K 120GB ====<br />
*SSD: Kingston HyperX 3K 120GB<br />
*Model Number: SH103S3120G<br />
*Firmware: 503ABBF0<br />
*Capacity: 120 GB<br />
*Misc: SATA3 port, linux 3.6.4-1-ck, ext4 <br />
*User: WonderWoofy<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 16562 MB in 2.00 seconds = 8289.47 MB/sec<br />
Timing buffered disk reads: 1078 MB in 3.01 seconds = 358.53 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.07445 s, 518 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches <br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.40264 s, 316 MB/s<br />
<br />
# dd if=/tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.149056 s, 7.2 GB/s<br />
<br />
==== Kingston SSDNow V+100 128 GB ====<br />
*SSD: Kingston SSDNow v+100 128 GB<br />
*Model Number: SVP100S2128G<br />
*Firmware: CJRA0202<br />
*Capacity: 128 GB<br />
*User: Tuxe<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 11598 MB in 1.99 seconds = 5822.73 MB/sec<br />
Timing buffered disk reads: 598 MB in 3.01 seconds = 198.90 MB/sec<br />
<br />
Minimum Read Rate: 145.8 MB/s<br />
Maximum Read Rate: 259.2 MB/s<br />
Average Read Rate: 243.5 MB/s<br />
Average Access Time 0.1 ms<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 9.74199 s, 110 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches <br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.62165 s, 232 MB/s<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.330142 s, 3.3 GB/s<br />
<br />
==== Kingston SNV425-S2BD 128GB ====<br />
*SSD: Kingston SNV425-S2BD/128GB<br />
*Model Number: SNV425S2128GB<br />
*Firmware: C09112a6<br />
*Capacity: 128 GB<br />
*User: thof<br />
*Filesystem: ext4<br />
*Kernel: 3.3.4<br />
<br />
# hdparm -Tt /dev/sda<br />
Timing cached reads: 3614 MB in 2.00 seconds = 1808.83 MB/sec<br />
Timing buffered disk reads: 736 MB in 3.01 seconds = 244.91 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 6.5301 s, 164 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches <br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.1377 s, 260 MB/s<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.363142 s, 3.0 GB/s<br />
<br />
===Mushkin===<br />
==== Mushkin mSATA Atlas 128GB ====<br />
*SSD: Mushkin Atlas 128GB SATA III<br />
*Model Number: MKNSSDAT120GB-DX <br />
*Firmware: 504ABBF0<br />
*Capacity: 120 GB<br />
*Misc: SATA II Port (mSATA), linux 3.6.4-1-ck, ext4, Sandforce, <br />
*User: WonderWoofy<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sdb:<br />
Timing cached reads: 16116 MB in 2.00 seconds = 8065.82 MB/sec<br />
Timing buffered disk reads: 458 MB in 3.00 seconds = 152.53 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.09965 s, 262 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches <br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.4438 s, 242 MB/s<br />
<br />
# dd if=/tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.143544 s, 7.5 GB/s<br />
<br />
===Liteon===<br />
====Liteon M3S====<br />
*SSD: Liteon M3S 256GB SATA III<br />
*Model Number: LCT-256M3S <br />
*Firmware: VRDC<br />
*Capacity: 256 GB<br />
*User: AleksMK<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 8406 MB in 2.00 seconds = 4206.12 MB/sec<br />
Timing buffered disk reads: 1212 MB in 3.00 seconds = 403.81 MB/sec<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.2338 s, 332 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches <br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.48531 s, 432 MB/s<br />
<br />
# dd if=/tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.24457 s, 4.4 GB/s<br />
<br />
<br />
===IBM===<br />
==== IBM MLC 128GB ====<br />
*[[User: darkol]]<br />
*SSD: IBM 128GB SATA 2.5" MLC HS Enterprise Value SSD<br />
*Model Number: 90Y8648<br />
*Firmware Version: <br />
*Capacity: 128 GB<br />
*User: darkol<br />
*Kernel:<br />
*Filesystem: ext4<br />
*System: IBM x3650 M4<br />
<br />
# RAID1<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 17260 MB in 2.00 seconds = 8642.01 MB/sec<br />
Timing buffered disk reads: 1262 MB in 3.00 seconds = 420.27 MB/sec<br />
<br />
# RAID5<br />
# hdparm -Tt /dev/sdb<br />
/dev/sda:<br />
Timing cached reads: 17108 MB in 2.00 seconds = 8565.69 MB/sec<br />
Timing buffered disk reads: 3986 MB in 3.00 seconds = 1328.38 MB/sec<br />
<br />
= Encrypted Partitions =<br />
<br />
This section should show some data for encrypted partitions.<br />
<br />
== dm-crypt with AES ==<br />
<br />
Please list your CPU and if you are using AES-NI. Without AES-NI support in the CPU, the processor will be the bottleneck long before you touch the >500MB/s SSD speeds. <br />
<br />
'''i7-620M Benchmark'''<br />
*~570 MB/s :With AES-NI<br />
*~100 MB/s :Without AES-NI<br />
<br />
'''i5-3210M'''<br />
*~500 MB/s :With AES-NI<br />
*~200 MB/s :Without AES-NI<br />
<br />
=== Crucial ===<br />
<br />
The crucial drive does not use any compression to reach its speeds, so it is expected to be fast.<br />
<br />
==== Crucial M4 256 Gb ====<br />
<br />
* User: crobe<br />
* Filesystem: ext4 on dm-crypt<br />
* Running Sata 6 Gbit/s on an older 3 Gbit/s controller<br />
* Comment: The drive is faster on writing ( on fresh space ), which has been observed on the internet. Maybe this is the maximum of my machine.<br />
<br />
# cryptsetup status<br />
type: LUKS1<br />
cipher: aes-xts-plain<br />
keysize: 256 bits<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 3012 MB in 2.00 seconds = 1507.62 MB/sec<br />
Timing buffered disk reads: 558 MB in 3.00 seconds = 185.93 MB/sec<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 Datensätze ein<br />
1024+0 Datensätze aus<br />
1073741824 Bytes (1,1 GB) kopiert, 7,86539 s, 137 MB/s<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 Datensätze ein<br />
1024+0 Datensätze aus<br />
1073741824 Bytes (1,1 GB) kopiert, 9,78325 s, 110 MB/s<br />
<br />
=== OCZ ===<br />
<br />
The OCZ Drives use compression on Data, so with uncompressible encrypted Data, speeds are expected to be way lower. Still, seek times should be as low as ever and the drive shouldn't get slower when it gets full, so there should be enough speed.<br />
<br />
==== OCZ-VERTEX2 180GB ====<br />
<br />
* SSD: OCZ <br />
* Model Number: Vertex2 <br />
* Capacity: 180Gb <br />
* User: crobe<br />
* Filesystem: ext4 on dm-crypt with AES, essiv, sha256<br />
* The bottleneck for the read/write speeds is definately the drive<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 2842 MB in 2.00 seconds = 1422.61 MB/sec<br />
Timing buffered disk reads: 550 MB in 3.00 seconds = 183.26 MB/sec<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 Datensätze ein<br />
1024+0 Datensätze aus<br />
1073741824 Bytes (1,1 GB) kopiert, 16,9194 s, 63,5 MB/s<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 Datensätze ein<br />
1024+0 Datensätze aus<br />
1073741824 Bytes (1,1 GB) kopiert, 14,5509 s, 73,8 MB/s<br />
<br />
Same values for bonnie++.<br />
<br />
=== Samsung ===<br />
<br />
==== SAMSUNG 470 128GB ====<br />
<br />
*SSD: SAMSUNG 470 128GB<br />
*Firmware: AXM09B1Q<br />
*Capacity: 128 GB<br />
*User: FredericChopin<br />
<br />
# cryptsetup status<br />
type: LUKS1<br />
cipher: aes-xts-plain<br />
keysize: 512 bits<br />
offset: 8192 sectors<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 3226 MB in 2.00 seconds = 1614.42 MB/sec<br />
Timing buffered disk reads: 570 MB in 3.00 seconds = 189.84 MB/sec<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 9.62518 s, 112 MB/s<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 9.34282 s, 115 MB/s<br />
<br />
==== SAMSUNG 830 256GB ====<br />
<br />
*SSD: Samsung 830 256GB<br />
*Model Number: MZ-7PC256B/WW<br />
*Firmware Version: CXM03BQ1<br />
*Capacity: 256 GB<br />
*User: stefseel<br />
*Kernel: 3.4.6-1-ARCH (with aesni_intel module)<br />
*Filesystem: ext4 (relatime,discard) over LVM2 over dm-crypt/LUKS (allow-discards)<br />
*System: Lenovo ThinkPad T430 (i5-3210M)<br />
<br />
# hdparm -Tt /dev/sda<br />
/dev/sda:<br />
Timing cached reads: 15000 MB in 2.00 seconds = 7500 MB/sec<br />
Timing buffered disk reads: 1470 MB in 3.00 seconds = 490 MB/sec<br />
<br />
With default Arch settings with installed pm-utils: JOURNAL_COMMIT_TIME_AC=0, DRIVE_READAHEAD_AC=256<br />
<br />
# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.62668 s, 300 MB/s<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 4.07337 s, 170 MB/s<br />
<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.154298 s, 7.0 GB/s<br />
<br />
What annoyed me was the poor read performance. I observed that in battery mode with unplugged AC the read rate was 500 MB/s. I did some research and found out that pm-utils is to blame. In AC mode it sets journal commit time to zero and readahead to 256 whereas in battery mode it sets journal commit time to 600 and readahead to 3072. See scripts /usr/lib/pm-utils/power.d/journal-commit and /usr/lib/pm-utils/power.d/readahead. So I added a custom config to set journal commit time always to 600 and readahead always to 4096, the result made me happy :)<br />
<br />
# cat /etc/pm/config.d/config<br />
DRIVE_READAHEAD_AC=4096<br />
DRIVE_READAHEAD_BAT=4096<br />
JOURNAL_COMMIT_TIME_AC=600<br />
JOURNAL_COMMIT_TIME_BAT=600<br />
<br />
# echo 3 > /proc/sys/vm/drop_caches<br />
# dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 2.15534 s, 500 MB/s<br />
<br />
However there is still an issue: after resuming from suspend read rate goes down to 270 MB/s.<br />
<br />
<br />
==== SAMSUNG 830 256GB ====<br />
*[[User: hunterthompson]]<br />
*SSD: SAMSUNG 830 256GB<br />
*Firmware: CXM03B1Q<br />
*Capacity: 256 GB<br />
*System: Thinkpad X230, 16GB PC-1600 CL9 Kingston HyperX<br />
*CPU: i7-3520M, AES-NI, Hyper-Threaded, 2.9GHz-3.6GHz, Steady 3.4GHz with all 4 threads 100%<br />
*Kernel: x86_64 linux-grsec 3.5.4-1-grsec (Desktop, Virt, Host, KVM, Security)<br />
*Encryption: Full Disk, LVM2 on LUKS dm-crypt, Allow-Discards<br />
*Cryptsetup: -h sha512 -c aes-xts-plain64 -y -s 512 luksFormat --align-payload=8192<br />
*Filesystem: mkfs.ext4 -b 4096 -E stride=128,stripe-width=128 /dev/mapper/VolGroup00-lvolhome<br />
*fstab: ext4,rw,noatime,nodiratime,discard,stripe=128,data=ordered,errors=remount-ro<br />
*Notes: SATAIII, partitions aligned and no swap<br />
<br />
% dd bs=1M count=1024 if=7600_Retail_Ultimate_DVD.iso of=/dev/null conv=fdatasync<br />
dd: fsync failed for ‘/dev/null’: Invalid argument<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.42075 s, 314 MB/s<br />
<br />
% dd bs=1M count=1024 if=/dev/zero of=test conv=fdatasync<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.48574 s, 308 MB/s<br />
<br />
% dd bs=1M count=1024 if=/dev/zero of=test conv=fdatasync<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.45361 s, 311 MB/s<br />
<br />
% dd bs=1M count=1024 if=/dev/zero of=test conv=fdatasync<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 3.44276 s, 312 MB/s<br />
<br />
== Truecrypt ==<br />
<br />
= Comparison - high end SCSI RAID 0 hard drive benchmark =<br />
== LSI 320-2X Megaraid SCSI == <br />
<br />
* SSD: N/A<br />
* Model Number: LSI MegaRAID 320-2x RAID 0 x 2 Seagate Cheetah ST373455LC 15,000 RPM 146GB drives<br />
* Capacity: 292Gb <br />
* User: rabinnh<br />
* Filesystem: ext4 on x86_64<br />
* Comment: No, this is not an SSD, but Googlers should have a reasonable basis for comparison to a high end hard drive system, and you won't get much higher end for an individual workstation. The cost of this disk subsystem is conservatively $760, and it gives at best half the performance of most SSDs.<br />
<br />
<pre>$sudo hdparm -Tt /dev/sda2<br />
/dev/sda2:<br />
Timing cached reads: 6344 MB in 2.00 seconds = 3174.02 MB/sec<br />
Timing buffered disk reads: 442 MB in 3.01 seconds = 146.97 MB/sec</pre><br />
<br />
<pre>$dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 7.13482 s, 150 MB/s<br />
</pre><br />
<pre><br />
$echo 3 > /proc/sys/vm/drop_caches<br />
$dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 7.24267 s, 148 MB/s</pre><br />
<br />
<pre>$dd if=tempfile of=/dev/null bs=1M count=1024<br />
1024+0 records in<br />
1024+0 records out<br />
1073741824 bytes (1.1 GB) copied, 0.459814 s, 2.3 GB/s</pre></div>Roshless