https://wiki.archlinux.org/api.php?action=feedcontributions&user=AsmundEr&feedformat=atomArchWiki - User contributions [en]2024-03-28T23:29:18ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=MythTV&diff=369982MythTV2015-04-17T16:27:33Z<p>AsmundEr: /* Requirements */ Flag as out-of-date</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[da:MythTV]]<br />
MythTV is an application suite designed to provide an amazing multimedia experience.<br />
It provides PVR functionality to a Linux based computer and also supports other media types. <br />
Combined with a nice, quiet computer and a decent TV, it makes an excellent centerpiece to a home theater system.<br />
<br />
==Structure==<br />
The MythTV system is split into a backend and a frontend. Each component has its own functions:<br />
<br />
===mythbackend===<br />
*Schedule and record television programming<br />
*Stream video data to the frontend<br />
*Flag commercial breaks<br />
*Transcode videos from one format to another<br />
<br />
===mythfrontend===<br />
*Provide a pretty GUI<br />
*Play back recorded content<br />
*Provide an interface to schedule programs<br />
<br />
The frontend and backend may be on separate computers on a network, and there may also be multiple frontends. This architecture allows for a central media distribution system that can reach anywhere a network can. This is a remarkably flexible system, and it even allows very low power machines to act as perfectly usable frontends.<br />
<br />
==Requirements==<br />
{{Out of date| The hardware discussed here is very old.}}<br />
MythTV is a very scalable system. With standard definition television and pure MPEG2 encoding and decoding with hardware acceleration, even a very modest system can act as both frontend and backend. How modest? Some people report being able to use fanless Via systems with Hauppauge PVR cards for both backend and frontend simultaneously. While the author does not condone the use of such a lightweight system, it has been done successfully.<br />
<br />
On the other end of the spectrum, high definition TV with MPEG4 transcoding and commercial flagging can require serious horsepower. Most people in the HD realm use high-end Athlon XPs, midrange to high-end Athlon 64s, and high-end Pentium 4s for their backends. The frontend can get away with a somewhat more midrange processor if XvMC playback acceleration is used.<br />
<br />
All systems are going to need a tuner card. The Hauppauge PVR series of cards (150, 250, 350, and 500) are very popular for use with MythTV due to fairly decent Linux support and low CPU usage. Other cards, like those based on the BT878 chipset, are also used. Unlike the PVR series, BT878 based cards require significant amounts of CPU power to save the video, as these cards output raw frames and not compressed streams.<br />
<br />
The only combination of hardware the author can say works is an Athlon XP 1700+ frontend with 512MB of DDR memory, and a Pentium 4 2.8GHz backend with 512MB of DDR2 memory.<br />
<br />
==Getting Started==<br />
In order to install MythTV on your system(s), you must have a working Linux installation. Since this is the Arch Linux website, this article will be geared towards Arch. A simple base system [[Installation guide|Installation]] with no extras is a suggested starting point.<br />
<br />
For the backend, it is also good to have [[LAMP]] working properly so that anybody can use a web browser to schedule programming through MythWeb. While it is not necessary, it is a very handy feature.<br />
<br />
A working [[Xorg]] (graphical) environment is necessary.<br />
<br />
==Make a "mythtv" User==<br />
{{Note|mythtv package installation creates mythtv user.}}<br />
If the purpose of the box is a stand-alone system, consider making a dedicated user for this purpose. For the rest of the guide, this username is "mythtv."<br />
<br />
# useradd -m -g users -G audio,lp,optical,storage,video,games,power -s /bin/bash mythtv<br />
# passwd mythtv <<set the password of your choosing>><br />
<br />
==Installing MythTV==<br />
<br />
Install the MythTV package and any desired plugins:<br />
<br />
# pacman -S mythtv mythplugins-mythweb ...<br />
<br />
*mythplugins-mytharchive - Create DVDs or archive recorded shows in MythTV<br />
*mythplugins-mythbrowser - Mini web browser for MythTV<br />
*mythplugins-mythgallery - Image gallery plugin for MythTV<br />
*mythplugins-mythgame - Game emulator plugin for MythTV<br />
*mythplugins-mythmusic - Music playing plugin for MythTV<br />
*mythplugins-mythnetvision - MythNetvision plugin for MythTV<br />
*mythplugins-mythnews - News checking plugin for MythTV<br />
*mythplugins-mythweather - Weather checking plugin for MythTV<br />
*mythplugins-mythweb - Web interface for the MythTV scheduler<br />
*mythplugins-mythzoneminder - View CCTV footage from zoneminder in MythTV<br />
<br />
At this point a generic MythTV installation is present that must be refined into a backend, a frontend, or both.<br />
<br />
===Backend setup===<br />
Before setting up your backend, make sure you have a functioning ''video capture card'' or a ''firewire input from a STB''. Unfortunately, that part of setup is outside the scope of this article. If you are in the United States, get an account at [http://www.schedulesdirect.org Schedules Direct] (this service provides TV listings at a minimal cost). Users outside the United States will need to use screen scrapers ([http://wiki.xmltv.org/index.php/Main_Page/ xmltv]) to do the same job. <br><br />
<br />
====Setting up the database====<br />
<br />
{{Note|This is a quick and dirty walk through of MySQL. Be sure you read the [[MySQL]] article for more details.}}<br />
Install MariaDB:<br />
# pacman -S mariadb<br />
and run MySQL daemon:<br />
# systemctl start mysqld<br />
<br />
If other machines in the LAN are expected to connect to the masterbackend server, comment out the "skip-networking" line in {{ic|/etc/mysql/my.cnf}} at this point.<br />
<br />
Setup mysql with a password:<br />
# mysql_secure_installation<br />
<br />
Create the database structure:<br />
$ mysql -u root -p </usr/share/mythtv/mc.sql<br />
<br />
If you have lost or overwritten your mc.sql file, it is always available [https://github.com/MythTV/mythtv/blob/master/mythtv/database/mc.sql here].<br />
<br />
Update your database<br />
# mysql_upgrade -u root -p<br />
<br />
{{Note|With the 0.26 release of mythtv, time zone tables are required to be in MySQL!}}<br />
To add them, simply execute the following:<br />
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p<yourpassword> mysql<br />
<br />
Some setups refuse frontends from remote machines. To fix this:<br />
# mysql -u root -p<br />
mysql> GRANT ALL ON mythconverg.* TO 'user'@'host.net' IDENTIFIED BY 'password';<br />
Query OK, 0 rows affected (0.00 sec)<br />
mysql> FLUSH PRIVILEGES;<br />
Query OK, 0 rows affected (0.00 sec)<br />
<br />
*Replace '''user''' with the user name running on the frontend (default: mythtv).<br />
*Replace '''host.net''' with the host name or IP address of the remote box needing access. Other common values are ''%.local'' and ''192.168.1.%''.<br />
*Replace '''password''' with a suitable password (default: mythtv).<br />
{{Note|MySQL / MariaDB treats a "user@host.net" and "user@192.168.1.1" as completely separate users, therefore you may need to use both types}}<br />
<br />
Example:<br />
<br />
# mysql -u root -p<br />
mysql> GRANT ALL ON mythconverg.* TO 'mythtv'@'192.168.0.%' IDENTIFIED BY 'mythtv';<br />
Query OK, 0 rows affected (0.00 sec)<br />
mysql> FLUSH PRIVILEGES;<br />
Query OK, 0 rows affected (0.00 sec)<br />
<br />
====Setting up the master backend====<br />
Load up your WM (lxde is a good choice for light-weight builds, but anything will work.)<br />
<br />
{{Note|Users wishing to just demo the software and those without capture card/hardware may follow [http://motorscript.com/mythtv-without-tv-tuner-card this] guide.}}<br />
<br />
Now run the mythtv-setup program<br />
$ mythtv-setup<br />
<br />
* '''General menu''' <br><br />
If this is your master backend, put its IP address in the first and fourth fields, identifying this computer as your master and giving its network IP address.<br><br />
On the next page, enter the paths where recordings and the live TV buffer will be stored. LVM or RAID solutions provide easily accessible large scale storage. But again, those are outside the scope of this article. Set the live TV buffer to a size you can handle and leave everything else alone.<br><br />
On the next page, set the settings to your locale. NTSC is mostly used in North America, and be sure to set whether using cable or broadcast.<br><br />
On the next two pages, leave everything as is unless you know for sure you want to change it.<br />
On the next page, if you have a fast backend that can handle recordings and flagging jobs simultaneously, it is recommended to set CPU usage to \"High\", maximum simultaneous jobs to 2, and to check the commercial flagging option.<br><br />
On the next page, set these options to taste. Automatic commercial flagging is highly recommended.<br />
Ignore the next page and finish.<br><br />
<br />
* '''Capture card menu''' <br><br />
Select your card type from the drop down list. Hauppauge PVR users will select the MPEG-2 encoder card option.<br><br />
Point mythtv-setup to the proper location, usually /dev/v4l/video0<br><br />
<br />
* '''Video sources menu''' <br><br />
This is where it gets important to have a source for TV listings. Schedules Direct users should create a new video source, name it, select the North America (Schedules Direct) option, and fill in their logon information. In order to verify that it is correct, go ahead and retrieve the listings. <br><br />
<br />
* '''Input connections menu''' <br><br />
This menu is rather self-explanatory. All you need to do is pick an input on the capture card and tell myth which video source it connects to. Most users will select their tuner and leave all the other inputs alone. Satellite users will select a video input, and on the next page provide the command to change channels on their STB using an external channel change program. This is also outside the scope of this article.<br />
<br />
* '''Channel editor menu''' <br><br />
This menu is safe to ignore<br />
<br />
* Exit the program (Esc)<br />
<br />
* Run mythfilldatabase<br />
$ mythfilldatabase<br />
<br />
This should populate your mysql database with TV listings for the next two weeks (or so).<br />
<br />
====Enable the mythbackend daemon====<br />
# systemctl enable mythbackend.service<br />
<br />
=== Security ===<br />
<br />
You may want to have the backend run as the previously-created mythtv user:<br />
<br />
This is a good idea since all user jobs are run as the same user as the user running the backend. If the backend is run as root, all user jobs will be run with root privileges.<br />
<br />
* Edit /etc/conf.d/mythbackend<br />
MBE_USER='mythtv'<br />
<br />
=== Troubleshooting ===<br />
<br />
If you get a libXvMCW.so.1 shared library error, install the following:<br />
{{bc|<br />
# pacman -S libxvmc<br />
}}<br />
<br />
If you cannot open /dev/video0 of your PVR150, install the firmware:<br />
# pacman -S ivtv-utils<br />
<br />
==Frontend setup==<br />
<br />
Compared to the backend, getting a frontend running is trivially simple. The frontend machine needs permission to access the database on the backend machine. On the backend machine, follow the instructions to grant remote access in the [[MySQL]] archlinux wiki. On the frontend machine, install the mythtv pacakages using pacman as above. Afterward, make sure you are in an X environment as a normal user and run mythfrontend. It will pop up a menu asking about the IP address of the backend and the local computer's name and IP address. Fill in this information and your frontend should be functional. <br />
<br />
On the other hand, the frontend has more options than a luxury car. All of those are an article on their own. There are a few notable options that should be set to ensure a good working setup. If you do not have an interlaced monitor (and almost nobody does), you will need to deinterlace your television output. Go into the TV playback menu and select kernel deinterlacing or bob2x deinterlacing. Try both and see which you like better. Also, in the general settings page, it is good to set up your [Alsa setup] settings, but those vary so greatly it is not worth suggesting values here.<br />
<br />
One problem I encountered running mythfrontend 0.20.0.2007013 on fglrx was that the colors were mixed up. People were blue-skinned etc. It turns out there is a hack for ATI cards in the source, but it is not enabled. Uncomment #define USE_ATI_PROPRIETARY_DRIVER_XVIDEO_HACK in libs/libmythtv/videoout_xv.cpp and rebuild. (this will change names in svn and so future versions)<br />
<br />
===Nvidia XvMC Setup===<br />
<br />
Assuming you have loaded the proprietary Nvidia drivers from pacman you may need do the following:<br />
{{bc|<br />
echo "libXvMCNVIDIA_dynamic.so.1" > /etc/X11/XvMCConfig }}<br />
<br />
This will allow Mythfrontend to use the XvMC environment for acceleration. Restart Mythfrontend<br />
<br />
==MythTV Plugins==<br />
There are a number of plugins available for MythTV in the AUR. They range from RSS readers to DVD players. Take a look at them. Simply installing the package on the frontend computer should impart the intended functionality. There is rarely any additional setup, and when there is, the install file will mention it.<br />
<br />
===MythWeb===<br />
[[MythWeb]] is a web interface for MythTV. Instructions for configuring MythWeb in Arch Linux can be found on the [[MythWeb]] page.<br />
<br />
=== Mythweather===<br />
<br />
As of 7-10-08 Mythweather is broken in Extra<br />
<p>extra/mythweather 0.21-1 (mythtv-extras)</p><br />
<br />
==Environment Variables==<br />
I found mythbackend would randomly stop running with the following error message:<br />
{{ic|Cannot locate your home directory. Please set the environment variable HOME or MYTHCONFDIR}}<br />
<br />
So I did the following as root:<br />
{{ic|mkdir /home/mythtv ; cp /home/(myusername)/.lircrc /home/mythtv/ ; chown -R (myusername):users /home/mythtv}}<br />
<br />
And then put the following in /etc/rc.conf<br />
{{ic|1=MYTHCONFDIR=/home/mythtv}}<br />
<br />
==Hints to a Happy Myth System==<br />
But not full articles (yet)<br />
*Run ntpd or openntpd on your backend to make sure it always has the right time.<br />
*[[lirc|LIRC]] on your frontend allows you to use a remote control, which is wonderful in a living room.<br />
*Use gdm, kdm, or xdm to automatically log in your frontend, and ~/.xinitrc to load mythfrontend on boot.<br />
*Set the "automatically run mythfilldatabase" option on one of your frontends to make sure you always have listings.<br />
*Do not forget to use the verbosity statements and log file location arguments to mythfrontend so you can see when things break.<br />
*Do not run your frontend as root, create a mythtv user<br />
<br />
===Using GDM to autologin your Mythfrontend===<br />
[[Display manager]]<br />
<p>In your /etc/gdm/custom.conf add the following statements under the [daemon] heading:</p><br />
{{bc|1=<br />
AutomaticLoginEnable=true<br />
AutomaticLogin=mythtv (assuming your frontend user is mythtv)}}<br />
FYI - GDM will not autologin as root<br />
<br />
===Using XDM to Automically Login to your MythFrontend===<br />
<p>Find in your /etc/inittab file the following line:</p><br />
{{bc|id:3:initdefault:}}<br />
<br />
<p>Change to:</p><br />
{{bc|id:5:initdefault:}}<br />
<br />
<p>Then add the following below it (or anywhere in the file):</p><br />
{{bc|x:5:respawn:su - MYTHUSER -c startx}}<br />
<br />
{{Note| Remember to change "MYTHUSER" to the username that you want to autologin under.}}<br />
<br />
<p>If you'd like to start mythfrontend on booting into Xorg, edit (or create if none exists) your MYTHUSER's .xinitrc file and add the following line:</p><br />
{{bc|mythfrontend}}<br />
<br />
===Optmize your system===<br />
Be sure to have a look at MythTV's extensive wiki documentation on how to keep your data stores happy, as well as optimize your system in various other ways to get the most out of your Myth box.<br />
<br />
[http://www.mythtv.org/wiki/Optimizing_Performance MythTV Wiki: Optimizing Performance]<br />
<br />
==References==<br />
*http://www.mythtv.org<br />
*http://mythtv.info<br />
*http://wilsonet.com/mythtv/fcmyth.php<br />
*http://www.linhes.org [A user friendly MythTV and Linux install that uses Arch Linux]</div>AsmundErhttps://wiki.archlinux.org/index.php?title=Talk:R&diff=332349Talk:R2014-08-25T08:22:47Z<p>AsmundEr: Asking if anyone has achieved good speedup with Intel MKL</p>
<hr />
<div>== Adding a graphical frontend to R ==<br />
<br />
There is a nice alternative to R-Studio; you can use VIM with TMUX and the VIM-R-Plugin. This is quiet neat and a likely more "arch" way of doing R. I think most of the users would rather do it that way so a word to that would be great in the apropriate section. <br />
<br />
[[User:ninux|ninux]] 20:40, 29 March 2013<br />
: Good idea. Go and do it. Everyone can edit the wiki. -- [[User:Fengchao|Fengchao]] ([[User talk:Fengchao|talk]]) 00:06, 31 March 2013 (UTC)<br />
:: I plan to add more info to the wiki in the coming days with a goal to remove the stub qualification [[User:Gabx|Gabx]] ([[User talk:Gabx|talk]]) 23:40, 25 September 2013 (UTC)<br />
<br />
== High performance R ==<br />
I have tried the solution using Intel MKL, and for me the speedup was negligible. This was for a script that does Markov-chain Monte Carlo studies of traits related to mating on a moose population. The libraries plyr, MuMIn, gdata, parallel and MCMCglmm were used. Does anyone have experience with significant speedupt using MKL? Perhaps in applications using lots of linear algebra?<br />
--[[User:AsmundEr|AsmundEr]] ([[User talk:AsmundEr|talk]]) 08:22, 25 August 2014 (UTC)</div>AsmundErhttps://wiki.archlinux.org/index.php?title=Benchmarking/Data_storage_devices&diff=268688Benchmarking/Data storage devices2013-07-29T12:13:19Z<p>AsmundEr: /* Baseline: mechanical drive over ethernet */ Additional details of the system</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 />
| 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 />
| 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 />
=== 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 ====<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 />
<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 />
=== 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>AsmundErhttps://wiki.archlinux.org/index.php?title=Benchmarking/Data_storage_devices&diff=268687Benchmarking/Data storage devices2013-07-29T12:11:18Z<p>AsmundEr: /* Table */ Added results for a mechanical harddrive accessed over network (NFS) (for comparison)</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 />
| 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 />
| 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)<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 />
=== 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 ====<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 />
<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 />
=== 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>AsmundErhttps://wiki.archlinux.org/index.php?title=Benchmarking/Data_storage_devices&diff=268686Benchmarking/Data storage devices2013-07-29T12:05:44Z<p>AsmundEr: /* Table */ Added results for a mechanical harddrive accessed over network (NFS) (for comparison)</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 />
| 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 />
| 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 || 47 || 115 || 8200<br />
|}<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 />
=== 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 ====<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 />
<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 />
=== 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 />
<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>AsmundErhttps://wiki.archlinux.org/index.php?title=FFmpeg&diff=263788FFmpeg2013-06-21T22:16:27Z<p>AsmundEr: /* Package installation */ Mention AUR version with ALL codecs</p>
<hr />
<div>[[Category:Audio/Video]]<br />
{{Article summary start}}<br />
{{Article summary text|This article attempts to walk users through the installation, usage and configuration of FFmpeg.}}<br />
{{Article summary end}}<br />
<br />
From the [http://www.ffmpeg.org/ FFmpeg homepage]:<br />
:''FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video. It includes libavcodec - the leading audio/video codec library.''<br />
<br />
== Package installation ==<br />
<br />
[[pacman|Install]] {{Pkg|ffmpeg}} from the [[official repositories]].<br />
<br />
A drop-in replacement fork called {{AUR|libav}} is available in [[AUR]]. The binary it provides is called '''avconv''' instead of '''ffmpeg'''.<br />
<br />
Note that the version in the official repositories does not include all codecs due to license constraints. Notably, the Fraunhofer AAC codec and the AAC+ codec are not included. {{AUR|ffmpeg-full}} from [[AUR]] provides a drop-in replacement with all codecs enabled.<br />
<br />
== Encoding examples ==<br />
<br />
=== Screen cast to .webm ===<br />
<br />
Using '''x11grab''' to video grab your display and using '''ALSA''' for sound. First we create lossless raw file {{ic|test.mkv}}.<br />
<br />
$ ffmpeg -f x11grab -r 30 -i :0.0 -f alsa -i hw:0,0 -acodec flac -vcodec ffvhuff test.mkv<br />
<br />
Then we process this {{ic|test.mkv}} file into a smaller {{ic|test.webm}} end product. Complex switches like {{ic|c:a}} and {{ic|c:v}} convert the stream into what's needed for [http://en.wikipedia.org/wiki/WebM WebM].<br />
<br />
$ ffmpeg -y -i test.mkv -c:a libvorbis -q:a 3 -c:v libvpx -b:v 2000k test.webm<br />
<br />
See https://github.com/kaihendry/recordmydesktop2.0/blob/master/r2d2.sh for a more fleshed out example.<br />
<br />
=== VOB to any container ===<br />
<br />
Concatenate the desired [[Wikipedia:VOB|VOB]] files into a single VOB file: <br />
$ cat ''video-1''.VOB ''video-2''.VOB ''video-3''.VOB > ''output''.VOB<br />
Concatenate and then pipe the output VOB to FFmpeg to use a different format:<br />
$ cat ''video-1''.VOB ''video-2''.VOB ''video-3''.VOB > ''output''.VOB | ffmpeg -i ...<br />
<br />
=== x264 lossless ===<br />
<br />
The ''ultrafast'' preset will provide the fastest encoding and is useful for quick capturing (such as screencasting):<br />
$ ffmpeg -i input -vcodec libx264 -preset ultrafast -qp 0 -acodec copy output.mkv<br />
On the opposite end of the preset spectrum is ''veryslow'' and will encode slower than ''ultrafast'' but provide a smaller output file size:<br />
$ ffmpeg -i input -vcodec libx264 -preset veryslow -qp 0 -acodec copy output.mkv<br />
Both examples will provide the same quality output.<br />
<br />
=== Single-pass MPEG-2 (near lossless) ===<br />
<br />
Allow FFmpeg to automatically set DVD standardized parameters. Encode to DVD [[Wikipedia:MPEG-2|MPEG-2]] at a frame rate of 30 frames/second:<br />
<br />
$ ffmpeg -i ''video''.VOB -target ntsc-dvd -sameq ''output''.mpg<br />
<br />
Encode to DVD MPEG-2 at a frame rate of 24 frames/second:<br />
<br />
$ ffmpeg -i ''video''.VOB -target film-dvd -sameq ''output''.mpg<br />
<br />
=== x264: constant rate factor ===<br />
<br />
Used when you want a specific quality output. General usage is to use the highest {{ic|-crf}} value that still provides an acceptable quality. A sane range is 18-28 and 23 is default. 18 is considered to be visually lossless. Use the slowest {{ic|-preset}} you have patience for. See the [https://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide x264 Encoding Guide] for more information.<br />
$ ffmpeg -i ''video'' -vcodec libx264 -preset slow -crf 22 -acodec libmp3lame -aq 4 ''output''.mkv<br />
{{ic|-tune}} option can be used to [http://forum.doom9.org/showthread.php?t=149394 match the type and content of the of media being encoded].<br />
<br />
=== YouTube ===<br />
<br />
FFmpeg is very useful to encode videos and strip their size before you upload them on YouTube. The following single line of code takes an input file and outputs a mkv container. <br />
<br />
$ ffmpeg -i ''video'' -c:v libx264 -crf 18 -preset slow -pix_fmt yuv420p -c:a copy ''output''.mkv<br />
<br />
For more information see the [https://bbs.archlinux.org/viewtopic.php?pid=1200667#p1200667 forums]. You can also create a custom alias {{ic|ytconvert}} which takes the name of the input file as first argument and the name of the .mkv container as second argument. To do so add the following to your {{ic|~/.bashrc}}:<br />
<br />
youtubeConvert(){<br />
ffmpeg -i $1 -c:v libx264 -crf 18 -preset slow -pix_fmt yuv420p -c:a copy $2.mkv<br />
}<br />
alias ytconvert=youtubeConvert<br />
See also [https://bbs.archlinux.org/viewtopic.php?pid=1200542#p1200542 Arch Linux forum thread].<br />
<br />
=== Two-pass x264 (very high-quality) ===<br />
<br />
Audio deactivated as only video statistics are recorded during the first of multiple pass runs: <br />
$ ffmpeg -i ''video''.VOB -an -vcodec libx264 -pass 1 -preset veryslow \<br />
-threads 0 -b 3000k -x264opts frameref=15:fast_pskip=0 -f rawvideo -y /dev/null<br />
Container format is automatically detected and muxed into from the output file extenstion ({{ic|.mkv}}):<br />
$ ffmpeg -i ''video''.VOB -acodec libvo-aacenc -ab 256k -ar 96000 -vcodec libx264 \<br />
-pass 2 -preset veryslow -threads 0 -b 3000k -x264opts frameref=15:fast_pskip=0 ''video''.mkv<br />
<br />
{{Tip|If you receive {{ic|Unknown encoder 'libvo-aacenc'}} error (given the fact that your ffmpeg is compiled with libvo-aacenc enabled), you may want to try {{ic|-acodec libvo_aacenc}}, an underscore instead of hyphen.}}<br />
<br />
=== Two-pass MPEG-4 (very high-quality) ===<br />
<br />
Audio deactivated as only video statistics are logged during the first of multiple pass runs: <br />
$ ffmpeg -i ''video''.VOB -an -vcodec mpeg4 -pass 1 -mbd 2 -trellis 2 -flags +cbp+mv0 \<br />
-pre_dia_size 4 -dia_size 4 -precmp 4 -cmp 4 -subcmp 4 -preme 2 -qns 2 -b 3000k \<br />
-f rawvideo -y /dev/null<br />
<br />
Container format is automatically detected and muxed into from the output file extenstion ({{ic|.avi}}):<br />
$ ffmpeg -i ''video''.VOB -acodec copy -vcodec mpeg4 -vtag DX50 -pass 2 -mbd 2 -trellis 2 \<br />
-flags +cbp+mv0 -pre_dia_size 4 -dia_size 4 -precmp 4 -cmp 4 -subcmp 4 -preme 2 -qns 2 \<br />
-b 3000k ''video''.avi<br />
* Introducing {{ic|threads}}={{ic|n}}>{{ic|1}} for {{ic|-vcodec mpeg4}} may skew the effects of [[Wikipedia:Motion_estimation|motion estimation]] and lead to [http://ffmpeg.org/faq.html#Why-do-I-see-a-slight-quality-degradation-with-multithreaded-MPEG_002a-encoding_003f reduced video quality] and compression efficiency.<br />
* The two-pass MPEG-4 example above also supports output to the [[Wikipedia:MPEG-4_Part_14|MP4]] container (replace {{ic|.avi}} with {{ic|.mp4}}).<br />
<br />
==== Determining bitrates with fixed output file sizes ====<br />
<br />
* (Desired File Size in MB - Audio File Size in MB) '''x''' 8192 kb/MB '''/''' Length of Media in Seconds (s) '''=''' [[Wikipedia:Bitrate|Bitrate]] in kb/s<br />
:* (3900 MB - 275 MB) = 3625 MB '''x''' 8192 kb/MB '''/''' 8830 s = 3363 kb/s required to achieve an approximate total output file size of 3900 MB<br />
<br />
=== Softsubs to hardsubs ===<br />
<br />
If have a softsubbed video (eg. ASS/SSA subs in a mkv container like most anime) you can 'burn' these subs into a new file to be played on a device which does not support subs or is to weak to display complex subs.<br />
<br />
* Install {{Pkg|mkvtoolnix-cli}} to pull out *.ass files from *.mkv files.<br />
<br />
* Recompile '''ffmpeg''' with {{ic|--enable-libass}} if it is not already enabled in your ffmpeg build. See [[ABS]] for easy recompiling.<br />
<br />
* Pull out subs from your file. This command assumes that track #2 is the ASS/SSA track. Use {{ic|mkvinfo}} if it is not.<br />
$ mkvextract tracks ''your file''.mkv 2:''your file''.ass<br />
<br />
* Recode file with ffmpeg. See sections above for suitable options. It is very important to disable sub-recording and enable sub-rendering:<br />
$ ffmpeg ... -sn -vf ass=''subtitles''.ass<br />
<br />
Output is set as *.mp4 since the default Android 4.2 player dislikes *.mkv. (But VLC on Android works with mkv). Example:<br />
$ ffmpeg -i ''video''.mkv -sn -vcodec libx264 -crf 18 -preset slow -vf ass=''subtitles''.ass -acodec copy ''output''.mp4<br />
<br />
== Preset files ==<br />
<br />
=== Creating presets ===<br />
<br />
<br />
Populate {{ic|~/.ffmpeg}} with the default [http://ffmpeg.org/ffmpeg-doc.html#SEC13 preset files]: <br />
<br />
$ cp -iR /usr/share/ffmpeg ~/.ffmpeg<br />
<br />
Create new and/or modify the default preset files:<br />
<br />
{{hc|~/.ffmpeg/libavcodec-vhq.ffpreset|2=<br />
vtag=DX50<br />
mbd=2<br />
trellis=2<br />
flags=+cbp+mv0<br />
pre_dia_size=4<br />
dia_size=4<br />
precmp=4<br />
cmp=4<br />
subcmp=4<br />
preme=2<br />
qns=2<br />
}}<br />
<br />
=== Using preset files ===<br />
<br />
Enable the {{ic|-vpre}} option after declaring the desired {{ic|-vcodec}}<br />
<br />
==== libavcodec-vhq.ffpreset ====<br />
<br />
* {{ic|libavcodec}} '''=''' Name of the vcodec/acodec<br />
* {{ic|vhq}} '''=''' Name of specific preset to be called out<br />
* {{ic|ffpreset}} '''=''' FFmpeg preset filetype suffix <br />
<br />
===== Two-pass MPEG-4 (very high quality) =====<br />
<br />
First pass of a multipass (bitrate) ratecontrol transcode:<br />
$ ffmpeg -i ''video''.mpg -an -vcodec mpeg4 -pass 1 -vpre vhq -f rawvideo -y /dev/null<br />
Ratecontrol based on the video statistics logged from the first pass: <br />
$ ffmpeg -i ''video''.mpg -acodec libvorbis -aq 8 -ar 48000 -vcodec mpeg4 \<br />
-pass 2 -vpre vhq -b 3000k ''output''.mp4<br />
<br />
* '''libvorbis quality settings (VBR)'''<br />
:* -aq 4 '''=''' 128 kb/s<br />
:* -aq 5 '''=''' 160 kb/s<br />
:* -aq 6 '''=''' 192 kb/s<br />
:* -aq 7 '''=''' 224 kb/s<br />
:* -aq 8 '''=''' 256 kb/s<br />
<br />
* [http://www.geocities.jp/aoyoume/aotuv/ aoTuV] is generally preferred over [http://vorbis.com/ libvorbis] provided by [http://www.xiph.org/ Xiph.Org] and is provided by [https://aur.archlinux.org/packages.php?ID=6155 libvorbis-aotuv] in the [[AUR]].<br />
<br />
== Volume gain ==<br />
<br />
Change the audio volume in multiples of 256 where '''256 = 100%''' (normal) volume. Additional values such as 400 are also valid options. <br />
-vol 256 = 100%<br />
-vol 512 = 200%<br />
-vol 768 = 300%<br />
-vol 1024 = 400%<br />
-vol 2048 = 800%<br />
<br />
To double the volume '''(512 = 200%)''' of an [[Wikipedia:Mp3|MP3]] file:<br />
$ ffmpeg -i ''file''.mp3 -vol 512 ''louder file''.mp3<br />
<br />
To quadruple the volume '''(1024 = 400%)''' of an [[Wikipedia:Ogg|Ogg]] file:<br />
$ ffmpeg -i ''file''.ogg -vol 1024 ''louder file''.ogg<br />
<br />
Note that gain metadata is only written to the output file. Unlike mp3gain or ogggain, the source sound file is untouched.<br />
<br />
== Extracting audio ==<br />
<br />
{{hc|$ ffmpeg -i ''video''.mpg|<br />
...<br />
Input #0, avi, from '''video''.mpg':<br />
Duration: 01:58:28.96, start: 0.000000, bitrate: 3000 kb/s<br />
Stream #0.0: Video: mpeg4, yuv420p, 720x480 [PAR 1:1 DAR 16:9], 29.97 tbr, 29.97 tbn, 29.97 tbc<br />
Stream #0.1: Audio: ac3, 48000 Hz, stereo, s16, 384 kb/s<br />
Stream #0.2: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s<br />
Stream #0.3: Audio: dts, 48000 Hz, 5.1 768 kb/s<br />
...<br />
}}<br />
<br />
Extract the first ({{ic|-map 0:1}}) [[Wikipedia:Dolby_Digital|AC-3]] encoded audio stream exactly as it was multiplexed into the file: <br />
$ ffmpeg -i ''video''.mpg -map 0:1 -acodec copy -vn ''video''.ac3<br />
Convert the third ({{ic|-map 0:3}}) [[Wikipedia:DTS_(sound_system)|DTS]] audio stream to an [[Wikipedia:Advanced_Audio_Coding|AAC]] file with a bitrate of 192 kb/s and a [[Wikipedia:Sampling_rate|sampling rate]] of 96000 Hz:<br />
$ ffmpeg -i ''video''.mpg -map 0:3 -acodec libvo-aacenc -ab 192k -ar 96000 -vn ''output''.aac<br />
{{ic|-vn}} disables the processing of the video stream.<br />
<br />
Extract audio stream with certain time interval: <br />
$ ffmpeg -ss 00:01:25 -t 00:00:05 -i ''video''.mpg -map 0:1 -acodec copy -vn ''output''.ac3<br />
{{ic|-ss}} specifies the start point, and {{ic|-t}} specifies the duration.<br />
<br />
=== Stripping audio ===<br />
<br />
# Copy the first video stream ({{ic|-map 0:0}}) along with the second AC-3 audio stream ({{ic|-map 0:2}}).<br />
# Convert the AC-3 audio stream to two-channel MP3 with a bitrate of 128 kb/s and a sampling rate of 48000 Hz.<br />
$ ffmpeg -i ''video''.mpg -map 0:0 -map 0:2 -vcodec copy -acodec libmp3lame \<br />
-ab 128k -ar 48000 -ac 2 ''video''.mkv<br />
<br />
{{hc|$ ffmpeg -i ''video''.mkv|<br />
...<br />
Input #0, avi, from '''video''.mpg':<br />
Duration: 01:58:28.96, start: 0.000000, bitrate: 3000 kb/s<br />
Stream #0.0: Video: mpeg4, yuv420p, 720x480 [PAR 1:1 DAR 16:9], 29.97 tbr, 29.97 tbn, 29.97 tbc<br />
Stream #0.1: Audio: mp3, 48000 Hz, stereo, s16, 128 kb/s<br />
}}<br />
<br />
{{Note|Removing undesired audio streams allows for additional bits to be allocated towards improving video quality.}}<br />
<br />
== Adding subtitles ==<br />
<br />
FFmpeg does not currently support muxing [[Wikipedia:Category:Subtitle_file_formats|subtitle files]] into existing streams. See [[Mencoder#Adding_SubRip_subtitles_to_a_file|MEncoder]] for subtitle muxing support.<br />
<br />
== Recording webcam ==<br />
<br />
FFmpeg supports grabbing input from Video4Linux2 devices. The following command will record a video from the webcam, assuming that the webcam is correctly recognized under {{ic|/dev/video0}}:<br />
<br />
$ ffmpeg -f v4l2 -s 640x480 -i /dev/video0 ''output''.mpg<br />
<br />
The above produces a silent video. It is also possible to include audio sources from a microphone. The following command will include a stream from the default [[Advanced Linux Sound Architecture|ALSA]] recording device into the video:<br />
<br />
$ ffmpeg -f alsa -i default -f v4l2 -s 640x480 -i /dev/video0 ''output''.mpg<br />
<br />
To use [[PulseAudio]] with an ALSA backend:<br />
<br />
$ ffmpeg -f alsa -i pulse -f v4l2 -s 640x480 -i /dev/video0 ''output''.mpg<br />
<br />
For a higher quality capture, try encoding the output using higher quality codecs:<br />
<br />
$ ffmpeg -f alsa -i default -f v4l2 -s 640x480 -i /dev/video0 -acodec flac \<br />
-vcodec libx264 ''output''.mkv<br />
<br />
== Package removal ==<br />
<br />
[[pacman]] will not [[Pacman#Removing_packages|remove]] configuration files outside of the defaults that were created during package installation. This includes user-created preset files.<br />
<br />
== See also ==<br />
<br />
* [http://mewiki.project357.com/wiki/X264_Settings x264 Settings] - MeWiki documentation<br />
* [http://ffmpeg.org/ffmpeg-doc.html FFmpeg documentation] - official documentation<br />
* [http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-x264.html Encoding with the x264 codec] - MEncoder documentation<br />
* [http://avidemux.org/admWiki/doku.php?id=tutorial:h.264 H.264 eEcoding guide] - Avidemux wiki<br />
* [http://howto-pages.org/ffmpeg/ Using FFmpeg] - Linux how to pages<br />
* [http://ffmpeg.org/general.html#Supported-File-Formats-and-Codecs List] of supported audio and video streams</div>AsmundErhttps://wiki.archlinux.org/index.php?title=Bluetooth&diff=262236Bluetooth2013-06-10T18:51:48Z<p>AsmundEr: Added "Out of date" template. The state of this page was unhelpful in setting up Bluetooth.</p>
<hr />
<div>[[Category:Bluetooth]]<br />
[[cs:Bluetooth]]<br />
[[de:Bluetooth]]<br />
[[es:Bluetooth]]<br />
[[fr:Bluetooth]]<br />
[[it:Bluetooth]]<br />
[[ru:Bluetooth]]<br />
[[zh-CN:Bluetooth]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers the installation and use of Bluetooth on Arch Linux.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Bluetooth mouse configuration}}<br />
{{Article summary end}}<br />
<br />
{{Out of date|Several generations of various deprecated tools are mentioned. bluez4 and bluez are confused. This article needs cleanup from someone who knows what commands belong in which packages.}}<br />
<br />
[http://www.bluetooth.org/ Bluetooth] is a standard for the short-range wireless interconnection of cellular phones, computers, and other electronic devices. In Linux, the canonical implementation of the Bluetooth protocol stack is [http://www.bluez.org/ BlueZ].<br />
<br />
== Installation ==<br />
To use Bluetooth, [[pacman|install]] {{Pkg|bluez}}, available in the [[Official Repositories]]. The {{ic|dbus}} daemon(start automatically by systemd) is used to read settings and for PIN pairing, while the {{ic|bluetooth}} daemon is required for the Bluetooth protocol.<br />
<br />
Start the bluetooth service:<br />
# systemctl start bluetooth.service<br />
<br />
Enable the bluetooth service at system boot up:<br />
# systemctl enable bluetooth.service<br />
<br />
== Graphical front-ends ==<br />
<br />
The following packages allow for a graphical interface to customize Bluetooth.<br />
<br />
=== Blueman ===<br />
<br />
[http://blueman-project.org Blueman] is a full featured Bluetooth manager written in [[GTK+]] and, as such, is recommended for [[GNOME]] or [[Xfce]]. You can install Blueman with the package {{Pkg|blueman}}, available in the [[Official Repositories]].<br />
<br />
Be sure that {{ic|bluetooth}} daemon is running as described above, and execute {{ic|blueman-applet}}. To make the applet run on login add {{ic|blueman-applet}} either under ''System -> Preferences -> Startup Applications'' (GNOME) or ''Xfce Menu -> Settings -> Session and Startup'' (Xfce).<br />
<br />
In order for a user to add and manage Bluetooth devices using Blueman, the user must be added to the 'lp' group. See /etc/dbus-1/system.d/bluetooth.conf for the section that enables users of the 'lp' group to communicate with the Bluetooth daemon.<br />
<br />
{{Note|If you are running Blueman outside GNOME/GDM (e.g., in Xfce using the {{ic|startx}} command) you should add {{ic|. /etc/X11/xinit/xinitrc.d/*}} on top of your {{ic|~/.xinitrc}} to make Nautilus capable to browse your devices.}}<br />
<br />
To receive files don't forget to right click on the ''Blueman tray icon -> Local Services -> Transfer -> File Receiving" and tick the square box next to "Enabled".<br />
<br />
==== Script for Thunar ====<br />
If you are not using Nautilus (for example Thunar) you may find the following script useful:<br />
{{hc|obex_thunar.sh|<br />
#!/bin/bash<br />
fusermount -u ~/bluetooth<br />
obexfs -b $1 ~/bluetooth<br />
thunar ~/bluetooth<br />
}}<br />
Now you will need to move the script to an appropriate location (e.g., {{ic|/usr/bin}}). After that, mark it as executable:<br />
{{bc|chmod +x /usr/bin/obex_thunar.sh}}<br />
The last step is to change the line in ''Blueman tray icon -> Local Services -> Transfer -> Advanced'' to {{ic|obex_thunar.sh %d}}.<br />
<br />
=== GNOME Bluetooth ===<br />
<br />
[http://live.gnome.org/GnomeBluetooth GNOME Bluetooth] is a fork of the old ''bluez-gnome'' and is focused on integration with the [[GNOME]] desktop environment. GNOME Bluetooth is required by {{Pkg|gnome-shell}}, so you should already have it installed if you are running GNOME 3. Otherwise, it can be installed with the package {{Pkg|gnome-bluetooth}}.<br />
<br />
Run {{ic|bluetooth-applet}} for a nice Bluetooth applet. You should now be able to setup devices and send files by right-clicking the Bluetooth icon. To make the applet run on login, add it to ''System -> Preferences -> Startup Applications''.<br />
<br />
To add a Bluetooth entry to the ''SendTo'' menu in Thunar's file properties menu, see instructions [http://thunar.xfce.org/pwiki/documentation/sendto_menu here].<br />
<br />
=== BlueDevil ===<br />
<br />
The Bluetooth tool for [[KDE]] is [https://projects.kde.org/projects/extragear/base/bluedevil BlueDevil]. It can be installed with the package {{Pkg|bluedevil}}, available in the [[Official Repositories]].<br />
<br />
Make sure {{ic|bluetooth}} daemon is running, as described above. You should get a Bluetooth icon both in Dolphin and in the system tray, from which you can configure BlueDevil and detect Bluetooth devices by clicking the icon. You can also configure BlueDevil from the KDE System Settings<br />
<br />
=== Fluxbox, Openbox, other WM ===<br />
Of course you can still use the preceding applications even if GNOME, Xfce or KDE are not your desktop manager. This list should help you figuring out which application does what:<br />
* bluetooth-applet -- tray icon with access to settings, pairing wizard, management of known devices<br />
* /usr/lib/gnome-user-share/gnome-user-share -- needs to be running if you're about to receive files via obexBT from a paired/bonded device<br />
<br />
if you're receiving an error during transmission and/or there's no file received add this into<br />
<br />
{{ic|/etc/dbus-1/system.d/bluetooth.conf}}<br />
<policy user="your_user_id"><br />
<allow own="org.bluez"/><br />
<allow send_destination="org.bluez"/><br />
<allow send_interface="org.bluez.Agent"/><br />
</policy><br />
<br />
* bluetooth-wizard -- for new devices to be paired<br />
* bluetooth-properties -- accessible also via bluetooth-applet icon<br />
* gnome-file-share-properties -- permissions on receiving files via bluetooth<br />
* bluez-sendto -- gui for sending files to a remote device<br />
<br />
== Manual configuration ==<br />
<br />
To configure BlueZ manually, you may need to edit the configuration files in {{ic|/etc/bluetooth}}. These are:<br />
audio.conf<br />
input.conf<br />
main.conf<br />
network.conf<br />
rfcomm.conf<br />
<br />
The default configuration should work for most purposes. Most configuration options are well-documented in these files, so customization is a simple matter of reading the option descriptions. For general options, start with {{ic|main.conf}}.<br />
<br />
<br />
=== Audio Streaming ===<br />
<br />
You can use {{aur|bluez-tools}} from the [[AUR]] with pulseaudio to stream audio to a bluetooth headset. <br />
Find the MAC of the headset:<br />
$ hcitool scan<br />
Connect to the headset:<br />
$ bt-audio -c XX:XX:XX:XX:XX:XX<br />
Open pulseaudio volume control:<br />
$ pavucontrol<br />
The headset should show up in the Configuration tab.<br />
<br />
== Pairing ==<br />
Many bluetooth devices require [http://en.wikipedia.org/wiki/Bluetooth#Pairing pairing].<br />
The exact procedure depends on the devices involved and their input functionality.<br />
<br />
The procedure on a mobile may be as follows:<br />
* The computer sends a connect request to the mobile. <br />
* A pin, determined by the computer, is prompted for at the mobile<br />
* The same key must be re-entered at the computer.<br />
<br />
To pair with a device without using the gnome-bluez package, the ''bluez-simple-agent'' utility that comes with the bluez package can be used. This utility depends on three packages from [extra]:<br />
<br />
# pacman -S python2-dbus python2-gobject dbus-glib<br />
<br />
First, scan for external devices:<br />
$ hcitool scan<br />
<br />
Run the script as root:<br />
<br />
# bluez-simple-agent<br />
<br />
The message "Agent registered" should be returned, press control-c to quit. <br />
<br />
Below is a basic example of pairing with a specific device. The script will ask for the passcode, enter the code and confirm with enter.<br />
<br />
# bluez-simple-agent hci0 00:11:22:33:AA:BB<br />
<br />
{{note|bluez-simple-agent is only needed once for pairing a device, not every time you want to connect.}}<br />
<br />
See the Examples section below for pairing examples with various devices.<br />
<br />
== Using Obex for sending and receiving files ==<br />
Another option, rather than using KDE or Gnome Bluetooth packages, is Obexfs which allows you to mount your phone and treat it as part of your filesystem. Note that to use Obexfs, you need a device that provides an Obex FTP service.<br />
<br />
To install;<br />
# pacman -S obexfs<br />
<br />
and then your phone can then be mounted running as root <br />
# obexfs -b <devices mac address> /mountpoint<br />
<br />
For more mounting options see http://dev.zuckschwerdt.org/openobex/wiki/ObexFs<br />
<br />
For devices don't support Obex FTP service, check if Obex Object Push is supported.<br />
<br />
# sdptool browse XX:XX:XX:XX:XX:XX<br />
<br />
Read the output, look for Obex Object Push, remember the channel for this service. If supported, you can use ussp-push to send files to this device:<br />
<br />
# ussp-push XX:XX:XX:XX:XX:XX@CHANNEL file wanted_file_name_on_phone<br />
<br />
== Examples ==<br />
<br />
=== Siemens S55 ===<br />
<br />
This is what I did to connect to my S55. (I have not figured out how to initiate the connection from the phone)<br />
* The steps under installation<br />
* <br />
$> hcitool scan<br />
Scanning ...<br />
XX:XX:XX:XX:XX:XX NAME<br />
$> B=XX:XX:XX:XX:XX:XX<br />
Start the simple-agent in a second terminal<br />
$> su -c bluez-simple-agent <br />
Password: <br />
Agent registered<br />
Back to the first console <br />
$> obexftp -b $B -l "Address book"<br />
# Phone ask for pin, I enter it and answer yes when asked if I want to save the device<br />
...<br />
<file name="5F07.adr" size="78712" modified="20030101T001858" user-perm="WD" group-perm="" /><br />
...<br />
$> obexftp -b 00:01:E3:6B:FF:D7 -g "Address book/5F07.adr"<br />
Browsing 00:01:E3:6B:FF:D7 ...<br />
Channel: 5<br />
Connecting...done<br />
Receiving "Address book/5F07.adr"... Sending "Address book"... done<br />
Disconnecting...done<br />
$> obexftp -b 00:01:E3:6B:FF:D7 -p a <br />
...<br />
Sending "a"... done<br />
Disconnecting...done<br />
<br />
=== Logitech Mouse MX Laser / M555b ===<br />
<br />
To quickly test the connection:<br />
<br />
$> hidd --connect XX:XX:XX:XX:XX:XX<br />
<br />
For automated reconnection, use your desktop wizard to configure the bluetooth mouse.<br />
If your desktop environment doesn't includes support for this task, see the [[Bluetooth mouse manual configuration]] guide.<br />
<br />
=== Motorola V900 ===<br />
<br />
After installing blueman and running blueman-applet, click "find me" under connections -> bluetooth in motorla device. In blueman-applet, scan devices, find the motorola, click "add" in blueman-applet. Click "bond" in blueman-applet, enter some pin, enter the same pin in motorola when it asks. In terminal:<br />
<br />
cd ~/<br />
mkdir bluetooth-temp<br />
obexfs -n xx:yy:zz:... ~/bluetooth-temp<br />
cd ~/bluetooth-temp<br />
<br />
and browse... Only audio, video, and pictures are available when you do this.<br />
<br />
=== Motorola RAZ ===<br />
<br />
> pacman -S obextool obexfs obexftp openobex bluez<br />
<br />
> lsusb<br />
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 002 Device 002: ID 03f0:171d Hewlett-Packard Wireless (Bluetooth + WLAN) Interface [Integrated Module]<br />
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
<br />
> hciconfig hci0 up<br />
<br />
> hciconfig<br />
hci0: Type: BR/EDR Bus: USB<br />
BD Address: 00:16:41:97:BA:5E ACL MTU: 1017:8 SCO MTU: 64:8<br />
UP RUNNING<br />
RX bytes:348 acl:0 sco:0 events:11 errors:0<br />
TX bytes:38 acl:0 sco:0 commands:11 errors:0<br />
<br />
> hcitool dev<br />
Devices:<br />
hci0 00:16:41:97:BA:5E<br />
<br />
'''Attention: make sure that bluetooth on your phone is enabled and your phone is visible! <br />
'''<br />
<br />
> hcitool scan<br />
Scanning ...<br />
00:1A:1B:82:9B:6D [quirxi]<br />
<br />
> hcitool inq<br />
Inquiring ...<br />
00:1A:1B:82:9B:6D clock offset: 0x1ee4 class: 0x522204<br />
<br />
> l2ping 00:1A:1B:82:9B:6D<br />
Ping: 00:1A:1B:82:9B:6D from 00:16:41:97:BA:5E (data size 44) ...<br />
44 bytes from 00:1A:1B:82:9B:6D id 0 time 23.94ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 1 time 18.85ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 2 time 30.88ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 3 time 18.88ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 4 time 17.88ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 5 time 17.88ms<br />
6 sent, 6 received, 0% loss<br />
<br />
> hcitool name 00:1A:1B:82:9B:6D<br />
[quirxi]<br />
<br />
# hciconfig -a hci0<br />
hci0: Type: BR/EDR Bus: USB<br />
BD Address: 00:16:41:97:BA:5E ACL MTU: 1017:8 SCO MTU: 64:8<br />
UP RUNNING<br />
RX bytes:9740 acl:122 sco:0 events:170 errors:0<br />
TX bytes:2920 acl:125 sco:0 commands:53 errors:0<br />
Features: 0xff 0xff 0x8d 0xfe 0x9b 0xf9 0x00 0x80<br />
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3<br />
Link policy:<br />
Link mode: SLAVE ACCEPT<br />
Name: 'BCM2045'<br />
Class: 0x000000<br />
Service Classes: Unspecified<br />
Device Class: Miscellaneous,<br />
HCI Version: 2.0 (0x3) Revision: 0x204a<br />
LMP Version: 2.0 (0x3) Subversion: 0x4176<br />
Manufacturer: Broadcoml / Corporation (15)<br />
<br />
> hcitool info 00:1A:1B:82:9B:6D<br />
Requesting information ...<br />
BD Address: 00:1A:1B:82:9B:6D<br />
Device Name: [quirxi]<br />
LMP Version: 1.2 (0x2) LMP Subversion: 0x309<br />
Manufacturer: Broadcom Corporation (15)<br />
Features: 0xff 0xfe 0x0d 0x00 0x08 0x08 0x00 0x00<br />
<3-slot packets> <5-slot packets> <encryption> <slot offset><br />
<timing accuracy> <role switch> <hold mode> <sniff mode><br />
<RSSI> <channel quality> <SCO link> <HV2 packets><br />
<HV3 packets> <A-law log> <CVSD> <power control><br />
<transparent SCO> <AFH cap. slave> <AFH cap. master><br />
<br />
'''Edit your main.conf and enter the proper class for your phone ( Class = 0x100100 ):'''<br />
> vim /etc/bluetooth/main.conf<br />
<br />
# Default device class. Only the major and minor device class bits are<br />
# considered.<br />
#Class = 0x000100<br />
Class = 0x100100<br />
<br />
> /etc/rc.d/dbus start<br />
:: Starting D-BUS system messagebus <br />
[DONE]<br />
<br />
> /etc/rc.d/bluetooth start<br />
:: Stopping bluetooth subsystem: pand dund rfcomm hidd bluetoothd<br />
[DONE]<br />
:: Starting bluetooth subsystem: bluetoothd<br />
<br />
'''Pairing with bluez-simple-agent only has to be done once. On your motorola-phone give 0000 in as your pin when phone asks for it !!'''<br />
> /usr/bin/bluez-simple-agent hci0 00:1A:1B:82:9B:6D<br />
RequestPinCode (/org/bluez/10768/hci0/dev_00_1A_1B_82_9B_6D)<br />
Enter PIN Code: 0000<br />
Release<br />
New device (/org/bluez/10768/hci0/dev_00_1A_1B_82_9B_6D)<br />
<br />
'''Now you can browse the filesystem of your phone with obexftp:'''<br />
> obexftp -v -b 00:1A:1B:82:9B:6D -B 9 -l<br />
Connecting..\done<br />
Tried to connect for 448ms<br />
Receiving "(null)"...-<?xml version="1.0" ?><br />
<!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd"><br />
<folder-listing><br />
<parent-folder /><br />
<folder name="audio" size="0" type="folder" modified="20101010T132323Z" user-perm="RW" /><br />
<folder name="video" size="0" type="folder" modified="20101010T132323Z" user-perm="RW" /><br />
<folder name="picture" size="0" type="folder" modified="20101010T132323Z" user-perm="RW" /><br />
</folder-listing><br />
done<br />
Disconnecting..\done<br />
<br />
'''Or you can mount your phone into a directory on your computer and treat it like a normal file system:'''<br />
<br />
> groupadd bluetooth<br />
> mkdir /mnt/bluetooth<br />
> chown root:bluetooth /mnt/bluetooth<br />
> chmod 775 /mnt/bluetooth<br />
> usermod -a -G bluetooth arno<br />
<br />
> obexfs -b 00:1A:1B:82:9B:6D /mnt/bluetooth/<br />
> l /mnt/bluetooth/<br />
total 6<br />
drwxr-xr-x 1 root root 0 10. Okt 13:25 .<br />
drwxr-xr-x 5 root root 4096 10. Okt 10:08 ..<br />
drwxr-xr-x 1 root root 0 10. Okt 2010 audio<br />
drwxr-xr-x 1 root root 0 10. Okt 2010 picture<br />
drwxr-xr-x 1 root root 0 10. Okt 2010 video<br />
<br />
=== Pairing with an iPhone using bluez-simple-agent ===<br />
<br />
Assuming a bluetooth device called hci0 and an iPhone that showed up in a hcitool scan as '00:00:DE:AD:BE:EF':<br />
<br />
# bluez-simple-agent hci0 00:00:DE:AD:BE:EF<br />
Passcode:<br />
<br />
=== Headset and Alsa Devices ===<br />
1. First if you have not already, install bluez<br />
# pacman -S bluez<br />
2. Scan for your device<br />
$ hcitool (-i <optional hci#>***) scan<br />
3. Pair your headset with your device<br />
$ bluez-simple-agent (optional hci# ***) XX:XX:XX:XX:XX:XX<br />
and put in your pin (0000 or 1234, etc)<br />
4. Add this to your/etc/asound.conf file<br />
#/etc/asound.conf<br />
<br />
pcm.btheadset {<br />
type plug<br />
slave {<br />
pcm {<br />
type bluetooth<br />
device XX:XX:XX:XX:XX:XX <br />
profile "auto"<br />
} <br />
} <br />
hint {<br />
show on<br />
description "BT Headset"<br />
} <br />
}<br />
ctl.btheadset {<br />
type bluetooth<br />
} <br />
<br />
5. Check to see if it has been added to alsa devices<br />
$ aplay -L<br />
<br />
6. Now play with aplay:<br />
$ aplay -D btheadset /path/to/audio/file<br />
<br />
or Mplayer:<br />
$ mplayer -ao alsa:device=btheadset /path/to/audio/or/video/file<br />
<br />
*** To find hci# for a usb dongle, type in <br />
$ hcitool dev<br />
<br />
=== Microsoft Bluetooth Mobile Keyboard 6000 ===<br />
<br />
1. Scan for your device<br />
$ hcitool (-i <optional hci#>***) scan<br />
Scanning ...<br />
00:11:22:33:44:55 Microsoft Bluetooth Mobile Keyboard 6000<br />
<br />
<br />
2. On second console run as root (do not terminate):<br />
# bluez-simple-agent<br />
Agent registered<br />
<br />
3. Back on first console run:<br />
$ bluez-simple-agent hci0 00:11:22:33:44:55<br />
Enter PIN Code: 1234<br />
(now enter that pin on the keyboard and press enter)<br />
Release<br />
New device (/org/bluez/5373/hci0/dev_00_11_22_33_44_55)<br />
<br />
4.<br />
$ bluez-test-device trusted 00:11:22:33:44:55<br />
<br />
5.<br />
$ bluez-test-input connect 00:11:22:33:44:55<br />
<br />
No your keyboard should work. You can terminate bluez-simple-agent on second console with Ctrl-C<br />
<br />
== Troubleshooting ==<br />
<br />
=== Segfaults in Bluez 4.95 ===<br />
If bluetoothd stops working after enabling or disabling your bluetooth device via rfkill or gnome-bluetooth applet, look at your dmesg output. If it looks like:<br />
<br />
bluetoothd[2330]: segfault at 1 ip 00007fcef2327b75 sp 00007fff9f769cb0 error 4 in libglib-2.0.so.0.2800.8[7fcef22ca000+e9000]<br />
<br />
then you should consider downgrading to 4.94 (just grab the PKGBUILD/etc from arch and change version to 4.94 and correct the md5sum for bluez) or wait for an update of bluez. [https://bugs.archlinux.org/task/25088?project=1&openedfrom=-1+week Here] is a (arch) bug report about it.<br />
<br />
=== passkey-agent ===<br />
$> passkey-agent --default 1234<br />
Can't register passkey agent<br />
The name org.bluez was not provided by any .service files<br />
You probably started {{ic|/etc/rc.d/bluetooth}} before {{ic|/etc/rc.d/dbus}}<br />
$> hciconfig dev<br />
# (no listing)<br />
Try running {{ic|hciconfig hc0 up}}<br />
<br />
=== Blueman ===<br />
If blueman-applet fails to start, try removing the entire ''/var/lib/bluetooth'' directory and restarting the machine (or just the hal, dbus, and bluetooth services).<br />
# rm -rf /var/lib/bluetooth<br />
# reboot<br />
<br />
If you see a notification saying '''Incoming file over Bluetooth''' then this means that the device isn't marked as trusted. Mark it as trusted and try again (looking at the code, it looks like some buttons should be displayed in the notification, but I don't see them).<br />
<br />
=== gnome-bluetooth ===<br />
If you see this when trying to enable receiving files in bluetooth-properties:<br />
Bluetooth OBEX start failed: Invalid path<br />
Bluetooth FTP start failed: Invalid path<br />
Then run:<br />
# pacman -S xdg-user-dirs<br />
$ xdg-user-dirs-update<br />
You can edit the paths using:<br />
$ vi ~/.config/user-dirs.dirs<br />
<br />
=== Bluetooth USB Dongle ===<br />
If you are using a USB dongle, you should check that your Bluetooth dongle is recognized. You can do that by inspecting {{ic|/var/log/messages.log}} when plugging in the USB dongle (or running {{ic|journalctl -f}} with systemd). It should look something like the following (look out for hci):<br />
<br />
# tail -f /var/log/messages.log<br />
Feb 20 15:00:24 hostname kernel: [ 2661.349823] usb 4-1: new full-speed USB device number 3 using uhci_hcd<br />
Feb 20 15:00:24 hostname bluetoothd[4568]: HCI dev 0 registered<br />
Feb 20 15:00:24 hostname bluetoothd[4568]: Listening for HCI events on hci0<br />
Feb 20 15:00:25 hostname bluetoothd[4568]: HCI dev 0 up<br />
Feb 20 15:00:25 hostname bluetoothd[4568]: Adapter /org/bluez/4568/hci0 has been enabled<br />
<br />
For a list of supported hardware please refer to the [[Bluetooth#Resources|resources]] section on this page.<br />
<br />
If you only get the first two lines, you may see that it found the device but you need to bring it up.<br />
Example:<br />
<br />
hciconfig -a hci0<br />
hci0: Type: USB<br />
BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0<br />
DOWN <br />
RX bytes:0 acl:0 sco:0 events:0 errors:0<br />
TX bytes:0 acl:0 sco:0 commands:0 errors:<br />
sudo hciconfig hci0 up<br />
hciconfig -a hci0<br />
hci0: Type: USB<br />
BD Address: 00:02:72:C4:7C:06 ACL MTU: 377:10 SCO MTU: 64:8<br />
UP RUNNING <br />
RX bytes:348 acl:0 sco:0 events:11 errors:0<br />
TX bytes:38 acl:0 sco:0 commands:11 errors:0<br />
<br />
If this fails with an error like:<br />
Operation not possible due to RF-kill<br />
it could be due either to the {{ic|rfkill}} utility, in which case it should be resolved with<br />
# rfkill unblock all<br />
or, it could simply be the hardware switch of the computer. The hardware bluetooth switch (at least sometimes) controls access to USB bluetooth dongles also. Flip/press this switch and try bringing the device up again.<br />
<br />
To verify that the device was detected you can use {{ic|hcitool}} which is part of the {{ic|bluez-utils}}. You can get a list of available devices and their identifiers and their MAC address by issuing:<br />
<br />
$ hcitool dev<br />
Devices:<br />
hci0 00:1B:DC:0F:DB:40<br />
<br />
More detailed informations about the device can be retrieved by using {{ic|hciconfig}}.<br />
<br />
$ hciconfig -a hci0<br />
hci0: Type: USB<br />
BD Address: 00:1B:DC:0F:DB:40 ACL MTU: 310:10 SCO MTU: 64:8<br />
UP RUNNING PSCAN ISCAN <br />
RX bytes:1226 acl:0 sco:0 events:27 errors:0<br />
TX bytes:351 acl:0 sco:0 commands:26 errors:0<br />
Features: 0xff 0xff 0x8f 0xfe 0x9b 0xf9 0x00 0x80<br />
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 <br />
Link policy: RSWITCH HOLD SNIFF PARK <br />
Link mode: SLAVE ACCEPT <br />
Name: 'BlueZ (0)'<br />
Class: 0x000100<br />
Service Classes: Unspecified<br />
Device Class: Computer, Uncategorized<br />
HCI Ver: 2.0 (0x3) HCI Rev: 0xc5c LMP Ver: 2.0 (0x3) LMP Subver: 0xc5c<br />
Manufacturer: Cambridge Silicon Radio (10)<br />
<br />
=== Logitech Bluetooth USB Dongle ===<br />
There are Logitech dongles (ex. Logitech MX5000) that can work in two modes Embedded and HCI. In embedded mode dongle emulates a USB device so it seems to your PC that your using a normal USB mouse/keyoard.<br />
<br />
If you hold the little red Button on the USB BT mini-receiver it will enable the other mode. Hold the red button on the BT dongle and plug it into the computer, and after 3-5 seconds of holding the button, the Bluetooth icon will appear in the system tray. [http://ubuntuforums.org/showthread.php?t=1332197 Discussion]<br />
<br />
=== hcitool scan: Device not found ===<br />
* On some Dell laptops (e.g. Studio 15) you have to switch the Bluetooth mode from HID to HCI using<br />
# hid2hci<br />
<br />
{{Note|hid2hci is no longer in the $PATH, it is under /lib/udev/hid2hci, but udev should run it automatically for you.}}<br />
<br />
* If the device won't show up and you have a Windows operating system on your machine, try booting it and enable the bluetooth adapter from windows.<br />
<br />
* Sometimes also this simple command helps:<br />
# hciconfig hci0 up<br />
<br />
=== My computer isn't visible ===<br />
Can't discover computer from your phone? Enable PSCAN and ISCAN:<br />
# enable PSCAN and ISCAN<br />
$ hciconfig hci0 piscan <br />
# check it worked<br />
$ hciconfig <br />
hci0: Type: USB<br />
BD Address: 00:12:34:56:78:9A ACL MTU: 192:8 SCO MTU: 64:8<br />
'''UP RUNNING PSCAN ISCAN'''<br />
RX bytes:20425 acl:115 sco:0 events:526 errors:0<br />
TX bytes:5543 acl:84 sco:0 commands:340 errors:0<br />
<br />
{{Note | Check DiscoverableTimeout and PairableTimeout in /etc/bluetooth/main.conf}}<br />
<br />
Try changing device class in /etc/bluetooth/main.conf as following<br />
# Default device class. Only the major and minor device class bits are<br />
# considered.<br />
#Class = 0x000100 (from default config)<br />
Class = 0x100100<br />
<br />
This was the only solution to make my computer visible for my phone. <br />
<br />
=== Nautilus cannot browse files ===<br />
If nautilus doesn't open and show this error:<br />
Nautilus cannot handle obex: locations. Couldn't display "obex://[XX:XX:XX:XX:XX:XX]/".<br />
Install gvfs-obexftp package:<br />
# pacman -S gvfs-obexftp<br />
<br />
=== Bluetooth is disabled when starting GNOME ===<br />
If you have {{ic|dbus}} and {{ic|bluetooth}} backgrounded (@) in your {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}}, it might happen that {{ic|bluetooth}} will be disabled when starting up GNOME. To solve this, make sure {{ic|dbus}} is not backgrounded.<br />
<br />
=== Sennheiser MM400 Headset connection problems ===<br />
If your {{ic|Sennheiser MM400 Headset}} immediately disconnects after connecting as {{ic|Headset Service}} with Blueman, try to connect it as {{ic|Audio Sink}}. Afterwards you can change the headset's {{ic|Audio Profile}} to {{ic|Telephony Duplex}} with a right click in Blueman.<br />
With this option headset functionality will be available although the headset was only connected as {{ic|Audio Sink}} in first place and no disconnection will happen (tested with bluez 4.96-3, pulseaudio 1.1-1 and blueman 1.23-2).<br />
<br />
=== My device is paired but no sound is played from it ===<br />
Try to first inspect '''/var/log/messages.log'''<br />
{{bc|# tail /var/log/messages.log<br />
Jan 12 20:08:58 localhost pulseaudio[1584]: [pulseaudio] module-bluetooth-device.c: Service not connected<br />
Jan 12 20:08:58 localhost pulseaudio[1584]: [pulseaudio] module-bluetooth-device.c: Bluetooth audio service not available}}<br />
<br />
If you see such messages, try first:<br />
{{bc|# pactl load-module module-bluetooth-device}}<br />
<br />
If the module fails to work, do this workaround:<br />
Open '''/etc/bluetooth/audio.conf''' and add after '''[General]''' (on a new line)<br />
{{bc|Enable&#61;Socket}}<br />
Then restart the bluetooth daemon with {{ic|/etc/rc.d/bluetooth restart}}.<br />
Pair again your device, and you should find it in the pulseaudio settings (advanced settings for the sound)<br />
<br />
[http://wiki.gentoo.org/index.php?title=Bluetooth_Headset&redirect=no More information on Gentoo Wiki]<br />
<br />
If after fixing this you still can't get sound, try using blueman (this is the only one that works for me), make sure that notify-osd is installed or it might show you weird error messages like this one: "Stream setup failed"<br />
<br />
fail (/usr/lib/python2.7/site-packages/blueman/gui/manager/ManagerDeviceMenu.py:134)<br />
fail (DBusException(dbus.String(u'Stream setup failed'),),)<br />
<br />
== See also ==<br />
*[http://www.gentoo.org/doc/en/bluetooth-guide.xml Gentoo Linux Bluetooth Guide]<br />
*[http://en.opensuse.org/HCL:Bluetooth openSUSE Bluetooth Hardware Compatibility List]<br />
*[http://linuxgazette.net/109/oregan3.html Accessing a Bluetooth phone (Linux Gazette)]<br />
*[http://www.adamish.com/blog/#a000361 Bluetooth computer visibility]<br />
*[http://www.elstel.org/MobilePhone.html Bluetooth for Your Mobile Phone: Bluetooth Pairing, Data Synchronization, Photo Download, Internet Dial-Up (Tethering)]</div>AsmundErhttps://wiki.archlinux.org/index.php?title=Dropbox&diff=247969Dropbox2013-02-20T11:36:20Z<p>AsmundEr: /* Automatically Starting Dropbox */ Changed link for daemon mode to the systemd one</p>
<hr />
<div>[[Category:Internet Applications]]<br />
[[de:Dropbox]]<br />
[[it:Dropbox]]<br />
[[zh-TW:Dropbox]]<br />
[https://www.dropbox.com Dropbox] is a file sharing system that recently introduced a GNU/Linux client. Use it to transparently sync files across computers and architectures. Simply drop files into your {{ic|~/Dropbox}} folder, and they will automatically sync to your centralized repository.<br />
<br />
==Installation==<br />
<br />
{{AUR|dropbox}} can be installed from the [[Arch User Repository|AUR]]. Alternatively, {{AUR|dropbox-experimental}} is also available.<br />
<br />
# After installing the package, you can start Dropbox from your application menu or run {{ic|dropboxd}} from the command-line. The client icon will appear in the system tray.<br />
# A pop-up will notify you that Dropbox is running from an unsupported location. Click on Don't ask again since you know that you have installed it from AUR rather than from the official homepage.<br />
# Eventually a pop-up will ask you to log in to your Dropbox account or create a new account. Enter your credentials.<br />
# After some time you will see a "Welcome to Dropbox" pop-up, which will give you the opportunity to view a short tour of Dropbox.<br />
# Press the "Finish and go to My Dropbox".<br />
<br />
For [[KDE]] users, no further steps are required (it is enough to install the above {{AUR|dropbox}} package from the AUR), as KDE saves running applications when logging out and restarts them automatically. Similarly for [[Xfce]] users, dropbox will be restarted automatically next time you login since the {{ic|dropbox.desktop}} file be placed in {{ic|~/.config/autostart}}.<br />
<br />
===Optional packages===<br />
<br />
*For a command-line interface, install {{AUR|dropbox-cli}} from the [[Arch User Repository|AUR]].<br />
*For integration with Nautilus, install {{AUR|nautilus-dropbox}} from the AUR. The Nautilus plugin will start Dropbox automatically.<br />
*For integration with Nemo, install {{AUR|nemo-dropbox-git}} from the AUR.<br />
*For integration with [[Thunar]], install {{AUR|thunar-dropbox}} from the AUR.<br />
*For [[KDE]] users, there is a KDE client available: {{AUR|kfilebox}} from the AUR.<br />
<br />
===Automatically Starting Dropbox===<br />
<br />
Dropbox can be automatically started by adding {{Ic|dropboxd}} to {{ic|~/.xinitrc}} (or {{ic|~/.config/openbox/autostart}}, depending on your setup). Alternatively, you can [[#Run as daemon with systemd|start it as a daemon]].<br />
<br />
== Alternative to install: use the web interface ==<br />
<br />
If all you need is basic access to the files in your Dropbox, you can use the web interface at https://www.dropbox.com/ to upload and download files to your Dropbox. This can be a viable alternative to running a Dropbox daemon and mirroring all the files on your own machine.<br />
<br />
==Run as daemon with systemd==<br />
<br />
Recent versions of Dropbox come with a systemd service file. Running Dropbox as a daemon does not give you an icon in the system tray, but syncs your files and folders in the background.<br />
<br />
To enable the daemon for your user, so that it will start at login:<br />
$ sudo systemctl enable dropbox@<user>.service<br />
Note that you have to manually start Dropbox the first time after installation, so that it runs through the login and setup screen. The daemon can be used subsequently.<br />
<br />
==Daemon (initscripts, deprecated)==<br />
{{out of date|Initscripts are deprecated; you should use the systemd method mentioned above.}}<br />
<br />
To run Dropbox as a daemon similarly to {{Ic|sshd}} or {{Ic|vsftpd}}, simply do one of the following:<br />
<br />
===dropbox-daemon Method===<br />
<br />
Install {{AUR|dropbox-daemon}}<br />
and configure your username in {{ic|/etc/conf.d/dropboxd.conf}}<br />
<br />
This allows you to start or stop Dropbox just like any other service.<br />
<br />
# /etc/rc.d/dropboxd start<br />
# /etc/rc.d/dropboxd stop<br />
# /etc/rc.d/dropboxd restart<br />
<br />
Place {{Ic|dropboxd}} in the DAEMONS array in {{ic|/etc/rc.conf}} for it to start at boot.:<br />
DAEMONS=(... '''@dropboxd''' ...)<br />
<br />
===Manual Method===<br />
<br />
As root, copy this into a file called {{ic|/etc/rc.d/dropboxd}} and set USER to your username.<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
<br />
USER=yourusername<br />
<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
PID=`pidof -o %PPID /opt/dropbox/dropbox`<br />
<br />
case "$1" in<br />
start)<br />
stat_busy "Starting Dropbox Service"<br />
LANG=$LOCALE<br />
[ -z "$PID" ] && su -c "/usr/bin/dropboxd &" $USER<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
add_daemon dropboxd<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping Dropbox Service"<br />
[ ! -z "$PID" ] && kill $PID > /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon dropboxd<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 3<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
;;<br />
esac<br />
exit 0<br />
</nowiki>}}<br />
<br />
An Organized Way:<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
USER=yourusername<br />
DROPBOXD_PATH='/usr/bin/dropboxd'<br />
DROPBOX_PATH='/opt/dropbox/dropbox'<br />
<br />
PID=`pidof -o %PPID $DROPBOX_PATH`<br />
<br />
case "$1" in<br />
start)<br />
stat_busy "Starting Dropbox Service"<br />
if [ $USER = 'yourusername' ]; then<br />
echo "Please edit /etc/rc.d/dropboxd' 'USER' before using this script."<br />
stat_fail<br />
else<br />
LANG=$LOCALE<br />
[ -z "$PID" ] && su -c "$DROPBOXD_PATH &" $USER<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
add_daemon dropboxd<br />
stat_done<br />
fi<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping Dropbox Service"<br />
[ ! -z "$PID" ] && kill $PID > /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon dropboxd<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 3<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
;;<br />
esac<br />
exit 0<br />
</nowiki>}}<br />
<br />
Make the file executable with<br />
# chmod +x /etc/rc.d/dropboxd<br />
<br />
This allows you to start or stop {{Ic|dropboxd}} just like any other service. For example:<br />
<br />
# /etc/rc.d/dropboxd start<br />
# /etc/rc.d/dropboxd stop<br />
# /etc/rc.d/dropboxd restart<br />
<br />
To start it at boot, add it to your DAEMONS array in rc.conf: {{ic|/etc/rc.conf}}:<br />
DAEMONS=(... '''@dropboxd''' ...)<br />
<br />
==Without Nautilus (Another Way)==<br />
<br />
Another way to use Dropbox without Nautilus but with another file manager like Thunar or Pcmanfm is described below:<br />
<br />
1. Create a fake Nautilus script that will launch Thunar:<br />
$ sudo touch /usr/bin/nautilus && sudo chmod +x /usr/bin/nautilus && sudo nano /usr/bin/nautilus<br />
<br />
2. Insert this text into the file, then save and exit:<br />
#!/bin/bash<br />
exec thunar $2<br />
exit 0<br />
<br />
3. Launch Dropbox<br />
$ dropboxd<br />
<br />
4. Click on the Dropbox tray icon to open your Dropbox folder in Thunar.<br />
<br />
{{Note|In this way there is no need to create a Dropbox daemon in {{ic|/etc/rc.d/}} and to start it at boot via {{ic|/etc/rc.conf}} or to make it start via your session manager: just leave the "Start Dropbox on system startup" option flagged in the Preferences window.}}<br />
<br />
{{Note|If you already have Nautilus installed but do not want to use it, don't modify the existing file under {{ic|/usr/bin}}, just change the {{ic|/usr/bin}} for {{ic|/opt/dropbox}} in the step 2 above, like this: {{Ic|$ sudo touch /opt/dropbox/nautilus && sudo chmod +x /opt/dropbox/nautilus && sudo nano /opt/dropbox/nautilus}}. Dropbox will look in this path first!}}<br />
<br />
==Securing Your Dropbox==<br />
<br />
If you want to store sensitive data in your Dropbox, you should encrypt it before. Syncing to Dropbox is encrypted, but all files are (for the time being) stored on the server unencrypted just as you put them in your Dropbox.<br />
<br />
* Dropbox works with [[TrueCrypt]], and after you initially uploaded the TrueCrypt volume to Dropbox, performance is quite okay, because Dropbox has a working binary diff.<br />
<br />
* Another possibility is to use [[EncFS]], which has the advantage that all files are encrypted separately, i.e. you do not have to determine in advance the size of the content you want to encrypt and your encrypted directory grows and shrinks while you add/delete/modify files in it. You can also mount an encrypted volume at startup using the {{ic|-S}} option of {{Ic|encfs}} to avoid having to input the passphrase, but note that your encrypted files are not secure from someone who has direct access to your computer.<br />
<br />
==Multiple Dropbox Instances==<br />
<br />
If you need to separate or distinguish your data, personal and work usage for example, you can subscribe to Dropbox with different email addresses and have multiple directories synced to different instances.<br />
<br />
The basic principle and general how-to are described in the [http://www.dropboxwiki.com/Multiple_Instances_On_Unix Dropbox Wiki].<br />
<br />
{{Note|When dealing with multiple instances you have to select the Dropbox destination folder, which the Dropbox installer asks in the last step; usage examples may be {{ic|/home/dropbox-personal}}, {{ic|/home/dropbox-work}}, and so on.}}<br />
<br />
For convenience, here is a script that I use to accomplish the task: just add a dir in the "dropboxes" list to have another instance of Dropbox, referring to the dir, loaded at script startup.<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash <br />
<br />
#******************************* <br />
# Multiple dropbox instances <br />
#******************************* <br />
<br />
dropboxes=(.dropbox-personal .dropbox-work) <br />
<br />
for dropbox in ${dropboxes[@]} <br />
do <br />
if ! [ -d $HOME/$dropbox ];then <br />
mkdir $HOME/$dropbox <br />
fi <br />
HOME=$HOME/$dropbox/ /usr/bin/dropbox start -i <br />
done <br />
</nowiki>}}<br />
<br />
==Dropbox on Laptops==<br />
<br />
Dropbox itself is pretty good at dealing with connectivity problems. If you have a laptop and roam between different network environments, Dropbox will have problems reconnecting if you do not restart it. The easiest way to solve this with [[netcfg]] is to use POST_UP and PRE_DOWN.<br />
<br />
In every network profile you use (or in the [[Netcfg#Per-interface_configuration]]), add the appropriate commands:<br />
{{bc|<nowiki><br />
POST_UP="any other code; su -c 'DISPLAY=:0 /usr/bin/dropboxd &' your_user"<br />
PRE_DOWN="any other code; killall dropbox"<br />
</nowiki>}}<br />
Obviously, your_user has to be edited and 'any other code;' can be omitted if you do not have any. The above will make sure that Dropbox is running only if there is a network profile active.<br />
<br />
If you have connectivity problem with [[NetworkManager]], [https://bbs.archlinux.org/viewtopic.php?pid=790905, this thread] on forum should be useful.<br />
<br />
==Known Issues==<br />
===Dropbox keeps saying Downloading files===<br />
But in fact now files are synced with your box. This problem is likely to appear when your Dropbox folder is located on a NTFS partition whose mount path contains spaces. See more in the [[https://bbs.archlinux.org/viewtopic.php?id=153368 forums]]. To resolve the problem pay attention to your entry in {{ic|/etc/fstab}}. Avoid spaces in the mount path and set write permissions:<br />
<br />
UUID=01CD2ABB65E17DE0 /run/media/username/Windows ntfs-3g uid=username,gid=users 0 0<br />
<br />
===Change the Dropbox location from the installation wizard===<br />
Some users experience the problem during setting-up Dropbox that they cannot select a Dropbox folder other than {{ic|/home/username/Dropbox}}. In this case when the window for changing the path is shown , hit CTRL+L, enter the location (e.g. /mnt/data/Dropbox) and click on the 'Choose' or 'Open' button.<br />
<br />
===Context menu entries in file manager do not work===<br />
Several file managers such as Thunar, Nautilus or its fork Nemo come with extensions that provide context menu entries for files and folders inside your Dropbox. Most of them will result in a browser action such as opening the file or folder in dropbox.com or sharing the link. If you experience these entries to not working, then you are likely to have not set the {{ic|$BROWSER}} variable which Dropbox requires. You can check that by <br />
<br />
echo $BROWSER<br />
<br />
To set your {{ic|$BROWSER}} variable open {{ic|~/.profile}} and replace {{ic|chromium}} with your default browser:<br />
<br />
if [ -n "$DISPLAY" ]; then<br />
BROWSER=chromium<br />
fi<br />
<br />
===Connecting...===<br />
{{Note|It seems that this issue has been fixed in later versions of dropbox (sometime before 1.6.0-2). It might be reasonable to test before installing one of the following scripts}}<br />
It may happen that Dropbox cannot connect successfully because it was loaded before an Internet connection was established. To solve the problem the content of the file {{ic|/opt/dropbox/dropboxd}} needs to be replaced with the following: <br />
<br />
<br />
#!/bin/sh<br />
<br />
# Copyright 2008 Evenflow, Inc., 2010 Dropbox<br />
#<br />
# Environment script for the dropbox executable.<br />
<br />
start_dropbox() {<br />
PAR=$(dirname $(readlink -f $0))<br />
OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH<br />
LD_LIBRARY_PATH=$PAR:$LD_LIBRARY_PATH <br />
<br />
TMP1=`ps ax|grep dropbox|grep -v grep`<br />
if [ -n "$TMP1" ]; then<br />
kill -9 $(pidof dropbox) >/dev/null 2>&1<br />
fi<br />
exec $PAR/dropbox $@ &<br />
}<br />
<br />
do_dropbox() {<br />
start_dropbox >/dev/null 2>&1<br />
while [ 1 ]; do<br />
sleep 5<br />
ERROR="$(net_test)"<br />
if [ -n "$ERROR" ]; then<br />
LAST_ERROR=1<br />
else<br />
if [ -n "$LAST_ERROR" ]; then<br />
# Connection seems to be up but last cycle was down<br />
LAST_ERROR=""<br />
start_dropbox >/dev/null 2>&1<br />
fi<br />
fi<br />
done<br />
<br />
}<br />
<br />
net_test() {<br />
TMP1="$(ip addr |grep "inet " |grep -v "127.0.0.1")"<br />
[ -z "$TMP1" ] && echo "error"<br />
}<br />
<br />
do_dropbox<br />
<br />
Following is an alternative script that will check for an actual Internet connection by using {{pkg|curl}} to check if any entry in a list of hosts and IP addresses is available.<br />
If none of the specified hosts are available, the script will wait and try again (albeit not forever).<br />
The way the script increments the waiting time is quite messy, but the logic goes like this:<br />
<br />
Start with a wait time of 5 seconds.<br />
<br />
Multiply by 1.5.<br />
<br />
Do this as long as the wait time is less than 1500 seconds (25 minutes), and the check_net()<br />
function returns non-zero values (failure).<br />
<br />
#!/bin/bash<br />
<br />
# Copyright 2008 Evenflow, Inc., 2010 Dropbox<br />
#<br />
# Environment script for the dropbox executable.<br />
<br />
WAIT_TIME=5 #initial time to wait between checking the internet connection<br />
#HOSTS="www.google.com www.wikipedia.org 8.8.8.8 208.67.222.222"<br />
HOSTS="www.google.com www.wikipedia.org "<br />
<br />
PAR=$(dirname $(readlink -f $0))<br />
OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH<br />
LD_LIBRARY_PATH=$PAR${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH<br />
<br />
#non-zero exit code iff none of the hosts could be reached<br />
check_net() {<br />
local ret=1<br />
for i in $HOSTS; do<br />
#ping -w2 -c2 $i > /dev/null 2>&1 && ret=0 && break<br />
curl -o /dev/null $i > /dev/null 2>&1 && ret=0 && break<br />
done<br />
echo $ret<br />
}<br />
<br />
#if dropbox is running; kill it. Then start dropbox<br />
start_dropbox() {<br />
local tmp=`ps ax|grep -E "[0-9] $PAR/dropbox"|grep -v grep`<br />
if [ -n "$tmp" ]; then<br />
kill -9 $(pidof dropbox) > /dev/null 2>&1<br />
fi<br />
exec $PAR/dropbox $@ > /dev/null 2>&1 &<br />
}<br />
<br />
#loop over: start dropbox iff check_net returns 0<br />
#loop (and with it, the entire script) terminates when dropbox has been restarted,<br />
#+ or the waiting time has exeeded 1500 seconds (it grows 50% with each iteration of the loop)<br />
attempt_startup() {<br />
while [ $WAIT_TIME -lt 1500 ] ; do<br />
if [ $(check_net) -eq 0 ]; then<br />
start_dropbox<br />
exit<br />
fi<br />
sleep $WAIT_TIME<br />
#WAIT_TIME=$(($WAIT_TIME+$WAIT_TIME/2))<br />
let "WAIT_TIME += WAIT_TIME/2"<br />
done<br />
}<br />
<br />
start_dropbox<br />
attempt_startup &<br />
<br />
{{Tip|When you update Dropbox via your preferred AUR helper, the file will (usually) be reverted to the default one. You can prevent this with {{ic|chattr +i /opt/dropbox/dropboxd}} which will make the file immutable. To reverse this action simply use {{ic|chattr -i /opt/dropbox/dropboxd}}. }}<br />
<br />
===Dropbox does not start - "This is usually because of a permission error"===<br />
<br />
====Check permissions====<br />
Make sure that you own Dropbox's directories before running the application. This includes<br />
*{{ic|~/.dropbox}} - Dropbox's configuration directory<br />
*{{ic|~/Dropbox}} - Dropbox's download directory (default)<br />
You can ensure this by changing their owner with {{ic|chown -R}}.<br />
<br />
This error could also be caused by {{ic|/var}} being full.<br />
<br />
====Re-linking your account====<br />
[https://www.dropbox.com/help/72 Dropbox's FAQ] suggests that this error may be caused by misconfiguration and is fixed by (re)moving the current configuration folder<br />
# mv ~/.dropbox ~/.dropbox.old<br />
and restarting Dropbox.<br />
<br />
====Errors caused by running out of space====<br />
A common error that might happen is that there is no more available space on your {{ic|/tmp}} and {{ic|/var}} partitions. If this happens, Dropbox will crash on startup with the following error in its log:<br />
{{bc|<br />
Exception: Not a valid FileCache file<br />
}}<br />
A detailed story of such an occurrence can be found in the [https://bbs.archlinux.org/viewtopic.php?pid=973458 forums]. Make sure there is enough space available before launching Dropbox.<br />
<br />
====Locale caused errors====<br />
Try starting {{Ic|dropboxd}} with this code:<br />
<br />
LANG=$LOCALE<br />
dropboxd<br />
<br />
(You can also use a different value for LANG; it must be in the format "en_US.UTF-8")<br />
This helps when running from a Bash script or Bash shell where {{ic|/etc/rc.d/functions}} has been loaded<br />
<br />
====Filesystem monitoring problem====<br />
If you have a lot of files to sync in your Dropbox folder, you might get the following error:<br />
<br />
Unable to monitor filesystem<br />
Please run: echo 100000 | sudo tee /proc/sys/fs/inotify/max_user_watches and restart Dropbox to correct the problem.<br />
<br />
This can be fixed easily by adding<br />
<br />
fs.inotify.max_user_watches = 100000<br />
<br />
to {{ic|/etc/sysctl.conf}} and restarting your computer.<br />
<br />
===Proxy Settings===<br />
The easiest way to set Dropbox's proxy settings is by defining them manually in the Proxies tab of the Preferences window. Alternatively, you can also set it to 'Auto-detect' and then export your proxy server to the http_proxy env variable prior to starting Dropbox (HTTP_PROXY is also usable)<br />
env http_proxy=http://your.proxy.here:port /usr/bin/dropboxd<br />
or<br />
export http_proxy=http://your.proxy.here:port<br />
/usr/bin/dropboxd<br />
<br />
Take note, Dropbox will only use proxy settings of the form http://your.proxy.here:port, not your.proxy.here:port as some other applications do.<br />
<br />
==Alternatives==<br />
*[[Ubuntu One]] - {{Pkg|ubuntuone-client}}<br />
*[https://spideroak.com/ Spider Oak] - {{AUR|spideroak}}<br />
*[http://kdropbox.deuteros.es/ KFileBox] - {{AUR|kfilebox}}<br />
*[https://www.wuala.com/ Wuala] - {{AUR|wuala}}</div>AsmundErhttps://wiki.archlinux.org/index.php?title=Talk:Dropbox&diff=247968Talk:Dropbox2013-02-20T11:33:10Z<p>AsmundEr: /* Daemon */ Seconded removal of initscripts-based daemon section</p>
<hr />
<div>== Daemon ==<br />
I think that [[Dropbox#Daemon]] section can be removed from this page :D what do you think? --[[User:Umby213|Umby213]] ([[User talk:Umby213|talk]]) 12:57, 26 January 2013 (UTC)<br />
<br />
I agree. I just updated the section about using Dropbox as a daemon with Systemd, and moved it to the top of the sections about daemons. I did not remove the initscripts-based section; if a third person agrees that it should be removed I think (s)he can go ahead and do so. --[[User:AsmundEr|AsmundEr]] ([[User talk:AsmundEr|talk]]) 11:33, 20 February 2013 (UTC)<br />
<br />
==Explaining how to start dropbox for all users in systemd==<br />
I do not know how to do this, but I think it has to do with the User info.<br />
Could this be explained propperly?<br />
Simply removing the User= statements has some strange behaviour (as I have tried this and it makes dropbox startup together with gdm).<br />
<br />
Can we add multiple usernames? Or disable it for root only? What would be the best way forward?<br />
<br />
<br />
==dropbox without nautilus==<br />
What do you think of adding the procedure explained here?<br />
<br />
--> [http://bbs.archlinux.org/viewtopic.php?pid=674176#p674176]<br />
<br />
It describes a very simple way on how to use dropbox without nautilus, give me your feedback!<br />
<br />
rent0n<br />
<br />
:If no-one else is going to comment, I'd suggest you add it in, clearly labelled as an alternative to the current method.<br />
:[[User:Jasonwryan|Jasonwryan]] 16:15, 19 December 2009 (EST)<br />
<br />
I followed those instructions and they work like a charm.--[[User:MDuo13|MDuo13]] 06:29, 30 April 2010 (EDT)</div>AsmundErhttps://wiki.archlinux.org/index.php?title=Dropbox&diff=247967Dropbox2013-02-20T11:29:20Z<p>AsmundEr: Moved systemd-based daemon to the top of the daemon alternatives, and expanded the text with some clarifications.</p>
<hr />
<div>[[Category:Internet Applications]]<br />
[[de:Dropbox]]<br />
[[it:Dropbox]]<br />
[[zh-TW:Dropbox]]<br />
[https://www.dropbox.com Dropbox] is a file sharing system that recently introduced a GNU/Linux client. Use it to transparently sync files across computers and architectures. Simply drop files into your {{ic|~/Dropbox}} folder, and they will automatically sync to your centralized repository.<br />
<br />
==Installation==<br />
<br />
{{AUR|dropbox}} can be installed from the [[Arch User Repository|AUR]]. Alternatively, {{AUR|dropbox-experimental}} is also available.<br />
<br />
# After installing the package, you can start Dropbox from your application menu or run {{ic|dropboxd}} from the command-line. The client icon will appear in the system tray.<br />
# A pop-up will notify you that Dropbox is running from an unsupported location. Click on Don't ask again since you know that you have installed it from AUR rather than from the official homepage.<br />
# Eventually a pop-up will ask you to log in to your Dropbox account or create a new account. Enter your credentials.<br />
# After some time you will see a "Welcome to Dropbox" pop-up, which will give you the opportunity to view a short tour of Dropbox.<br />
# Press the "Finish and go to My Dropbox".<br />
<br />
For [[KDE]] users, no further steps are required (it is enough to install the above {{AUR|dropbox}} package from the AUR), as KDE saves running applications when logging out and restarts them automatically. Similarly for [[Xfce]] users, dropbox will be restarted automatically next time you login since the {{ic|dropbox.desktop}} file be placed in {{ic|~/.config/autostart}}.<br />
<br />
===Optional packages===<br />
<br />
*For a command-line interface, install {{AUR|dropbox-cli}} from the [[Arch User Repository|AUR]].<br />
*For integration with Nautilus, install {{AUR|nautilus-dropbox}} from the AUR. The Nautilus plugin will start Dropbox automatically.<br />
*For integration with Nemo, install {{AUR|nemo-dropbox-git}} from the AUR.<br />
*For integration with [[Thunar]], install {{AUR|thunar-dropbox}} from the AUR.<br />
*For [[KDE]] users, there is a KDE client available: {{AUR|kfilebox}} from the AUR.<br />
<br />
===Automatically Starting Dropbox===<br />
<br />
Dropbox can be automatically started by adding {{Ic|dropboxd}} to {{ic|~/.xinitrc}} (or {{ic|~/.config/openbox/autostart}}, depending on your setup). Alternatively, you can [[#Daemon|start it as a daemon]].<br />
<br />
== Alternative to install: use the web interface ==<br />
<br />
If all you need is basic access to the files in your Dropbox, you can use the web interface at https://www.dropbox.com/ to upload and download files to your Dropbox. This can be a viable alternative to running a Dropbox daemon and mirroring all the files on your own machine.<br />
<br />
==Run as daemon with systemd==<br />
<br />
Recent versions of Dropbox come with a systemd service file. Running Dropbox as a daemon does not give you an icon in the system tray, but syncs your files and folders in the background.<br />
<br />
To enable the daemon for your user, so that it will start at login:<br />
$ sudo systemctl enable dropbox@<user>.service<br />
Note that you have to manually start Dropbox the first time after installation, so that it runs through the login and setup screen. The daemon can be used subsequently.<br />
<br />
==Daemon (initscripts, deprecated)==<br />
{{out of date|Initscripts are deprecated; you should use the systemd method mentioned above.}}<br />
<br />
To run Dropbox as a daemon similarly to {{Ic|sshd}} or {{Ic|vsftpd}}, simply do one of the following:<br />
<br />
===dropbox-daemon Method===<br />
<br />
Install {{AUR|dropbox-daemon}}<br />
and configure your username in {{ic|/etc/conf.d/dropboxd.conf}}<br />
<br />
This allows you to start or stop Dropbox just like any other service.<br />
<br />
# /etc/rc.d/dropboxd start<br />
# /etc/rc.d/dropboxd stop<br />
# /etc/rc.d/dropboxd restart<br />
<br />
Place {{Ic|dropboxd}} in the DAEMONS array in {{ic|/etc/rc.conf}} for it to start at boot.:<br />
DAEMONS=(... '''@dropboxd''' ...)<br />
<br />
===Manual Method===<br />
<br />
As root, copy this into a file called {{ic|/etc/rc.d/dropboxd}} and set USER to your username.<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
<br />
USER=yourusername<br />
<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
PID=`pidof -o %PPID /opt/dropbox/dropbox`<br />
<br />
case "$1" in<br />
start)<br />
stat_busy "Starting Dropbox Service"<br />
LANG=$LOCALE<br />
[ -z "$PID" ] && su -c "/usr/bin/dropboxd &" $USER<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
add_daemon dropboxd<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping Dropbox Service"<br />
[ ! -z "$PID" ] && kill $PID > /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon dropboxd<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 3<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
;;<br />
esac<br />
exit 0<br />
</nowiki>}}<br />
<br />
An Organized Way:<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
USER=yourusername<br />
DROPBOXD_PATH='/usr/bin/dropboxd'<br />
DROPBOX_PATH='/opt/dropbox/dropbox'<br />
<br />
PID=`pidof -o %PPID $DROPBOX_PATH`<br />
<br />
case "$1" in<br />
start)<br />
stat_busy "Starting Dropbox Service"<br />
if [ $USER = 'yourusername' ]; then<br />
echo "Please edit /etc/rc.d/dropboxd' 'USER' before using this script."<br />
stat_fail<br />
else<br />
LANG=$LOCALE<br />
[ -z "$PID" ] && su -c "$DROPBOXD_PATH &" $USER<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
add_daemon dropboxd<br />
stat_done<br />
fi<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping Dropbox Service"<br />
[ ! -z "$PID" ] && kill $PID > /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon dropboxd<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 3<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
;;<br />
esac<br />
exit 0<br />
</nowiki>}}<br />
<br />
Make the file executable with<br />
# chmod +x /etc/rc.d/dropboxd<br />
<br />
This allows you to start or stop {{Ic|dropboxd}} just like any other service. For example:<br />
<br />
# /etc/rc.d/dropboxd start<br />
# /etc/rc.d/dropboxd stop<br />
# /etc/rc.d/dropboxd restart<br />
<br />
To start it at boot, add it to your DAEMONS array in rc.conf: {{ic|/etc/rc.conf}}:<br />
DAEMONS=(... '''@dropboxd''' ...)<br />
<br />
==Without Nautilus (Another Way)==<br />
<br />
Another way to use Dropbox without Nautilus but with another file manager like Thunar or Pcmanfm is described below:<br />
<br />
1. Create a fake Nautilus script that will launch Thunar:<br />
$ sudo touch /usr/bin/nautilus && sudo chmod +x /usr/bin/nautilus && sudo nano /usr/bin/nautilus<br />
<br />
2. Insert this text into the file, then save and exit:<br />
#!/bin/bash<br />
exec thunar $2<br />
exit 0<br />
<br />
3. Launch Dropbox<br />
$ dropboxd<br />
<br />
4. Click on the Dropbox tray icon to open your Dropbox folder in Thunar.<br />
<br />
{{Note|In this way there is no need to create a Dropbox daemon in {{ic|/etc/rc.d/}} and to start it at boot via {{ic|/etc/rc.conf}} or to make it start via your session manager: just leave the "Start Dropbox on system startup" option flagged in the Preferences window.}}<br />
<br />
{{Note|If you already have Nautilus installed but do not want to use it, don't modify the existing file under {{ic|/usr/bin}}, just change the {{ic|/usr/bin}} for {{ic|/opt/dropbox}} in the step 2 above, like this: {{Ic|$ sudo touch /opt/dropbox/nautilus && sudo chmod +x /opt/dropbox/nautilus && sudo nano /opt/dropbox/nautilus}}. Dropbox will look in this path first!}}<br />
<br />
==Securing Your Dropbox==<br />
<br />
If you want to store sensitive data in your Dropbox, you should encrypt it before. Syncing to Dropbox is encrypted, but all files are (for the time being) stored on the server unencrypted just as you put them in your Dropbox.<br />
<br />
* Dropbox works with [[TrueCrypt]], and after you initially uploaded the TrueCrypt volume to Dropbox, performance is quite okay, because Dropbox has a working binary diff.<br />
<br />
* Another possibility is to use [[EncFS]], which has the advantage that all files are encrypted separately, i.e. you do not have to determine in advance the size of the content you want to encrypt and your encrypted directory grows and shrinks while you add/delete/modify files in it. You can also mount an encrypted volume at startup using the {{ic|-S}} option of {{Ic|encfs}} to avoid having to input the passphrase, but note that your encrypted files are not secure from someone who has direct access to your computer.<br />
<br />
==Multiple Dropbox Instances==<br />
<br />
If you need to separate or distinguish your data, personal and work usage for example, you can subscribe to Dropbox with different email addresses and have multiple directories synced to different instances.<br />
<br />
The basic principle and general how-to are described in the [http://www.dropboxwiki.com/Multiple_Instances_On_Unix Dropbox Wiki].<br />
<br />
{{Note|When dealing with multiple instances you have to select the Dropbox destination folder, which the Dropbox installer asks in the last step; usage examples may be {{ic|/home/dropbox-personal}}, {{ic|/home/dropbox-work}}, and so on.}}<br />
<br />
For convenience, here is a script that I use to accomplish the task: just add a dir in the "dropboxes" list to have another instance of Dropbox, referring to the dir, loaded at script startup.<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash <br />
<br />
#******************************* <br />
# Multiple dropbox instances <br />
#******************************* <br />
<br />
dropboxes=(.dropbox-personal .dropbox-work) <br />
<br />
for dropbox in ${dropboxes[@]} <br />
do <br />
if ! [ -d $HOME/$dropbox ];then <br />
mkdir $HOME/$dropbox <br />
fi <br />
HOME=$HOME/$dropbox/ /usr/bin/dropbox start -i <br />
done <br />
</nowiki>}}<br />
<br />
==Dropbox on Laptops==<br />
<br />
Dropbox itself is pretty good at dealing with connectivity problems. If you have a laptop and roam between different network environments, Dropbox will have problems reconnecting if you do not restart it. The easiest way to solve this with [[netcfg]] is to use POST_UP and PRE_DOWN.<br />
<br />
In every network profile you use (or in the [[Netcfg#Per-interface_configuration]]), add the appropriate commands:<br />
{{bc|<nowiki><br />
POST_UP="any other code; su -c 'DISPLAY=:0 /usr/bin/dropboxd &' your_user"<br />
PRE_DOWN="any other code; killall dropbox"<br />
</nowiki>}}<br />
Obviously, your_user has to be edited and 'any other code;' can be omitted if you do not have any. The above will make sure that Dropbox is running only if there is a network profile active.<br />
<br />
If you have connectivity problem with [[NetworkManager]], [https://bbs.archlinux.org/viewtopic.php?pid=790905, this thread] on forum should be useful.<br />
<br />
==Known Issues==<br />
===Dropbox keeps saying Downloading files===<br />
But in fact now files are synced with your box. This problem is likely to appear when your Dropbox folder is located on a NTFS partition whose mount path contains spaces. See more in the [[https://bbs.archlinux.org/viewtopic.php?id=153368 forums]]. To resolve the problem pay attention to your entry in {{ic|/etc/fstab}}. Avoid spaces in the mount path and set write permissions:<br />
<br />
UUID=01CD2ABB65E17DE0 /run/media/username/Windows ntfs-3g uid=username,gid=users 0 0<br />
<br />
===Change the Dropbox location from the installation wizard===<br />
Some users experience the problem during setting-up Dropbox that they cannot select a Dropbox folder other than {{ic|/home/username/Dropbox}}. In this case when the window for changing the path is shown , hit CTRL+L, enter the location (e.g. /mnt/data/Dropbox) and click on the 'Choose' or 'Open' button.<br />
<br />
===Context menu entries in file manager do not work===<br />
Several file managers such as Thunar, Nautilus or its fork Nemo come with extensions that provide context menu entries for files and folders inside your Dropbox. Most of them will result in a browser action such as opening the file or folder in dropbox.com or sharing the link. If you experience these entries to not working, then you are likely to have not set the {{ic|$BROWSER}} variable which Dropbox requires. You can check that by <br />
<br />
echo $BROWSER<br />
<br />
To set your {{ic|$BROWSER}} variable open {{ic|~/.profile}} and replace {{ic|chromium}} with your default browser:<br />
<br />
if [ -n "$DISPLAY" ]; then<br />
BROWSER=chromium<br />
fi<br />
<br />
===Connecting...===<br />
{{Note|It seems that this issue has been fixed in later versions of dropbox (sometime before 1.6.0-2). It might be reasonable to test before installing one of the following scripts}}<br />
It may happen that Dropbox cannot connect successfully because it was loaded before an Internet connection was established. To solve the problem the content of the file {{ic|/opt/dropbox/dropboxd}} needs to be replaced with the following: <br />
<br />
<br />
#!/bin/sh<br />
<br />
# Copyright 2008 Evenflow, Inc., 2010 Dropbox<br />
#<br />
# Environment script for the dropbox executable.<br />
<br />
start_dropbox() {<br />
PAR=$(dirname $(readlink -f $0))<br />
OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH<br />
LD_LIBRARY_PATH=$PAR:$LD_LIBRARY_PATH <br />
<br />
TMP1=`ps ax|grep dropbox|grep -v grep`<br />
if [ -n "$TMP1" ]; then<br />
kill -9 $(pidof dropbox) >/dev/null 2>&1<br />
fi<br />
exec $PAR/dropbox $@ &<br />
}<br />
<br />
do_dropbox() {<br />
start_dropbox >/dev/null 2>&1<br />
while [ 1 ]; do<br />
sleep 5<br />
ERROR="$(net_test)"<br />
if [ -n "$ERROR" ]; then<br />
LAST_ERROR=1<br />
else<br />
if [ -n "$LAST_ERROR" ]; then<br />
# Connection seems to be up but last cycle was down<br />
LAST_ERROR=""<br />
start_dropbox >/dev/null 2>&1<br />
fi<br />
fi<br />
done<br />
<br />
}<br />
<br />
net_test() {<br />
TMP1="$(ip addr |grep "inet " |grep -v "127.0.0.1")"<br />
[ -z "$TMP1" ] && echo "error"<br />
}<br />
<br />
do_dropbox<br />
<br />
Following is an alternative script that will check for an actual Internet connection by using {{pkg|curl}} to check if any entry in a list of hosts and IP addresses is available.<br />
If none of the specified hosts are available, the script will wait and try again (albeit not forever).<br />
The way the script increments the waiting time is quite messy, but the logic goes like this:<br />
<br />
Start with a wait time of 5 seconds.<br />
<br />
Multiply by 1.5.<br />
<br />
Do this as long as the wait time is less than 1500 seconds (25 minutes), and the check_net()<br />
function returns non-zero values (failure).<br />
<br />
#!/bin/bash<br />
<br />
# Copyright 2008 Evenflow, Inc., 2010 Dropbox<br />
#<br />
# Environment script for the dropbox executable.<br />
<br />
WAIT_TIME=5 #initial time to wait between checking the internet connection<br />
#HOSTS="www.google.com www.wikipedia.org 8.8.8.8 208.67.222.222"<br />
HOSTS="www.google.com www.wikipedia.org "<br />
<br />
PAR=$(dirname $(readlink -f $0))<br />
OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH<br />
LD_LIBRARY_PATH=$PAR${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH<br />
<br />
#non-zero exit code iff none of the hosts could be reached<br />
check_net() {<br />
local ret=1<br />
for i in $HOSTS; do<br />
#ping -w2 -c2 $i > /dev/null 2>&1 && ret=0 && break<br />
curl -o /dev/null $i > /dev/null 2>&1 && ret=0 && break<br />
done<br />
echo $ret<br />
}<br />
<br />
#if dropbox is running; kill it. Then start dropbox<br />
start_dropbox() {<br />
local tmp=`ps ax|grep -E "[0-9] $PAR/dropbox"|grep -v grep`<br />
if [ -n "$tmp" ]; then<br />
kill -9 $(pidof dropbox) > /dev/null 2>&1<br />
fi<br />
exec $PAR/dropbox $@ > /dev/null 2>&1 &<br />
}<br />
<br />
#loop over: start dropbox iff check_net returns 0<br />
#loop (and with it, the entire script) terminates when dropbox has been restarted,<br />
#+ or the waiting time has exeeded 1500 seconds (it grows 50% with each iteration of the loop)<br />
attempt_startup() {<br />
while [ $WAIT_TIME -lt 1500 ] ; do<br />
if [ $(check_net) -eq 0 ]; then<br />
start_dropbox<br />
exit<br />
fi<br />
sleep $WAIT_TIME<br />
#WAIT_TIME=$(($WAIT_TIME+$WAIT_TIME/2))<br />
let "WAIT_TIME += WAIT_TIME/2"<br />
done<br />
}<br />
<br />
start_dropbox<br />
attempt_startup &<br />
<br />
{{Tip|When you update Dropbox via your preferred AUR helper, the file will (usually) be reverted to the default one. You can prevent this with {{ic|chattr +i /opt/dropbox/dropboxd}} which will make the file immutable. To reverse this action simply use {{ic|chattr -i /opt/dropbox/dropboxd}}. }}<br />
<br />
===Dropbox does not start - "This is usually because of a permission error"===<br />
<br />
====Check permissions====<br />
Make sure that you own Dropbox's directories before running the application. This includes<br />
*{{ic|~/.dropbox}} - Dropbox's configuration directory<br />
*{{ic|~/Dropbox}} - Dropbox's download directory (default)<br />
You can ensure this by changing their owner with {{ic|chown -R}}.<br />
<br />
This error could also be caused by {{ic|/var}} being full.<br />
<br />
====Re-linking your account====<br />
[https://www.dropbox.com/help/72 Dropbox's FAQ] suggests that this error may be caused by misconfiguration and is fixed by (re)moving the current configuration folder<br />
# mv ~/.dropbox ~/.dropbox.old<br />
and restarting Dropbox.<br />
<br />
====Errors caused by running out of space====<br />
A common error that might happen is that there is no more available space on your {{ic|/tmp}} and {{ic|/var}} partitions. If this happens, Dropbox will crash on startup with the following error in its log:<br />
{{bc|<br />
Exception: Not a valid FileCache file<br />
}}<br />
A detailed story of such an occurrence can be found in the [https://bbs.archlinux.org/viewtopic.php?pid=973458 forums]. Make sure there is enough space available before launching Dropbox.<br />
<br />
====Locale caused errors====<br />
Try starting {{Ic|dropboxd}} with this code:<br />
<br />
LANG=$LOCALE<br />
dropboxd<br />
<br />
(You can also use a different value for LANG; it must be in the format "en_US.UTF-8")<br />
This helps when running from a Bash script or Bash shell where {{ic|/etc/rc.d/functions}} has been loaded<br />
<br />
====Filesystem monitoring problem====<br />
If you have a lot of files to sync in your Dropbox folder, you might get the following error:<br />
<br />
Unable to monitor filesystem<br />
Please run: echo 100000 | sudo tee /proc/sys/fs/inotify/max_user_watches and restart Dropbox to correct the problem.<br />
<br />
This can be fixed easily by adding<br />
<br />
fs.inotify.max_user_watches = 100000<br />
<br />
to {{ic|/etc/sysctl.conf}} and restarting your computer.<br />
<br />
===Proxy Settings===<br />
The easiest way to set Dropbox's proxy settings is by defining them manually in the Proxies tab of the Preferences window. Alternatively, you can also set it to 'Auto-detect' and then export your proxy server to the http_proxy env variable prior to starting Dropbox (HTTP_PROXY is also usable)<br />
env http_proxy=http://your.proxy.here:port /usr/bin/dropboxd<br />
or<br />
export http_proxy=http://your.proxy.here:port<br />
/usr/bin/dropboxd<br />
<br />
Take note, Dropbox will only use proxy settings of the form http://your.proxy.here:port, not your.proxy.here:port as some other applications do.<br />
<br />
==Alternatives==<br />
*[[Ubuntu One]] - {{Pkg|ubuntuone-client}}<br />
*[https://spideroak.com/ Spider Oak] - {{AUR|spideroak}}<br />
*[http://kdropbox.deuteros.es/ KFileBox] - {{AUR|kfilebox}}<br />
*[https://www.wuala.com/ Wuala] - {{AUR|wuala}}</div>AsmundErhttps://wiki.archlinux.org/index.php?title=Systemd&diff=242941Systemd2013-01-04T10:05:00Z<p>AsmundEr: /* Automount */ Info about clash with mlocate default settings.</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Daemons and system services]]<br />
[[Category:Boot process]]<br />
[[es:Systemd]]<br />
[[fr:Systemd]]<br />
[[it:Systemd]]<br />
[[ja:Systemd]]<br />
[[ru:Systemd]]<br />
[[zh-CN:Systemd]]<br />
[[zh-TW:Systemd]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers how to install and configure systemd.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|systemd/User}}<br />
{{Article summary wiki|systemd/Services}}<br />
{{Article summary wiki|systemd FAQ}}<br />
{{Article summary wiki|init Rosetta}}<br />
{{Article summary wiki|udev}}<br />
{{Article summary end}}<br />
From the [http://freedesktop.org/wiki/Software/systemd project web page]:<br />
<br />
'''''systemd''' is a system and service manager for Linux, compatible with SysV and LSB init scripts. '''systemd''' provides aggressive parallelization capabilities, uses socket and [[D-Bus]] activation for starting services, offers on-demand starting of daemons, keeps track of processes using Linux [[cgroups|control groups]], supports snapshotting and restoring of the system state, maintains mount and automount points and implements an elaborate transactional dependency-based service control logic. It can work as a drop-in replacement for [[SysVinit|sysvinit]].''<br />
<br />
{{Note|1=For a detailed explanation as to why Arch has moved to systemd, see [https://bbs.archlinux.org/viewtopic.php?pid=1149530#p1149530 this forum post].}}<br />
<br />
See also the [[Wikipedia:Systemd|Wikipedia article]].<br />
<br />
== Considerations before switching ==<br />
<br />
* Do [http://freedesktop.org/wiki/Software/systemd/ some reading] about systemd.<br />
* Note the fact that systemd has a '''journal''' system that replaces '''syslog''', although the two can co-exist. See the [[#Journal|section on the journal]] below.<br />
* While systemd can replace some of the functionality of '''cron''', '''acpid''', or '''xinetd''', there is no need to switch away from using the traditional daemons unless you want to.<br />
* Interactive initscripts are not working with systemd. In particular, '''netcfg-menu''' [https://bugs.archlinux.org/task/31377 cannot] be used at system start-up.<br />
<br />
== Installation ==<br />
{{Note|{{pkg|systemd}} and {{pkg|systemd-sysvcompat}} are both installed by default on installation media newer than [https://www.archlinux.org/news/systemd-is-now-the-default-on-new-installations/ 2012-10-13].}}<br />
<br />
{{Note|If you are running Arch Linux inside a VPS, please see [[Virtual_Private_Server#Moving_your_VPS_from_initscripts_to_systemd|the appropriate page]].}}<br />
<br />
The following section is aimed at Arch Linux installations that still rely on {{pkg|sysvinit}} and {{pkg|initscripts}} which have not migrated to {{pkg|systemd}}.<br />
<br />
# Install {{pkg|systemd}} and append the following to your [[kernel line]]: {{ic|1=init=/usr/lib/systemd/systemd}}<br />
# Once completed you may enable any desired services via the use of {{ic|systemctl enable <service_name>}} (this roughly equates to what you included in the {{ic|DAEMONS}} array, with [[Daemons_List|different names]].).<br />
# Reboot your system and verify that {{ic|systemd}} is currently active by using the following command: {{ic|cat /proc/1/comm}}. This should return the string {{ic|systemd}}.<br />
# Make sure your hostname is set correctly under systemd: {{ic|hostnamectl set-hostname myhostname}}.<br />
# Proceed to remove {{pkg|initscripts}} and {{pkg|sysvinit}} from your system and install {{pkg|systemd-sysvcompat}}.<br />
# Optionally, remove the {{ic|1=init=/usr/lib/systemd/systemd}} parameter as it is no longer needed. {{pkg|systemd-sysvcompat}} provides the default init.<br />
<br />
=== Supplementary information ===<br />
<br />
* If you have {{ic|quiet}} in your kernel parameters, you might want to remove it for your first couple of systemd boots, to assist with identifying any issues during boot.<br />
<br />
* Adding your user to [[Users and Groups|groups]] ({{ic|optical}}, {{ic|audio}}, {{ic|scanner}}, etc.) is '''not''' necessary for most use cases with systemd. The groups can even cause some functionality to break. For example, the audio group will break fast user switching and allows applications to block software mixing. Every PAM login provides a logind session, which for a local session will give you permissions via [[Wikipedia:Access control list|POSIX ACLs]] on audio/video devices, and allow certain operations like mounting removable storage via [[udisks]].<br />
<br />
* Removing {{Pkg|initscripts}} package will break compatibility with {{ic|rc.conf}}. Be careful if you have static network set up there or use some daemons, which are not migrated to systemd yet. See the [[#Initscripts emulation|Initscripts emulation section]] for more details on how the two systems can coexist.<br />
<br />
* If you mount LVM devices in fstab your system will wait for them and time out. Wait for the time out to happen and enter your root password in the emergency console. Then type {{ic|systemctl enable lvm}} to enable lvm in systemd. After another reboot the lvm devices should be mountable.<br />
<br />
== Native configuration ==<br />
<br />
{{Note|You may need to create these files. All files should have '''644''' permissions and '''root:root''' ownership.}}<br />
<br />
=== Hostname ===<br />
<br />
The hostname is configured in {{ic|/etc/hostname}}. The file should not contain the system's domain, if any. To set the hostname, do:<br />
<br />
# hostnamectl set-hostname '''myhostname'''<br />
<br />
See {{ic|man 5 hostname}} and {{ic|man 1 hostnamectl}} for details.<br />
<br />
Here is an example file:<br />
{{hc|/etc/hostname|<br />
myhostname<br />
}}<br />
<br />
=== Locale ===<br />
<br />
The default system locale is configured in {{ic|/etc/locale.conf}}. To set the default locale, do:<br />
<br />
# localectl set-locale LANG="de_DE.utf8"<br />
<br />
{{Note|Before you set the default locale, you first need to enable locales available to the system by uncommenting them in {{ic|/etc/locale.gen}} and then executing {{ic|locale-gen}} as root. The locale set via {{ic|localectl}} must be one of the '''uncommented''' locales in {{ic|/etc/locale.gen}}.}}<br />
<br />
See {{ic|man 1 localectl}} and {{ic|man 5 locale.conf}} for details.<br />
<br />
* For more information, see [[Locale]].<br />
<br />
Here is an example file:<br />
{{hc|/etc/locale.conf|<nowiki><br />
LANG=en_US.utf8<br />
</nowiki>}}<br />
<br />
=== Virtual console ===<br />
<br />
The virtual console (keyboard mapping, console font and console map) is configured in {{ic|/etc/vconsole.conf}}:<br />
<br />
{{hc|/etc/vconsole.conf|2=<br />
KEYMAP=us<br />
FONT=lat9w-16<br />
FONT_MAP=8859-1_to_uni}}<br />
<br />
{{Note|As of {{pkg|systemd}}-194, the built-in ''kernel'' font and the ''us'' keymap are used if {{ic|1=KEYMAP=}} and {{ic|1=FONT=}} are empty or not set.}}<br />
<br />
Another way to set the keyboard mapping (keymap) is doing:<br />
<br />
# localectl set-keymap de<br />
<br />
<code>localectl</code> can also be used to set the X11 keymap:<br />
<br />
# localectl set-x11-keymap de<br />
<br />
See {{ic|man 1 localectl}} and {{ic|man 5 vconsole.conf}} for details.<br />
<br />
* For more information, see [[Fonts#Console fonts|console fonts]] and [[KEYMAP|keymaps]].<br />
<br />
=== Time zone ===<br />
<br />
The time zone is configured by creating an appropriate {{ic|/etc/localtime}} symlink, pointing to a zoneinfo file under {{ic|/usr/share/zoneinfo/}}. To do this automatically:<br />
<br />
# timedatectl set-timezone America/Toronto<br />
<br />
See {{ic|man 1 timedatectl}}, {{ic|man 5 localtime}}, and {{ic|man 7 archlinux}} for more details.<br />
<br />
Alternatively, create the symlink yourself:<br />
<!-- DO NOT MAKE THIS AN ABSOLUTE SYMLINK, archlinux(7) clearly shows this should be a relative symlink --><br />
# ln -sf ../usr/share/zoneinfo/America/Toronto /etc/localtime<br />
<br />
If the old configuration file {{ic|/etc/timezone}} exists you can now remove it safely, because it is not used by systemd.<br />
<br />
=== Hardware clock ===<br />
<br />
Systemd will use '''UTC''' for the hardware clock by default.<br />
<br />
{{Tip|It is advised to have a [[NTP|Network Time Protocol daemon]] running to keep the system time synchronized with Internet time and the hardware clock.}}<br />
<br />
==== Hardware clock in localtime ====<br />
<br />
If you want to change the hardware clock to use local time ('''STRONGLY DISCOURAGED''') do:<br />
<br />
# timedatectl set-local-rtc true<br />
<br />
If you want to revert to the hardware clock being in UTC, do:<br />
<br />
# timedatectl set-local-rtc false<br />
<br />
Be warned that, if the hardware clock is set to localtime, dealing with daylight saving time is messy. If the DST changes when your computer is off, your clock will be wrong on next boot ([http://www.cl.cam.ac.uk/~mgk25/mswish/ut-rtc.html there is a lot more to it]). Recent kernels set the system time from the RTC directly on boot, assuming that the RTC is in UTC. This means that if the RTC is in local time, then the system time will first be set up wrongly and then corrected shortly afterwards on every boot. This is the root of certain weird bugs (time going backwards is rarely a good thing).<br />
<br />
One reason for allowing the RTC to be in local time is to allow dual boot with Windows ([http://blogs.msdn.com/b/oldnewthing/archive/2004/09/02/224672.aspx which uses localtime]). However, Windows is able to deal with the RTC being in UTC with a simple [[Time#UTC in Windows|registry fix]]. There, it is recommended that Windows are changed to use UTC, rather than Linux to use localtime. If you make Windows use UTC, also remember to disable the "Internet Time Update" Windows feature, so that Windows don't mess with the hardware clock, trying to sync it with internet time. You should instead leave touching the RTC and syncing it to internet time to Linux, by enabling an [[NTP]] daemon, as suggested previously.<br />
<br />
* For more information, see [[Time]].<br />
<br />
=== Kernel modules ===<br />
<br />
Today, all necessary module loading is handled automatically by [[udev]], so that, if you don't want/need to use any out-of-tree kernel modules, there is no need to put modules that should be loaded at boot in any config file. However, there are cases where you might want to load an extra module during the boot process, or blacklist another one for your computer to function properly.<br />
<br />
==== Extra modules to load at boot ====<br />
<br />
Extra kernel modules to be loaded during boot are configured as a static list in files under {{ic|/etc/modules-load.d/}}. Each configuration file is named in the style of {{ic|/etc/modules-load.d/<program>.conf}}. Configuration files simply contain a list of kernel module names to load, separated by newlines. Empty lines and lines whose first non-whitespace character is {{ic|#}} or {{ic|;}} are ignored.<br />
<br />
{{hc|/etc/modules-load.d/virtio-net.conf|<br />
# Load virtio-net.ko at boot<br />
virtio-net}}<br />
<br />
See {{ic|man 5 modules-load.d}} for more details.<br />
<br />
==== Blacklisting ====<br />
<br />
Module blacklisting works the same way as with {{Pkg|initscripts}} since it is actually handled by {{Pkg|kmod}}. See [[Kernel modules#Blacklisting|Module Blacklisting]] for details.<br />
<br />
=== Filesystem mounts ===<br />
<br />
The default setup will automatically fsck and mount filesystems before starting services that need them to be mounted. For example, systemd automatically makes sure that remote filesystem mounts like [[NFS]] or [[Samba]] are only started after the network has been set up. Therefore, local and remote filesystem mounts specified in {{ic|/etc/fstab}} should work out of the box.<br />
<br />
See {{ic|man 5 systemd.mount}} for details.<br />
<br />
==== Automount ====<br />
<br />
* If you have a large {{ic|/home}} partition, it might be better to allow services that do not depend on {{ic|/home}} to start while {{ic|/home}} is checked by fsck. This can be achieved by adding the following options to the {{ic|/etc/fstab}} entry of your {{ic|/home}} partition:<br />
<br />
noauto,x-systemd.automount<br />
<br />
This will fsck and mount {{ic|/home}} when it is first accessed, and the kernel will buffer all file access to {{ic|/home}} until it is ready.<br />
<br />
Note: this will make your {{ic|/home}} filesystem type {{ic|autofs}}, which is ignored by [[mlocate]] by default. The speedup of automounting {{ic|/home}} may not be more than a second or two, depending on your system, so this trick may not be worth it. <br />
<br />
* The same applies to remote filesystem mounts. If you want them to be mounted only upon access, you will need to use the {{ic|noauto,x-systemd.automount}} parameters. In addition, you can use the {{ic|1=x-systemd.device-timeout=#}} option to specify a timeout in case the network resource is not available.<br />
<br />
* If you have encrypted filesystems with keyfiles, you can also add the {{ic|noauto}} parameter to the corresponding entries in {{ic|/etc/crypttab}}. Systemd will then not open the encrypted device on boot, but instead wait until it is actually accessed and then automatically open it with the specified keyfile before mounting it. This might save a few seconds on boot if you are using an encrypted RAID device for example, because systemd doesn't have to wait for the device to become available. For example:<br />
<br />
{{hc|/etc/crypttab|<br />
data /dev/md0 /root/key noauto}}<br />
<br />
==== LVM ====<br />
<br />
If you have [[LVM]] volumes not activated via the [[Mkinitcpio|initramfs]], enable the {{ic|lvm-monitoring}} service, which is provided by the {{pkg|lvm2}} package:<br />
<br />
# systemctl enable lvm-monitoring<br />
<br />
Similarly, if you have LVM on encrypted devices mounted later during boot (e.g. from {{ic|/etc/crypttab}}), enable the {{ic|lvm-on-crypt}} service, which is also provided by the {{pkg|lvm2}} package:<br />
<br />
# systemctl enable lvm-on-crypt<br />
<br />
=== ACPI power management ===<br />
<br />
Systemd handles some power-related [[Wikipedia:Advanced_Configuration_and_Power_Interface|ACPI]] events. They can be configured via the following options from {{ic|/etc/systemd/logind.conf}}:<br />
<br />
* {{ic|HandlePowerKey}}: specifies which action is invoked when the power key is pressed.<br />
* {{ic|HandleSuspendKey}}: specifies which action is invoked when the suspend key is pressed.<br />
* {{ic|HandleHibernateKey}}: specifies which action is invoked when the hibernate key is pressed.<br />
* {{ic|HandleLidSwitch}}: specifies which action is invoked when the lid is closed.<br />
<br />
The specified action can be one of {{ic|ignore}}, {{ic|poweroff}}, {{ic|reboot}}, {{ic|halt}}, {{ic|suspend}}, {{ic|hibernate}} or {{ic|kexec}}.<br />
<br />
If these options are not configured, systemd will use its defaults: {{ic|1=HandlePowerKey=poweroff}}, {{ic|1=HandleSuspendKey=suspend}}, {{ic|1=HandleHibernateKey=hibernate}}, and {{ic|1=HandleLidSwitch=suspend}}.<br />
<br />
On systems which run no graphical setup or only a simple window manager like [[i3]] or [[awesome]], this may replace the [[acpid]] daemon which is usually used to react to these ACPI events.<br />
<br />
{{Note|Systemd cannot handle AC and Battery ACPI events, so if you use [[Laptop Mode Tools]] or other similar tools [[acpid]] is still required.}}<br />
<br />
In the current version of systemd, the {{ic|Handle}} options will apply throughout the system unless they are "inhibited" (temporarily turned off) by a program, such as a power manager inside a desktop environment. If these inhibits are not taken, you can end up with a situation where systemd suspends your system, then when it wakes up the other power manager suspends it again.<br />
<br />
{{Warning|Currently, the power managers in the newest versions of [[KDE]] and [[GNOME]] are the only ones that issue the necessary "inhibited" commands. Until the others do, you will need to set the {{ic|Handle}} options to {{ic|ignore}} if you want your ACPI events to be handled by [[Xfce]], [[acpid]] or other programs. New versions are on the way that will include this functionality.}}<br />
<br />
{{Note|Systemd can also use other suspend backends (such as [[Uswsusp]] or [[TuxOnIce]]), in addition to the default ''kernel'' backend, in order to put the computer to sleep or hibernate.}}<br />
<br />
==== Sleep hooks ====<br />
<br />
Systemd does not use [[pm-utils]] to put the machine to sleep when using {{ic|systemctl suspend}}, {{ic|systemctl hibernate}} or {{ic|systemctl hybrid-sleep}}; [[pm-utils]] hooks, including any [[Pm-utils#Creating_your_own_hooks|custom hooks]], will not be run. However, systemd provides two similar mechanisms to run custom scripts on these events.<br />
<br />
===== Suspend/resume service files =====<br />
<br />
Service files can be hooked into suspend.target, hibernate.target and sleep.target to execute actions before or after suspend/hibernate. Separate files should be created for user actions and root/system actions. To activate the user service files, {{ic|# systemctl enable suspend@<user> && systemctl enable resume@<user>}}. Examples:<br />
<br />
{{hc|/etc/systemd/system/suspend@.service|2=<nowiki><br />
[Unit]<br />
Description=User suspend actions<br />
Before=sleep.target<br />
<br />
[Service]<br />
User=%I<br />
Type=forking<br />
Environment=DISPLAY=:0<br />
ExecStartPre= -/usr/bin/pkill -u %u unison ; /usr/local/bin/music.sh stop ; /usr/bin/mysql -e 'slave stop'<br />
ExecStart=/usr/bin/sflock<br />
<br />
[Install]<br />
WantedBy=sleep.target</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/resume@.service|2=<nowiki><br />
[Unit]<br />
Description=User resume actions<br />
After=suspend.target<br />
<br />
[Service]<br />
User=%I<br />
Type=simple<br />
ExecStartPre=/usr/local/bin/ssh-connect.sh<br />
ExecStart=/usr/bin/mysql -e 'slave start'<br />
<br />
[Install]<br />
WantedBy=suspend.target</nowiki>}}<br />
<br />
For root/system actions (activate with {{ic|# systemctl enable root-suspend}}):<br />
<br />
{{hc|/etc/systemd/system/root-resume.service|2=<nowiki><br />
[Unit]<br />
Description=Local system resume actions<br />
After=suspend.target<br />
<br />
[Service]<br />
Type=simple<br />
ExecStart=/usr/bin/systemctl restart mnt-media.automount<br />
<br />
[Install]<br />
WantedBy=suspend.target</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/root-suspend.service|2=<nowiki><br />
[Unit]<br />
Description=Local system suspend actions<br />
Before=sleep.target<br />
<br />
[Service]<br />
Type=simple<br />
ExecStart=-/usr/bin/pkill sshfs<br />
<br />
[Install]<br />
WantedBy=sleep.target</nowiki>}}<br />
<br />
A couple of handy hints about these service files (more in {{ic|man systemd.service}}):<br />
* If {{ic|1=<nowiki>Type=OneShot</nowiki>}} then you can use multiple {{ic|1=<nowiki>ExecStart=</nowiki>}} lines. Otherwise only one ExecStart line is allowed. You can add more commands with either {{ic|ExecStartPre}} or by separating commands with a semicolon (see the first example above -- note the spaces before and after the semicolon...these are required!).<br />
* A command prefixed with '-' will cause a non-zero exit status to be ignored and treated as a successful command. <br />
* The best place to find errors when troubleshooting these service files is of course with {{ic|journalctl}}.<br />
<br />
===== Hooks in /usr/lib/systemd/system-sleep =====<br />
<br />
Systemd runs all executables in {{ic|/usr/lib/systemd/system-sleep/}}, passing two arguments to each of them:<br />
<br />
* Argument 1: either {{ic|pre}} or {{ic|post}}, depending on whether the machine is going to sleep or waking up<br />
* Argument 2: {{ic|suspend}}, {{ic|hibernate}} or {{ic|hybrid-sleep}}, depending on which is being invoked<br />
<br />
In contrast to [[pm-utils]], systemd will run these scripts concurrently and not one after another.<br />
<br />
The output of any custom script will be logged by {{ic|systemd-suspend.service}}, {{ic|systemd-hibernate.service}} or {{ic|systemd-hybrid-sleep.service}}. You can see its output in systemd's [[Systemd#Journal|journal]]:<br />
# journalctl -b -u systemd-suspend<br />
<br />
Note that you can also use {{ic|sleep.target}}, {{ic|suspend.target}}, {{ic|hibernate.target}} or {{ic|hybrid-sleep.target}} to hook units into the sleep state logic instead of using custom scripts.<br />
<br />
An example of a custom sleep script:<br />
<br />
{{hc|/usr/lib/systemd/system-sleep/example.sh|<br />
#!/bin/sh<br />
case $1/$2 in<br />
pre/*)<br />
echo "Going to $2..."<br />
;;<br />
post/*)<br />
echo "Waking up from $2..."<br />
;;<br />
esac}}<br />
<br />
See {{ic|man 7 systemd.special}} and {{ic|man 8 systemd-sleep}} for more details.<br />
<br />
=== Temporary files ===<br />
<br />
Systemd-tmpfiles uses configuration files in {{ic|/usr/lib/tmpfiles.d/}} and {{ic|/etc/tmpfiles.d/}} to describe the creation, cleaning and removal of volatile and temporary files and directories which usually reside in directories such as {{ic|/run}} or {{ic|/tmp}}. Each configuration file is named in the style of {{ic|/etc/tmpfiles.d/<program>.conf}}. This will also override any files in {{ic|/usr/lib/tmpfiles.d/}} with the same name.<br />
<br />
tmpfiles are usually provided together with service files to create directories which are expected to exist by certain daemons. For example the [[Samba]] daemon expects the directory {{ic|/var/run/samba}} to exist and to have the correct permissions. The corresponding tmpfile looks like this:<br />
<br />
{{hc|/usr/lib/tmpfiles.d/samba.conf|<br />
D /var/run/samba 0755 root root}}<br />
<br />
However, tmpfiles may also be used to write values into certain files on boot. For example, if you use {{ic|/etc/rc.local}} to disable wakeup from USB devices with {{ic|echo USBE > /proc/acpi/wakeup}}, you may use the following tmpfile instead:<br />
<br />
{{hc|/etc/tmpfiles.d/disable-usb-wake.conf|<br />
w /proc/acpi/wakeup - - - - USBE}}<br />
<br />
The tmpfiles method is recommended in this case since systemd doesn't actually support {{ic|/etc/rc.local}}.<br />
<br />
See {{ic|man 5 tmpfiles.d}} for details.<br />
<br />
=== Units ===<br />
<br />
A unit configuration file encodes information about a service, a socket, a device, a mount point, an automount point, a swap file or partition, a start-up target, a file system path or a timer controlled and supervised by systemd. The syntax is inspired by XDG Desktop Entry Specification .desktop files, which are in turn inspired by Microsoft Windows .ini files.<br />
<br />
See {{ic|man 5 systemd.unit}} for details.<br />
<br />
== Transitioning from initscripts to systemd ==<br />
<br />
=== Initscripts emulation ===<br />
<br />
Integration with Arch's classic configuration is provided by the {{Pkg|initscripts}} package. When {{Pkg|initscripts}} are installed in parallel with systemd, with the system running on systemd, systemd will do the following:<br />
<br />
# Parse the {{ic|DAEMONS}} array of {{ic|/etc/rc.conf}} and start all listed daemons at boot<br />
# Execute {{ic|/etc/rc.local}} during boot<br />
# Execute {{ic|/etc/rc.local.shutdown}} during shutdown<br />
<br />
Initscripts emulation is simply meant as a transitional measure to ease users' move to systemd, and '''will eventually go away'''. Native systemd does not rely on {{ic|rc.conf}} centralised configuration, so it is recommended to use [[#Native configuration|native systemd configuration files]], which will take precedence over {{ic|/etc/rc.conf}}.<br />
<br />
{{Note|The recommended way to replace {{ic|/etc/rc.local}} is to write the custom service files for any things you want to run on the system startup. See the corresponding [[#Writing_custom_.service_files|section]].}}<br />
<br />
{{Note|If you disabled {{keypress|Ctrl+Alt+Del}} to reboot in {{ic|/etc/inittab}}, you will have to reconfigure this setting for systemd by running {{ic|systemctl mask ctrl-alt-del.target}} as root.}}<br />
<br />
=== Moving away from the DAEMONS array ===<br />
<br />
For a pure systemd setup, you should remove the {{ic|/etc/rc.conf}} file entirely and enable services only via {{ic|systemctl}}. For each {{ic|<service_name>}} in the {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}}, run:<br />
<br />
# systemctl enable <service_name><br />
<br />
{{Tip|For a list of commonly used daemons with their initscripts and systemd equivalents, see [[Daemons List|this table]].}}<br />
<br />
If {{ic|<service_name>.service}} does not exist:<br />
<br />
* Most probably, systemd uses a different name. For example, {{ic|cronie.service}} replaces the {{ic|crond}} init daemon; {{ic|alsa-store.service}} and {{ic|alsa-restore.service}} replace the {{ic|alsa}} init daemon. Another important instance is the {{ic|network}} daemon, which is replaced with another set of service files (see [[Configuring Network]] for more details.)<br />
* Otherwise, a service file may not be available for systemd. In that case, you'll need to keep {{ic|rc.conf}} to start the service during boot up.<br />
<br />
{{Tip|You may look inside a package that contains daemon start scripts for service names. For instance:<br />
$ pacman -Ql cronie<br />
[...]<br />
cronie /etc/rc.d/crond #Daemon initscript listed in the DAEMONS array (unused in a "pure" systemd configuration)<br />
[...]<br />
cronie /usr/lib/systemd/system/cronie.service #Corresponding systemd daemon service<br />
[...]<br />
}}<br />
<br />
* Finally, some services do not need to be explicitly enabled by the user. For instance, {{ic|dbus.service}} will automatically be enabled when {{ic|dbus-core}} is installed. {{ic|alsa-store.service}} and {{ic|alsa-restore.service}} are also enabled automatically by systemd. Check the list of available services and their state using the {{ic|systemctl}} command like this: {{ic|systemctl status <service_name>}}.<br />
<br />
== Basic systemctl usage ==<br />
<br />
The main command used to introspect and control systemd is {{ic|systemctl}}. Some of its uses are examining the system state and managing the system and services. See {{ic|man 1 systemctl}} for more details.<br />
<br />
{{Tip|You can use all of the following {{ic|systemctl}} commands with the {{ic|-H <user>@<host>}} switch to control a systemd instance on a remote machine. This will use [[SSH]] to connect to the remote systemd instance.}}<br />
<br />
{{Note|{{ic|systemadm}} is the official graphical frontend for {{ic|systemctl}}. It is provided by the {{AUR|systemd-ui-git}} package from the [[AUR]].}}<br />
<br />
=== Analyzing the system state ===<br />
<br />
List running units:<br />
<br />
$ systemctl<br />
<br />
or:<br />
<br />
$ systemctl list-units<br />
<br />
List failed units:<br />
<br />
$ systemctl --failed<br />
<br />
The available unit files can be seen in {{ic|/usr/lib/systemd/system/}} and {{ic|/etc/systemd/system/}} (the latter takes precedence). You can see list installed unit files by:<br />
<br />
$ systemctl list-unit-files<br />
<br />
=== Using units ===<br />
<br />
Units can be, for example, services ({{ic|.service}}), mount points ({{ic|.mount}}), devices ({{ic|.device}}) or sockets ({{ic|.socket}}).<br />
<br />
When using {{ic|systemctl}}, you generally have to specify the complete name of the unit file, including its suffix, for example {{ic|sshd.socket}}. There are however a few shortforms when specifying the unit in the following {{ic|systemctl}} commands:<br />
<br />
* If you don't specify the suffix, systemctl will assume {{ic|.service}}. For example, {{ic|netcfg}} and {{ic|netcfg.service}} are treated equivalent.<br />
* Mount points will automatically be translated into the appropriate {{ic|.mount}} unit. For example, specifying {{ic|/home}} is equivalent to {{ic|home.mount}}.<br />
* Similiar to mount points, devices are automatically translated into the appropriate {{ic|.device}} unit, therefore specifying {{ic|/dev/sda2}} is equivalent to {{ic|dev-sda2.device}}.<br />
<br />
See {{ic|man systemd.unit}} for details.<br />
<br />
Activate a unit immediately:<br />
<br />
# systemctl start <unit><br />
<br />
Deactivate a unit immediately:<br />
<br />
# systemctl stop <unit><br />
<br />
Restart a unit:<br />
<br />
# systemctl restart <unit><br />
<br />
Ask a unit to reload its configuration:<br />
<br />
# systemctl reload <unit><br />
<br />
Show the status of a unit, including whether it is running or not:<br />
<br />
$ systemctl status <unit><br />
<br />
Check whether a unit is already enabled or not:<br />
<br />
$ systemctl is-enabled <unit><br />
<br />
Enable a unit to be started on bootup:<br />
<br />
# systemctl enable <unit><br />
<br />
{{Note|If services do not have an {{ic|Install}} section, it usually means they are called automatically by other services. But if you need to install them manually, use the following command, replacing {{ic|foo}} with the name of the service.<br />
# ln -s /usr/lib/systemd/system/''foo''.service /etc/systemd/system/graphical.target.wants/<br />
}}<br />
<br />
Disable a unit to not start during bootup:<br />
<br />
# systemctl disable <unit><br />
<br />
Show the manual page associated with a unit (this has to be supported by the unit file):<br />
<br />
$ systemctl help <unit><br />
<br />
Reload systemd, scanning for new or changed units:<br />
<br />
# systemctl daemon-reload<br />
<br />
=== Power management ===<br />
<br />
If you are in a local {{ic|systemd-logind}} user session and no other session is active, the following commands will work without root privileges. If not (for example, because another user is logged into a tty), systemd will automatically ask you for the root password.<br />
<br />
Shut down and reboot the system:<br />
<br />
$ systemctl reboot<br />
<br />
Shut down and power-off the system:<br />
<br />
$ systemctl poweroff<br />
<br />
Suspend the system:<br />
<br />
$ systemctl suspend<br />
<br />
Put the system into hibernation:<br />
<br />
$ systemctl hibernate<br />
<br />
Put the system into hybrid-sleep state (or suspend-to-both):<br />
<br />
$ systemctl hybrid-sleep<br />
<br />
== Running DEs under systemd ==<br />
<br />
To enable graphical login, run your preferred [[Display Manager]] daemon (e.g. [[KDM]]). At the moment, service files exist for [[GDM]], [[KDM]], [[SLiM]], [[XDM]], [[LXDM]] and [[LightDM]].<br />
<br />
# systemctl enable kdm<br />
<br />
This should work out of the box. If not, you might have a {{ic|default.target}} set manually or from a older install:<br />
<br />
{{hc|# ls -l /etc/systemd/system/default.target|<br />
/etc/systemd/system/default.target -> /usr/lib/systemd/system/graphical.target}}<br />
<br />
Simply delete the symlink and systemd will use its stock {{ic|default.target}} (i.e. {{ic|graphical.target}}).<br />
<br />
# rm /etc/systemd/system/default.target<br />
<br />
=== Using systemd-logind ===<br />
<br />
{{Note|As of 2012-10-30, [[ConsoleKit]] has been [https://www.archlinux.org/news/consolekit-replaced-by-logind/ replaced by systemd-logind] as the default mechanism to login to the DE.}}<br />
<br />
In order to check the status of your user session, you can use {{ic|loginctl}}. All [[PolicyKit]] actions like suspending the system or mounting external drives will work out of the box.<br />
<br />
$ loginctl show-session $XDG_SESSION_ID<br />
<br />
== Writing custom .service files ==<br />
''See: [[Systemd/Services]]''<br />
<br />
=== Handling dependencies ===<br />
<br />
With systemd, dependencies can be resolved by designing the unit files correctly. The most typical case is that the unit {{ic|A}} requires the unit {{ic|B}} to be running before {{ic|A}} is started. In that case add {{ic|1=Requires=B}} and {{ic|1=After=B}} to the {{ic|[Unit]}} section of {{ic|A}}. If the dependency is optional, add {{ic|1=Wants=B}} and {{ic|1=After=B}} instead. Note that {{ic|1=Wants=}} and {{ic|1=Requires=}} do not imply {{ic|1=After=}}, meaning that if {{ic|1=After=}} is not specified, the two units will be started in parallel.<br />
<br />
Dependencies are typically placed on services and not on targets. For example, {{ic|network.target}} is pulled in by whatever service configures your network interfaces, therefore ordering your custom unit after it is sufficient since {{ic|network.target}} is started anyway.<br />
<br />
=== Type ===<br />
<br />
There are several different start-up types to consider when writing a custom service file. This is set with the {{ic|1=Type=}} parameter in the {{ic|[Service]}} section. See {{ic|man systemd.service}} for a more detailed explanation.<br />
<br />
* {{ic|1=Type=simple}}: systemd considers the service to be started up immediately. The process must not fork. Do not use this type if other services need to be ordered on this service, unless it is socket activated.<br />
* {{ic|1=Type=forking}}: systemd considers the service started up once the process forks and the parent has exited. For classic daemons use this type unless you know that it is not necessary. You should specify {{ic|1=PIDFile=}} as well so systemd can keep track of the main process.<br />
* {{ic|1=Type=oneshot}}: This is useful for scripts that do a single job and then exit. You may want to set {{ic|1=RemainAfterExit=yes}} as well so that systemd still considers the service as active after the process has exited.<br />
* {{ic|1=Type=notify}}: Identical to {{ic|1=Type=simple}}, but with the stipulation that the daemon will send a signal to systemd when it is ready. The reference implementation for this notification is provided by {{ic|libsystemd-daemon.so}}.<br />
* {{ic|1=Type=dbus}}: The service is considered ready when the specified {{ic|BusName}} appears on DBus's system bus.<br />
<br />
=== Replacing provided unit files ===<br />
<br />
The unit files in {{ic|/etc/systemd/system/}} take precedence over the ones in {{ic|/usr/lib/systemd/system/}}.<br />
To make your own version of a unit (which will not be destroyed by an upgrade), copy the old unit file from {{ic|/usr/lib/}} to {{ic|/etc/}} and make your changes there. Alternatively you can use {{ic|.include}} to parse an existing service file and then override or add new options. For example, if you simply want to add an additional dependency to a service file, you may use:<br />
<br />
{{hc|/etc/systemd/system/<service-name>.service|2=<br />
.include /usr/lib/systemd/system/<service-name>.service<br />
<br />
[Unit]<br />
Requires=<new dependency><br />
After=<new dependency>}}<br />
<br />
Then run the following for your changes to take effect:<br />
<br />
# systemctl reenable <unit><br />
# systemctl restart <unit><br />
<br />
{{Tip|You can use {{ic|systemd-delta}} to see which unit files have been overridden and what exactly has been changed.}} As the provided unit files will be updated from time to time, use systemd-delta for system maintenance.<br />
<br />
=== Syntax highlighting for units within Vim ===<br />
<br />
Syntax highlighting for systemd unit files within [[Vim]] can be enabled by installing {{Pkg|vim-systemd}} from the [[Official Repositories|official repositories]].<br />
<br />
== Targets ==<br />
<br />
Systemd uses ''targets'' which serve a similar purpose as runlevels but act a little different. Each ''target'' is named instead of numbered and is intended to serve a specific purpose with the possibility of having multiple ones active at the same time. Some ''targets'' are implemented by inheriting all of the services of another ''target'' and adding additional services to it. There are systemd ''target''s that mimic the common SystemVinit runlevels so you can still switch ''target''s using the familiar {{ic|telinit RUNLEVEL}} command.<br />
<br />
=== Get current targets ===<br />
<br />
The following should be used under systemd instead of {{ic|runlevel}}:<br />
<br />
$ systemctl list-units --type=target<br />
<br />
=== Create custom target ===<br />
<br />
The runlevels that are assigned a specific purpose on vanilla Fedora installs; 0, 1, 3, 5, and 6; have a 1:1 mapping with a specific systemd ''target''. Unfortunately, there is no good way to do the same for the user-defined runlevels like 2 and 4. If you make use of those it is suggested that you make a new named systemd ''target'' as {{ic|/etc/systemd/system/<your target>}} that takes one of the existing runlevels as a base (you can look at {{ic|/usr/lib/systemd/system/graphical.target}} as an example), make a directory {{ic|/etc/systemd/system/<your target>.wants}}, and then symlink the additional services from {{ic|/usr/lib/systemd/system/}} that you wish to enable.<br />
<br />
=== Targets table ===<br />
<br />
{| border="1"<br />
! SysV Runlevel !! systemd Target !! Notes<br />
|-<br />
| 0 || runlevel0.target, poweroff.target || Halt the system.<br />
|-<br />
| 1, s, single || runlevel1.target, rescue.target || Single user mode.<br />
|-<br />
| 2, 4 || runlevel2.target, runlevel4.target, multi-user.target || User-defined/Site-specific runlevels. By default, identical to 3.<br />
|-<br />
| 3 || runlevel3.target, multi-user.target || Multi-user, non-graphical. Users can usually login via multiple consoles or via the network.<br />
|-<br />
| 5 || runlevel5.target, graphical.target || Multi-user, graphical. Usually has all the services of runlevel 3 plus a graphical login.<br />
|-<br />
| 6 || runlevel6.target, reboot.target || Reboot<br />
|-<br />
| emergency || emergency.target || Emergency shell<br />
|-<br />
|}<br />
<br />
=== Change current target ===<br />
<br />
In systemd targets are exposed via "target units". You can change them like this:<br />
<br />
# systemctl isolate graphical.target<br />
<br />
This will only change the current target, and has no effect on the next boot. This is equivalent to commands such as {{ic|telinit 3}} or {{ic|telinit 5}} in Sysvinit.<br />
<br />
=== Change default target to boot into ===<br />
<br />
The standard target is {{ic|default.target}}, which is aliased by default to {{ic|graphical.target}} (which roughly corresponds to the old runlevel 5). To change the default target at boot-time, append one of the following [[kernel parameters]] to your bootloader:<br />
<br />
{{Tip|The {{ic|.target}} extension can be left out.}}<br />
<br />
* {{ic|1=systemd.unit=multi-user.target}} (which roughly corresponds to the old runlevel 3),<br />
* {{ic|1=systemd.unit=rescue.target}} (which roughly corresponds to the old runlevel 1).<br />
<br />
Alternatively, you may leave the bootloader alone and change {{ic|default.target}}. This can be done using {{ic|systemctl}}:<br />
<br />
# systemctl enable multi-user.target<br />
<br />
The effect of this command is outputted by {{ic|systemctl}}; a symlink to the new default target is made at {{ic|/etc/systemd/system/default.target}}. This works if, and only if:<br />
<br />
[Install]<br />
Alias=default.target<br />
<br />
is in the target's configuration file. Currently, {{ic|multi-user.target}} and {{ic|graphical.target}} both have it.<br />
<br />
== Journal ==<br />
<br />
Since version 38, systemd has its own logging system, the journal. Therefore, running a syslog daemon is no longer required. To read the log, use:<br />
<br />
# journalctl<br />
<br />
By default (when {{ic|Storage&#61;}} is set to {{ic|auto}} in {{ic|/etc/systemd/journald.conf}}), the journal writes to {{ic|/var/log/journal/}}. If the directory {{ic|/var/log/journal/}} does not exist (e.g. if you or some program delete it), systemd will '''not''' create it automatically, but instead write its logs to {{ic|/run/systemd/journal}}. This means that logs will be lost on reboot.<br />
<br />
=== Filtering output ===<br />
<br />
{{ic|journalctl}} allows you to filter the output by specific fields.<br />
<br />
Examples:<br />
<br />
Show all messages from this boot:<br />
<br />
# journalctl -b<br />
<br />
However, often one is interested in messages not from the current, but from the previous boot (e.g. if an unrecoverable system crash happened). Currently, this feature is not implemented, though there was a diskussion at [http://comments.gmane.org/gmane.comp.sysutils.systemd.devel/6608 systemd-devel@lists.freedesktop.org] (September/October 2012).<br />
<br />
As a workaround you can use at the moment:<br />
<br />
# journalctl --since=today | tac | sed -n '/-- Reboot --/{n;:r;/-- Reboot --/q;p;n;b r}' | tac<br />
<br />
, provided, that the previous boot happened today. Be aware that, if there are many messages for the current day, the output of this command can be delayed for quite some time.<br />
<br />
Follow new messages:<br />
<br />
# journalctl -f<br />
<br />
Show all messages by a specific executable:<br />
<br />
# journalctl /usr/lib/systemd/systemd<br />
<br />
Show all messages by a specific process:<br />
<br />
# journalctl _PID=1<br />
<br />
Show all messages by a specific unit:<br />
<br />
# journalctl -u netcfg<br />
<br />
See {{ic|man journalctl}}, {{ic|systemd.journal-fields}} or Lennert's [http://0pointer.de/blog/projects/journalctl.html blog post] for details.<br />
<br />
=== Journal size limit ===<br />
<br />
If the journal is persistent (non-volatile), its size limit is set to a default value of 10% of the size of the respective file system. E.g. with {{ic|/var/log/journal}} located on a 50 GiB root partition this would lead to 5 GiB of journal data. The maximum size of the persistent journal can be controlled by {{ic|SystemMaxUse}} in {{ic|/etc/systemd/journald.conf}}, so to limit it for example to 50 MiB uncomment and edit the corresponding line to:<br />
<br />
SystemMaxUse=50M<br />
<br />
Refer to {{ic|man journald.conf}} for more info.<br />
<br />
=== Journald in conjunction with syslog ===<br />
<br />
Compatibility with classic syslog implementations is provided via a socket {{ic|/run/systemd/journal/syslog}}, to which all messages are forwarded. To make the syslog daemon work with the journal, it has to bind to this socket instead of {{ic|/dev/log}} ([http://lwn.net/Articles/474968/ official announcement]). The {{pkg|syslog-ng}} package in the repositories automatically provides the necessary configuration.<br />
<br />
# systemctl enable syslog-ng<br />
<br />
== Optimization ==<br />
<br />
{{merge|Improve Boot Performance|reason=Should be moved to the article covering this topic.}}<br />
<br />
See [[Improve Boot Performance]].<br />
<br />
=== Analyzing the boot process ===<br />
<br />
==== Using systemd-analyze ====<br />
<br />
Systemd provides a tool called {{ic|systemd-analyze}} that allows you to analyze your boot process so you can see which unit files are causing your boot process to slow down. You can then optimize your system accordingly. You have to install {{Pkg|python2-cairo}} and {{Pkg|python2-gobject}} to use it.<br />
<br />
To see how much time was spent in kernelspace and userspace on boot, simply use:<br />
<br />
$ systemd-analyze<br />
<br />
{{Tip|To see how much time was spent in the initramfs, append the {{ic|timestamp}} hook to your {{ic|HOOKS}} array in {{ic|/etc/[[mkinitcpio]].conf}} and as root, rebuild your initramfs with {{ic|mkinitcpio -p linux}} }}<br />
<br />
To list the started unit files, sorted by the time each of them took to start up:<br />
<br />
$ systemd-analyze blame<br />
<br />
You can also create a SVG file which describes your boot process graphically, similiar to [[Bootchart]]:<br />
<br />
$ systemd-analyze plot > plot.svg<br />
<br />
==== Using bootchart ====<br />
<br />
You could also use a version of bootchart to visualize the boot sequence. Since you are not able to put a second init into the kernel command line you won't be able to use any of the standard bootchart setups. However the {{AUR|bootchart2}} package from [[AUR]] comes with an undocumented systemd service. After you've installed bootchart2 do:<br />
<br />
# systemctl enable bootchart<br />
<br />
Read the [https://github.com/mmeeks/bootchart bootchart documentation] for further details on using this version of bootchart.<br />
<br />
=== Readahead ===<br />
<br />
Systemd comes with its own readahead implementation, this should in principle improve boot time. However, depending on your kernel version and the type of your hard drive, your mileage may vary (i.e. it might be slower). To enable, do:<br />
<br />
# systemctl enable systemd-readahead-collect systemd-readahead-replay<br />
<br />
Remember that in order for the readahead to work its magic, you should reboot a couple of times.<br />
<br />
== Troubleshooting ==<br />
<br />
=== "Error: No space left on device" when trying to start/restart a service ===<br />
Note: I don't know if this is a proper solution, but it seems to have worked for me (I didn't use the same value as they said to, however).<br />
<br />
See this link: [http://support.crashplanpro.com/doku.php/recipe/increase_inotify_watches CrashPlan Support]<br />
<br />
Thanks to [http://forums.fedoraforum.org/showthread.php?t=283422 Fedora Forum] for pointing me to this site.<br />
<br />
=== Shutdown/reboot takes terribly long ===<br />
<br />
If the shutdown process takes a very long time (or seems to freeze) most likely a service not exiting is to blame. Systemd waits some time for each service to exit before trying to kill it. To find out if you are affected, see [http://freedesktop.org/wiki/Software/systemd/Debugging#Shutdown_Completes_Eventually this article].<br />
<br />
=== Short lived processes don't seem to log any output ===<br />
<br />
If {{ic|systemctl -u foounit.service}} doesn't show any output for a short lived service, look at the PID instead. For example, if systemd-modules-load.service fails, and {{ic|systemctl status systemd-modules-load}} shows that it ran as PID 123, then you might be able to see output in the journal for that PID, i.e. {{ic|journalctl -b _PID&#61;123}}. Metadata fields for the journal such as _SYSTEMD_UNIT and _COMM are collected asynchronously and rely on the {{ic|/proc}} directory for the process existing. Fixing this requires fixing the kernel to provide this data via a socket connection, similar to SCM_CREDENTIALS.<br />
<br />
== See also ==<br />
<br />
*[http://www.freedesktop.org/wiki/Software/systemd Official Web Site]<br />
*[http://0pointer.de/public/systemd-man/ Manual Pages]<br />
*[http://freedesktop.org/wiki/Software/systemd/Optimizations systemd Optimizations]<br />
*[http://www.freedesktop.org/wiki/Software/systemd/FrequentlyAskedQuestions FAQ]<br />
*[http://www.freedesktop.org/wiki/Software/systemd/TipsAndTricks Tips And Tricks]<br />
*[http://0pointer.de/public/systemd-ebook-psankar.pdf systemd for Administrators (PDF)]<br />
*[http://fedoraproject.org/wiki/Systemd About systemd on Fedora Project]<br />
*[http://fedoraproject.org/wiki/How_to_debug_Systemd_problems How to debug systemd problems]<br />
*[http://www.h-online.com/open/features/Control-Centre-The-systemd-Linux-init-system-1565543.html Two] [http://www.h-online.com/open/features/Booting-up-Tools-and-tips-for-systemd-1570630.html part] introductory article in ''The H Open'' magazine.<br />
*[http://0pointer.de/blog/projects/systemd.html Lennart's blog story]<br />
*[http://0pointer.de/blog/projects/systemd-update.html status update]<br />
*[http://0pointer.de/blog/projects/systemd-update-2.html status update2]<br />
*[http://0pointer.de/blog/projects/systemd-update-3.html status update3]<br />
*[http://0pointer.de/blog/projects/why.html most recent summary]<br />
*[http://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet Fedora's SysVinit to systemd cheatsheet]</div>AsmundErhttps://wiki.archlinux.org/index.php?title=Fail2ban&diff=242940Fail2ban2013-01-04T10:00:50Z<p>AsmundEr: /* Filesystem Access */</p>
<hr />
<div>[[Category:Secure Shell]]<br />
[[ro:Fail2ban]]<br />
{{Warning|Using an IP blacklist will stop trivial attacks but it relies on an additional daemon and successful logging (the partition containing /var can become full, especially if an attacker is pounding on the server). Additionally, if the attacker knows your IP address, they can send packets with a spoofed source header and get you locked out of the server. [[SSH keys]] provide an elegant solution to the problem of brute forcing without these problems.}}<br />
<br />
[http://www.fail2ban.org/wiki/index.php/Main_Page Fail2ban] scans log files like {{ic|/var/log/pwdfail}} or {{ic|/var/log/apache/error_log}} and bans IP that makes too many password failures. It updates firewall rules to reject the IP address. <br />
<br />
==Installation==<br />
First, install python2-pyinotify so that Fail2ban can detect modification to the log files:<br />
# pacman -S python2-pyinotify<br />
<br />
Then, install {{Pkg|fail2ban}}:<br />
# pacman -S fail2ban<br />
<br />
If you want Fail2ban to send an email when someone has been banned, you have to configure [[SSMTP]] (for example). You will also have to install {{Pkg|whois}} to get some information about the ''attacker''.<br />
# pacman -S whois<br />
===initscripts===<br />
Now you can start the {{Ic|fail2ban}} daemon:<br />
# /etc/rc.d/fail2ban start<br />
<br />
You can add it into DAEMONS array in {{ic|/etc/rc.conf}}: <br />
DAEMONS=(... fail2ban ...)<br />
===systemd===<br />
If using [[systemd]], then use:<br />
# systemctl start fail2ban.service<br />
<br />
And enable it at boot if you like:<br />
# systemctl enable fail2ban.service<br />
<br />
Please note that this currently requires {{ic|syslog-ng}} logging. This is because a pure systemd {{ic|journalctl}} does not log to {{ic|/var/log/auth.log}} which is parsed by the service in default.<br />
<br />
==Hardening==<br />
Currently, fail2ban requires to run as root, therefore you may wish to consider some additional hardening on the process with systemd. Ref:[http://0pointer.de/blog/projects/security.html systemd for Administrators, Part XII]<br />
===Capabilities===<br />
For added security consider limiting fail2ban capabilities by adding ''CapabilityBoundingSet'' under {{ic|[Service]}} section of the systemd service file, e.g.:<br />
CapabilityBoundingSet=CAP_DAC_READ_SEARCH CAP_NET_ADMIN CAP_NET_RAW<br />
In the example above, '''CAP_DAC_READ_SEARCH''' will allow fail2ban full read access, and '''CAP_NET_ADMIN''' and '''CAP_NET_RAW''' allow setting of firewall rules with [[iptables]]. Additional capabilities may be required, depending on your fail2ban configuration. See {{ic|man capabilities}} for more info.<br />
===Filesystem Access===<br />
Also considering limiting file system read and write access, by using ''ReadOnlyDirectories'' and ''ReadWriteDirectories'', again under the under {{ic|[Service]}} section. For example:<br />
ReadOnlyDirectories=/<br />
ReadWriteDirectories=/var/run/fail2ban /var/spool/postfix/maildrop<br />
In the example above, this limits the file system to read-only, except for {{ic|/var/run/fail2ban}} for pid and socket files, and {{ic|/var/spool/postfix/maildrop}} for [[postfix]] sendmail. Again, this will be dependent on you system configuration and fail2ban configuration. Note that adding {{ic|/var/log}} is necessary if you want fail2ban to log its activity.<br />
<br />
==SSH jail==<br />
Edit {{ic|/etc/fail2ban/jail.conf}} and modify the ssh-iptables section to enable it and configure the action.<br />
<br />
If your firewall is iptables:<br />
[ssh-iptables]<br />
enabled = true<br />
filter = sshd<br />
action = iptables[name=SSH, port=ssh, protocol=tcp] <br />
sendmail-whois[name=SSH, dest=your@mail.org, sender=fail2ban@mail.com]<br />
logpath = /var/log/auth.log <br />
maxretry = 5<br />
<br />
If your firewall is shorewall:<br />
[ssh-shorewall]<br />
enabled = true<br />
filter = sshd<br />
action = shorewall<br />
sendmail-whois[name=SSH, dest=your@mail.org, sender=fail2ban@mail.com]<br />
logpath = /var/log/auth.log <br />
maxretry = 5<br />
<br />
{{Note|You can set {{Ic|BLACKLISTNEWONLY}} to {{Ic|No}} in {{ic|/etc/shorewall/shorewall.conf}} otherwise the rule added to ban an IP address will affect only new connections.}}<br />
<br />
Also do not forget to add/change:<br />
LogLevel VERBOSE<br />
in your {{ic|/etc/ssh/sshd_config}}. Else, password failures are not logged correctly.<br />
<br />
==See also==<br />
*[[sshguard]]</div>AsmundErhttps://wiki.archlinux.org/index.php?title=MythTV&diff=236540MythTV2012-11-23T19:40:11Z<p>AsmundEr: /* Installing MythTV */ Removed reference to mythplugins-mythvideo, as this no longer exists. Ditto for myththemes.</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[da:MythTV]]<br />
MythTV is an application suite designed to provide an amazing multimedia experience.<br />
It provides PVR functionality to a Linux based computer and also supports other media types. <br />
Combined with a nice, quiet computer and a decent TV, it makes an excellent centerpiece to a home theater system.<br />
<br />
==Structure==<br />
The MythTV system is split into a backend and a frontend. Each component has its own functions:<br />
<br />
===mythbackend===<br />
*Schedule and record television programming<br />
*Stream video data to the frontend<br />
*Flag commercial breaks<br />
*Transcode videos from one format to another<br />
<br />
===mythfrontend===<br />
*Provide a pretty GUI<br />
*Play back recorded content<br />
*Provide an interface to schedule programs<br />
<br />
The frontend and backend may be on separate computers on a network, and there may also be multiple frontends. This architecture allows for a central media distribution system that can reach anywhere a network can. This is a remarkably flexible system, and it even allows very low power machines to act as perfectly usable frontends.<br />
<br />
==Requirements==<br />
MythTV is a very scalable system. With standard definition television and pure MPEG2 encoding and decoding with hardware acceleration, even a very modest system can act as both frontend and backend. How modest? Some people report being able to use fanless Via systems with Hauppauge PVR cards for both backend and frontend simultaneously. While the author does not condone the use of such a lightweight system, it has been done successfully.<br />
<br />
On the other end of the spectrum, high definition TV with MPEG4 transcoding and commercial flagging can require serious horsepower. Most people in the HD realm use high-end Athlon XPs, midrange to high-end Athlon 64s, and high-end Pentium 4s for their backends. The frontend can get away with a somewhat more midrange processor if XvMC playback acceleration is used.<br />
<br />
All systems are going to need a tuner card. The Hauppauge PVR series of cards (150, 250, 350, and 500) are very popular for use with MythTV due to fairly decent Linux support and low CPU usage. Other cards, like those based on the BT878 chipset, are also used. Unlike the PVR series, BT878 based cards require significant amounts of CPU power to save the video, as these cards output raw frames and not compressed streams.<br />
<br />
The only combination of hardware the author can say works is an Athlon XP 1700+ frontend with 512MB of DDR memory, and a Pentium 4 2.8GHz backend with 512MB of DDR2 memory.<br />
<br />
==Getting Started==<br />
In order to install MythTV on your system(s), you must have a working Linux installation. Since this is the Arch Linux website, this article will be geared towards Arch. A simple base system [[:Category:Installation|Installation]] with no extras is a suggested starting point.<br />
<br />
For the backend, it is also good to have [[LAMP]] working properly so that anybody can use a web browser to schedule programming through MythWeb. While it is not necessary, it is a very handy feature.<br />
<br />
A working [[Xorg]] (graphical) environment is necessary.<br />
<br />
==Make a "mythtv" User==<br />
<br />
If the purpose of the box is a stand-alone system, consider making a dedicated user for this purpose. For the rest of the guide, this username is "mythtv."<br />
<br />
# useradd -m -g users -G audio,lp,optical,storage,video,games,power -s /bin/bash mythtv<br />
# passwd mythtv <<set the password of your choosing>><br />
<br />
Become user mythtv<br />
<br />
# su mythtv<br />
<br />
Create a file for mythtv for database connections ~<br />
<br />
$ mkdir ~/.mythtv<br />
<br />
Paste the following into {{ic|~/.mythtv/mysql.txt}}<br />
<br />
{{bc|1=DBHostName=localhost<br />
<br />
# By default, Myth tries to ping the DB host to see if it exists.<br />
# If your DB host or network doesn't accept pings, set this to no:<br />
#<br />
DBHostPing=no<br />
<br />
DBHostName=localhost<br />
DBUserName=mythtv<br />
DBName=mythconverg<br />
DBPassword=mythtv<br />
<br />
# Set the following if you want to use something other than this<br />
# machine's real hostname for identifying settings in the database.<br />
# This is useful if your hostname changes often, as otherwise you<br />
# will need to reconfigure mythtv (or futz with the DB) every time.<br />
# TWO HOSTS MUST NOT USE THE SAME VALUE<br />
#<br />
LocalHostName=MYCOOLMYTHTVHOST<br />
<br />
# If you want your frontend to be able to wake your MySQL server<br />
# using WakeOnLan, have a look at the following settings:<br />
#<br />
#<br />
# The time the frontend waits (in seconds) between reconnect tries.<br />
# This should be the rough time your MySQL server needs for startup<br />
#<br />
#WOLsqlReconnectWaitTime=0<br />
#<br />
#<br />
# This is the number of retries to wake the MySQL server<br />
# until the frontend gives up<br />
#<br />
#WOLsqlConnectRetry=5<br />
#<br />
#<br />
# This is the command executed to wake your MySQL server.<br />
#<br />
#WOLsqlCommand=echo 'WOLsqlServerCommand not set'}}<br />
<br />
==Installing MythTV==<br />
<br />
Install the MythTV package and any desired plugins:<br />
<br />
# pacman -S mythtv mythplugins-mythweb ...<br />
<br />
*mythplugins-mytharchive - Create DVDs or archive recorded shows in MythTV<br />
*mythplugins-mythbrowser - Mini web browser for MythTV<br />
*mythplugins-mythgallery - Image gallery plugin for MythTV<br />
*mythplugins-mythgame - Game emulator plugin for MythTV<br />
*mythplugins-mythmusic - Music playing plugin for MythTV<br />
*mythplugins-mythnetvision - MythNetvision plugin for MythTV<br />
*mythplugins-mythnews - News checking plugin for MythTV<br />
*mythplugins-mythweather - Weather checking plugin for MythTV<br />
*mythplugins-mythweb - Web interface for the MythTV scheduler<br />
*mythplugins-mythzoneminder - View CCTV footage from zoneminder in MythTV<br />
<br />
At this point a generic MythTV installation is present that must be refined into a backend, a frontend, or both.<br />
<br />
===Backend setup===<br />
Before setting up your backend, make sure you have a functioning ''video capture card'' or a ''firewire input from a STB''. Unfortunately, that part of setup is outside the scope of this article. If you are in the United States, get an account at [http://www.schedulesdirect.org Schedules Direct] (this service provides TV listings at a minimal cost). Users outside the United States will need to use screen scrapers ([http://wiki.xmltv.org/index.php/Main_Page/ xmltv]) to do the same job. <br><br />
<br />
====Setting up the database====<br />
<br />
{{Note|This is a quick and dirty walk through of MySQL. Be sure you read the [[MySQL]] article for more details.}}<br />
Install and run MySQL<br />
<br />
# pacman -S mysql<br />
<br />
If other machines in your LAN are expected to connect to the masterbackend server, comment out the "skip-networking" line in {{ic|/etc/mysql/my.cnf}} at this point.<br />
<br />
[[Daemon#Performing daemon actions manually|Start the mysqld daemon]] and add mysqld to your [[Daemons#Starting on Boot|DAEMONS array]] so it starts automatically on boot.<br />
<br />
Setup mysql with a password:<br />
<br />
{{hc|# mysql_secure_installation|2=<br />
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL<br />
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!<br />
<br />
<br />
In order to log into MySQL to secure it, we'll need the current<br />
password for the root user. If you've just installed MySQL, and<br />
you haven't set the root password yet, the password will be blank,<br />
so you should just press enter here.<br />
<br />
Enter current password for root (enter for none): <br />
OK, successfully used password, moving on...<br />
<br />
Setting the root password ensures that nobody can log into the MySQL<br />
root user without the proper authorisation.<br />
<br />
You already have a root password set, so you can safely answer 'n'.<br />
<br />
Change the root password? [Y/n] n<br />
... skipping.<br />
<br />
By default, a MySQL installation has an anonymous user, allowing anyone<br />
to log into MySQL without having to have a user account created for<br />
them. This is intended only for testing, and to make the installation<br />
go a bit smoother. You should remove them before moving into a<br />
production environment.<br />
<br />
Remove anonymous users? [Y/n] <br />
... Success!<br />
<br />
Normally, root should only be allowed to connect from 'localhost'. This<br />
ensures that someone cannot guess at the root password from the network.<br />
<br />
Disallow root login remotely? [Y/n] <br />
... Success!<br />
<br />
By default, MySQL comes with a database named 'test' that anyone can<br />
access. This is also intended only for testing, and should be removed<br />
before moving into a production environment.<br />
<br />
Remove test database and access to it? [Y/n] <br />
- Dropping test database...<br />
... Success!<br />
- Removing privileges on test database...<br />
... Success!<br />
<br />
Reloading the privilege tables will ensure that all changes made so far<br />
will take effect immediately.<br />
<br />
Reload privilege tables now? [Y/n] <br />
... Success!<br />
<br />
Cleaning up...<br />
<br />
<br />
<br />
All done! If you've completed all of the above steps, your MySQL<br />
installation should now be secure.<br />
<br />
Thanks for using MySQL!}}<br />
<br />
Create the database structure:<br />
<br />
# mysql -u root -p </usr/share/mythtv/mc.sql<br />
<br />
If you have lost or overwritten your mc.sql file, it is always available [https://github.com/MythTV/mythtv/blob/master/mythtv/database/mc.sql here].<br />
<br />
Do not forget to update your database<br />
# mysql_upgrade -u root -p<br />
<br />
{{Note|With the 0.26 release of mythtv, time zone tables are required to be in MySQL!}}<br />
To add them, simply execute the following:<br />
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p<yourpassword> mysql<br />
<br />
====Setting up the master backend====<br />
Load up your WM (lxde is a good choice for light-weight builds, but anything will work.)<br />
<br />
Now run the mythtv-setup program<br />
$ mythtv-setup<br />
<br />
* '''General menu''' <br><br />
If this is your master backend, put its IP address in the first and fourth fields, identifying this computer as your master and giving its network IP address.<br><br />
On the next page, enter the paths where recordings and the live TV buffer will be stored. LVM or RAID solutions provide easily accessible large scale storage. But again, those are outside the scope of this article. Set the live TV buffer to a size you can handle and leave everything else alone.<br><br />
On the next page, set the settings to your locale. NTSC is mostly used in North America, and be sure to set whether using cable or broadcast.<br><br />
On the next two pages, leave everything as is unless you know for sure you want to change it.<br />
On the next page, if you have a fast backend that can handle recordings and flagging jobs simultaneously, it is recommended to set CPU usage to \"High\", maximum simultaneous jobs to 2, and to check the commercial flagging option.<br><br />
On the next page, set these options to taste. Automatic commercial flagging is highly recommended.<br />
Ignore the next page and finish.<br><br />
<br />
* '''Capture card menu''' <br><br />
Select your card type from the drop down list. Hauppauge PVR users will select the MPEG-2 encoder card option.<br><br />
Point mythtv-setup to the proper location, usually /dev/v4l/video0<br><br />
<br />
* '''Video sources menu''' <br><br />
This is where it gets important to have a source for TV listings. Schedules Direct users should create a new video source, name it, select the North America (Schedules Direct) option, and fill in their logon information. In order to verify that it is correct, go ahead and retrieve the listings. <br><br />
<br />
* '''Input connections menu''' <br><br />
This menu is rather self-explanatory. All you need to do is pick an input on the capture card and tell myth which video source it connects to. Most users will select their tuner and leave all the other inputs alone. Satellite users will select a video input, and on the next page provide the command to change channels on their STB using an external channel change program. This is also outside the scope of this article.<br />
<br />
* '''Channel editor menu''' <br><br />
This menu is safe to ignore<br />
<br />
* Exit the program (Esc)<br />
<br />
* Run mythfilldatabase<br />
$ mythfilldatabase<br />
<br />
This should populate your mysql database with TV listings for the next two weeks (or so).<br />
<br />
Add mythbackend to the /etc/rc.conf daemons line.<br />
<br />
DAEMONS=( . . . '''mythbackend''')<br />
<br />
=== Security ===<br />
<br />
You may want to have the backend run as the previously-created mythtv user:<br />
<br />
This is a good idea since all user jobs are run as the same user as the user running the backend. If the backend is run as root, all user jobs will be run with root privileges.<br />
<br />
* Edit /etc/conf.d/mythbackend<br />
MBE_USER='mythtv'<br />
<br />
=== Troubleshooting ===<br />
<br />
If you get a libXvMCW.so.1 shared library error, install the following:<br />
{{bc|<br />
# pacman -S libxvmc<br />
}}<br />
<br />
If you cannot open /dev/video0 of your PVR150, install the firmware:<br />
# pacman -S ivtv-utils<br />
<br />
==Frontend setup==<br />
<br />
Compared to the backend, getting a frontend running is trivially simple. Just make sure you are in an X environment as a normal user and run mythfrontend. It will pop up a menu asking about the IP address of the backend and the local computer's name and IP address. Fill in this information and your frontend should be functional. On the other hand, the frontend has more options than a luxury car. All of those are an article on their own. There are a few notable options that should be set to ensure a good working setup. If you do not have an interlaced monitor (and almost nobody does), you will need to deinterlace your television output. Go into the TV playback menu and select kernel deinterlacing or bob2x deinterlacing. Try both and see which you like better. Also, in the general settings page, it is good to set up your [Alsa setup] settings, but those vary so greatly it is not worth suggesting values here.<br />
<br />
One problem I encountered running mythfrontend 0.20.0.2007013 on fglrx was that the colors were mixed up. People were blue-skinned etc. It turns out there is a hack for ATI cards in the source, but it is not enabled. Uncomment #define USE_ATI_PROPRIETARY_DRIVER_XVIDEO_HACK in libs/libmythtv/videoout_xv.cpp and rebuild. (this will change names in svn and so future versions)<br />
<br />
===Nvidia XvMC Setup===<br />
<br />
Assuming you have loaded the proprietary Nvidia drivers from pacman you may need do the following:<br />
{{bc|<br />
echo "libXvMCNVIDIA_dynamic.so.1" > /etc/X11/XvMCConfig }}<br />
<br />
This will allow Mythfrontend to use the XvMC environment for acceleration. Restart Mythfrontend<br />
<br />
==MythTV Plugins==<br />
There are a number of plugins available for MythTV in the AUR. They range from RSS readers to DVD players. Take a look at them. Simply installing the package on the frontend computer should impart the intended functionality. There is rarely any additional setup, and when there is, the install file will mention it.<br />
<br />
===MythWeb===<br />
[[MythWeb]] is a web interface for MythTV. Instructions for configuring MythWeb in Arch Linux can be found on the [[MythWeb]] page.<br />
<br />
=== Mythweather===<br />
<br />
As of 7-10-08 Mythweather is broken in Extra<br />
<p>extra/mythweather 0.21-1 (mythtv-extras)</p><br />
<br />
==Environment Variables==<br />
I found mythbackend would randomly stop running with the following error message:<br />
{{ic|Cannot locate your home directory. Please set the environment variable HOME or MYTHCONFDIR}}<br />
<br />
So I did the following as root:<br />
{{ic|mkdir /home/mythtv ; cp /home/(myusername)/.lircrc /home/mythtv/ ; chown -R (myusername):users /home/mythtv}}<br />
<br />
And then put the following in /etc/rc.conf<br />
{{ic|1=MYTHCONFDIR=/home/mythtv}}<br />
<br />
==Hints to a Happy Myth System==<br />
But not full articles (yet)<br />
*Run ntpd or openntpd on your backend to make sure it always has the right time.<br />
*[[lirc|LIRC]] on your frontend allows you to use a remote control, which is wonderful in a living room.<br />
*Use gdm, kdm, or xdm to automatically log in your frontend, and ~/.xinitrc to load mythfrontend on boot.<br />
*Set the "automatically run mythfilldatabase" option on one of your frontends to make sure you always have listings.<br />
*Do not forget to use the verbosity statements and log file location arguments to mythfrontend so you can see when things break.<br />
*Do not run your frontend as root, create a mythtv user<br />
<br />
===Using GDM to autologin your Mythfrontend===<br />
[[Display Manager]]<br />
<p>In your /etc/gdm/custom.conf add the following statements under the [daemon] heading:</p><br />
{{bc|1=<br />
AutomaticLoginEnable=true<br />
AutomaticLogin=mythtv (assuming your frontend user is mythtv)}}<br />
FYI - GDM will not autologin as root<br />
<br />
===Using XDM to Automically Login to your MythFrontend===<br />
<p>Find in your /etc/inittab file the following line:</p><br />
{{bc|id:3:initdefault:}}<br />
<br />
<p>Change to:</p><br />
{{bc|id:5:initdefault:}}<br />
<br />
<p>Then add the following below it (or anywhere in the file):</p><br />
{{bc|x:5:respawn:su - MYTHUSER -c startx}}<br />
<br />
{{Note| Remember to change "MYTHUSER" to the username that you want to autologin under.}}<br />
<br />
<p>If you'd like to start mythfrontend on booting into Xorg, edit (or create if none exists) your MYTHUSER's .xinitrc file and add the following line:</p><br />
{{bc|mythfrontend}}<br />
<br />
===Optmize your system===<br />
Be sure to have a look at MythTV's extensive wiki documentation on how to keep your data stores happy, as well as optimize your system in various other ways to get the most out of your Myth box.<br />
<br />
[http://www.mythtv.org/wiki/Optimizing_Performance MythTV Wiki: Optimizing Performance]<br />
<br />
==References==<br />
*http://www.mythtv.org<br />
*http://mythtv.info<br />
*http://wilsonet.com/mythtv/fcmyth.php<br />
*http://www.linhes.org [A user friendly MythTV and Linux install that uses Arch Linux]</div>AsmundErhttps://wiki.archlinux.org/index.php?title=Syslinux&diff=219085Syslinux2012-08-22T06:45:50Z<p>AsmundEr: /* Chainloading */</p>
<hr />
<div>[[Category:Boot loaders]]<br />
[[tr:Syslinux]]<br />
[[zh-CN:Syslinux]]<br />
[[it:Syslinux]]<br />
{{Article summary start}}<br />
{{Article summary text|Describes installing and configuring Syslinux, a collection of bootloaders.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary end}}<br />
<br />
Syslinux is a collection of boot loaders capable of booting from hard drives, CDs, and over the network via PXE. It supports the fat, ext2, ext3, ext4, and btrfs file systems.<br />
<br />
{{Note|Since Syslinux 4, Extlinux and Syslinux are the same thing.}} <br />
<br />
{{Note|Syslinux does not support [[UEFI]] as of May 2012. According to upstream, UEFI support will be eventually added to Syslinux, but there is no time-frame as to when it will be functional.}}<br />
<br />
== Syslinux Boot Process ==<br />
#'''Load MBR'''. At boot, the computer loads the [[MBR]] ({{ic|/usr/lib/syslinux/mbr.bin}}). <br />
#'''Search active partition'''. The MBR looks for the partition that is marked as active (boot flag). <br />
#'''Execute volume boot record'''. Once found, the volume boot record (VBR) will be executed. In the case of ext2/3/4 and fat12/16/32, the starting sector of {{ic|ldlinux.sys}} is hard-coded into the VBR.<br />
#'''Execute ldlinux.sys'''. The VBR will execute ({{ic|ldlinux.sys}}). Therefore, if the location of {{ic|ldlinux.sys}} changes, syslinux will no longer boot. (In the case of btrfs, the above method will not work since files move around resulting in the sector location of {{ic|ldlinux.sys}} changing. Therefore, the entire Syslinux code needs to be stored outside the filesystem. The code is stored in the sectors following the VBR.) <br />
#'''Search configuration file'''. Once Syslinux is fully loaded, it looks for a configuration file, either {{ic|extlinux.conf}} or {{ic|syslinux.cfg}}. <br />
#'''Load configuration'''. If one is found, the configuration file is loaded. If no configuration file is found, you will be given a syslinux prompt.<br />
<br />
==Installation==<br />
===Automatic Install ===<br />
The {{ic|syslinux-install_update}} script will install Syslinux, copy/symlink {{ic|*.c32}} modules to {{ic|/boot/syslinux}}, set the boot flag and install the boot code in the MBR. It can handle MBR and GPT disks along with softraid.<br />
<br />
1. Install the {{Pkg|syslinux}} package:<br />
# pacman -S syslinux<br />
2. If you use a separate boot partition make sure that it is mounted. Check with {{ic|lsblk}}; if you don't see a {{ic|/boot}} mountpoint, mount it before you go any further.<br/><br />
3. Run {{ic|syslinux-install_update}} with flags: {{ic|-i}} (install the files), {{ic|-a}} (mark the partition ''active'' with the ''boot'' flag), {{ic|-m}} (install the ''MBR'' boot code):<br />
# syslinux-install_update -iam<br />
4. Edit {{ic|/boot/syslinux/syslinux.cfg}}.<br />
<br />
===Manual Install ===<br />
{{Note| If you are unsure of which partition table you are using (MBR or GPT), you are likely using the MBR partition table. Most of the time GPT will create a special MBR-style partition (type 0xEE) using the whole disk which will be displayed with the following command:<br />
# fdisk -l /dev/sda<br />
<br />
or alternatively:<br />
# sgdisk -l /dev/sda<br />
<br />
will show "GPT: not present" if it is not a GPT disk.<br />
}}<br />
<br />
{{Note| If you are trying to rescue an installed system with a live CD, be sure to [[Change_Root|chroot]] into it before executing these commands. If you do not chroot first, you must prepend all file paths (not {{ic|/dev/}} paths) with the mount point.}}<br />
<br />
Make sure you have the {{Pkg|syslinux}} package installed. Then install Syslinux onto your boot partition, which must contain a fat, ext2, ext3, ext4, or btrfs file system.<br />
You should install it on a mounted directory, not a {{ic|/dev/sdXY}} device. You do not have to install it on the root directory of a file system, e.g., with device {{ic|/dev/sda1}} mounted on {{ic|/boot}} you can install syslinux in the syslinux directory:<br />
# mkdir /boot/syslinux<br />
# extlinux --install /boot/syslinux <br />
<br />
====MBR Partition Table====<br />
Next you need mark your boot partition active in your partition table. Applications capable of doing this include {{ic|fdisk}}, {{ic|cfdisk}}, {{ic|sfdisk}}, {{ic|parted/gparted}}. It should look like this:<br />
{{hc|# fdisk -l /dev/sda|<br />
[...]<br />
Device Boot Start End Blocks Id System<br />
/dev/sda1 * 2048 104447 51200 83 Linux<br />
/dev/sda2 104448 625142447 312519000 83 Linux<br />
}}<br />
<br />
Install the MBR:<br />
<br />
# dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/mbr.bin of=/dev/sda<br />
<br />
{{Note|1=An alternate MBR doesn't work properly in '''Syslinux 4.05''' - it always invokes first partition. This bug was fixed in this commit: https://git.kernel.org/?p=boot/syslinux/syslinux.git;a=commit;h=794ff174175734a0974e1846f0db29040b096e45.}}<br />
<br />
An alternate MBR which Syslinux provides is: altmbr.bin. This MBR does ''not'' scan for bootable partitions; instead, the last byte of the MBR is set to a value indicating which partition to boot from. Here is an example of how {{ic|altmbr.bin}} can be copied into position:<br />
<br />
# printf '\x5' | cat /usr/lib/syslinux/altmbr.bin - | dd bs=440 count=1 iflag=fullblock conv=notrunc of=/dev/sda<br />
<br />
In this case, a single byte of value 5 is appended to the contents of {{ic|altmbr.bin}} and the resulting 440 bytes are written to the MBR on device sda. Syslinux was installed on the first logical partition ({{ic|/dev/sda5}}) of the disk.<br />
<br />
====GUID Partition Table aka GPT====<br />
Main article [[GUID Partition Table]].<br />
<br />
Bit 2 of the attributes for the {{ic|/boot}} partition needs to be set.<br />
<br />
# sgdisk /dev/sda --attributes=1:set:2<br />
<br />
This would toggle the attribute ''legacy BIOS bootable'' on partition 1. To check:<br />
<br />
# sgdisk /dev/sda --attributes=1:show<br />
1:2:1 (legacy BIOS bootable)<br />
<br />
Install the MBR:<br />
# dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/gptmbr.bin of=/dev/sda<br />
<br />
====Rebooting====<br />
When you reboot your system now, you will have a syslinux prompt. To automatically boot your system or get a boot menu, you still need to create a configuration file.<br />
<br />
== Configuration ==<br />
The syslinux configuration file, {{ic|syslinux.cfg}}, should be created in the same directory where you installed syslinux. In our case, {{ic|/boot/syslinux/}}.<br />
<br />
The bootloader will look for either {{ic|syslinux.cfg}} (preferred) or {{ic| extlinux.conf}}<br />
<br />
'''Tips''':<br />
*Instead of {{ic|LINUX}}, the keyword {{ic|KERNEL}} can also be used. {{ic|KERNEL}} tries to detect the type of the file, while {{ic|LINUX}} always expects a Linux kernel. <br />
*{{ic|TIMEOUT}} value is in units of 1/10 of a second.<br />
<br />
=== Examples ===<br />
==== Basic Config ====<br />
This is a simple configuration file that will show a boot: prompt and automatically boot after 5 seconds.<br />
<br />
Note: the partition in question needs to be whatever you have as / (root), not /boot.<br />
<br />
Config:<br />
PROMPT 1<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux-fallback.img<br />
<br />
If you want to boot directly without seeing a prompt, set {{ic|PROMPT}} to {{ic|0}}.<br />
<br />
If you want to use [[UUID]] for persistent device naming instead of device names, change:<br />
APPEND root=/dev/sda2 ro<br />
<br />
to:<br />
APPEND root=UUID=<uuid here> ro<br />
<br />
==== Text Boot menu ====<br />
Syslinux also allows you to use a boot menu. To use it, copy the menu COM32 module to your syslinux directory:<br />
# cp /usr/lib/syslinux/menu.c32 /boot/syslinux/<br />
<br />
If {{ic|/boot}} is in the same partition as {{ic|/usr}}, a symlink will also work:<br />
# ln -s /usr/lib/syslinux/menu.c32 /boot/syslinux/<br />
<br />
Config:<br />
UI menu.c32<br />
PROMPT 0<br />
<br />
MENU TITLE Boot Menu<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux-fallback.img<br />
<br />
For more details about the menu system, see http://git.kernel.org/?p=boot/syslinux/syslinux.git;a=blob;f=doc/menu.txt.<br />
<br />
==== Graphical Boot menu ====<br />
Syslinux also allows you to use a graphical boot menu. To use it, copy the vesamenu COM32 module to your syslinux folder:<br />
# cp /usr/lib/syslinux/vesamenu.c32 /boot/syslinux/<br />
<br />
If {{ic|/boot}} is the same partition as {{ic|/}}, a symlink will also work:<br />
# ln -s /usr/lib/syslinux/vesamenu.c32 /boot/syslinux/<br />
<br />
[http://projects.archlinux.org/archiso.git/tree/configs/releng/syslinux This config] uses the same menu design as the Arch Install CD. The background file can be found there too.<br />
<br />
Config:<br />
UI vesamenu.c32<br />
DEFAULT arch<br />
PROMPT 0<br />
MENU TITLE Boot Menu<br />
MENU BACKGROUND splash.png<br />
TIMEOUT 50<br />
<br />
MENU WIDTH 78<br />
MENU MARGIN 4<br />
MENU ROWS 5<br />
MENU VSHIFT 10<br />
MENU TIMEOUTROW 13<br />
MENU TABMSGROW 11<br />
MENU CMDLINEROW 11<br />
MENU HELPMSGROW 16<br />
MENU HELPMSGENDROW 29<br />
<br />
# Refer to http://www.syslinux.org/wiki/index.php/Comboot/menu.c32<br />
<br />
MENU COLOR border 30;44 #40ffffff #a0000000 std<br />
MENU COLOR title 1;36;44 #9033ccff #a0000000 std<br />
MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all<br />
MENU COLOR unsel 37;44 #50ffffff #a0000000 std<br />
MENU COLOR help 37;40 #c0ffffff #a0000000 std<br />
MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std<br />
MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std<br />
MENU COLOR msg07 37;40 #90ffffff #a0000000 std<br />
MENU COLOR tabmsg 31;40 #30ffffff #00000000 std<br />
<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux.img<br />
<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux-fallback.img<br />
<br />
Since Syslinux 3.84, {{ic|vesamenu.c32}} supports the {{ic|MENU RESOLUTION $WIDTH $HEIGHT}} directive.<br />
To use it, insert {{ic|MENU RESOLUTION 1440 900}} into your config for a 1440x900 resolution.<br />
The background picture has to have exactly the right resolution, however, as syslinux will otherwise refuse to load the menu.<br />
<br />
=== Auto Boot ===<br />
If you don't want to see the syslinux menu at all, comment out all {{ic|UI}} commands and make sure there is a {{ic|DEFAULT}} set in your {{ic|syslinux.cfg}}.<br />
<br />
=== Chainloading ===<br />
If you want to chainload other operating systems (such as Windows) or boot loaders, copy (or symlink) the {{ic|chain.c32}} module to the syslinux directory (for details, see the instructions in the previous section). Then create a section in the configuration file:<br />
<br />
LABEL windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND hd0 3<br />
<br />
{{ic|hd0 3}} is the third partition on the first BIOS drive - drives are counted from zero, but partitions are counted from one. <br />
<br />
If you are unsure about which drive your BIOS thinks is "first", you can instead use the MBR identifier, or if you are using GPT, the filesystem labels. To use the MBR identifier, run the command<br />
# fdisk -l /dev/sdb<br />
<br />
Disk /dev/sdb: 128.0 GB, 128035676160 bytes <br />
255 heads, 63 sectors/track, 15566 cylinders, total 250069680 sectors<br />
Units = sectors of 1 * 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 512 bytes<br />
I/O size (minimum/optimal): 512 bytes / 512 bytes<br />
Disk identifier: 0xf00f1fd3<br />
<br />
Device Boot Start End Blocks Id System<br />
/dev/sdb1 2048 4196351 2097152 7 HPFS/NTFS/exFAT<br />
/dev/sdb2 4196352 250066943 122935296 7 HPFS/NTFS/exFAT<br />
<br />
replacing {{ic|/dev/sdb}} with the drive you wish to chainload. Using the hex number under Disk identifier: {{ic|0xf00f1fd3}} in this case, the syntax in syslinux.cfg is<br />
<br />
LABEL windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND mbr:0xf00f1fd3<br />
<br />
For more details about chainloading, see [http://syslinux.zytor.com/wiki/index.php/Comboot/chain.c32].<br />
<br />
If you have [[GRUB]] installed on the same partition, you can chainload it by using: <br />
<br />
LABEL grub2<br />
MENU LABEL Grub2<br />
COM32 chain.c32<br />
append file=../grub/boot.img<br />
<br />
This may be required for booting from ISO images.<br />
<br />
=== Using memtest ===<br />
Use this {{ic|LABEL}} section to launch memtest (install the {{Pkg|memtest86+}} package):<br />
<br />
LABEL memtest<br />
MENU LABEL Memtest86+<br />
LINUX ../memtest86+/memtest.bin<br />
<br />
=== HDT ===<br />
HDT (Hardware Detection Tool) displays hardware information. Like before, the {{ic|.c32}} file has to be copied or symlinked from {{ic|/boot/syslinux/}}.<br />
For PCI info, either copy or symlink {{ic|/usr/share/hwdata/pci.ids}} to {{ic|/boot/syslinux/pci.ids}}<br />
<br />
LABEL hdt<br />
MENU LABEL Hardware Info<br />
COM32 hdt.c32<br />
<br />
=== Reboot and power off ===<br />
Use the following sections to reboot or power off your machine:<br />
<br />
LABEL reboot<br />
MENU LABEL Reboot<br />
COM32 reboot.c32<br />
<br />
LABEL poweroff<br />
MENU LABEL Power Off<br />
COMBOOT poweroff.com<br />
<br />
=== Clear Menu ===<br />
To clear the screen when exiting the menu, add the following line:<br />
MENU CLEAR<br />
<br />
=== Keyboard remapping ===<br />
If you often have to edit your boot parameters, you might want to remap your keyboard layout. This allows you to enter "=", "/" and other characters easily on a non-US keyboard.<br />
<br />
First you have to create a compatible keymap (for example a german one):<br />
# cp /usr/share/kbd/keymaps/i386/qwerty/us.map.gz ./<br />
# cp /usr/share/kbd/keymaps/i386/qwertz/de.map.gz ./<br />
# gunzip {de,us}.map.gz<br />
# mv de.{,k}map<br />
# mv us.{,k}map<br />
# keytab-lilo de > de.ktl<br />
<br />
Copy {{ic|de.ktl}} as root to {{ic|/boot/syslinux/}} and set ownership to root:<br />
# chown root:root /boot/syslinux/de.ktl<br />
<br />
Now edit {{ic|syslinux.conf}} and add<br />
KBDMAP de.ktl<br />
<br />
==Troubleshooting==<br />
===I have a Syslinux Prompt - Yikes!===<br />
You can type in the {{ic|LABEL}} name of the entry that you want to boot (as per your {{ic|syslinux.cfg}}). If you used the example configs, just type:<br />
boot: arch<br />
<br />
If you get an error that the config file could not be loaded, you can pass your needed boot parameters, e.g.:<br />
boot: ../vmlinuz-linux root=/dev/sda2 ro initrd=../initramfs-linux.img<br />
<br />
If you do not have access to {{ic|boot:}} in ramfs, and therefore temporarily unable to boot kernel again,<br />
<br />
1) Create temp directory, in order to mount your root partition (if it does not exist already):<br />
<br />
# mkdir -p /new_root<br />
<br />
2) Mount {{ic|/}} under {{ic|/new_root}} (in case {{ic|/boot/}} is on the same partition, otherwise you will need to mount them both):<br />
{{Note|If {{ic|/boot}} is on its own ext2 partition then busybox cannot mount it.}}<br />
<br />
# mount /dev/sd[a-z][1-9] /new_root<br />
<br />
3) Use {{ic|vim}} and edit {{ic|syslinux.cfg}} again to suit your needs and save file.<br />
<br />
4) Reboot.<br />
<br />
===No Default or UI found on some computers===<br />
Certain motherboard manufacturers have less compatibility for booting from USB devices than others. While an ext4 formatted USB drive may boot on a more recent computer, some computers may hang if the boot partition containing the kernel and initrd are not on a fat16 partition. To prevent an older machine from loading ldlinux and failing to read {{ic|syslinux.cfg}}, use cfdisk to create a fat16 partition (<=2GB) and format with <br />
# pacman -S dosfstools<br />
# mkfs.msdos -F 16 /dev/sda1<br />
<br />
then install and configure syslinux.<br />
<br />
===MISSING OPERATING SYSTEM===<br />
<br />
If you get this message, check if the partition that contains {{ic|/boot}} has the boot flag enabled. If the flag is enabled, then perhaps this partition starts at sector 1 rather than sector 63 or 2048. Check this with fdisk -l. If it starts at sector 1, you can move the partition(s) with gparted from a rescue disk. Or, if you have a separate boot partition, you can back up /boot with <br />
# cp -a /boot /boot.bak<br />
and then boot up with the arch install disk. Next, use cfdisk to delete the /boot partition, and recreate it. This time it should begin at the proper sector, 63. Now mount your partitions and chroot into your mounted system, as described in the beginners guide. Restore /boot with the command<br />
# cp -a /boot.bak/* /boot<br />
Check if /etc/fstab is correct. Then run<br />
# syslinux-install_update -iam<br />
and reboot.<br />
<br />
===Windows boots up! No Syslinux!===<br />
'''Solution:''' Make sure the partition that contains {{ic|/boot}} has the boot flag enabled. Also, make sure the boot flag is not enabled on the Windows partition. See the installation section above.<br />
<br />
The MBR that comes with syslinux looks for the first active partition that has the boot flag set. The Windows partition was likely found first and had the boot flag set. If you wanted, you could use the MBR that Windows or MS-DOS fdisk provides.<br />
<br />
===Menu entries do nothing===<br />
You select a menu entry and it does nothing, it just "refreshes" the menu. This usually means that you have an error in your {{ic|syslinux.cfg}} file. Hit {{Keypress|Tab}} to edit your boot parameters. Alternatively, press {{Keypress|Esc}} and type in the LABEL of your boot entry (e.g. ''arch'').<br />
<br />
===Cannot remove ldlinux.sys===<br />
<br />
The {{ic|ldlinux.sys}} file has the immutable attribute set, which prevents it from being deleted or overwritten. This is because the sector location of the file must not change or else Syslinux has to be reinstalled. To remove it, run:<br />
<br />
# chattr -i /boot/syslinux/ldlinux.sys<br />
# rm /boot/syslinux/ldlinux.sys<br />
<br />
===A white block on the upper left corner appears when a kernel is loaded with modesetting on in early stage and when using vesamenu===<br />
'''Brain0''' said:<br />
''As of linux-3.0, the modesetting driver tries to keep the current contents of the screen after changing the resolution (at least it does so with my Intel, when having syslinux in text mode). It seems that this goes wrong when combined with the vesamenu module in syslinux (the white block is actually an attempt to keep the syslinux menu, but the driver fails to capture the picture from vesa graphics mode).''<br />
<br />
If you have a custom resolution and a vesamenu with early modesetting, try to append the following in {{ic|syslinux.cfg}} to remove the white block and continue in graphics mode:<br />
<br />
APPEND root=/dev/sda6 ro 5 '''vga=current''' quiet splash<br />
<br />
== See also ==<br />
* [http://www.syslinux.org The Syslinux Project]'s web site.</div>AsmundErhttps://wiki.archlinux.org/index.php?title=IOS&diff=211299IOS2012-06-26T16:45:12Z<p>AsmundEr: /* Introduction */ Updated jailbreak section to current status.</p>
<hr />
<div>{{Lowercase_title}}<br />
[[Category:Sound]]<br />
{{Article summary start}}<br />
{{Article summary text|<br />
The purpose of this article is to demonstrate the use of an iPod/idevices under Arch Linux.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Audiobook}}<br />
{{Article summary end}}<br />
<br />
{{Out of date|HAL has been deprecated for a while now.}}<br />
<br />
=== Changing iPod Mountpoint ===<br />
<br />
Traditional iPods are accessed just like a normal USB storage device containing a vfat file system (in rare cases {{ic|hfsplus}}), and can be [[USB Storage Devices | accessed as such]]. See the [[USB Storage Devices]] article for detailed instructions.<br />
<br />
If udisks2 is running, it will mount an attached iPod to {{ic|/run/user/''$USER''/media/''iPod name''}} (the older udisks will use {{ic|/media/''&lt;iPod name&gt;''}}).<br />
<br />
If the volume label of your iPod is long, or contains a mixture of spaces, and/or lower-case and capital letters, it may present an inconvenience. You may easily change the volume label for more expedient access using {{ic|dosfslabel}} from the {{pkg|dosfstools}} package:<br />
<br />
* Get and confirm the current volume label:<br />
# dosfslabel /dev/sd''XY''<br />
* Set the new volume label:<br />
# dosfslabel /dev/sd''XY'' ArchPod<br />
* Unmount the device:<br />
$ udisksctl unmount -b /dev/sd''XY''<br />
* Mount it again:<br />
$ udisksctl mount -b /dev/sd''XY''<br />
where {{ic|/dev/sdxx}} is the current device node of your iPod.<br />
<br />
== Importing videos and pictures ==<br />
<br />
Both videos and photos can be found in typically in {{ic|''&lt;mountpoint&gt;''/DCIM/100APPLE}}.<br />
<br />
=== HTML5 videos ===<br />
<br />
Typically you want to convert MOV files to a HTML5 video format like OGV using ffmpeg2theora. Note that the creation date metadata is not in the converted video, so you need to use a script like:<br />
<br />
find -name "*.MOV" | while read mov<br />
do<br />
d=$(gst-discoverer-0.10 -v $mov | awk '/datetime:/{print $2}' | tr -d \")<br />
base=${mov%.*}<br />
if test -f $base.ogv<br />
then<br />
touch -d${d} $base.ogv<br />
ls -l $base.ogv<br />
else<br />
echo $base.ogv missing<br />
fi<br />
done<br />
<br />
And use {{ic|cp -a}} or {{ic|rsync -t}} in order to preserve the file's date & time.<br />
<br />
=== Importing pictures and deleting them ===<br />
<br />
You can move photos and videos out of {{ic|''&lt;mountpoint&gt;''/DCIM/100APPLE}}, however you need to trigger a rebuild of the "Camera Roll" database by deleting the old databases.<br />
<br />
PhotoData$ sudo rm Photos* com.apple.photos.caches_metadata.plist<br />
<br />
== Converting video for iPod ==<br />
<br />
=== Gen 5/5.5 ===<br />
<br />
=== Handbrake ===<br />
<br />
[http://handbrake.fr/ Handbrake] is a nifty tool with presets for a variety of iPod versions. CLI and GTK versions are available from pacman as {{pkg|handbrake-cli}} and {{pkg|handbrake}} respectively.<br />
<br />
If you do decide to take the CLI way, a good guide is available at http://trac.handbrake.fr/wiki/CLIGuide.<br />
<br />
==== DVD to iPod ====<br />
'''Get with:''' http://diveintomark.org/public/2007/06/podencoder.txt{{Linkrot|2012|01|23}}<br><br />
'''Depends on:''' aur/gpac mplayer<br />
<br />
Has detailed help, and is fairly self explanatory.<br />
<br />
Mirrored at http://src.iphitus.org/scripts/podencoder.txt{{Linkrot|2011|09|04}}<br />
<br />
An alternative is to use a method suggested at [DVD Ripping] then use one of the programs listed below to convert that to an iPod-friendly format.<br />
<br />
==== Video File to iPod ====<br />
'''Get with:''' http://src.iphitus.org/scripts/mp4ize.txt{{Linkrot|2011|09|04}}<br><br />
'''Depends on:''' {{pkg|mplayer}}<br />
<br />
I originally found this script here: http://thomer.com/howtos/ipod_video.html http://thomer.com/howtos/mp4ize <br />
It has been modified to properly handle file names with unusual characters. Thanks to Thomer for the great script.<br />
<br />
=== More Advanced/Configurable Methods ===<br />
<br />
==== Avidemux ====<br />
[[pacman|Install]] the {{pkg|avidemux}} package from the official repositories.<br />
<br />
This can convert to mp4 files. If you enforce a hard max of bit rate @ 700ish and keep the video size to 720x480 or 320x240 than it works fine for video file exporting.<br />
<br />
==== Mencoder ====<br />
<br />
[[pacman|Install]] the {{pkg|mplayer}} package from the official repositories.<br />
<br />
Has ''extremely'' comprehensive configuration support, which will be able to spit out iPod-compatible video files. Check out {{ic|man mencoder}}; a lot of MPlayer opts will also affect encoding.<br />
<br />
A basic guide is also available at [[Mencoder]].<br />
<br />
An example command to encode iPhone/iPod Touch-compatible video:<br />
<br />
mencoder INPUT -o output.mp4 \<br />
-vf scale=480:-10,harddup \<br />
-oac faac -faacopts mpeg=4:object=2:raw:br=128 \<br />
-of lavf -lavfopts format=mp4 \<br />
-ovc x264 -x264encopts nocabac:level_idc=30:bframes=0<br />
<br />
==== FFMpeg ====<br />
<br />
[[pacman|Install]] the {{pkg|ffmpeg}} package from the official repositories.<br />
<br />
Another encoder with comprehensive configuration support. Example command to encode for 5G iPod:<br />
<br />
ffmpeg -vcodec xvid -b 300 -qmin 3 -qmax 5 -bufsize 4096 \<br />
-g 300 -acodec aac -ab 96 -i INPUT -s 320x240 \<br />
-aspect 4:3 output.mp4<br />
<br />
or iPod Touch/iPhone compatible video output:<br />
<br />
ffmpeg -f mp4 -vcodec mpeg4 -maxrate 1000 -b 700 -qmin 3 -qmax 5\<br />
-bufsize 4096 -g 300 -acodec aac -ab 192 -s 480×320 -aspect 4:3 -i INPUT output.mp4<br />
<br />
== iPhone/iPod Touch ==<br />
<br />
=== Introduction ===<br />
By default, neither the iPhone nor the iPod Touch present mass storage capability over USB, though there exist two solutions for accessing your files.<br />
<br />
The first is to mount your device through the FUSE file system SSHFS. This requires jailbreaking, which can be done on any major OS using e.g. [http://www.ijailbreak.com/how-to/how-to-jailbreak-iphone-4s-absinthe-linux/ Absinthe] for recent iOS versions. After jailbreaking, an SSH server will also need to be installed on the device, which can be done through the Cydia program, installed on the device during the jailbreak process.<br />
<br />
The second is to use a different FUSE file system called [http://www.libimobiledevice.org/ iFuse], which allows you to mount your device through USB, as you normally would. This method requires no hacking and is in general the better solution, though be aware that the software is still under heavy development. As of late, however, it has proven to be rather reliable and stable.<br />
<br />
{{Note|The current releases of {{pkg|libgpod}} and {{pkg|gtkpod}} support the iPod Touch and the iPhone OS 3.1.x up to iOS 4.3.x. It is possible to transfer pictures and music without limitations.}}<br />
<br />
Refer to this page:[https://help.ubuntu.com/community/PortableDevices/iPhone]<br />
<br />
=== Making Friends with the Device ===<br />
<br />
==== The SSHFS Way ====<br />
<br />
After this the easiest way to properly initialise a few things on the device's side is with the [http://launchpad.net/ipod-convenience iPod convenience script]. This is available in the AUR as {{AUR|ipod-convenience}}<br />
<br />
Next do {{ic|modprobe fuse}} to actually load the fuse module. You may also want to add it to your MODULES array in {{ic|/etc/rc.conf}} to have it loaded on boot.<br />
<br />
A few things may need changing in the script, depending on your setup. If you do not use sudo, replace:<br />
sudo lsusb -v -d 05ac: | grep iSerial | awk '{print $3}' | cut -b1-16 | xargs printf "FirewireGuid: 0x%s" >> $MOUNTPOINT/iTunes_Control/Device/SysInfo<br />
with:<br />
su -c "lsusb -v -d 05ac: | grep iSerial | awk '{print $3}' | cut -b1-16 | xargs printf \"FirewireGuid: 0x%s\" >> $MOUNTPOINT/iTunes_Control/Device/SysInfo"<br />
in the file /usr/share/ipod-convenience/mount-umount. You may also need to replace:<br />
PROCESS=`ssh root@$IPADDRESS ps x | grep MobileMusicPlayer | grep -v grep | awk '{print $1}'`<br />
with:<br />
PROCESS=`ssh root@$IPADDRESS ps ax | grep MobileMusicPlayer | grep -v grep | awk '{print $1}'`<br />
(I'm not sure under what circumstances this is necessary; it was on my iPod Touch running 2.2.1, and it will not have any adverse affect under other firmware version)<br />
<br />
After that, edit the {{ic|/etc/default/ipod-convenience}} file with details of your device's IP address, and create the mount point, which is {{ic|/media/ipod}} by default (make sure to set the permissions correctly if you want it accessible by a regular user)<br />
<br />
To actually mount the device, run {{ic|ipod-touch-mount}} or {{ic|iphone-mount}} (they both do exactly the same thing so it doesn't matter which). This should prompt for the root password of the device twice, which is 'alpine' by default in firmware versions 1.1 and up. This will need to be done every time you want to sync. (This can be done without having to type the password each time by using SSH keys - see [[Using SSH Keys]] for more information)<br />
<br />
==== The iFuse Way ====<br />
{{Note|If using an iPad/iPad2 that has a screen password, one must unlock the device to gain access through the USB interface.}}<br />
{{Note|The current version of ifuse is unable to mount an iPad2 using iOS v5.0.1. The git version of libimobiledevice in AUR works with an iPod using iOS v5.1.1}}<br />
<br />
You will need to install '''usbmuxd''', '''libplist''', '''libimobiledevice''', '''ifuse'''. You can pull in all four with:<br />
# pacman -S ifuse<br />
Now make sure that you have the fuse module loaded by doing {{ic|modprobe fuse}}, assuming that you do not have it in {{ic|/etc/rc.conf}} already.<br />
<br />
You can now mount your device. Make sure it is unlocked before you plug it in, or it won't be recognized.<br />
# ifuse <mountpoint><br />
The mountpoint field is where you want to have it mounted.<br />
<br />
And you're done! You should be able to point your syncing software of choice to the mount point and be able to transfer files.<br />
<br />
To unmount your device:<br />
# umount <mountpoint><br />
<br />
You can also try adding this to your [[udev]] rules for automatic mounting:<br />
{{hc|/etc/udev/rules.d/91-iOS-automount.rules|<nowiki><br />
SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/129[13]/*", ENV{INTERFACE}=="255/*", ENV{dir_name}="ipod"<br />
SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/129[024]/*", ENV{INTERFACE}=="255/*", ENV{dir_name}="iphone"<br />
SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129[13]", ENV{dir_name}="ipod"<br />
SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129[024]", ENV{dir_name}="iphone"<br />
SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129a", ENV{dir_name}="ipad"<br />
SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129f", ENV{dir_name}="ipad2"<br />
<br />
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129[0-9]", RUN+="/bin/mkdir -p '/media/%E{dir_name}'", RUN+="/usr/bin/ifuse '/media/%E{dir_name}' -u '%s{serial}' -o sync,allow_other"<br />
ACTION=="remove", SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/129[0-9]/*", ENV{INTERFACE}=="255/*", RUN+="/bin/umount -l '/media/%E{dir_name}'", RUN+="/bin/rmdir '/media/%E{dir_name}'"</nowiki>}}<br />
<br />
{{Note|udev rules that automatically mount the device can interfere with Amarok 2. Using such rules might prevent Amarok from recognizing and mounting the device sometimes. See [https://bugs.kde.org/show_bug.cgi?id&#61;300958 bug 300958] on KDE Bugzilla for more information, the general advice is to let Amarok handle this for you.}}<br />
<br />
==== Generating HashInfo file ====<br />
If you have not previously synced your device using iTunes specifically, you will get error messages telling you that the HashInfo file is missing. This can be fixed by making an iTunes installation on MacOS or Windows create it (by plugging in the iPod there). Alternatively you can create this file yourself, instructions can be found on [http://ihash.marcansoft.com/ this website].<br />
<br />
=== Unobfuscating the Database ===<br />
<br />
Since firmware version 2.0, Apple has obfuscated the music database. If you are using recent firmware, the file {{ic|/System/Library/Lockdown/Checkpoint.xml}} can be modified to enable use of the older, non-obfuscated database. Replace:<br />
<key>DBVersion</key><br />
<integer>4</integer><br />
with:<br />
<key>DBVersion</key><br />
<integer>2</integer><br />
Then reboot your device.<br />
<br />
If syncing fails with "ERROR: Unsupported checksum type '0' in cbk file generation!", you may need to leave this at 4. libgpod seems to [http://gitorious.org/libgpod/libgpod/blobs/b9b83dc8b6c3d1f0c53ed32f05279ca838d54e02/src/itdb_sqlite.c#line2064 expect a hashed database.]<br />
<br />
=== Syncing ===<br />
<br />
Use your favourite iPod-compatible program. Individual configuration will vary, but in general, pointing your program to your specified mount point should yield good results.<br />
<br />
After you've synced, run {{ic|ipod-touch-umount}} (or {{ic|iphone-umount}}, depending on your taste) to unmount the SSHFS file system and restart the {{ic|MobileMusicPlayer}} process on the device, so that the new music database is read.<br />
<br />
If you used iFuse, simply type:<br />
# umount <mountpoint><br />
You will still need to reload the MobileMusicPlayer process. If your device is not jailbroken, then you are stuck restarting it.<br />
<br />
=== The iFuse Way - iPhone OS 3.x and 4.x ===<br />
''Warning: this software is considered unstable and should probably not be used in a productive environment''<br />
<br />
Make sure you already installed base-devel, which contains several programs needed to compile your new components. If you did not, just run:<br />
<br />
# pacman -S base-devel<br />
<br />
which will install everything you will need.<br />
<br />
You will need to install {{Pkg|libplist}}, {{Pkg|libimobiledevice}}, {{Pkg|libgpod}}, {{Pkg|usbmuxd}} and {{Pkg|ifuse}}.<br />
<br />
Now make sure that you have the fuse module loaded by doing {{ic|modprobe fuse}}, assuming that you do not have it in /etc/rc.conf already.<br />
Check if the group "usbmux" has been created and add your user using<br />
# gpasswd -a <user> usbmux<br />
<br />
To make sure the new rules apply, execute<br />
$ udevadm control --reload-rules<br />
and plug in your iPod/iPhone. <br />
<br />
Run as ROOT:<br />
# usbmuxd<br />
Now you should the be able to mount your device by running<br />
$ ifuse ~/ipod<br />
or similar. Make sure the directory used exists and is accessible to your user.<br />
<br />
Mount the device and create the iTunes_Control/Device directory. Then, get your UUID. It should be in the syslog from usbmuxd, or you can find it by running <br />
$ lsusb -v | egrep "iSerial.*[a-f0-9]{40}"<br />
It should be 40 characters long. Then, run <br />
$ ipod-read-sysinfo-extended <uuid> <mountpoint>. <br />
This should generate a file named {{ic|iTunes_Control/Device/SysInfoExtended}}.<br />
<br />
Now, start up your favourite app, it should detect the device via libgpod.<br />
I recommend using gtkpod-git for the time being, as that is what the libgpod developers seem to be using for debugging purposes.<br />
<br />
{{Note|If gtkpod/gtkpod-git seems to work only from root/sudo while your user only gets the slash screen, you can delete your {{ic|~/.gtkpod}} folder and retry. Note that gtkpod will forget your preferences.}}<br />
<br />
=== Rhythmbox ===<br />
<br />
Rhythmbox uses the Gnome Virtual File System to detect mobile devices. If using the iFuse way, gvfs-afc needs to be installed:<br />
# pacman -S gvfs-afc<br />
<br />
== iPod Classic/Nano3g ==<br />
<br />
You need to set up the iPod to make libgpod able to find its FireWire ID. For this, you will need to get your FireWire ID manually<br />
<br />
1) Mount the iPod as a rw mount point. In the following example, I will use {{ic|/mnt/ipod}}.<br />
<br />
2 ) Find the serial number by typing<br />
<br />
sudo lsusb -v | grep -i Serial <br />
<br />
this should print a 16 character long string like 00A1234567891231 (it will have no colons or hyphens) <br />
<br />
3) Once you have that number, create or edit {{ic|/mnt/ipod/iPod_Control/Device/SysInfo}}. Add to that file the line below:<br />
<br />
FirewireGuid: 0xffffffffffffffff<br />
<br />
(replace ffffffffffffffff with the 16 digit string you obtained at the previous step and do not forget the trailing 0x before the string)<br />
<br />
Your iPod can now be managed with Amarok or gtkpod.<br />
<br />
== iPod management apps ==<br />
*[http://live.gnome.org/Rhythmbox Rhythmbox]<br />
**GTK interface ([[GNOME]])<br />
**Is part of the official GNOME projects.<br />
**Fast, light interface.<br />
**Manage music on your computer and iPod<br />
**Download or stream podcasts and video podcasts<br />
**Queue up songs and podcasts<br />
**Last.fm integration<br />
**Live radio stations<br />
**Jamendo and Magnatune support<br />
**Audio CD burning<br />
**Album cover display<br />
**Song lyrics display<br />
**DAAP sharing<br />
<br />
*[http://banshee.fm Banshee]<br />
**GTK interface (GNOME)<br />
**Uses Mono so it is slower and more resource hogging than rhythmbox<br />
**Device Sync: Sync your music and videos to your Android, iPod, or other device - or import its media<br />
**Podcasts: Download or stream podcasts and video podcasts<br />
**Play Queue: Queue up songs, videos, and podcasts, or let the Auto DJ take over<br />
**Shuffle Modes: Shuffle (or Auto DJ) by artist, album, rating, or even songs' acoustic similarity<br />
**Album Art: Artwork is automatically fetched as you listen<br />
**Powerful Search, Smart Playlists: Find exactly what you want, fast<br />
**Video Support: All the power of Banshee, now for your videos<br />
<br />
*[http://www.yamipod.com Yamipod]<br />
**GTK interface (GNOME)<br />
**super lightweight application for managing ONLY music on your iPod (not on your computer)<br />
**easy ratings edit<br />
**PC to iPod synchronization<br />
**News RSS and podcasts to iPod upload<br />
**Last.fm support <br />
**playlist support<br />
<br />
*[http://www.gtkpod.org gtkpod]<br />
**GTK interface (GNOME)<br />
**Read your existing iTunesDB (i.e. import the existing contents of your iPod including play counts, ratings and on-the-go playlists).<br />
**Add MP3, WAV, M4A (non-protected AAC), M4B (audio book), podcasts, and various video files (single files, directories or existing playlists) to the **iPod. You need a third party product to download podcasts, like 'bashpodder' or 'gpodder'<br />
**View, add and modify Cover Art<br />
**Browse the contents of your local hard disk by album/artist/genre by adding all your songs to the 'local' database. From there the tracks can be **dragged over to the iPod/Shuffle easily.<br />
**Create and modify playlists, including smart playlists.<br />
**You can choose the charset the ID3 tags are encoded in from within gtkpod. The default is the charset currently used by your locale setting.<br />
**Extract tag information (artist, album, title...) from the filename if you supply a template.<br />
**Detect duplicates when adding songs (optional).<br />
**Remove and export tracks from your iPod.<br />
**Modify ID3 tags -- changes are also updated in the original file (optional).<br />
**Refresh ID3 tags from file (if you have changed the tags in the original file).<br />
**Sync directories.<br />
**Normalize the volume of your tracks (uses mp3gain or the replay-gain tag)<br />
**Write the updated iTunesDB and added songs to your iPod.<br />
**Work offline and synchronize your new playlists / songs with the iPod at a later time.<br />
**Export your korganizer/kaddressbook/Thunderbird/evocalendar/evolution/webcalendar... data to the iPod (scripts for other programs can be added).<br />
<br />
*[http://www.floola.com Floola]<br />
**GTK interface (GNOME)<br />
<br />
*[http://amarok.kde.org/ Amarok]<br />
**KDE/qt interface<br />
<br />
*[http://qpod.sourceforge.net qPod]<br />
**KDE/qt interface<br />
**front-end for GNUpod<br />
<br />
*[http://www.gnu.org/software/gnupod/ GNUpod]<br />
**command-line only<br />
<br />
*[http://www.jakpod.de/ jakpod]<br />
** JakPod is based on Java and allows you to copy music and video files to your iPod.<br />
** iPod Nano 6th support<br />
** {{AUR|jakpod}}<br />
<br />
== See also ==<br />
** [http://help.ubuntu.com/community/PortableDevices/iPhone More information about iPhone/iPod Touch support]<br />
** [http://wiki.gotux.net/code/perl/atget Apple trailers downloader script]</div>AsmundErhttps://wiki.archlinux.org/index.php?title=IOS&diff=211298IOS2012-06-26T16:24:49Z<p>AsmundEr: /* The iFuse Way */ Note on libimobiledevice git version working with iOS 5.</p>
<hr />
<div>{{Lowercase_title}}<br />
[[Category:Sound]]<br />
{{Article summary start}}<br />
{{Article summary text|<br />
The purpose of this article is to demonstrate the use of an iPod/idevices under Arch Linux.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Audiobook}}<br />
{{Article summary end}}<br />
<br />
{{Out of date|HAL has been deprecated for a while now.}}<br />
<br />
=== Changing iPod Mountpoint ===<br />
<br />
Traditional iPods are accessed just like a normal USB storage device containing a vfat file system (in rare cases {{ic|hfsplus}}), and can be [[USB Storage Devices | accessed as such]]. See the [[USB Storage Devices]] article for detailed instructions.<br />
<br />
If udisks2 is running, it will mount an attached iPod to {{ic|/run/user/''$USER''/media/''iPod name''}} (the older udisks will use {{ic|/media/''&lt;iPod name&gt;''}}).<br />
<br />
If the volume label of your iPod is long, or contains a mixture of spaces, and/or lower-case and capital letters, it may present an inconvenience. You may easily change the volume label for more expedient access using {{ic|dosfslabel}} from the {{pkg|dosfstools}} package:<br />
<br />
* Get and confirm the current volume label:<br />
# dosfslabel /dev/sd''XY''<br />
* Set the new volume label:<br />
# dosfslabel /dev/sd''XY'' ArchPod<br />
* Unmount the device:<br />
$ udisksctl unmount -b /dev/sd''XY''<br />
* Mount it again:<br />
$ udisksctl mount -b /dev/sd''XY''<br />
where {{ic|/dev/sdxx}} is the current device node of your iPod.<br />
<br />
== Importing videos and pictures ==<br />
<br />
Both videos and photos can be found in typically in {{ic|''&lt;mountpoint&gt;''/DCIM/100APPLE}}.<br />
<br />
=== HTML5 videos ===<br />
<br />
Typically you want to convert MOV files to a HTML5 video format like OGV using ffmpeg2theora. Note that the creation date metadata is not in the converted video, so you need to use a script like:<br />
<br />
find -name "*.MOV" | while read mov<br />
do<br />
d=$(gst-discoverer-0.10 -v $mov | awk '/datetime:/{print $2}' | tr -d \")<br />
base=${mov%.*}<br />
if test -f $base.ogv<br />
then<br />
touch -d${d} $base.ogv<br />
ls -l $base.ogv<br />
else<br />
echo $base.ogv missing<br />
fi<br />
done<br />
<br />
And use {{ic|cp -a}} or {{ic|rsync -t}} in order to preserve the file's date & time.<br />
<br />
=== Importing pictures and deleting them ===<br />
<br />
You can move photos and videos out of {{ic|''&lt;mountpoint&gt;''/DCIM/100APPLE}}, however you need to trigger a rebuild of the "Camera Roll" database by deleting the old databases.<br />
<br />
PhotoData$ sudo rm Photos* com.apple.photos.caches_metadata.plist<br />
<br />
== Converting video for iPod ==<br />
<br />
=== Gen 5/5.5 ===<br />
<br />
=== Handbrake ===<br />
<br />
[http://handbrake.fr/ Handbrake] is a nifty tool with presets for a variety of iPod versions. CLI and GTK versions are available from pacman as {{pkg|handbrake-cli}} and {{pkg|handbrake}} respectively.<br />
<br />
If you do decide to take the CLI way, a good guide is available at http://trac.handbrake.fr/wiki/CLIGuide.<br />
<br />
==== DVD to iPod ====<br />
'''Get with:''' http://diveintomark.org/public/2007/06/podencoder.txt{{Linkrot|2012|01|23}}<br><br />
'''Depends on:''' aur/gpac mplayer<br />
<br />
Has detailed help, and is fairly self explanatory.<br />
<br />
Mirrored at http://src.iphitus.org/scripts/podencoder.txt{{Linkrot|2011|09|04}}<br />
<br />
An alternative is to use a method suggested at [DVD Ripping] then use one of the programs listed below to convert that to an iPod-friendly format.<br />
<br />
==== Video File to iPod ====<br />
'''Get with:''' http://src.iphitus.org/scripts/mp4ize.txt{{Linkrot|2011|09|04}}<br><br />
'''Depends on:''' {{pkg|mplayer}}<br />
<br />
I originally found this script here: http://thomer.com/howtos/ipod_video.html http://thomer.com/howtos/mp4ize <br />
It has been modified to properly handle file names with unusual characters. Thanks to Thomer for the great script.<br />
<br />
=== More Advanced/Configurable Methods ===<br />
<br />
==== Avidemux ====<br />
[[pacman|Install]] the {{pkg|avidemux}} package from the official repositories.<br />
<br />
This can convert to mp4 files. If you enforce a hard max of bit rate @ 700ish and keep the video size to 720x480 or 320x240 than it works fine for video file exporting.<br />
<br />
==== Mencoder ====<br />
<br />
[[pacman|Install]] the {{pkg|mplayer}} package from the official repositories.<br />
<br />
Has ''extremely'' comprehensive configuration support, which will be able to spit out iPod-compatible video files. Check out {{ic|man mencoder}}; a lot of MPlayer opts will also affect encoding.<br />
<br />
A basic guide is also available at [[Mencoder]].<br />
<br />
An example command to encode iPhone/iPod Touch-compatible video:<br />
<br />
mencoder INPUT -o output.mp4 \<br />
-vf scale=480:-10,harddup \<br />
-oac faac -faacopts mpeg=4:object=2:raw:br=128 \<br />
-of lavf -lavfopts format=mp4 \<br />
-ovc x264 -x264encopts nocabac:level_idc=30:bframes=0<br />
<br />
==== FFMpeg ====<br />
<br />
[[pacman|Install]] the {{pkg|ffmpeg}} package from the official repositories.<br />
<br />
Another encoder with comprehensive configuration support. Example command to encode for 5G iPod:<br />
<br />
ffmpeg -vcodec xvid -b 300 -qmin 3 -qmax 5 -bufsize 4096 \<br />
-g 300 -acodec aac -ab 96 -i INPUT -s 320x240 \<br />
-aspect 4:3 output.mp4<br />
<br />
or iPod Touch/iPhone compatible video output:<br />
<br />
ffmpeg -f mp4 -vcodec mpeg4 -maxrate 1000 -b 700 -qmin 3 -qmax 5\<br />
-bufsize 4096 -g 300 -acodec aac -ab 192 -s 480×320 -aspect 4:3 -i INPUT output.mp4<br />
<br />
== iPhone/iPod Touch ==<br />
<br />
=== Introduction ===<br />
By default, neither the iPhone nor the iPod Touch present mass storage capability over USB, though there exist two solutions for accessing your files.<br />
<br />
The first is to mount your device through the FUSE file system SSHFS. This requires jailbreaking, which at the moment requires access to a computer running Mac OS or a recent version of Windows, and [http://www.quickpwn.com/ QuickPwn]. After jailbreaking, an SSH server will also need to be installed on the device, which can be done through the Cydia program, installed on the device during the jailbreak process.<br />
<br />
The second is to use a different FUSE file system called [http://www.libimobiledevice.org/ iFuse], which allows you to mount your device through USB, as you normally would. This method requires no hacking and is in general the better solution, though be aware that the software is still under heavy development. As of late, however, it has proven to be rather reliable and stable.<br />
<br />
{{Note|The current releases of {{pkg|libgpod}} and {{pkg|gtkpod}} support the iPod Touch and the iPhone OS 3.1.x up to iOS 4.3.x. It is possible to transfer pictures and music without limitations.}}<br />
<br />
Refer to this page:[https://help.ubuntu.com/community/PortableDevices/iPhone]<br />
<br />
=== Making Friends with the Device ===<br />
<br />
==== The SSHFS Way ====<br />
<br />
After this the easiest way to properly initialise a few things on the device's side is with the [http://launchpad.net/ipod-convenience iPod convenience script]. This is available in the AUR as {{AUR|ipod-convenience}}<br />
<br />
Next do {{ic|modprobe fuse}} to actually load the fuse module. You may also want to add it to your MODULES array in {{ic|/etc/rc.conf}} to have it loaded on boot.<br />
<br />
A few things may need changing in the script, depending on your setup. If you do not use sudo, replace:<br />
sudo lsusb -v -d 05ac: | grep iSerial | awk '{print $3}' | cut -b1-16 | xargs printf "FirewireGuid: 0x%s" >> $MOUNTPOINT/iTunes_Control/Device/SysInfo<br />
with:<br />
su -c "lsusb -v -d 05ac: | grep iSerial | awk '{print $3}' | cut -b1-16 | xargs printf \"FirewireGuid: 0x%s\" >> $MOUNTPOINT/iTunes_Control/Device/SysInfo"<br />
in the file /usr/share/ipod-convenience/mount-umount. You may also need to replace:<br />
PROCESS=`ssh root@$IPADDRESS ps x | grep MobileMusicPlayer | grep -v grep | awk '{print $1}'`<br />
with:<br />
PROCESS=`ssh root@$IPADDRESS ps ax | grep MobileMusicPlayer | grep -v grep | awk '{print $1}'`<br />
(I'm not sure under what circumstances this is necessary; it was on my iPod Touch running 2.2.1, and it will not have any adverse affect under other firmware version)<br />
<br />
After that, edit the {{ic|/etc/default/ipod-convenience}} file with details of your device's IP address, and create the mount point, which is {{ic|/media/ipod}} by default (make sure to set the permissions correctly if you want it accessible by a regular user)<br />
<br />
To actually mount the device, run {{ic|ipod-touch-mount}} or {{ic|iphone-mount}} (they both do exactly the same thing so it doesn't matter which). This should prompt for the root password of the device twice, which is 'alpine' by default in firmware versions 1.1 and up. This will need to be done every time you want to sync. (This can be done without having to type the password each time by using SSH keys - see [[Using SSH Keys]] for more information)<br />
<br />
==== The iFuse Way ====<br />
{{Note|If using an iPad/iPad2 that has a screen password, one must unlock the device to gain access through the USB interface.}}<br />
{{Note|The current version of ifuse is unable to mount an iPad2 using iOS v5.0.1. The git version of libimobiledevice in AUR works with an iPod using iOS v5.1.1}}<br />
<br />
You will need to install '''usbmuxd''', '''libplist''', '''libimobiledevice''', '''ifuse'''. You can pull in all four with:<br />
# pacman -S ifuse<br />
Now make sure that you have the fuse module loaded by doing {{ic|modprobe fuse}}, assuming that you do not have it in {{ic|/etc/rc.conf}} already.<br />
<br />
You can now mount your device. Make sure it is unlocked before you plug it in, or it won't be recognized.<br />
# ifuse <mountpoint><br />
The mountpoint field is where you want to have it mounted.<br />
<br />
And you're done! You should be able to point your syncing software of choice to the mount point and be able to transfer files.<br />
<br />
To unmount your device:<br />
# umount <mountpoint><br />
<br />
You can also try adding this to your [[udev]] rules for automatic mounting:<br />
{{hc|/etc/udev/rules.d/91-iOS-automount.rules|<nowiki><br />
SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/129[13]/*", ENV{INTERFACE}=="255/*", ENV{dir_name}="ipod"<br />
SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/129[024]/*", ENV{INTERFACE}=="255/*", ENV{dir_name}="iphone"<br />
SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129[13]", ENV{dir_name}="ipod"<br />
SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129[024]", ENV{dir_name}="iphone"<br />
SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129a", ENV{dir_name}="ipad"<br />
SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129f", ENV{dir_name}="ipad2"<br />
<br />
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129[0-9]", RUN+="/bin/mkdir -p '/media/%E{dir_name}'", RUN+="/usr/bin/ifuse '/media/%E{dir_name}' -u '%s{serial}' -o sync,allow_other"<br />
ACTION=="remove", SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/129[0-9]/*", ENV{INTERFACE}=="255/*", RUN+="/bin/umount -l '/media/%E{dir_name}'", RUN+="/bin/rmdir '/media/%E{dir_name}'"</nowiki>}}<br />
<br />
{{Note|udev rules that automatically mount the device can interfere with Amarok 2. Using such rules might prevent Amarok from recognizing and mounting the device sometimes. See [https://bugs.kde.org/show_bug.cgi?id&#61;300958 bug 300958] on KDE Bugzilla for more information, the general advice is to let Amarok handle this for you.}}<br />
<br />
==== Generating HashInfo file ====<br />
If you have not previously synced your device using iTunes specifically, you will get error messages telling you that the HashInfo file is missing. This can be fixed by making an iTunes installation on MacOS or Windows create it (by plugging in the iPod there). Alternatively you can create this file yourself, instructions can be found on [http://ihash.marcansoft.com/ this website].<br />
<br />
=== Unobfuscating the Database ===<br />
<br />
Since firmware version 2.0, Apple has obfuscated the music database. If you are using recent firmware, the file {{ic|/System/Library/Lockdown/Checkpoint.xml}} can be modified to enable use of the older, non-obfuscated database. Replace:<br />
<key>DBVersion</key><br />
<integer>4</integer><br />
with:<br />
<key>DBVersion</key><br />
<integer>2</integer><br />
Then reboot your device.<br />
<br />
If syncing fails with "ERROR: Unsupported checksum type '0' in cbk file generation!", you may need to leave this at 4. libgpod seems to [http://gitorious.org/libgpod/libgpod/blobs/b9b83dc8b6c3d1f0c53ed32f05279ca838d54e02/src/itdb_sqlite.c#line2064 expect a hashed database.]<br />
<br />
=== Syncing ===<br />
<br />
Use your favourite iPod-compatible program. Individual configuration will vary, but in general, pointing your program to your specified mount point should yield good results.<br />
<br />
After you've synced, run {{ic|ipod-touch-umount}} (or {{ic|iphone-umount}}, depending on your taste) to unmount the SSHFS file system and restart the {{ic|MobileMusicPlayer}} process on the device, so that the new music database is read.<br />
<br />
If you used iFuse, simply type:<br />
# umount <mountpoint><br />
You will still need to reload the MobileMusicPlayer process. If your device is not jailbroken, then you are stuck restarting it.<br />
<br />
=== The iFuse Way - iPhone OS 3.x and 4.x ===<br />
''Warning: this software is considered unstable and should probably not be used in a productive environment''<br />
<br />
Make sure you already installed base-devel, which contains several programs needed to compile your new components. If you did not, just run:<br />
<br />
# pacman -S base-devel<br />
<br />
which will install everything you will need.<br />
<br />
You will need to install {{Pkg|libplist}}, {{Pkg|libimobiledevice}}, {{Pkg|libgpod}}, {{Pkg|usbmuxd}} and {{Pkg|ifuse}}.<br />
<br />
Now make sure that you have the fuse module loaded by doing {{ic|modprobe fuse}}, assuming that you do not have it in /etc/rc.conf already.<br />
Check if the group "usbmux" has been created and add your user using<br />
# gpasswd -a <user> usbmux<br />
<br />
To make sure the new rules apply, execute<br />
$ udevadm control --reload-rules<br />
and plug in your iPod/iPhone. <br />
<br />
Run as ROOT:<br />
# usbmuxd<br />
Now you should the be able to mount your device by running<br />
$ ifuse ~/ipod<br />
or similar. Make sure the directory used exists and is accessible to your user.<br />
<br />
Mount the device and create the iTunes_Control/Device directory. Then, get your UUID. It should be in the syslog from usbmuxd, or you can find it by running <br />
$ lsusb -v | egrep "iSerial.*[a-f0-9]{40}"<br />
It should be 40 characters long. Then, run <br />
$ ipod-read-sysinfo-extended <uuid> <mountpoint>. <br />
This should generate a file named {{ic|iTunes_Control/Device/SysInfoExtended}}.<br />
<br />
Now, start up your favourite app, it should detect the device via libgpod.<br />
I recommend using gtkpod-git for the time being, as that is what the libgpod developers seem to be using for debugging purposes.<br />
<br />
{{Note|If gtkpod/gtkpod-git seems to work only from root/sudo while your user only gets the slash screen, you can delete your {{ic|~/.gtkpod}} folder and retry. Note that gtkpod will forget your preferences.}}<br />
<br />
=== Rhythmbox ===<br />
<br />
Rhythmbox uses the Gnome Virtual File System to detect mobile devices. If using the iFuse way, gvfs-afc needs to be installed:<br />
# pacman -S gvfs-afc<br />
<br />
== iPod Classic/Nano3g ==<br />
<br />
You need to set up the iPod to make libgpod able to find its FireWire ID. For this, you will need to get your FireWire ID manually<br />
<br />
1) Mount the iPod as a rw mount point. In the following example, I will use {{ic|/mnt/ipod}}.<br />
<br />
2 ) Find the serial number by typing<br />
<br />
sudo lsusb -v | grep -i Serial <br />
<br />
this should print a 16 character long string like 00A1234567891231 (it will have no colons or hyphens) <br />
<br />
3) Once you have that number, create or edit {{ic|/mnt/ipod/iPod_Control/Device/SysInfo}}. Add to that file the line below:<br />
<br />
FirewireGuid: 0xffffffffffffffff<br />
<br />
(replace ffffffffffffffff with the 16 digit string you obtained at the previous step and do not forget the trailing 0x before the string)<br />
<br />
Your iPod can now be managed with Amarok or gtkpod.<br />
<br />
== iPod management apps ==<br />
*[http://live.gnome.org/Rhythmbox Rhythmbox]<br />
**GTK interface ([[GNOME]])<br />
**Is part of the official GNOME projects.<br />
**Fast, light interface.<br />
**Manage music on your computer and iPod<br />
**Download or stream podcasts and video podcasts<br />
**Queue up songs and podcasts<br />
**Last.fm integration<br />
**Live radio stations<br />
**Jamendo and Magnatune support<br />
**Audio CD burning<br />
**Album cover display<br />
**Song lyrics display<br />
**DAAP sharing<br />
<br />
*[http://banshee.fm Banshee]<br />
**GTK interface (GNOME)<br />
**Uses Mono so it is slower and more resource hogging than rhythmbox<br />
**Device Sync: Sync your music and videos to your Android, iPod, or other device - or import its media<br />
**Podcasts: Download or stream podcasts and video podcasts<br />
**Play Queue: Queue up songs, videos, and podcasts, or let the Auto DJ take over<br />
**Shuffle Modes: Shuffle (or Auto DJ) by artist, album, rating, or even songs' acoustic similarity<br />
**Album Art: Artwork is automatically fetched as you listen<br />
**Powerful Search, Smart Playlists: Find exactly what you want, fast<br />
**Video Support: All the power of Banshee, now for your videos<br />
<br />
*[http://www.yamipod.com Yamipod]<br />
**GTK interface (GNOME)<br />
**super lightweight application for managing ONLY music on your iPod (not on your computer)<br />
**easy ratings edit<br />
**PC to iPod synchronization<br />
**News RSS and podcasts to iPod upload<br />
**Last.fm support <br />
**playlist support<br />
<br />
*[http://www.gtkpod.org gtkpod]<br />
**GTK interface (GNOME)<br />
**Read your existing iTunesDB (i.e. import the existing contents of your iPod including play counts, ratings and on-the-go playlists).<br />
**Add MP3, WAV, M4A (non-protected AAC), M4B (audio book), podcasts, and various video files (single files, directories or existing playlists) to the **iPod. You need a third party product to download podcasts, like 'bashpodder' or 'gpodder'<br />
**View, add and modify Cover Art<br />
**Browse the contents of your local hard disk by album/artist/genre by adding all your songs to the 'local' database. From there the tracks can be **dragged over to the iPod/Shuffle easily.<br />
**Create and modify playlists, including smart playlists.<br />
**You can choose the charset the ID3 tags are encoded in from within gtkpod. The default is the charset currently used by your locale setting.<br />
**Extract tag information (artist, album, title...) from the filename if you supply a template.<br />
**Detect duplicates when adding songs (optional).<br />
**Remove and export tracks from your iPod.<br />
**Modify ID3 tags -- changes are also updated in the original file (optional).<br />
**Refresh ID3 tags from file (if you have changed the tags in the original file).<br />
**Sync directories.<br />
**Normalize the volume of your tracks (uses mp3gain or the replay-gain tag)<br />
**Write the updated iTunesDB and added songs to your iPod.<br />
**Work offline and synchronize your new playlists / songs with the iPod at a later time.<br />
**Export your korganizer/kaddressbook/Thunderbird/evocalendar/evolution/webcalendar... data to the iPod (scripts for other programs can be added).<br />
<br />
*[http://www.floola.com Floola]<br />
**GTK interface (GNOME)<br />
<br />
*[http://amarok.kde.org/ Amarok]<br />
**KDE/qt interface<br />
<br />
*[http://qpod.sourceforge.net qPod]<br />
**KDE/qt interface<br />
**front-end for GNUpod<br />
<br />
*[http://www.gnu.org/software/gnupod/ GNUpod]<br />
**command-line only<br />
<br />
*[http://www.jakpod.de/ jakpod]<br />
** JakPod is based on Java and allows you to copy music and video files to your iPod.<br />
** iPod Nano 6th support<br />
** {{AUR|jakpod}}<br />
<br />
== See also ==<br />
** [http://help.ubuntu.com/community/PortableDevices/iPhone More information about iPhone/iPod Touch support]<br />
** [http://wiki.gotux.net/code/perl/atget Apple trailers downloader script]</div>AsmundErhttps://wiki.archlinux.org/index.php?title=Pm-utils&diff=182695Pm-utils2012-02-08T08:59:14Z<p>AsmundEr: /* Troubleshooting */ Added part on missing swap partition</p>
<hr />
<div>[[Category:Power management (English)]]<br />
{{i18n|pm-utils}} {{DISPLAYTITLE:pm-utils}}<br />
{{Article summary start}}<br />
{{Article summary text|Describes installing, configuring, using and troubleshooting pm-utils, the new suspend and powerstate setting framework.}}<br />
{{Article summary heading|Related articles}}<br />
{{Article summary wiki|Uswsusp}}<br />
{{Article summary wiki|Tuxonice}}<br />
{{Article summary end}}<br />
'''pm-utils''' is the new suspend and powerstate setting framework. It is designed to replace such scripts as those provided by the {{ic|powersave}} package.<br />
<br />
pm-utils can be thought of as a collection of shell scripts that wrap the kernel mode suspend/resume with the various hacks. These hacks are needed to work around bugs in drivers and subsystems that are not yet aware of suspend. It is easily extensible by putting custom hooks into a directory, which can either be done by the system administrator or those hooks can be part of a package, especially if this package needs special attention during a system suspend or power state transition.<br />
<br />
A lesser known feature is one that mimics toggling done by [[Laptop Mode Tools]], although the responsible scripts have been deleted from the Arch Linux package.<br />
<br />
Used in conjunction with the [[cpufrequtils]] package, notebook (and desktop) owners are provided with a complete power management suite.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] the {{Pkg|pm-utils}} package which is available in the [[Official Repositories|official repositories]].<br />
<br />
{{Note|If you run into issues when resuming video, it might be necessary to also install {{Pkg|vbetool}} from the [[Official Repositories|official repositories]].}}<br />
<br />
{{Note|If you are starting from a clean install, make sure that you have {{Pkg|acpi}} installed.}}<br />
<br />
The suspend backend is specified by the SLEEP_MODULE configuration variable in {{ic|/etc/pm/config.d}} and defaults to the kernel backend. The Arch Linux package ships with support for the following backends:<br />
{{Hc|<nowiki>pacman -Ql pm-utils | grep module.d</nowiki>|<br />
pm-utils /usr/lib/pm-utils/module.d/<br />
pm-utils /usr/lib/pm-utils/module.d/kernel<br />
pm-utils /usr/lib/pm-utils/module.d/tuxonice<br />
pm-utils /usr/lib/pm-utils/module.d/uswsusp<br />
}}<br />
Furthermore, {{Pkg|pm-utils}} ships with its own video quirks database in {{ic|/usr/lib/pm-utils/video-quirks/}}.<br />
<br />
To use the alternative suspend backends - uswsusp or tuxonice - the respective packages need to be installed. Both of these are available in the [[Arch User Repository]]:<br />
* uswsusp - {{AUR|uswsusp-git}}<br />
* tuxonice - {{AUR|linux-ice}}<br />
<br />
== Basic Configuration ==<br />
=== Standby / Suspend to RAM ===<br />
In the ideal case, running {{ic|sudo pm-suspend}} should initiate suspend to memory, meaning that all running state will be preserved in RAM and all components other than RAM will be shut down to conserve power. Pressing the power button should initiate a resume from this state.<br />
<br />
In some cases, it is possible that running {{ic|pm-suspend causes}} hangs or other issues. This may be due to specific "misbehaving" modules. If you know which modules could cause such issues, adding a SUSPEND_MODULES config to {{Ic|/etc/pm/config.d/modules}} of the form<br />
SUSPEND_MODULES="uhci_hd button ehci_hd"<br />
should cause these modules to be specifically unloaded before suspend and reloaded after resume.<br />
<br />
To configure invoking {{ic|pm-suspend}} automatically on power events like laptop lid close, please refer to [[Acpid]].<br />
<br />
=== Hibernation (suspend2disk) ===<br />
In order for suspend2disk (hibernate) to work, we need to edit the bootloader configuration (as root) and add {{ic|1=resume=/path/to/swap/drive}} (e.g. {{ic|/dev/sda2}}) to the kernel options. These examples are for [[Grub2]], where we must edit the file {{ic|/boot/grub/grub.cfg}}. If you use another bootloader, the configuration file will have another name and will look slightly different. Consult your bootloader wiki page.<br />
<br />
'''Grub2 config:'''<br />
{{bc|1=menuentry 'Arch Linux' --class archlinux --class gnu-linux --class gnu --class os {<br />
set root='hd0,msdos3'<br />
linux /vmlinuz-linux root=/dev/sda3 '''resume=/dev/sda2''' ro<br />
initrd /initramfs-linux.img}}<br />
<br />
RAID swap example:<br />
{{bc|1=menuentry 'Arch Linux' --class archlinux --class gnu-linux --class gnu --class os {<br />
set root='hd0,msdos2'<br />
linux /vmlinuz-linux root=/dev/md2 resume=/dev/md0 ro md=0,/dev/sda2,/dev/sdb2 md=2,/dev/sda5,/dev/sdb5<br />
initrd /initramfs-linux.img}}<br />
<br />
If you want to use the UUID of the device instead, then use the following example. (The UUID itself can be found out by using the {{ic|blkid}} command as root.):<br />
{{bc|1=menuentry 'Arch Linux' --class archlinux --class gnu-linux --class gnu --class os {<br />
set root='hd0,msdos2'<br />
linux /vmlinuz-linux cryptdevice=/dev/sda2:main root=/dev/mapper/main-root resume=/dev/disk/by-uuid/1d893194-b151-43cd-a89e-6f89bd8b9f99 ro<br />
initrd /initramfs-linux.img}}<br />
<br />
When the machine is placed into hibernation, it will now move all data from RAM to the swap partition.<br />
<br />
For discussion regarding permanence, please refer to [https://bbs.archlinux.org/viewtopic.php?pid=886789#p88678 this thread].<br />
<br />
Even if your swap partition is smaller than RAM, you still have a big chance in hibernating successfully. According to [http://www.mjmwired.net/kernel/Documentation/power/interface.txt kernel documentation], ''{{ic|/sys/power/image_size}} controls the size of the image created by the suspend-to-disk mechanism'', which has a default value of 500M. ''The suspend-to-disk mechanism will do its best to ensure the image size will not exceed that number.'' You may either decrease it due to a small swap partition or increase it in purpose of possible hibernation speed up.<br />
<br />
{{Warning|You may have to add the {{ic|resume}} hook to {{ic|/etc/mkinitcpio.conf}}, see [[Pm-utils#Resume_Hook|below]]!}}<br />
<br />
=== Suspend/Hibernate as regular user ===<br />
<br />
Three methods are available to suspend without the need for a root password: using [[Udev]], using UPower, and giving the user the appropriate permissions with [[sudo|visudo]].<br />
<br />
==== UPower method ====<br />
<br />
Install {{Pkg|upower}}. To suspend to RAM:<br />
$ dbus-send --system --print-reply --dest="org.freedesktop.UPower" \<br />
/org/freedesktop/UPower org.freedesktop.UPower.Suspend<br />
<br />
To suspend to disk (hibernate):<br />
$ dbus-send --system --print-reply --dest="org.freedesktop.UPower" \<br />
/org/freedesktop/UPower org.freedesktop.UPower.Hibernate<br />
<br />
==== User Permission Method ====<br />
<br />
Because the {{Pkg|pm-utils}} scripts must be run as root, you may want to make the scripts accessible to normal users by running sudo without the root password. To do so, edit the {{ic|/etc/sudoers}} file with {{ic|visudo}} as root. For more information, see [[sudo]].<br />
<br />
Add the following lines, replacing {{ic|''username''}} with your own user name, then save and exit {{ic|visudo}}:<br />
''username'' ALL = NOPASSWD: /usr/sbin/pm-hibernate<br />
''username'' ALL = NOPASSWD: /usr/sbin/pm-suspend<br />
<br />
Or you can enable it for a group, using the following lines, replacing {{ic|''group''}}:<br />
''%group'' ALL = NOPASSWD: /usr/sbin/pm-hibernate<br />
''%group'' ALL = NOPASSWD: /usr/sbin/pm-suspend<br />
<br />
{{Note|These must come after any user privilege specifications, e.g., {{ic|1=username ALL=(ALL) ALL}}, or they will not work.}}<br />
<br />
You can now run the scripts without a password by simply running:<br />
$ sudo pm-hibernate<br />
<br />
or:<br />
<br />
$ sudo pm-suspend<br />
<br />
Also, add yourself to the {{ic|power}} [[Users and Groups|group]] so that way using things like applets to do suspend will work. If you do not do this, when you try to use suspend though things like [[GNOME]]'s shutdown applet, your computer will just play a very annoying loud triple beep and lock the screen.<br />
# gpasswd -a ''username'' power<br />
<br />
You should now be able to use your [[Desktop Environment]]'s power management tools to automatically suspend or hibernate when doing things like closing the laptop lid, running low on battery power, etc.<br />
<br />
===Power saving===<br />
pm-utils supports running commands depending on whether the system is connected to the AC adapter or not; therefore, a script has to be created inside the folder {{ic|/etc/pm/power.d/}}. An example of such a script can be found in the [http://crunchbanglinux.org/forums/post/110148/#p110148 crunchbang forum]. Be aware that upower must be running in order to detect changing AC states [https://bbs.archlinux.org/viewtopic.php?id=132125 (see more information)].<br />
<br />
=== Using Swap file insted of regular swap partition ===<br />
If you want use swap file insted of regular swap patition you have to make changes: [[Swap#Swap_file_resuming|Swap file resuming]].<br />
<br />
== Advanced Configuration ==<br />
The main configuration file is {{ic|/usr/lib/pm-utils/defaults}}. You ''should not edit this file'', since after a package update it might be overwritten with the default settings. Put your config file into {{ic|/etc/pm/config.d/}} instead.<br />
You can just put a simple text file with<br />
SUSPEND_MODULES="button uhci_hcd"<br />
named {{ic|modules}} or {{ic|config}} into {{ic|/etc/pm/config.d}} and it will override the settings in the system-wide configuration file.<br />
<br />
=== Available variables for use in config files ===<br />
;{{ic|1=SUSPEND_MODULES="button"}}: the list of modules to be unloaded before suspend<br />
;{{ic|1=SLEEP_MODULE="tuxonice uswsusp kernel"}}: the default sleep/wake systems to try<br />
;{{ic|1=HIBERNATE_MODE="shutdown"}}: forces the system to shut down rather than reboot<br />
<br />
=== Disabling a hook ===<br />
If a hook is run which you do not like or which you think is not useful or even harmful, we would appreciate a bug report for that.<br />
You can however easily disable hooks by just creating an empty file corresponding to the hook in {{ic|/etc/pm/sleep.d/}}. Say you want to disable the hook {{ic|/usr/lib/pm-utils/sleep.d/45pcmcia}}, you can do this easily by calling<br />
# touch /etc/pm/sleep.d/45pcmcia<br />
Do not set the executable bit on that dummy-hook.<br />
<br />
==== Alternative method ====<br />
Create a file in {{ic|/etc/pm/config.d}} with the modules you want to blacklist in the {{ic|HOOK_BLACKLIST}} variable.<br />
For example, to manage power saving yourself, use:<br />
HOOK_BLACKLIST="intel-audio-powersave journal-commit laptop-mode pcie-aspm sata_alpm sched-powersave"<br />
<br />
=== Creating your own hooks ===<br />
If you want to do something specific to your setup during suspend or hibernate, then you can easily put your own hook into {{ic|/etc/pm/sleep.d}}. The hooks in this directory will be called in alphabetic order during suspend (that is the reason their names all start with 2 digits, to make the ordering explicit) and in the reverse order during resume. The general convention to be followed on number ordering is:.<br />
;00 - 49: User and most package supplied hooks. If a hook assumes that all of the usual services and userspace infrastructure is still running, it should be here.<br />
;50 - 74: Service handling hooks. Hooks that start or stop a service belong in this range. At or before 50, hooks can assume that all services are still enabled.<br />
;75 - 89: Module and non-core hardware handling. If a hook needs to load/unload a module, or if it needs to place non-video hardware that would otherwise break suspend or hibernate into a safe state, it belongs in this range. At or before 75, hooks can assume all modules are still loaded.<br />
;90 - 99: Reserved for critical suspend hooks.<br />
<br />
I am showing a pretty useless demonstration hook here, that will just put some informative lines into your log file:<br />
<br />
#!/bin/bash<br />
case $1 in<br />
hibernate)<br />
echo "Hey guy, we are going to suspend to disk!"<br />
;;<br />
suspend)<br />
echo "Oh, this time we are doing a suspend to RAM. Cool!"<br />
;;<br />
thaw)<br />
echo "Oh, suspend to disk is over, we are resuming..."<br />
;;<br />
resume)<br />
echo "Hey, the suspend to RAM seems to be over..."<br />
;;<br />
*) echo "Somebody is calling me totally wrong."<br />
;;<br />
esac<br />
<br />
Put this into {{ic|/etc/pm/sleep.d/66dummy}}, do a {{ic|chmod +x /etc/pm/sleep.d/66dummy}} and it will spew some useless lines during suspend and resume.<br />
<br />
{{Warning|All the hooks run as root. This means that you need to be careful when creating temporary files, check that the {{ic|PATH}} environment variable is set correctly, etc. to avoid security problems.}}<br />
<br />
== How it works ==<br />
The concept is quite easy: the main script ({{ic|pm-action}}, called via symlinks as either {{ic|pm-suspend}}, {{ic|pm-hibernate}} or {{ic|pm-suspend-hybrid}}) executes so-called "hooks", executable scripts, in the alphabetical sorted order with the parameter {{ic|suspend}} (suspend to RAM) or {{ic|hibernate}} (suspend to disk).<br />
Once all hooks are done, it puts the machine to sleep. After the machine has woken up again, all those hooks are executed in reverse order with the parameter {{ic|resume}} (resume from RAM) or {{ic|thaw}} (resume from disk).<br />
The hooks perform various tasks, such as preparing the bootloader, stopping the Bluetooth subsystem, or unloading of critical modules.<br />
<br />
Both {{ic|pm-suspend}} and {{ic|pm-hibernate}} are usually called from [[Udev]], initiated by desktop applets like {{Pkg|gnome-power-manager}} or {{ic|kpowersave}}.<br />
<br />
{{Note|{{ic|suspend-hybrid}} is a placeholder right now -- it is not completely implemented.}}<br />
<br />
There is also the possibility to set the machine into high-power and low-power mode, the command {{ic|pm-powersave}} is used with an additional parameter of {{ic|true}} or {{ic|false}}. It works basically the same as the suspend framework.<br />
<br />
The hooks for suspend are placed in<br />
;{{ic|/usr/lib/pm-utils/sleep.d}}: distribution / package provided hooks<br />
;{{ic|/etc/pm/sleep.d}}: hooks added by the system administrator<br />
<br />
The hooks for the power state are placed in <br />
;{{ic|/usr/lib/pm-utils/power.d}}: distribution / package provided hooks<br />
;{{ic|/etc/pm/power.d}}: hooks added by the system administrator<br />
<br />
Hooks in {{ic|/etc/pm/}} take precedence over those in {{ic|/usr/lib/pm-utils/}}, so the system administrator can override the defaults provided by the distribution.<br />
<br />
=== Pm-suspend internals ===<br />
<br />
This outlines the internal actions when {{ic|pm-suspend}} is run, describing how {{ic|pm-utils}} gracefully falls back onto the kernel method if the requirements of other methods are not met.<br />
<br />
$ pm-suspend<br />
<br />
The first step is set-up preliminary variables and source parent scripts:<br />
export STASHNAME=pm-suspend<br />
export METHOD="$(echo ${0##*pm-} |tr - _)"<br />
. "/usr/lib/pm-utils/pm-functions"<br />
<br />
The variable {{Ic|METHOD}} is extracted from the executable name, ''suspend'' from {{ic|pm-suspend}} and ''hibernate'' from {{ic|pm-hibernate}}.<br />
<br />
The location of runtime configuration parameters is defined in {{Ic|/usr/lib/pm-utils/pm-functions}} as ''PM_UTILS_RUNDIR="/var/run/pm-utils"'' and ''STORAGEDIR="${PM_UTILS_RUNDIR}/${STASHNAME}/storage"''. Therefore ''STORAGEDIR="/var/run/pm-utils/pm-suspend/storage"''; this is where {{ic|pm-suspend}} will cache its configuration. Disabled hooks are stored as plain text files with the hook name prefixed by "''disable_hook:''". Configuration parameters are appended to the ''parameters'' file:<br />
$ ls -lah /var/run/pm-utils/pm-suspend/storage/<br />
-rw-r--r-- 1 root root 20 May 19 09:57 disable_hook:99video<br />
-rw-r--r-- 1 root root 0 May 19 02:59 parameters<br />
-rw-r--r-- 1 root root 247 May 19 02:59 parameters.rm<br />
-rw-r--r-- 1 root root 9 May 19 02:59 state:cpu0_governor<br />
-rw-r--r-- 1 root root 9 May 19 02:59 state:cpu1_governor<br />
<br />
Then {{Ic|pm-functions}} will source the files located in {{Ic|/etc/pm/config.d/}} in addition to {{Ic|/usr/lib/pm-utils/defaults}}. Upon returning, {{Ic|pm-functions}} will proceed to source the files specified by '''$SLEEP_METHOD''' as {{Ic|/usr/lib/pm-utils/module.d/$SLEEP_METHOD[...]}} if they exist:<br />
for mod in $SLEEP_MODULE; do<br />
mod="${PM_UTILS_LIBDIR}/module.d/${mod}"<br />
[ -f "$mod" ] || continue<br />
. "$mod"<br />
done<br />
<br />
Otherwise, if '''$SLEEP_MODULE''' is empty, {{Ic|do_suspend()}} will be set to the kernel backend as described above:<br />
if [ -z "$SUSPEND_MODULE" ]; then<br />
if grep -q mem /sys/power/state; then<br />
SUSPEND_MODULE="kernel"<br />
do_suspend() { echo -n "mem" >/sys/power/state; }<br />
elif [ -c /dev/pmu ] && pm-pmu --check; then<br />
SUSPEND_MODULE="kernel"<br />
do_suspend() { pm-pmu --suspend; }<br />
elif grep -q standby /sys/power/state; then<br />
SUSPEND_MODULE="kernel"<br />
do_suspend() { echo -n "standby" >/sys/power/state; }<br />
fi<br />
fi<br />
<br />
Assuming '''$SLEEP_MODULE''' is not empty and {{Ic|uswsusp}} is specified, {{Ic|/usr/lib/pm-utils/module.d/uswsusp}} is executed. This script checks several requirements (these are the requirements for being able to use uswsusp):<br />
* [ -z $SUSPEND_MODULE ]<br />
* command_exists s2ram<br />
* grep -q mem /sys/power/state || ( [ -c /dev/pmu ] && pm-pmu --check; );<br />
If these requirements are met, do_suspend() is defined as:<br />
do_suspend()<br />
{<br />
uswsusp_get_quirks<br />
s2ram --force $OPTS<br />
}<br />
Most importantly, the {{Ic|uswsusp}} module runs:<br />
add_before_hooks uswsusp_hooks<br />
add_module_help uswsusp_help<br />
The first function, ''add_before_hook'' disables the '''pm-utils''' hooks '''99video''' since this functionality is subsumed by '''s2ram'''.<br />
The second function, ''add_module_help'', adds uswsusp-module-specific help, which in essence replaces the help function provided by '''99video'''.<br />
<br />
Back to {{Ic|pm-suspend}}:<br />
command_exists "check_$METHOD" && command_exists "do_$METHOD"<br />
"check_$METHOD"<br />
This verifies that the ''check_suspend'' and ''do_suspend'' methods have been defined. The ''check_suspend'' method simply verifies that $SUSPEND_MODULE is not empty:<br />
<br />
check_suspend() { [ -n "$SUSPEND_MODULE" ]; }<br />
<br />
Lastly, {{Ic|pm-suspend}} must run all hooks that have not been disabled, sync file-system buffers, and run ''do_suspend'':<br />
if run_hooks sleep "$ACTION $METHOD"; then<br />
# Sleep only if we know how and if a hook did not inhibit us.<br />
log "$(date): performing $METHOD"<br />
sync<br />
"do_$METHOD" || r=128<br />
log "$(date): Awake."<br />
<br />
The method ''run_hooks'' is a wrapper for ''_run_hooks'', which the case of {{ic|pm-suspend}} is called as ''run_hooks sleep "suspend suspend"''. Given that:<br />
PARAMETERS="${STORAGEDIR}/parameters"<br />
PM_UTILS_LIBDIR="/usr/lib/pm-utils"<br />
PM_UTILS_ETCDIR="/etc/pm"<br />
<br />
The method ''_run_hooks'', will for each hook in ''"${PM_UTILS_LIBDIR}/$1.d"'' and ''"${PM_UTILS_ETCDIR}/$1.d"'', check that sleep has not been inhibited and update the runtime parameters stored in ''$PARAMETERS'' before running each hook via ''run_hook $hook $2''. In the case of Suspend-to-RAM, all the hooks in ''{/usr/lib/pm-utils/sleep.d/,/etc/pm/sleep.d/}'' will be enumerated, and ''run_hook'' will be passed the parameters ''$hook'' and "''suspend suspend''". The method ''run_hook'' uses the ''hook_ok'' function to verify that the hook has not been disabled before executing the hook with the "''suspend suspend''" parameters.<br />
<br />
== Troubleshooting ==<br />
If suspend or hibernate did not work correctly, you will probably find some information in the log file {{ic|/var/log/pm-suspend.log}}. For example, which hooks were run and what the output of them was should be in that log file.<br />
<br />
Also, check the output of the {{ic|pm-is-supported}} command. This command (with the {{ic|--hibernate}} or {{ic|--suspend}} flag) will do some sanity checking and report any errors it finds in your configuration. It will not detect all possible errors, but may still be useful.<br />
<br />
=== Resume Hook ===<br />
It has been suggested that some systems, including those using [[LVM]], require the {{ic|resume}} hook be added to the initrd image, otherwise the kernel will '''not''' resume. You can see if this is happening if the hibernation works fine, no error messages appear in {{ic|/var/log/pm-suspend.log}} and the kernel logs the following message: "PM: Hibernation image not present or could not be loaded." To add the resume hook, edit {{ic|/etc/mkinitcpio.conf}} as root and add {{ic|resume}} to the HOOKS array:<br />
HOOKS="base udev autodetect ide scsi sata lvm2 '''''resume''''' filesystems "<br />
<br />
Note that this is an example, and your HOOKS array may look different.<br />
<br />
{{ic|resume}} must be placed ''after'' {{ic|ide}}, {{ic|scsi}}, {{ic|sata}} and/or {{ic|lvm2}}, but before {{ic|filesystems}}. Of course, there has to be an appropriate {{ic|resume}} file in {{ic|/lib/initcpio/hooks}}, but it should already be there, as it is part of the {{ic|mkinitcpio}} package.<br />
<br />
Finally, you must rebuild the initrd image for these changes to take effect:<br />
# mkinitcpio -p linux<br />
<br />
{{Note|If you use a custom kernel, then you might have to change the value of the '-p' option.}}<br />
<br />
=== Set UUID === <br />
If you experience segmentation faults that might result in an unresponsive system and missing keys then try to set the UUID in the resume-path in {{ic|/boot/grub/menu.lst}} as explained [[#Hibernation (suspend2disk)|above]].<br />
<br />
=== Reboot instead of resume from suspend ===<br />
<br />
This problem started when saving NVS area during suspend was introduced (in 2.6.35-rc4) ([http://www.spinics.net/lists/linux-acpi/msg29521.html mailing list post]). However, it is known that this mechanism does not work on all machines, so the kernel developers allow the user to disable it with the help of the {{ic|1=acpi_sleep=nonvs}} kernel command line option. This option could be pass to the kernel through [[GRUB]] options by editing the file {{ic|/boot/grub/menu.lst}} (GRUB 0.97) on the {{ic|kernel}} line.<br />
<br />
=== Resume from suspend shuts down instead of wake up ===<br />
On an Acer Aspire AS3810TG, resuming from suspend shuts down the computer instead of waking it up. If you experience a similar issue, try passing the parameter {{ic|1=i8042.reset=1}} to your kernel. In [[GRUB2]], the line in {{ic|/boot/grub/grub.cfg}} should be something like this:<br />
linux /vmlinuz-linux root=/dev/vg00/root resume=/dev/vg00/swap i8042.reset=1 ro<br />
<br />
Although I have not tested this, you could also set this parameter live without having to restart by doing:<br />
# sysctl -e -w i8042.reset=1<br />
<br />
=== Blank screen when waking from suspend ===<br />
Some laptops (e.g Dell Inspiron Mini 1018) will just show a black screen with no backlight after resuming from suspend. If this happens to you, try going into the BIOS of the laptop and disabling Intel SpeedStep if it is present.<br />
<br />
You could also try, without disabling SpeedStep, creating a quirk in {{ic|/etc/pm/sleep.d/}} with this content (requires {{Pkg|vbetool}}):<br />
{{bc|#!/bin/sh<br />
#<br />
case "$1" in<br />
suspend)<br />
;;<br />
resume)<br />
sleep 5<br />
vbetool dpms off<br />
vbetool dpms on<br />
;;<br />
*) exit $NA<br />
;;<br />
esac}}<br />
save it as you want but with a {{ic|00}} in front of the name so this is called last when resuming; remember to {{ic|chmod +x}} the script.<br />
Try adjusting the {{ic|sleep}} time if the other commands are called too soon, or if it works well, you can also try removing that line.<br />
<br />
=== VirtualBox problems ===<br />
The VirtualBox kernel modules cause {{ic|pm-suspend}} and {{ic|pm-hibernate}} to fail on some laptops. (See [https://bbs.archlinux.org/viewtopic.php?id=123354 this discussion]). Instead of suspending or hibernating, the system freezes and indicator LEDs blink (the suspend indicator in the case of ThinkPads and the Caps Lock and Scroll Lock indicators in the case of the MSI Wind U100). The {{ic|pm-suspend}} and {{ic|pm-hibernate}} logs appear normal.<br />
<br />
The problem can be fixed by removing the modules before suspension or hibernation and reloading them afterwards. That can be accomplished through a script:<br />
{{bc|1=<br />
#!/bin/sh<br />
<br />
rmmod vboxdrv<br />
pm-hibernate<br />
modprobe vboxdrv<br />
}}<br />
<br />
{{Note|Some users reported that it is sufficient to rebuild the kernel module by running {{ic|vboxbuild}} as root.}}<br />
<br />
=== Hibernate with missing swap partition ===<br />
If you try to hibernate without an active swap partition, your system will look like it is going into hibernate, and then immediately resume again. There are no error messages warning you that there is no swap partition, even when verbose logging is activated, so this problem can be very hard to debug. On my system, the swap partition was somehow corrupted and deactivated, so this may happen even if you set up a swap partition during install. If hibernate displays this behaviour, make sure that you actually have a swap partition that is being used as such. The output of the {{ic|blkid}} command should look e.g. like<br />
{{bc|1=<br />
# blkid<br />
/dev/sda1: UUID="00000-000-000-0000000" TYPE="ext2" <br />
/dev/sda2: UUID="00000-000-000-0000000" TYPE="ext4"<br />
/dev/sda3: UUID="00000-000-000-0000000" TYPE="ext4"<br />
/dev/sda4: UUID="00000-000-000-0000000" TYPE="swap"<br />
}}<br />
with one of the lines having {{ic|"swap"}} as the type. If this is not the case, consult [[Swap#Swap partition]] for instructions on re-creating/activating the swap partition.<br />
<br />
== Tips and Tricks / FAQ ==<br />
=== Triggering suspend manually ===<br />
If you want to trigger suspend manually for debugging, without using [[Udev]] and other frameworks, run {{ic|pm-suspend}} or {{ic|pm-hibernate}} as root.<br />
<br />
=== Automatically deactivate kwin compositing before suspend===<br />
At the moment, {{ic|pm-suspend}} fails to resume with garbled screen when you resume from suspend with active AIGLX clients, such as kwin compositing (only ati-catalyst?).<br />
To automatically deactivate kwin compositing, add a new hook under {{ic|/etc/pm/sleep.d/00togglecompositing}} with this content:<br />
{{hc|/etc/pm/sleep.d/00togglecompositing|<nowiki><br />
#!/bin/bash<br />
USER=`finger|grep '*:0'|grep -o '^\w*'`<br />
DBUS_SESSION_BUS_ADDRESS=`grep -o 'DBUS_SESSION_BUS_ADDRESS=.*' /home/$USER/.dbus/session-bus/*|sed s/DBUS_SESSION_BUS_ADDRESS=//`<br />
case $1 in<br />
hibernate)<br />
;;<br />
suspend)<br />
if `sudo -u $USER -i DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS qdbus org.kde.kwin /KWin compositingActive`;<br />
then<br />
sudo -u $USER -i DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS qdbus org.kde.kwin /KWin toggleCompositing;<br />
sleep 1<br />
fi<br />
;;<br />
thaw)<br />
;;<br />
resume)<br />
sudo -u $USER -i DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS qdbus org.kde.kwin /KWin toggleCompositing;<br />
;;<br />
*) echo "somebody is calling me totally wrong."<br />
;;<br />
esac<br />
</nowiki>}}<br />
<br />
I do not know if it is very secure or if it can be done more simply. Feel free to add better versions.<br />
<br />
If you are having trouble getting the above script to work, you can try my version. This version removes the use of {{ic|finger}}, and fixes the DBUS_SESSION_BUS_ADDRESS resolution which did not work for me (though my solution is admittedly quite dirty). Simply replace the first three lines with:<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
USER=`who | grep ':0' | grep -o '^\w*' | head -n1`<br />
. /home/$USER/.dbus/session-bus/*<br />
</nowiki>}}<br />
<br />
=== Using another sleep back-end (like uswsusp) ===<br />
Create a file with a SLEEP_MODULE variable, like this:<br />
$ cat /etc/pm/config.d/module <br />
SLEEP_MODULE=uswsusp<br />
To list available modules, use:<br />
$ pacman -Ql pm-utils | grep module.d<br />
<br />
=== Having the HD power management level automatically set again on resume ===<br />
Do it like this:<br />
{{hc|/etc/pm/sleep.d/50-hdparm_pm|<nowiki><br />
#!/bin/dash<br />
<br />
if [ -n "$1" ] && ([ "$1" = "resume" ] || [ "$1" = "thaw" ]); then<br />
hdparm -B 254 /dev/sda > /dev/null<br />
fi<br />
</nowiki>}}<br />
<br />
Then run:<br />
$ sudo chmod +x /etc/pm/sleep.d/50-hdparm_pm<br />
<br />
If the above [[Bash]] script fails the work, the following may work instead:<br />
{{hc|/etc/pm/sleep.d/50-hdparm_pm|<nowiki><br />
#!/bin/sh<br />
<br />
. "${PM_FUNCTIONS}"<br />
case "$1" in<br />
thaw|resume)<br />
sleep 6<br />
hdparm -B 254 /dev/sda<br />
;;<br />
*)<br />
;;<br />
esac<br />
exit $NA<br />
</nowiki>}}<br />
<br />
Lower {{ic|-B}} switch values may be effective. See [[hdparm]].<br />
<br />
=== Restarting the mouse ===<br />
On some laptops the mouse will hang after an otherwise successful suspend. One way to remedy this is to force a re-initialization of the PS/2 driver (here {{ic|i8042}}) through a hook in {{ic|/etc/pm/hooks}} (see [[#Creating_your_own_hooks|hooks]])<br />
<br />
#!/bin/sh <br />
echo -n "i8042" > /sys/bus/platform/drivers/i8042/unbind<br />
echo -n "i8042" > /sys/bus/platform/drivers/i8042/bind<br />
<br />
=== pm-utils seems to not do anything / where is the logfile ===<br />
If pm-utils seems to not do anything when called via the desktop applets, then try to call {{ic|pm-suspend}} or {{ic|pm-hibernate}} [[#Triggering_suspend_manually|manually from a root shell in a terminal]]. Maybe you will already get some output that will point you to the problem.<br />
The suspend scripts also write a [[#Troubleshooting|log file at {{ic|/var/log/pm-suspend.log}}]].<br />
<br />
=== Add sleep modes to Openbox menu ===<br />
Openbox users can add the new scripts as additional shutdown options within the Openbox menu by adding the items to a new or existing sub-menu in {{ic|~/.config/openbox/menu.xml}}, for example:<br />
<menu id="64" label="Shutdown"><br />
<item label="Lock"> <action name="Execute"> <execute>xscreensaver-command -lock</execute> </action> </item><br />
<item label="Logout"> <action name="Exit"/> </item><br />
<item label="Reboot"> <action name="Execute"> <execute>sudo shutdown -r now</execute> </action> </item><br />
<item label="Poweroff"> <action name="Execute"> <execute>sudo shutdown -h now </execute> </action> </item><br />
'''''<item label="Hibernate"> <action name="Execute"> <execute>sudo pm-hibernate</execute> </action> </item>'''''<br />
'''''<item label="Suspend"> <action name="Execute"> <execute>sudo pm-suspend</execute> </action> </item>'''''<br />
</menu><br />
<br />
=== Blank screen issue ===<br />
Some users have reported having issues with their laptops not resuming after a suspend or hibernate. This is due to the {{ic|autodetect}} hook. This can be disabled using the same method for adding the {{ic|resume}} hook. Just remove {{ic|autodetect}} from the list and follow the steps to build the new image. See [[#Resume Hook|Resume Hook]] for more details on building the new image.<br />
<br />
=== Handling "sleep" and "power" buttons ===<br />
"Sleep" and "power" buttons are handled by {{ic|acpid}} in {{ic|/etc/acpi/handler.sh}} (see "button/power" and "power/sleep" entries). You may want to substitute the default actions with calls to {{ic|pm-suspend}} and {{ic|pm-hibernate}}.<br />
<br />
=== Locking the screen saver on hibernate or suspend ===<br />
It is a good idea to have the system require a password after waking up. One way to do this is to make a script {{ic|/etc/pm/sleep.d/00screensaver-lock}} (making sure it is chmodded to 755 and owned by {{ic|root:root}}, like other similar scripts in this area). Replace '''username''' with your username and add your desired screen locker in between the "" after {{ic|su $USER -c}}.<br />
<br />
{{hc|/etc/pm/sleep.d/00screensaver-lock|<nowiki><br />
#!/bin/sh<br />
#<br />
# 00screensaver-lock: lock workstation on hibernate or suspend<br />
<br />
DBUS=$(ps aux | grep 'dbus-launch' | grep -v root)<br />
if [[ ! -z $DBUS ]];then<br />
USER=$(echo $DBUS | awk '{print $1}')<br />
USERHOME=$(getent passwd $USER | cut -d: -f6)<br />
export XAUTHORITY="$USERHOME/.Xauthority"<br />
for x in /tmp/.X11-unix/*; do<br />
DISPLAYNUM=$(echo $x | sed s#/tmp/.X11-unix/X##)<br />
if [[ -f "$XAUTHORITY" ]]; then<br />
export DISPLAY=":$DISPLAYNUM"<br />
fi<br />
done<br />
else<br />
USER=username<br />
USERHOME=/home/username<br />
export XAUTHORITY="$USERHOME/.Xauthority"<br />
export DISPLAY=":0"<br />
fi<br />
<br />
case "$1" in<br />
hibernate|suspend)<br />
su $USER -c "/usr/bin/slimlock" & # or any other such as /usr/bin/xscreensaver-command -lock<br />
;;<br />
thaw|resume)<br />
;;<br />
*) exit $NA<br />
;;<br />
esac<br />
</nowiki>}}<br />
<br />
'''Note:''' for the previous script to work TTY lock must be disabled in slimlock. Be sure to set {{ic|tty_lock 0}} in {{ic|/etc/slimlock.conf}} [https://github.com/joelburget/slimlock/issues/4].<br />
<br />
== Other Resources ==<br />
* [https://wiki.ubuntu.com/UnderstandingSuspend Understanding Suspend] - Ubuntu article explaining how suspending to RAM works<br />
* [http://www.mjmwired.net/kernel/Documentation/power/basic-pm-debugging.txt#178 PM Debugging] - Basic PM debugging<br />
*[[Cpufrequtils]] - CPU Frequency Scaling and CPU Power schemes<br />
*[[Acpid]] - daemon for delivering ACPI events.<br />
<br />
== Credits ==<br />
''This wiki entry was originally sourced from the [http://en.opensuse.org/SDB:Pm-utils OpenSUSE Wiki] (Licensed under GPL). A big thank you goes to the {{Pkg|pm-utils}} developers and documenters for their time.''</div>AsmundErhttps://wiki.archlinux.org/index.php?title=Pm-utils&diff=182694Pm-utils2012-02-08T08:24:22Z<p>AsmundEr: /* Hibernation (suspend2disk) */ Added remark that the example is for Grub2.</p>
<hr />
<div>[[Category:Power management (English)]]<br />
{{i18n|pm-utils}} {{DISPLAYTITLE:pm-utils}}<br />
{{Article summary start}}<br />
{{Article summary text|Describes installing, configuring, using and troubleshooting pm-utils, the new suspend and powerstate setting framework.}}<br />
{{Article summary heading|Related articles}}<br />
{{Article summary wiki|Uswsusp}}<br />
{{Article summary wiki|Tuxonice}}<br />
{{Article summary end}}<br />
'''pm-utils''' is the new suspend and powerstate setting framework. It is designed to replace such scripts as those provided by the {{ic|powersave}} package.<br />
<br />
pm-utils can be thought of as a collection of shell scripts that wrap the kernel mode suspend/resume with the various hacks. These hacks are needed to work around bugs in drivers and subsystems that are not yet aware of suspend. It is easily extensible by putting custom hooks into a directory, which can either be done by the system administrator or those hooks can be part of a package, especially if this package needs special attention during a system suspend or power state transition.<br />
<br />
A lesser known feature is one that mimics toggling done by [[Laptop Mode Tools]], although the responsible scripts have been deleted from the Arch Linux package.<br />
<br />
Used in conjunction with the [[cpufrequtils]] package, notebook (and desktop) owners are provided with a complete power management suite.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] the {{Pkg|pm-utils}} package which is available in the [[Official Repositories|official repositories]].<br />
<br />
{{Note|If you run into issues when resuming video, it might be necessary to also install {{Pkg|vbetool}} from the [[Official Repositories|official repositories]].}}<br />
<br />
{{Note|If you are starting from a clean install, make sure that you have {{Pkg|acpi}} installed.}}<br />
<br />
The suspend backend is specified by the SLEEP_MODULE configuration variable in {{ic|/etc/pm/config.d}} and defaults to the kernel backend. The Arch Linux package ships with support for the following backends:<br />
{{Hc|<nowiki>pacman -Ql pm-utils | grep module.d</nowiki>|<br />
pm-utils /usr/lib/pm-utils/module.d/<br />
pm-utils /usr/lib/pm-utils/module.d/kernel<br />
pm-utils /usr/lib/pm-utils/module.d/tuxonice<br />
pm-utils /usr/lib/pm-utils/module.d/uswsusp<br />
}}<br />
Furthermore, {{Pkg|pm-utils}} ships with its own video quirks database in {{ic|/usr/lib/pm-utils/video-quirks/}}.<br />
<br />
To use the alternative suspend backends - uswsusp or tuxonice - the respective packages need to be installed. Both of these are available in the [[Arch User Repository]]:<br />
* uswsusp - {{AUR|uswsusp-git}}<br />
* tuxonice - {{AUR|linux-ice}}<br />
<br />
== Basic Configuration ==<br />
=== Standby / Suspend to RAM ===<br />
In the ideal case, running {{ic|sudo pm-suspend}} should initiate suspend to memory, meaning that all running state will be preserved in RAM and all components other than RAM will be shut down to conserve power. Pressing the power button should initiate a resume from this state.<br />
<br />
In some cases, it is possible that running {{ic|pm-suspend causes}} hangs or other issues. This may be due to specific "misbehaving" modules. If you know which modules could cause such issues, adding a SUSPEND_MODULES config to {{Ic|/etc/pm/config.d/modules}} of the form<br />
SUSPEND_MODULES="uhci_hd button ehci_hd"<br />
should cause these modules to be specifically unloaded before suspend and reloaded after resume.<br />
<br />
To configure invoking {{ic|pm-suspend}} automatically on power events like laptop lid close, please refer to [[Acpid]].<br />
<br />
=== Hibernation (suspend2disk) ===<br />
In order for suspend2disk (hibernate) to work, we need to edit the bootloader configuration (as root) and add {{ic|1=resume=/path/to/swap/drive}} (e.g. {{ic|/dev/sda2}}) to the kernel options. These examples are for [[Grub2]], where we must edit the file {{ic|/boot/grub/grub.cfg}}. If you use another bootloader, the configuration file will have another name and will look slightly different. Consult your bootloader wiki page.<br />
<br />
'''Grub2 config:'''<br />
{{bc|1=menuentry 'Arch Linux' --class archlinux --class gnu-linux --class gnu --class os {<br />
set root='hd0,msdos3'<br />
linux /vmlinuz-linux root=/dev/sda3 '''resume=/dev/sda2''' ro<br />
initrd /initramfs-linux.img}}<br />
<br />
RAID swap example:<br />
{{bc|1=menuentry 'Arch Linux' --class archlinux --class gnu-linux --class gnu --class os {<br />
set root='hd0,msdos2'<br />
linux /vmlinuz-linux root=/dev/md2 resume=/dev/md0 ro md=0,/dev/sda2,/dev/sdb2 md=2,/dev/sda5,/dev/sdb5<br />
initrd /initramfs-linux.img}}<br />
<br />
If you want to use the UUID of the device instead, then use the following example. (The UUID itself can be found out by using the {{ic|blkid}} command as root.):<br />
{{bc|1=menuentry 'Arch Linux' --class archlinux --class gnu-linux --class gnu --class os {<br />
set root='hd0,msdos2'<br />
linux /vmlinuz-linux cryptdevice=/dev/sda2:main root=/dev/mapper/main-root resume=/dev/disk/by-uuid/1d893194-b151-43cd-a89e-6f89bd8b9f99 ro<br />
initrd /initramfs-linux.img}}<br />
<br />
When the machine is placed into hibernation, it will now move all data from RAM to the swap partition.<br />
<br />
For discussion regarding permanence, please refer to [https://bbs.archlinux.org/viewtopic.php?pid=886789#p88678 this thread].<br />
<br />
Even if your swap partition is smaller than RAM, you still have a big chance in hibernating successfully. According to [http://www.mjmwired.net/kernel/Documentation/power/interface.txt kernel documentation], ''{{ic|/sys/power/image_size}} controls the size of the image created by the suspend-to-disk mechanism'', which has a default value of 500M. ''The suspend-to-disk mechanism will do its best to ensure the image size will not exceed that number.'' You may either decrease it due to a small swap partition or increase it in purpose of possible hibernation speed up.<br />
<br />
{{Warning|You may have to add the {{ic|resume}} hook to {{ic|/etc/mkinitcpio.conf}}, see [[Pm-utils#Resume_Hook|below]]!}}<br />
<br />
=== Suspend/Hibernate as regular user ===<br />
<br />
Three methods are available to suspend without the need for a root password: using [[Udev]], using UPower, and giving the user the appropriate permissions with [[sudo|visudo]].<br />
<br />
==== UPower method ====<br />
<br />
Install {{Pkg|upower}}. To suspend to RAM:<br />
$ dbus-send --system --print-reply --dest="org.freedesktop.UPower" \<br />
/org/freedesktop/UPower org.freedesktop.UPower.Suspend<br />
<br />
To suspend to disk (hibernate):<br />
$ dbus-send --system --print-reply --dest="org.freedesktop.UPower" \<br />
/org/freedesktop/UPower org.freedesktop.UPower.Hibernate<br />
<br />
==== User Permission Method ====<br />
<br />
Because the {{Pkg|pm-utils}} scripts must be run as root, you may want to make the scripts accessible to normal users by running sudo without the root password. To do so, edit the {{ic|/etc/sudoers}} file with {{ic|visudo}} as root. For more information, see [[sudo]].<br />
<br />
Add the following lines, replacing {{ic|''username''}} with your own user name, then save and exit {{ic|visudo}}:<br />
''username'' ALL = NOPASSWD: /usr/sbin/pm-hibernate<br />
''username'' ALL = NOPASSWD: /usr/sbin/pm-suspend<br />
<br />
Or you can enable it for a group, using the following lines, replacing {{ic|''group''}}:<br />
''%group'' ALL = NOPASSWD: /usr/sbin/pm-hibernate<br />
''%group'' ALL = NOPASSWD: /usr/sbin/pm-suspend<br />
<br />
{{Note|These must come after any user privilege specifications, e.g., {{ic|1=username ALL=(ALL) ALL}}, or they will not work.}}<br />
<br />
You can now run the scripts without a password by simply running:<br />
$ sudo pm-hibernate<br />
<br />
or:<br />
<br />
$ sudo pm-suspend<br />
<br />
Also, add yourself to the {{ic|power}} [[Users and Groups|group]] so that way using things like applets to do suspend will work. If you do not do this, when you try to use suspend though things like [[GNOME]]'s shutdown applet, your computer will just play a very annoying loud triple beep and lock the screen.<br />
# gpasswd -a ''username'' power<br />
<br />
You should now be able to use your [[Desktop Environment]]'s power management tools to automatically suspend or hibernate when doing things like closing the laptop lid, running low on battery power, etc.<br />
<br />
===Power saving===<br />
pm-utils supports running commands depending on whether the system is connected to the AC adapter or not; therefore, a script has to be created inside the folder {{ic|/etc/pm/power.d/}}. An example of such a script can be found in the [http://crunchbanglinux.org/forums/post/110148/#p110148 crunchbang forum]. Be aware that upower must be running in order to detect changing AC states [https://bbs.archlinux.org/viewtopic.php?id=132125 (see more information)].<br />
<br />
=== Using Swap file insted of regular swap partition ===<br />
If you want use swap file insted of regular swap patition you have to make changes: [[Swap#Swap_file_resuming|Swap file resuming]].<br />
<br />
== Advanced Configuration ==<br />
The main configuration file is {{ic|/usr/lib/pm-utils/defaults}}. You ''should not edit this file'', since after a package update it might be overwritten with the default settings. Put your config file into {{ic|/etc/pm/config.d/}} instead.<br />
You can just put a simple text file with<br />
SUSPEND_MODULES="button uhci_hcd"<br />
named {{ic|modules}} or {{ic|config}} into {{ic|/etc/pm/config.d}} and it will override the settings in the system-wide configuration file.<br />
<br />
=== Available variables for use in config files ===<br />
;{{ic|1=SUSPEND_MODULES="button"}}: the list of modules to be unloaded before suspend<br />
;{{ic|1=SLEEP_MODULE="tuxonice uswsusp kernel"}}: the default sleep/wake systems to try<br />
;{{ic|1=HIBERNATE_MODE="shutdown"}}: forces the system to shut down rather than reboot<br />
<br />
=== Disabling a hook ===<br />
If a hook is run which you do not like or which you think is not useful or even harmful, we would appreciate a bug report for that.<br />
You can however easily disable hooks by just creating an empty file corresponding to the hook in {{ic|/etc/pm/sleep.d/}}. Say you want to disable the hook {{ic|/usr/lib/pm-utils/sleep.d/45pcmcia}}, you can do this easily by calling<br />
# touch /etc/pm/sleep.d/45pcmcia<br />
Do not set the executable bit on that dummy-hook.<br />
<br />
==== Alternative method ====<br />
Create a file in {{ic|/etc/pm/config.d}} with the modules you want to blacklist in the {{ic|HOOK_BLACKLIST}} variable.<br />
For example, to manage power saving yourself, use:<br />
HOOK_BLACKLIST="intel-audio-powersave journal-commit laptop-mode pcie-aspm sata_alpm sched-powersave"<br />
<br />
=== Creating your own hooks ===<br />
If you want to do something specific to your setup during suspend or hibernate, then you can easily put your own hook into {{ic|/etc/pm/sleep.d}}. The hooks in this directory will be called in alphabetic order during suspend (that is the reason their names all start with 2 digits, to make the ordering explicit) and in the reverse order during resume. The general convention to be followed on number ordering is:.<br />
;00 - 49: User and most package supplied hooks. If a hook assumes that all of the usual services and userspace infrastructure is still running, it should be here.<br />
;50 - 74: Service handling hooks. Hooks that start or stop a service belong in this range. At or before 50, hooks can assume that all services are still enabled.<br />
;75 - 89: Module and non-core hardware handling. If a hook needs to load/unload a module, or if it needs to place non-video hardware that would otherwise break suspend or hibernate into a safe state, it belongs in this range. At or before 75, hooks can assume all modules are still loaded.<br />
;90 - 99: Reserved for critical suspend hooks.<br />
<br />
I am showing a pretty useless demonstration hook here, that will just put some informative lines into your log file:<br />
<br />
#!/bin/bash<br />
case $1 in<br />
hibernate)<br />
echo "Hey guy, we are going to suspend to disk!"<br />
;;<br />
suspend)<br />
echo "Oh, this time we are doing a suspend to RAM. Cool!"<br />
;;<br />
thaw)<br />
echo "Oh, suspend to disk is over, we are resuming..."<br />
;;<br />
resume)<br />
echo "Hey, the suspend to RAM seems to be over..."<br />
;;<br />
*) echo "Somebody is calling me totally wrong."<br />
;;<br />
esac<br />
<br />
Put this into {{ic|/etc/pm/sleep.d/66dummy}}, do a {{ic|chmod +x /etc/pm/sleep.d/66dummy}} and it will spew some useless lines during suspend and resume.<br />
<br />
{{Warning|All the hooks run as root. This means that you need to be careful when creating temporary files, check that the {{ic|PATH}} environment variable is set correctly, etc. to avoid security problems.}}<br />
<br />
== How it works ==<br />
The concept is quite easy: the main script ({{ic|pm-action}}, called via symlinks as either {{ic|pm-suspend}}, {{ic|pm-hibernate}} or {{ic|pm-suspend-hybrid}}) executes so-called "hooks", executable scripts, in the alphabetical sorted order with the parameter {{ic|suspend}} (suspend to RAM) or {{ic|hibernate}} (suspend to disk).<br />
Once all hooks are done, it puts the machine to sleep. After the machine has woken up again, all those hooks are executed in reverse order with the parameter {{ic|resume}} (resume from RAM) or {{ic|thaw}} (resume from disk).<br />
The hooks perform various tasks, such as preparing the bootloader, stopping the Bluetooth subsystem, or unloading of critical modules.<br />
<br />
Both {{ic|pm-suspend}} and {{ic|pm-hibernate}} are usually called from [[Udev]], initiated by desktop applets like {{Pkg|gnome-power-manager}} or {{ic|kpowersave}}.<br />
<br />
{{Note|{{ic|suspend-hybrid}} is a placeholder right now -- it is not completely implemented.}}<br />
<br />
There is also the possibility to set the machine into high-power and low-power mode, the command {{ic|pm-powersave}} is used with an additional parameter of {{ic|true}} or {{ic|false}}. It works basically the same as the suspend framework.<br />
<br />
The hooks for suspend are placed in<br />
;{{ic|/usr/lib/pm-utils/sleep.d}}: distribution / package provided hooks<br />
;{{ic|/etc/pm/sleep.d}}: hooks added by the system administrator<br />
<br />
The hooks for the power state are placed in <br />
;{{ic|/usr/lib/pm-utils/power.d}}: distribution / package provided hooks<br />
;{{ic|/etc/pm/power.d}}: hooks added by the system administrator<br />
<br />
Hooks in {{ic|/etc/pm/}} take precedence over those in {{ic|/usr/lib/pm-utils/}}, so the system administrator can override the defaults provided by the distribution.<br />
<br />
=== Pm-suspend internals ===<br />
<br />
This outlines the internal actions when {{ic|pm-suspend}} is run, describing how {{ic|pm-utils}} gracefully falls back onto the kernel method if the requirements of other methods are not met.<br />
<br />
$ pm-suspend<br />
<br />
The first step is set-up preliminary variables and source parent scripts:<br />
export STASHNAME=pm-suspend<br />
export METHOD="$(echo ${0##*pm-} |tr - _)"<br />
. "/usr/lib/pm-utils/pm-functions"<br />
<br />
The variable {{Ic|METHOD}} is extracted from the executable name, ''suspend'' from {{ic|pm-suspend}} and ''hibernate'' from {{ic|pm-hibernate}}.<br />
<br />
The location of runtime configuration parameters is defined in {{Ic|/usr/lib/pm-utils/pm-functions}} as ''PM_UTILS_RUNDIR="/var/run/pm-utils"'' and ''STORAGEDIR="${PM_UTILS_RUNDIR}/${STASHNAME}/storage"''. Therefore ''STORAGEDIR="/var/run/pm-utils/pm-suspend/storage"''; this is where {{ic|pm-suspend}} will cache its configuration. Disabled hooks are stored as plain text files with the hook name prefixed by "''disable_hook:''". Configuration parameters are appended to the ''parameters'' file:<br />
$ ls -lah /var/run/pm-utils/pm-suspend/storage/<br />
-rw-r--r-- 1 root root 20 May 19 09:57 disable_hook:99video<br />
-rw-r--r-- 1 root root 0 May 19 02:59 parameters<br />
-rw-r--r-- 1 root root 247 May 19 02:59 parameters.rm<br />
-rw-r--r-- 1 root root 9 May 19 02:59 state:cpu0_governor<br />
-rw-r--r-- 1 root root 9 May 19 02:59 state:cpu1_governor<br />
<br />
Then {{Ic|pm-functions}} will source the files located in {{Ic|/etc/pm/config.d/}} in addition to {{Ic|/usr/lib/pm-utils/defaults}}. Upon returning, {{Ic|pm-functions}} will proceed to source the files specified by '''$SLEEP_METHOD''' as {{Ic|/usr/lib/pm-utils/module.d/$SLEEP_METHOD[...]}} if they exist:<br />
for mod in $SLEEP_MODULE; do<br />
mod="${PM_UTILS_LIBDIR}/module.d/${mod}"<br />
[ -f "$mod" ] || continue<br />
. "$mod"<br />
done<br />
<br />
Otherwise, if '''$SLEEP_MODULE''' is empty, {{Ic|do_suspend()}} will be set to the kernel backend as described above:<br />
if [ -z "$SUSPEND_MODULE" ]; then<br />
if grep -q mem /sys/power/state; then<br />
SUSPEND_MODULE="kernel"<br />
do_suspend() { echo -n "mem" >/sys/power/state; }<br />
elif [ -c /dev/pmu ] && pm-pmu --check; then<br />
SUSPEND_MODULE="kernel"<br />
do_suspend() { pm-pmu --suspend; }<br />
elif grep -q standby /sys/power/state; then<br />
SUSPEND_MODULE="kernel"<br />
do_suspend() { echo -n "standby" >/sys/power/state; }<br />
fi<br />
fi<br />
<br />
Assuming '''$SLEEP_MODULE''' is not empty and {{Ic|uswsusp}} is specified, {{Ic|/usr/lib/pm-utils/module.d/uswsusp}} is executed. This script checks several requirements (these are the requirements for being able to use uswsusp):<br />
* [ -z $SUSPEND_MODULE ]<br />
* command_exists s2ram<br />
* grep -q mem /sys/power/state || ( [ -c /dev/pmu ] && pm-pmu --check; );<br />
If these requirements are met, do_suspend() is defined as:<br />
do_suspend()<br />
{<br />
uswsusp_get_quirks<br />
s2ram --force $OPTS<br />
}<br />
Most importantly, the {{Ic|uswsusp}} module runs:<br />
add_before_hooks uswsusp_hooks<br />
add_module_help uswsusp_help<br />
The first function, ''add_before_hook'' disables the '''pm-utils''' hooks '''99video''' since this functionality is subsumed by '''s2ram'''.<br />
The second function, ''add_module_help'', adds uswsusp-module-specific help, which in essence replaces the help function provided by '''99video'''.<br />
<br />
Back to {{Ic|pm-suspend}}:<br />
command_exists "check_$METHOD" && command_exists "do_$METHOD"<br />
"check_$METHOD"<br />
This verifies that the ''check_suspend'' and ''do_suspend'' methods have been defined. The ''check_suspend'' method simply verifies that $SUSPEND_MODULE is not empty:<br />
<br />
check_suspend() { [ -n "$SUSPEND_MODULE" ]; }<br />
<br />
Lastly, {{Ic|pm-suspend}} must run all hooks that have not been disabled, sync file-system buffers, and run ''do_suspend'':<br />
if run_hooks sleep "$ACTION $METHOD"; then<br />
# Sleep only if we know how and if a hook did not inhibit us.<br />
log "$(date): performing $METHOD"<br />
sync<br />
"do_$METHOD" || r=128<br />
log "$(date): Awake."<br />
<br />
The method ''run_hooks'' is a wrapper for ''_run_hooks'', which the case of {{ic|pm-suspend}} is called as ''run_hooks sleep "suspend suspend"''. Given that:<br />
PARAMETERS="${STORAGEDIR}/parameters"<br />
PM_UTILS_LIBDIR="/usr/lib/pm-utils"<br />
PM_UTILS_ETCDIR="/etc/pm"<br />
<br />
The method ''_run_hooks'', will for each hook in ''"${PM_UTILS_LIBDIR}/$1.d"'' and ''"${PM_UTILS_ETCDIR}/$1.d"'', check that sleep has not been inhibited and update the runtime parameters stored in ''$PARAMETERS'' before running each hook via ''run_hook $hook $2''. In the case of Suspend-to-RAM, all the hooks in ''{/usr/lib/pm-utils/sleep.d/,/etc/pm/sleep.d/}'' will be enumerated, and ''run_hook'' will be passed the parameters ''$hook'' and "''suspend suspend''". The method ''run_hook'' uses the ''hook_ok'' function to verify that the hook has not been disabled before executing the hook with the "''suspend suspend''" parameters.<br />
<br />
== Troubleshooting ==<br />
If suspend or hibernate did not work correctly, you will probably find some information in the log file {{ic|/var/log/pm-suspend.log}}. For example, which hooks were run and what the output of them was should be in that log file.<br />
<br />
=== Resume Hook ===<br />
It has been suggested that some systems, including those using [[LVM]], require the {{ic|resume}} hook be added to the initrd image, otherwise the kernel will '''not''' resume. You can see if this is happening if the hibernation works fine, no error messages appear in {{ic|/var/log/pm-suspend.log}} and the kernel logs the following message: "PM: Hibernation image not present or could not be loaded." To add the resume hook, edit {{ic|/etc/mkinitcpio.conf}} as root and add {{ic|resume}} to the HOOKS array:<br />
HOOKS="base udev autodetect ide scsi sata lvm2 '''''resume''''' filesystems "<br />
<br />
Note that this is an example, and your HOOKS array may look different.<br />
<br />
{{ic|resume}} must be placed ''after'' {{ic|ide}}, {{ic|scsi}}, {{ic|sata}} and/or {{ic|lvm2}}, but before {{ic|filesystems}}. Of course, there has to be an appropriate {{ic|resume}} file in {{ic|/lib/initcpio/hooks}}, but it should already be there, as it is part of the {{ic|mkinitcpio}} package.<br />
<br />
Finally, you must rebuild the initrd image for these changes to take effect:<br />
# mkinitcpio -p linux<br />
<br />
{{Note|If you use a custom kernel, then you might have to change the value of the '-p' option.}}<br />
<br />
=== Set UUID === <br />
If you experience segmentation faults that might result in an unresponsive system and missing keys then try to set the UUID in the resume-path in {{ic|/boot/grub/menu.lst}} as explained [[#Hibernation (suspend2disk)|above]].<br />
<br />
=== Reboot instead of resume from suspend ===<br />
<br />
This problem started when saving NVS area during suspend was introduced (in 2.6.35-rc4) ([http://www.spinics.net/lists/linux-acpi/msg29521.html mailing list post]). However, it is known that this mechanism does not work on all machines, so the kernel developers allow the user to disable it with the help of the {{ic|1=acpi_sleep=nonvs}} kernel command line option. This option could be pass to the kernel through [[GRUB]] options by editing the file {{ic|/boot/grub/menu.lst}} (GRUB 0.97) on the {{ic|kernel}} line.<br />
<br />
=== Resume from suspend shuts down instead of wake up ===<br />
On an Acer Aspire AS3810TG, resuming from suspend shuts down the computer instead of waking it up. If you experience a similar issue, try passing the parameter {{ic|1=i8042.reset=1}} to your kernel. In [[GRUB2]], the line in {{ic|/boot/grub/grub.cfg}} should be something like this:<br />
linux /vmlinuz-linux root=/dev/vg00/root resume=/dev/vg00/swap i8042.reset=1 ro<br />
<br />
Although I have not tested this, you could also set this parameter live without having to restart by doing:<br />
# sysctl -e -w i8042.reset=1<br />
<br />
=== Blank screen when waking from suspend ===<br />
Some laptops (e.g Dell Inspiron Mini 1018) will just show a black screen with no backlight after resuming from suspend. If this happens to you, try going into the BIOS of the laptop and disabling Intel SpeedStep if it is present.<br />
<br />
You could also try, without disabling SpeedStep, creating a quirk in {{ic|/etc/pm/sleep.d/}} with this content (requires {{Pkg|vbetool}}):<br />
{{bc|#!/bin/sh<br />
#<br />
case "$1" in<br />
suspend)<br />
;;<br />
resume)<br />
sleep 5<br />
vbetool dpms off<br />
vbetool dpms on<br />
;;<br />
*) exit $NA<br />
;;<br />
esac}}<br />
save it as you want but with a {{ic|00}} in front of the name so this is called last when resuming; remember to {{ic|chmod +x}} the script.<br />
Try adjusting the {{ic|sleep}} time if the other commands are called too soon, or if it works well, you can also try removing that line.<br />
<br />
=== VirtualBox problems ===<br />
The VirtualBox kernel modules cause {{ic|pm-suspend}} and {{ic|pm-hibernate}} to fail on some laptops. (See [https://bbs.archlinux.org/viewtopic.php?id=123354 this discussion]). Instead of suspending or hibernating, the system freezes and indicator LEDs blink (the suspend indicator in the case of ThinkPads and the Caps Lock and Scroll Lock indicators in the case of the MSI Wind U100). The {{ic|pm-suspend}} and {{ic|pm-hibernate}} logs appear normal.<br />
<br />
The problem can be fixed by removing the modules before suspension or hibernation and reloading them afterwards. That can be accomplished through a script:<br />
{{bc|1=<br />
#!/bin/sh<br />
<br />
rmmod vboxdrv<br />
pm-hibernate<br />
modprobe vboxdrv<br />
}}<br />
<br />
{{Note|Some users reported that it is sufficient to rebuild the kernel module by running {{ic|vboxbuild}} as root.}}<br />
<br />
== Tips and Tricks / FAQ ==<br />
=== Triggering suspend manually ===<br />
If you want to trigger suspend manually for debugging, without using [[Udev]] and other frameworks, run {{ic|pm-suspend}} or {{ic|pm-hibernate}} as root.<br />
<br />
=== Automatically deactivate kwin compositing before suspend===<br />
At the moment, {{ic|pm-suspend}} fails to resume with garbled screen when you resume from suspend with active AIGLX clients, such as kwin compositing (only ati-catalyst?).<br />
To automatically deactivate kwin compositing, add a new hook under {{ic|/etc/pm/sleep.d/00togglecompositing}} with this content:<br />
{{hc|/etc/pm/sleep.d/00togglecompositing|<nowiki><br />
#!/bin/bash<br />
USER=`finger|grep '*:0'|grep -o '^\w*'`<br />
DBUS_SESSION_BUS_ADDRESS=`grep -o 'DBUS_SESSION_BUS_ADDRESS=.*' /home/$USER/.dbus/session-bus/*|sed s/DBUS_SESSION_BUS_ADDRESS=//`<br />
case $1 in<br />
hibernate)<br />
;;<br />
suspend)<br />
if `sudo -u $USER -i DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS qdbus org.kde.kwin /KWin compositingActive`;<br />
then<br />
sudo -u $USER -i DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS qdbus org.kde.kwin /KWin toggleCompositing;<br />
sleep 1<br />
fi<br />
;;<br />
thaw)<br />
;;<br />
resume)<br />
sudo -u $USER -i DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS qdbus org.kde.kwin /KWin toggleCompositing;<br />
;;<br />
*) echo "somebody is calling me totally wrong."<br />
;;<br />
esac<br />
</nowiki>}}<br />
<br />
I do not know if it is very secure or if it can be done more simply. Feel free to add better versions.<br />
<br />
If you are having trouble getting the above script to work, you can try my version. This version removes the use of {{ic|finger}}, and fixes the DBUS_SESSION_BUS_ADDRESS resolution which did not work for me (though my solution is admittedly quite dirty). Simply replace the first three lines with:<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
USER=`who | grep ':0' | grep -o '^\w*' | head -n1`<br />
. /home/$USER/.dbus/session-bus/*<br />
</nowiki>}}<br />
<br />
=== Using another sleep back-end (like uswsusp) ===<br />
Create a file with a SLEEP_MODULE variable, like this:<br />
$ cat /etc/pm/config.d/module <br />
SLEEP_MODULE=uswsusp<br />
To list available modules, use:<br />
$ pacman -Ql pm-utils | grep module.d<br />
<br />
=== Having the HD power management level automatically set again on resume ===<br />
Do it like this:<br />
{{hc|/etc/pm/sleep.d/50-hdparm_pm|<nowiki><br />
#!/bin/dash<br />
<br />
if [ -n "$1" ] && ([ "$1" = "resume" ] || [ "$1" = "thaw" ]); then<br />
hdparm -B 254 /dev/sda > /dev/null<br />
fi<br />
</nowiki>}}<br />
<br />
Then run:<br />
$ sudo chmod +x /etc/pm/sleep.d/50-hdparm_pm<br />
<br />
If the above [[Bash]] script fails the work, the following may work instead:<br />
{{hc|/etc/pm/sleep.d/50-hdparm_pm|<nowiki><br />
#!/bin/sh<br />
<br />
. "${PM_FUNCTIONS}"<br />
case "$1" in<br />
thaw|resume)<br />
sleep 6<br />
hdparm -B 254 /dev/sda<br />
;;<br />
*)<br />
;;<br />
esac<br />
exit $NA<br />
</nowiki>}}<br />
<br />
Lower {{ic|-B}} switch values may be effective. See [[hdparm]].<br />
<br />
=== Restarting the mouse ===<br />
On some laptops the mouse will hang after an otherwise successful suspend. One way to remedy this is to force a re-initialization of the PS/2 driver (here {{ic|i8042}}) through a hook in {{ic|/etc/pm/hooks}} (see [[#Creating_your_own_hooks|hooks]])<br />
<br />
#!/bin/sh <br />
echo -n "i8042" > /sys/bus/platform/drivers/i8042/unbind<br />
echo -n "i8042" > /sys/bus/platform/drivers/i8042/bind<br />
<br />
=== pm-utils seems to not do anything / where is the logfile ===<br />
If pm-utils seems to not do anything when called via the desktop applets, then try to call {{ic|pm-suspend}} or {{ic|pm-hibernate}} [[#Triggering_suspend_manually|manually from a root shell in a terminal]]. Maybe you will already get some output that will point you to the problem.<br />
The suspend scripts also write a [[#Troubleshooting|log file at {{ic|/var/log/pm-suspend.log}}]].<br />
<br />
=== Add sleep modes to Openbox menu ===<br />
Openbox users can add the new scripts as additional shutdown options within the Openbox menu by adding the items to a new or existing sub-menu in {{ic|~/.config/openbox/menu.xml}}, for example:<br />
<menu id="64" label="Shutdown"><br />
<item label="Lock"> <action name="Execute"> <execute>xscreensaver-command -lock</execute> </action> </item><br />
<item label="Logout"> <action name="Exit"/> </item><br />
<item label="Reboot"> <action name="Execute"> <execute>sudo shutdown -r now</execute> </action> </item><br />
<item label="Poweroff"> <action name="Execute"> <execute>sudo shutdown -h now </execute> </action> </item><br />
'''''<item label="Hibernate"> <action name="Execute"> <execute>sudo pm-hibernate</execute> </action> </item>'''''<br />
'''''<item label="Suspend"> <action name="Execute"> <execute>sudo pm-suspend</execute> </action> </item>'''''<br />
</menu><br />
<br />
=== Blank screen issue ===<br />
Some users have reported having issues with their laptops not resuming after a suspend or hibernate. This is due to the {{ic|autodetect}} hook. This can be disabled using the same method for adding the {{ic|resume}} hook. Just remove {{ic|autodetect}} from the list and follow the steps to build the new image. See [[#Resume Hook|Resume Hook]] for more details on building the new image.<br />
<br />
=== Handling "sleep" and "power" buttons ===<br />
"Sleep" and "power" buttons are handled by {{ic|acpid}} in {{ic|/etc/acpi/handler.sh}} (see "button/power" and "power/sleep" entries). You may want to substitute the default actions with calls to {{ic|pm-suspend}} and {{ic|pm-hibernate}}.<br />
<br />
=== Locking the screen saver on hibernate or suspend ===<br />
It is a good idea to have the system require a password after waking up. One way to do this is to make a script {{ic|/etc/pm/sleep.d/00screensaver-lock}} (making sure it is chmodded to 755 and owned by {{ic|root:root}}, like other similar scripts in this area). Replace '''username''' with your username and add your desired screen locker in between the "" after {{ic|su $USER -c}}.<br />
<br />
{{hc|/etc/pm/sleep.d/00screensaver-lock|<nowiki><br />
#!/bin/sh<br />
#<br />
# 00screensaver-lock: lock workstation on hibernate or suspend<br />
<br />
DBUS=$(ps aux | grep 'dbus-launch' | grep -v root)<br />
if [[ ! -z $DBUS ]];then<br />
USER=$(echo $DBUS | awk '{print $1}')<br />
USERHOME=$(getent passwd $USER | cut -d: -f6)<br />
export XAUTHORITY="$USERHOME/.Xauthority"<br />
for x in /tmp/.X11-unix/*; do<br />
DISPLAYNUM=$(echo $x | sed s#/tmp/.X11-unix/X##)<br />
if [[ -f "$XAUTHORITY" ]]; then<br />
export DISPLAY=":$DISPLAYNUM"<br />
fi<br />
done<br />
else<br />
USER=username<br />
USERHOME=/home/username<br />
export XAUTHORITY="$USERHOME/.Xauthority"<br />
export DISPLAY=":0"<br />
fi<br />
<br />
case "$1" in<br />
hibernate|suspend)<br />
su $USER -c "/usr/bin/slimlock" & # or any other such as /usr/bin/xscreensaver-command -lock<br />
;;<br />
thaw|resume)<br />
;;<br />
*) exit $NA<br />
;;<br />
esac<br />
</nowiki>}}<br />
<br />
'''Note:''' for the previous script to work TTY lock must be disabled in slimlock. Be sure to set {{ic|tty_lock 0}} in {{ic|/etc/slimlock.conf}} [https://github.com/joelburget/slimlock/issues/4].<br />
<br />
== Other Resources ==<br />
* [https://wiki.ubuntu.com/UnderstandingSuspend Understanding Suspend] - Ubuntu article explaining how suspending to RAM works<br />
* [http://www.mjmwired.net/kernel/Documentation/power/basic-pm-debugging.txt#178 PM Debugging] - Basic PM debugging<br />
*[[Cpufrequtils]] - CPU Frequency Scaling and CPU Power schemes<br />
*[[Acpid]] - daemon for delivering ACPI events.<br />
<br />
== Credits ==<br />
''This wiki entry was originally sourced from the [http://en.opensuse.org/SDB:Pm-utils OpenSUSE Wiki] (Licensed under GPL). A big thank you goes to the {{Pkg|pm-utils}} developers and documenters for their time.''</div>AsmundErhttps://wiki.archlinux.org/index.php?title=Solid_state_drive&diff=181551Solid state drive2012-02-01T12:06:39Z<p>AsmundEr: /* Using MBR - Legacy Method */ Updated to reflect the current version of fdisk, after reading the manpages more carefully.</p>
<hr />
<div>[[Category: Storage (English)]]<br />
{{i18n|Solid State Drives}}<br />
{{Article summary start}}<br />
{{Article summary text|This article covers many aspects of SSDs (solid state drives) as they relate to Linux; however, the underlying principals and key learning presented within are general enough to be applicable to users running SSDs on other operating systems such as the Windows family of products as well as MacOS X. Beyond the aforementioned information, Linux users will benefit from the tweaks/optimization presented herein.}}<br />
{{Article summary heading|Related Articles}}<br />
{{Article summary wiki|SSD Benchmarking}}<br />
{{Article summary wiki|SSD Memory Cell Clearing}}<br />
{{Article summary end}}<br />
<br />
==Introduction==<br />
Solid State Drives (SSDs) are not PnP devices. Special considerations such as partition alignment, choice of file system, TRIM support, etc. are needed to setup SSDs for optimal performance. This article attempts to capture referenced, key learnings to enable users to get the most out of SSDs under Linux. Users are encouraged to read this article in its entirety before acting on recommendations as the content is organized by topic, not necessarily by any systematic or chronologically relevant order.<br />
<br />
{{Note|This article is targeted at users running Linux, but much of the content is also relevant to our friends using both Windows and Mac OS X.}}<br />
===Advantages over HDDs===<br />
*Fast read speeds - 2-3x faster than modern desktop HDDs (7,200 RPM using SATA2 interface).<br />
*Sustained read speeds - No decrease in read speed across the entirety of the device. HDD performance tapers off as the drive heads move from the outer edges to the center of HDD platters.<br />
*Minimal access time - Approx. 100x faster than an HDD. For example, 0.1 ms (100 ns) vs. 12-20 ms (12,000-20,000 ns) for desktop HDDs.<br />
*High degree of reliability.<br />
*No moving parts.<br />
*Minimal heat production.<br />
*Minimal power consumption - Fractions of a W at idle and 1-2 W while reading/writing vs. 10-30 W for a HDD depending on RPMs.<br />
*Light-weight - ideal for laptops.<br />
<br />
===Limitations===<br />
*Per-storage cost (dollars per GB, vs. pennies per GB for rotating media).<br />
*Capacity of marketed models is lower than that of HDDs.<br />
*Large cells require different filesystem optimizations than rotating media. The flash translation layer hides the raw flash access which a modern OS could use to optimize access.<br />
*Partitions and filesystems need some SSD-specific tuning. Page size and erase page size are not autodetected.<br />
*Cells wear out. Consumer MLC cells at mature 50nm processes can handle 10000 writes each; 35nm generally handles 5000 writes, and 25nm 3000 (smaller being higher density and cheaper). If writes are properly spread out, are not too small, and align well with cells, this translates into a lifetime write volume for the SSD that is a multiple of its capacity. Daily write volumes have to be balanced against life expectancy.<br />
*Firmwares and controllers are complex. They occasionally have bugs. Modern ones consume power comparable with HDDs. They [https://lwn.net/Articles/353411/ implement] the equivalent of a log-structured filesystem with garbage collection. They translate SATA commands traditionally intended for rotating media. Some of them do on the fly compression. They spread out repeated writes across the entire area of the flash, to prevent wearing out some cells prematurely. They also coalesce writes together so that small writes are not amplified into as many erase cycles of large cells. Finally they move cells containing data so that the cell does not lose its contents over time.<br />
*Performance can drop as the disk gets filled. Garbage collection is not universally well implemented, meaning freed space is not always collected into entirely free cells.<br />
<br />
==Pre-Purchase Considerations==<br />
There are several key features to look for prior to purchasing a contemporary SSD.<br />
===Key Features===<br />
*Native [http://en.wikipedia.org/wiki/TRIM TRIM] support is a vital feature that both prolongs SSD lifetime and reduces loss of performance for write operations over time.<br />
*Buying the right sized SSD is key. As with all filesystems, target <75 % occupancy for all SSD partitions to ensure efficient use by the kernel.<br />
<br />
===Reviews===<br />
This section is not meant to be all-inclusive, but does capture some key reviews.<br />
*[http://www.anandtech.com/show/2738 SSD Anthology (history lesson, a bit dated)]<br />
*[http://www.anandtech.com/show/2829 SSD Relapse (refresher and more up to date])<br />
*[http://forums.anandtech.com/showthread.php?t=2069761 One user's recommendations]<br />
*[http://techgage.com/article/enabling_and_testing_ssd_trim_support_under_linux/ Enabling and Testing SSD TRIM Support Under Linux]<br />
<br />
==Tips for Maximizing SSD Performance==<br />
===Partition Alignment ===<br />
===== High-level Overview =====<br />
'''Proper partition alignment is essential for optimal performance and longevity.''' Key to alignment is partitioning to (at least) the EBS (erase block size) of the SSD. <br />
<br />
{{Note|The EBS is largely vendor specific; a Google search on the model of interest would be a good idea! The Intel X25-M for example is thought to have an EBS of 512 KiB, but Intel has yet to publish anything officially to this end.}}<br />
{{Note|If one do not know the EBS of one's SSD, use a size of 512 KiB. Those numbers are greater or equal than all the current EBS. Aligning partitions for such an EBS will result in partitions also aligned for all lesser sizes. This is how Windows Seven and Ubuntu "optimizes" partitions to work with SSD.}}<br />
<br />
If the partitions are not aligned to begin at multiples of the EBS (512 KiB for example), aligning the file system is a pointless exercise because everything is skewed by the start offset of the partition. Traditionally, hard drives were addressed by indicating the ''cylinder'', the ''head'', and the ''sector'' at which data was to be read or written. These represented the radial position, the drive head (= platter and side) and the axial position of the data respectively. With LBA (logical block addressing), this is no longer the case. Instead, the entire hard drive is addressed as one continuous stream of data.<br />
<br />
==== Using GPT - Modern Method ====<br />
[[GPT]] is an alternative, contemporary partitioning style. It is intended to replace the old Master Boot Record ([[MBR]]) system. GPT has several advantages over MBR, which has quirks dating back to MS-DOS times. With recent developments to the formatting tools fdisk (MBR) and gdisk (GPT), it is equally easy to use GPT or MBR and get maximum performance. <br />
<br />
===== Choosing between GPT and MBR =====<br />
The choice basically boils down to this: <br />
* If using [[GRUB|GRUB Legacy]] as the bootloader, one must use MBR. See [[#Using MBR - Legacy Method]] further down.<br />
* If wantig to dual-boot with Windows, one must use MBR. See [[#Using MBR - Legacy Method]] further down.<br />
** A special exception to this rule: dual-booting Windows Vista/7 64 bit, and using [[UEFI]] instead of BIOS, one must use GPT.<br />
* If none of the above apply, choose freely between GPT and MBR. Since GPT is more modern, it is recommended in this case.<br />
<br />
===== Gdisk Usage Summary=====<br />
<br />
The GPT-able tool equivalent to fdisk, gdisk, can perform partitions alignment automatically on a 2048 sectors (or 1024KiB) block size base which should be compatible with the vast majority of SSD if not all. GNU parted also support GPT, but is [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=601813 less user-friendly] for aligning partitions. A summary of the typical usage of gdisk:<br />
<br />
* Install gdisk (gptfdisk package) from the extra repository.<br />
* Simply start gdisk against your SSD.<br />
* If the SSD is brand new or if wanting to start over, create a new empty GUID partition table (aka GPT) with the 'o' command.<br />
* Create a new partition with the 'n' command (primary type/1st partition).<br />
* Assuming the partition is new, gdisk will pick the highest possible alignment. Otherwise, it will pick the largest power of two that divides all partition offsets.<br />
* If choosing to start on a sector before the 2048th gdisk will automatically shift the partition start to the 2048th disk sector. This is to ensure a 2048-sectors alignment (as a sector is 512B, this is a 1024KiB alignment which should fit any SSD NAND erase block).<br />
* Use the +x{M,G} format to extend the partition x megabytes or gigabytes, if choosing a size that is not a multiple of the alignment size (1024kiB), gdisk will shrink the partition to the nearest inferior multiple).<br />
* Select the partition's type id, the default, 'Linux/Windows data' (code 0700), should be fine for most use. Press L to show the codes list.<br />
* Assign other partitions in a like fashion.<br />
* Write the table to disk and exit via the 'w' command.<br />
* Create the filesystems as usual.<br />
<br />
{{Warning|If planing to use the GPT partitioned SSD as a boot-disk on a BIOS based system (most systems except Apple computers and some very rare motherboard models with Intel chipset) one may have to create, preferably at the disk's beginning, a 1 MiB partition with the partition type as BIOS boot or bios_grub partition (gdisk type code EF02) for booting from the disk using [[GRUB2]]. For [[Syslinux]], one does not need to create a separate 1 MiB bios_grub partition, but one needs to have separate /boot partition and enable '''Legacy BIOS Bootable partition''' attribute for that partition (using gdisk). See [[GPT]] for more information.}}<br />
<br />
{{Warning|GRUB legacy does not support GUID partitioning scheme, users must use [[burg]], [[GRUB2]] or [[Syslinux]].}}<br />
<br />
{{Warning|If planing to dual boot with Windows (XP, Vista or 7) do NOT use GPT since they do NOT support booting from a GPT disk in BIOS systems! Users need to use the legacy MBR method described below for dual-boot in BIOS systems! This limitation does not apply if booting in UEFI mode and using Windows Vista (64bits) or 7 (64bits). For 32-bit Windows Vista and 7, and 32 and 64-bit Windows XP, users need to use MBR partitioning and boot in BIOS mode only.}}<br />
<br />
==== Using MBR - Legacy Method ====<br />
Using MBR, the utility for editing the partition table is called fdisk. Recent versions of fdisk have abandoned the deprecated system of using cylinders as the default display unit, as well as MS-DOS compatibility by default. The latest fdisk automatically aligns all partitions to 2048 sectors, or 1024 KiB, which should work for all EBS sizes that are known to be used by SSD manufacturers. This means that the default settings will give you proper alignment.<br />
<br />
Note that in the olden days, fdisk used cylinders as the default display unit, and retained an MS-DOS compatibility quirk that messed with SSD alignment. Therefore one will find many guides around the internet from around 2008-2009 making a big deal out of getting everything correct. With the latest fdisk, things are much simpler, as reflected in this guide.<br />
<br />
===== Fdisk Usage Summary =====<br />
*Start fdisk.<br />
*If the SSD is brand new, create a new empty DOS partition table with the 'o' command.<br />
*Create a new partition with the 'n' command (primary type/1st partition).<br />
*Use the +xG format to extend the partition x gigabytes.<br />
*Change the partition's system id from the default type of Linux (type 83) to the desired type via the 't' command. This is an optional step should the user wish to create another type of partition for example, swap, NTFS, LVM, etc. Note that a complete listing of all valid partition types is available via the 'l' command.<br />
*Assign other partitions in a like fashion.<br />
*Write the table to disk and exit via the 'w' command.<br />
<br />
When finished, users may format their newly created partitions with the 'mkfs.x /dev/sdXN' where x is the filesystem, X is the drive letter, and N is the partition number.<br />
The following example will format the first partition on the first disk to ext4 using the defaults specified in {{ic|/etc/mke2fs.conf}}:<br />
# mkfs.ext4 /dev/sda1<br />
<br />
{{Warning|Using the mkfs command can be dangerous as a simple mistake can result in formatting the WRONG partition and in data loss! TRIPLE check the target of this command before hitting the Enter key!}}<br />
<br />
====== Special Considerations for Logical Partitions ======<br />
<br />
---Place holder for content. <br />
<br />
====== Special Considerations for RAID0 Setups with Multiple SSDs ======<br />
<br />
---Place holder for content.<br />
<br />
===Encrypted partition===<br />
<br />
When using cryptsetup, define a sufficient payload ([http://www.spinics.net/lists/dm-crypt/msg02421.html see here]):<br />
cryptsetup luksFormat --align-payload=8192 ...<br />
But remember that DISCARD/TRIM feature is NOT SUPPORTED by device-mapper (but they are working on it, [http://news.gmane.org/find-root.php?group=gmane.linux.kernel.device-mapper.dm-crypt&article=4075 see here]. August 2011 news: support will be in Linux 3.1, and involves a userspace dm-crypt update as well [http://superuser.com/questions/302710/trim-support-via-dm-crypt-device-mapper#318847])<br />
<br />
===Mount Flags===<br />
There are several key mount flags to use in one's {{ic|/etc/fstab}} entries for SSD partitions.<br />
<br />
*'''noatime''' - Reading accesses to the file system will no longer result in an update to the atime information associated with the file. The importance of the noatime setting is that it eliminates the need by the system to make writes to the file system for files which are simply being read. Since writes can be somewhat expensive as mentioned in previous section, this can result in measurable performance gains. Note that the write time information to a file will continue to be updated anytime the file is written to with this option enabled.<br />
*'''discard''' - The discard flag will enable the benefits of the TRIM command so long as one is using kernel version >=2.6.33. It does not work with ext3; using the discard flag for an ext3 root partition will result in it being mounted read-only.<br />
<br />
/dev/sda1 / ext4 defaults,noatime,discard 0 1<br />
/dev/sda2 /home ext4 defaults,noatime,discard 0 1<br />
<br />
{{Note| One can set the discard flag with tune2fs: tune2fs -o discard /dev/sda1.}}<br />
{{Accuracy}}<br />
{{Warning|It is critically important that users switch the controller driving the SSD to AHCI mode (not IDE mode) to ensure that the kernel is able to use the TRIM command.}} <br />
{{Warning|Users need to be certain that kernel version 2.6.33 or above is being used AND that their SSD supports TRIM before attempting to mount a partition with the discard flag. Data loss can occur otherwise!}}<br />
{{Warning|Using an OCZ Vertex II SSD (supports TRIM) and kernel 2.6.37.4 on Arch, some people experienced trouble with the '''discard''' option: all changes made to the filesystem would disappear after a reboot! According to [http://www.mjmwired.net/kernel/Documentation/filesystems/ext4.txt#356 this], '''discard''' is disabled by default because it not stable enough.}}<br />
<br />
====Special considerations for Mac computers====<br />
<br />
By default, Apple's firmware switches SATA drives into IDE mode (not AHCI mode) when booting any OS besides Mac OS. It is easy to switch back to AHCI if using [[GRUB2]] with an Intel SATA controller.<br />
<br />
First determine the PCI identifier of the SATA controller. Run the command<br />
# lspci -nn<br />
and find the line that says "SATA AHCI Controller". The PCI identifier is in square brackets and should look like 8086:27c4 (but the last digits may be different).<br />
<br />
Now edit /boot/grub/grub.cfg and add the line:<br />
# setpci -d 8086:27c4 90.b=40<br />
right above the "set root" line of each OS for which AHCI wil be enabled. Be sure to substitute the appropriate PCI identifier.<br />
<br />
(credit: http://darkfader.blogspot.com/2010/04/windows-on-intel-mac-and-ahci-mode.html)<br />
<br />
=== I/O Scheduler ===<br />
<br />
Consider switching from the default scheduler, which under Arch is cfq (completely fair queuing), to the noop or deadline scheduler for an SSD. The later two offer performance boosts over cfq. Using the noop scheduler, for example, simply processes requests in the order they are received, without giving any consideration to where the data physically resides on the disk. This option is thought to be advantageous for SSDs since seek times are identical for all sectors on the SSD.<br />
<br />
However, some SSDs, particularly earlier, JMicron-based ones, may experience better performance sticking with the default scheduler (see [http://www.alphatek.info/2009/02/02/io-scheduler-and-ssd-part-2/ here]{{Linkrot|2011|09|04}} for one such benchmark); on these, while seek times are similar for all sectors, random access throughput is bad enough to offset any advantage. If the SSD was manufactured within the last year or so, or is made by Intel, this probably does not apply.<br />
<br />
For more on schedulers, see [http://www.linux-mag.com/id/7564/1 this] Linux Magazine article (needs registration).<br />
<br />
About the default scheduler for ssd drives: {{Bug|22605}}<br />
<br />
The cfq scheduler is enabled by default on Arch. Verify this by viewing the contents /sys/block/sda/queue/scheduler:<br />
$ cat /sys/block/sdX/queue/scheduler<br />
noop deadline [cfq]<br />
The scheduler currently in use is denoted from the available schedulers by the brackets. <br />
<br />
There are several ways to change the scheduler.<br />
<br />
{{Note|Only switch the scheduler to noop or deadline for SSDs. Keeping the cfq scheduler for all other physical HDDs is ''highly'' recommended.}}<br />
<br />
===== Using the sys virtual filesystem =====<br />
This method is preferred when the system has several physical storage devices (for example an SSD and an HDD).<br />
Add the following line in {{ic|/etc/rc.local}}:<br />
echo noop > /sys/block/sdX/queue/scheduler<br />
where X is the letter for the SSD device.<br />
<br />
Because of the potential for udev to assign different {{ic|/dev/}} nodes to drives before and after a kernel update, users must take care that the noop scheduler is applied to the correct device upon boot. One way to do this is by using the SSD's device ID to determine its {{ic|/dev/}} node. To do this automatically, use the following snippet instead of the line above and add it to {{ic|/etc/rc.local}}:<br />
SSD=(ata-OCZ-ONYX_XA1Y7CE3709UG79OTHVM ata-SAMSUNG_SSD_830_Series_S0VTNYABA01063)<br />
<br />
declare -i i=0<br />
while [ "${SSD[$i]}" != "" ]; do<br />
NODE=`ls -l /dev/disk/by-id/${SSD[$i]} | awk '{ print $NF }' | sed -e 's/[/\.]//g'`<br />
echo noop > /sys/block/$NODE/queue/scheduler<br />
i=i+1<br />
done<br />
where ''SSD'' is a Bash array containing the device IDs of all SSD devices. Device IDs are listed in {{ic|/dev/disk/by-id/}} as symbolic links pointing to their corresponding {{ic|/dev/}} nodes. To view the links listed with their targets, issue the following command:<br />
ls -l /dev/disk/by-id/<br />
<br />
===== Kernel parameter =====<br />
If the sole storage device in the system is an SSD, consider setting the I/O scheduler for the entire system via the elevator kernel parameter:<br />
elevator=noop<br />
<br />
For example, with GRUB, in {{ic|/boot/grub/menu.lst}}:<br />
kernel /vmlinuz26 root=/dev/sda3 ro elevator=noop<br />
or with GRUB2, in {{ic|/etc/default/grub}}: (remember to run update-grub afterwards)<br />
GRUB_CMDLINE_LINUX="elevator=noop"<br />
<br />
=== Swap Space on SSDs ===<br />
One can place a swap partition on an SSD. Note that most modern desktops with an excess of 2 Gigs of memory rarely use swap at all. The notable exception is systems which make use of the hibernate feature. The following is recommended tweak for SSDs using a swap partition that will reduce the "swapiness" of the system thus avoiding writes to swap.<br />
<br />
# echo 1 > /proc/sys/vm/swappiness<br />
<br />
Or one can simply modify {{ic|/etc/sysctl.conf}} as recommended in the [[Maximizing_performance#Swappiness|Maximizing Performance]] wiki article.<br />
<br />
vm.swappiness=1<br />
vm.vfs_cache_pressure=50<br />
<br />
=== SSD Memory Cell Clearing ===<br />
On occasion, users may wish to completely reset an SSD's cells to the same virgin state they were at the time he/she installed the device thus restoring it to its [http://www.anandtech.com/storage/showdoc.aspx?i=3531&p=8 factory default write performance]. Write performance is known to degrade over time even on SSDs with native TRIM support. TRIM only safeguards against file deletes, not replacements such as an incremental save.<br />
<br />
The reset is easily accomplished in a three step procedure denoted on the [[SSD Memory Cell Clearing]] wiki article.<br />
<br />
==Tips for Minimizing SSD Read/Writes==<br />
An overarching theme for SSD usage should be 'simplicity' in terms of locating high-read/write operations either in RAM (Random Access Memory) or on a physical HDD rather than on an SSD. Doing so will add longevity to an SSD. This is primarily due to the large erase block size (512 KiB in some cases); a lot of small writes result in huge effective writes.<br />
<br />
{{Note|A 32GB SSD with a mediocre 10x write amplification factor, a standard 10000 write/erase cycle, and '''10GB of data written per day''', would get an '''8 years life expectancy'''. It gets better with bigger SSDs and modern controllers with less write amplification.}}<br />
<br />
Use {{ic|iotop -oPa}} and sort by disk writes to see how much programs are writing to disk.<br />
<br />
=== Intelligent Partition Scheme ===<br />
Consider relocating the /var partition to a physical disc on the system rather than on the SSD itself to avoid read/write wear. Many users elect to keep only /, and /home on the SSD (/boot is okay too) locating /var and /tmp on a physical HDD. <br />
<br />
{{bc|# SSD<br />
/<br />
/home<br />
<br />
# HDD<br />
/boot<br />
/var<br />
/media/data (and other extra partitions, etc.)}}<br />
<br />
If the SSD is the only storage device on the system (i.e. no HDDs), consider allocating a separate partition for /var to allow for better crash recovery for example in the event of a broken program wasting all the space on / or if some run away log file maxes out the space, etc.<br />
<br />
Another intelligent option is to locate /tmp is into RAM provided the system has enough to spare. See the next section for more on this procedure.<br />
<br />
=== The noatime Mount Flag ===<br />
Assign the '''noatime''' flag to partitions residing on SSDs. See the [[#Mount_Flags|Mount Flags]] section below for more.<br />
<br />
=== Locate Browser Profiles in RAM ===<br />
One can ''easily'' mount browser profile(s) such as chromium, firefox, opera, etc. into RAM via tmpfs and also use rsync to keep them synced with HDD-based backups. In addition to the obvious speed enhancements, users will also save read/write cycles on their SSD by doing so.<br />
<br />
The AUR contains several packages to automate this process, for example:<br />
*{{AUR|profile-sync-daemon}}<br />
<br />
=== Compiling in tmpfs ===<br />
Intentionally compiling in /tmp is a great idea to minimize this problem. For systems with >4 GB of memory, the tmp line in {{ic|/etc/fstab}} can be tweaked to use more than 1/2 the physical memory on the system via the size flag.<br />
<br />
Example of a machine with 8 GB of physical memory:<br />
tmpfs /tmp tmpfs nodev,nosuid,size=7G 0 0<br />
<br />
=== Disabling Journaling on the Filesystem? ===<br />
Using a journaling filesystem such as ext3 or ext4 on an SSD WITHOUT a journal is an option to decrease read/writes. The obvious drawback of using a filesystem with journaling disabled is data loss as a result of an ungraceful dismount (i.e. post power failure, kernel lockup, etc.). With modern SSDs, [http://thunk.org/tytso/blog/2009/03/01/ssds-journaling-and-noatimerelatime Ted Tso]{{Linkrot|2011|09|04}} advocates that journaling can be enabled with minimal extraneous read/write cycles under most circumstances:<br />
<br />
'''Amount of data written (in megabytes) on an ext4 file system mounted with noatime.'''<br />
{| border="1" cellpadding="5"<br />
! operation !! journal !! w/o journal !! percent change<br />
|-<br />
!git clone<br />
|367.0<br />
|353.0<br />
|3.81 %<br />
|-<br />
!make<br />
|207.6<br />
|199.4<br />
|3.95 %<br />
|-<br />
!make clean<br />
|6.45<br />
|3.73<br />
|42.17 %<br />
|}<br />
<br />
''"What the results show is that metadata-heavy workloads, such as make clean, do result in almost twice the amount data written to disk. This is to be expected, since all changes to metadata blocks are first written to the journal and the journal transaction committed before the metadata is written to their final location on disk. However, for more common workloads where we are writing data as well as modifying filesystem metadata blocks, the difference is much smaller."''<br />
<br />
{{Note|The make clean example from the table above typifies the importance of intentionally doing compiling in /dev/shm as recommended in the [[Solid_State_Drives#Compiling in /dev/shm|preceding section]] of this article!}}<br />
<br />
=== Choice of Filesystem ===<br />
Many options exist for file systems including ext2, ext3, ext4, btrfs, etc.<br />
<br />
==== Btrfs ====<br />
[http://en.wikipedia.org/wiki/Btrfs Btrfs] support has been included with the mainline 2.6.29 release of the Linux kernel. Some feel that it is not mature enough for production use while there are also early adopters of this potential successor to ext4. It should be noted that at the time this article was originally written (27-June-2010), a stable version of btrfs did not exist. See [http://www.madeo.co.uk/?p=346 this] blog entry for more on btrfs. Be sure to read the [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs wiki] as well.<br />
<br />
{{Warning|At the time this entry was written (21-Nov-2010) there is NO fsck utility to fix/diagnose errors on btrfs partitions. While Btrfs is stable on a stable machine, it is currently possible to corrupt a filesystem irrecoverably in the event of a crash or power loss on disks that do not handle flush requests correctly.}}<br />
<br />
==== Ext4 ====<br />
[http://en.wikipedia.org/wiki/Ext4 Ext4] is another filsesystem that has support for SSD. It is considered as stable since 2.6.28 and is mature enough for daily use. Contrary to Btrfs, ext4 does not automatically detect the disk nature; users must explicitly enable the TRIM command support using the '''discard''' mounting option in [[fstab]] (or with tune2fs -o discard /dev/sdaX).<br />
See the [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/filesystems/btrfs.txt;h=64087c34327fe0ba11e790e0a41224b8e7c1d30c;hb=HEAD official in kernel tree documentation] for further information on ext4.<br />
<br />
== SSD Benchmarking ==<br />
See the [[SSD Benchmarking]] article for a general process of benchmarking SSDs or to see some of the SSDs in the database.<br />
<br />
== Firmware Updates ==<br />
=== OCZ ===<br />
OCZ has a command line utility available for Linux (i686 and x86_64) on their forum [http://www.ocztechnology.com/ssd_tools/ here].</div>AsmundErhttps://wiki.archlinux.org/index.php?title=ASUS_Eee_PC&diff=181442ASUS Eee PC2012-01-31T18:27:13Z<p>AsmundEr: /* Power Management */ Remark about suspend/hibernate</p>
<hr />
<div>[[Category:ASUS (English)]]<br />
This should be the page to gather all information on installing and running arch on the Asus Eee. <br />
Why? Because the 'old' page is a bit confusing/outdated, wrongly named (makes finding it in a search hard) and the title limits it to just the install precedure.<br />
<br />
The 'old' page should be cleaned up and merged into this page, and any future information should also go on this page. If no one that actualy owns an Eee want to do it, then I (Mr.Elendig) can do it, but it will take some time.<br />
<br />
Until this page actualy get some contents, go to [[Installing Arch Linux on the Asus EEE PC]].<br />
<br />
= Eee 700 Series and 900=<br />
This should be filled with the majority of the content from [[Installing Arch Linux on the Asus EEE PC]].<br />
<br />
=== Installation ===<br />
Installation can be achieved from an external cdrom drive, or from a usb stick configured as described in [[Install from USB stick]]<br />
<br />
The wireless module (ath5k) is now part of the stock kernel. The stock kernel performs very well on the eeepc. You do not need to install any extra packages from AUR for wireless or install any special kernel.<br />
<br />
During installation make sure you add the following packages in addition to the base packages for wireless to work.<br />
<br />
wireless_tools<br />
netcfg<br />
<br />
Thats all you now need for a working eee.<br />
<br />
=== If you do want an optimized Pentium-M kernel ===<br />
toofishes created a repository for the Eee. You can find some basic packages like a Pentium-M optimized kernel. Add<br />
[eee]<br />
Server = http://code.toofishes.net/packages/eee<br />
to your {{Filename|/etc/pacman.conf}} to use the repository.<br />
<br />
Simply use pacman to install the package you need. Install the packages with this command:<br />
# pacman -S kernel-eee<br />
<br />
Then, add the following to {{Filename|/boot/grub/menu.lst}}; note that no initrd is needed:<br />
# (2) Arch Linux<br />
title Arch Linux EEE kernel<br />
root (hd0,0)<br />
kernel /boot/vmlinuzeee root=/dev/sda1 ro<br />
<br />
Restart and select Arch Linux EEE kernel from the grub boot menu.<br />
<br />
===Xorg===<br />
Xorg works without an xorg.conf on the eeepc fine with the new hotplugging system.<br />
<br />
# pacman -S xorg xf86-input-keyboard xf86-input-synaptics xf86-video-intel<br />
<br />
start hal<br />
<br />
# /etc/rc.d/hal start<br />
<br />
and add hal to the daemons line of your /etc/rc.conf file<br />
<br />
===Sound===<br />
If sound does not work in a new installation add the following line to {{Filename|/etc/modprobe.d/modprobe.conf}}<br />
options snd-hda-intel model=3stack-dig<br />
<br />
= Eee 900A =<br />
<br />
The 900A is a 900 with a Intel Atom CPU and new hardware (the most is like in 901), you can get help in [[Asus Eee PC 900A]].<br />
<br />
= Eee 901, 904, and 1000(H) =<br />
The 901, 904, and 1000(H) all seem to share much-of, if not all the same hardware. The steps for setting up Arch Linux are as follows.<br />
NB. There is a separate wiki page as well dedicated to the [[Asus_Eee_PC_901|901]].<br />
<br />
== Setting up the Network ==<br />
Two PKGBUILD files are available in the AUR to help you get your network interfaces up and running. The first is delcake's "atl1e" drivers for your wired ethernet, and the second is jbooth's "eeert2860" drivers for wireless.<br />
<br />
=== atl1e ===<br />
delcake's PKGBUILD is located [http://aur.archlinux.org/packages.php?ID=18663 here] in the AUR.<br />
Note that in order to build this package, you will need to get the unrar and unzip packages from the mirror of you choice, as well as the LinuxDrivers.zip source code linked on the AUR page unless you did your wireless drivers first.<br />
<br />
#Transfer the PKGBUILD to your Eee PC. Get the source files too if you do not have internet yet.<br />
#Install the unrar and unzip packages if you do not already have them.<br />
#Issue a 'makepkg' command at the location of the PKGBUILD.<br />
<br />
If all goes well, a .pkg.tar.gz file that starts with the name atl1e will have been created in the same folder.<br />
<br />
As root, run 'pacman -U <package name>.pkg.tar.gz' to install your newly created module.<br />
In order to detect it, run both 'depmod -a' and 'modprobe atl1e' as root in that order.<br />
<br />
At this point, you should be able to issue an 'ifconfig -a' command and see your brand new eth0 device staring back at you. Don't forget to add atl1e to your modules list in /etc/rc.conf to automatically load your ethernet module during boot.<br />
<br />
* '''WARNING:''' You will need to recompile this module any time you do a kernel upgrade, so hang on to that PKGBUILD and zip file.<br />
<br />
=== eeert2860 ===<br />
jbooth's PKGBUILD is located [http://aur.archlinux.org/packages.php?ID=18705 here] in the AUR.<br />
Note that in order to build this package, you will need to get the wireless_tools package from the mirror of your choice, as well as Ralink's drivers listed under the sources section unless you did your wired drivers first.<br />
<br />
#Transfer the PKGBUILD to your Eee PC. Get the source files too if you do not have internet yet.<br />
#Install the wireless_tools package if you do not already have it.<br />
#Issue a 'makepkg' command at the location of the PKGBUILD.<br />
<br />
Hopefully, the makepkg command went through without a hitch, and a .pkg.tar.gz file will have been created in the same folder.<br />
<br />
As root, run 'pacman -U <package name>.pkg.tar.gz' to install your newly created module.<br />
In order to detect it, run both 'depmod -a' and 'modprobe rt2860sta' as root in that order.<br />
<br />
Now you should see your ra0 wireless device in the output of 'ifconfig -a'. As root, run 'ifconfig ra0 up' to bring up the interface for configuration.<br />
<br />
*'''Still no ra0 device?''' Make sure that the WLAN device is enabled in your BIOS.<br />
<br />
* '''WARNING:''' You will need to recompile this module any time you do a kernel upgrade, so hang on to the PKGBUILD and .tar.bz2 file.<br />
<br />
==Eee 901 20G lsmod and lspci==<br />
'''<br />
Note :''' This section was moved from the 70x/900 page.<br />
<br />
The following are from a stock ASUS EeePC 901 20G Linux version:<br />
<br />
lsmod:<br />
<pre><br />
Module Size Used by<br />
acpi_cpufreq 5004 0 <br />
freq_table 1988 1 acpi_cpufreq<br />
usb_storage 22980 0 <br />
libusual 6352 1 usb_storage<br />
pciehp 31172 0 <br />
pci_hotplug 9672 1 pciehp<br />
ehci_hcd 25420 0 <br />
uhci_hcd 18636 0 <br />
usbhid 13444 0 <br />
usbcore 91992 6 usb_storage,libusual,ehci_hcd,uhci_hcd,usbhid<br />
snd_pcm_oss 33568 0 <br />
snd_mixer_oss 13056 1 snd_pcm_oss<br />
rt2860sta 468248 1 <br />
atl1e 26388 0 <br />
fuse 34516 0 <br />
asus_acpi 6560 0 <br />
button 5648 0 <br />
processor 19820 1 acpi_cpufreq<br />
battery 7940 0 <br />
ac 3524 0 <br />
autofs4 15876 0 <br />
sr_mod 13284 0 <br />
cdrom 30624 1 sr_mod<br />
snd_hda_intel 284112 0 <br />
snd_pcm 50696 2 snd_pcm_oss,snd_hda_intel<br />
snd_timer 15556 1 snd_pcm<br />
snd_page_alloc 6728 2 snd_hda_intel,snd_pcm<br />
snd_hwdep 6084 1 snd_hda_intel<br />
snd 34852 6 snd_pcm_oss,snd_mixer_oss,snd_hda_intel,snd_pcm,snd_timer,snd_hwdep<br />
soundcore 3744 1 snd<br />
genrtc 6028 0<br />
</pre><br />
<br />
lspci:<br />
<pre><br />
00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03)<br />
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03)<br />
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)<br />
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)<br />
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)<br />
00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02)<br />
00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02)<br />
00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02)<br />
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02)<br />
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02)<br />
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02)<br />
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02)<br />
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02)<br />
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)<br />
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)<br />
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 02)<br />
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02)<br />
01:00.0 Network controller: RaLink RT2790 Wireless 802.11n PCIe<br />
03:00.0 Ethernet controller: Atheros Corp. L1e Gigabit Ethernet Adapter (rev b0)<br />
</pre><br />
<br />
= Eee 904HA =<br />
[[Asus Eee PC 904HA]]<br />
<br />
= Eee T91MT =<br />
[[Asus Eee PC T91MT]]<br />
<br />
= Eee T101MT =<br />
[[Asus Eee PC T101MT]]<br />
<br />
= Eee 1000HA =<br />
[[Asus Eee PC 1000HA]]<br />
<br />
= Eee 1000HE =<br />
[[Asus Eee PC 1000HE]]<br />
<br />
= Eee 1001P =<br />
[[Asus Eee PC 1001p]]<br />
<br />
= Eee 1001PX =<br />
[[Asus Eee PC 1001px]]<br />
<br />
= Eee 1005HA =<br />
[[Asus Eee PC 1005HA]]<br />
<br />
= Eee 1005P(E) =<br />
[[Asus Eee PC 1005P]]<br />
<br />
= Eee 1015B =<br />
<br />
Things that "just work":<br />
* Wlan (ath9k is part of the kernel)<br />
* Ethernet<br />
* Graphics (with kms and dri2, using the xf86-video-ati driver)<br />
* Webcam (using v4l)<br />
* Suspend-to-RAM (after installing acpid)<br />
* Cardreader (but keucr is in staging, thus '''taints the kernel'''. PyroPeter experienced '''crashes''' while he inserted or removed sd cards)<br />
<br />
''/etc/modprobe.d/eeepc1015b.conf:''<br />
# supposed to help against following msg in dmesg:<br />
# SP5100 TCO timer: mmio address 0xbafe00 already in use<br />
blacklist sp5100_tco<br />
<br />
# if you don't need the sd-card reader you may want to blacklist<br />
# keucr. it is in staging, thus taints the kernel<br />
blacklist keucr<br />
<br />
== Audio ==<br />
<br />
After running alsaconf the graphics card was the default audio output, so I had to create {{Filename|/etc/asound.conf}} with the following contents:<br />
<br />
defaults.ctl.card 1<br />
defaults.pcm.card 1<br />
defaults.timer.card 1<br />
<br />
= Eee 1015 PE/PEM =<br />
[[Asus Eee PC 1015 PE/PEM]]<br />
<br />
<br />
== Hardware ==<br />
<br />
The Eee 1015 series laptops come with a 1024x600 LED display and a Dual Core Intel Atom processor (N550). They also have a Braodcom wireless card and an Atheros Ethernet port. <br />
<br />
== Installation ==<br />
<br />
(Work in progress)<br />
To install Arch on the Asus Eee 1015 series you need to use an external cd-rom drive or a usb-stick. The partition created by Asus on my 1015 PEM is as follows:<br />
<br />
Number Start End Size Type File System Flags<br />
1 1049kb 107Gb 107Gb primary NTFS <br />
2 107Gb 123Gb 16.1Gb primary fat32 hidden<br />
3 123Gb 250Gb 127Gb primary NTFS <br />
4 250Gb 250Gb 21.2Gb primary <br />
<br />
Results may vary. The first partition was the Windows 7 installation. The second is the recovery partition with splashtop. Removing this second partition will cause the fast-start Linux to stop working. The third is Windows D:\ drive and the last one is the boot partition for Windows 7.<br />
<br />
Due to the limitations of having 4 partitions per drive I installed arch on the first 107Gb partition and created a swap file instead of a partition as per [[Swap]]. <br />
<br />
=== ACPI ===<br />
<br />
To enable acpi you need to edit menu.lst and add acpi_osi=Linux to the kernel line like so:<br />
<br />
kernel /boot/vmlinuz26 root=/dev/sda1 ro acpi_osi=Linux<br />
<br />
This enabled you to trigger devices in /sys/devices/platform/eeepc/.<br />
<br />
{{Note|As far as I can tell, this is no longer required. If you do add it, the module eeepc-wmi will fail to load - kernel 2.6.39.2-1}}<br />
<br />
=== Modules ===<br />
<br />
In order to get CPU frequency scaling as well as the proper special-purpose Eee PC module loaded, you can use the following MODULES statement in /etc/rc.conf:<br />
<br />
MODULES=( acpi-cpufreq cpufreq_ondemand eeepc-wmi )<br />
<br />
If you get double keypresses for with your function keys (like the mute key, etc.), add the following into {{Filename|/etc/modprobe.d/blacklist.conf}} (Create this file if it isn't present)<br />
<pre>blacklist eeepc-laptop</pre><br />
{{Note|As long as you do not add acpi_osi-Linux to menu.lst, the eeepc modules load automagically and are not required in MODULES}}<br />
<br />
= Eee 1015 PX =<br />
[[Asus_Eee_PC_1015PX]]<br />
<br />
= Eee 1015 PN =<br />
[[Asus_EEE_PC_1015pn]]<br />
<br />
= Eee 1201T =<br />
[[Asus Eee PC 1201T]]<br />
<br />
= Eee 1201NL =<br />
[[Asus Eee PC 1201NL]]<br />
<br />
= Eee 1215n =<br />
[[Asus EEE PC 1215n]]<br />
<br />
= Eee 1215P =<br />
[[Asus EEE PC 1215p]]<br />
<br />
= Eee 1215B =<br />
<br />
Things that work out of the box: Wifi, Ethernet, Video (max resolution available with basic Xorg and xfce packages installed), Touchpad, Keyboard (Fn keys not working).<br />
<br />
{{Note|Since kernel 3.0, you may need to blacklist the "bcma" module for '''Wifi''' to work! If iwconfig does not list your wireless card, this means you. See [[Broadcom_wireless#Wi-Fi_card_does_not_work_or_show_up_since_kernel_upgrade_.28brcmsmac.29]].}}<br />
<br />
Things that need work: Audio, Fn keys, Power management.<br />
<br />
== Installation ==<br />
<br />
Arch setup encountered no problems, GRUB installed successfully with no damages to Windows (need to uncomment the windows lines in in /boot/grub/menu.lst) and Express Gate.<br />
<br />
== Audio ==<br />
<br />
With the xfce4 desktop environment audio doesn't work by default (didn't test with other de). <br />
To fix this, add the following lines in your ~/.asoundrc:<br />
{{bc|defaults.pcm.card 1<br />
defaults.ctl.card 1}}<br />
<br />
(Credit to Touko Korpela from the Debian mailing list)<br />
<br />
== Video ==<br />
<br />
Youtube videos with the default ati driver work flawlessly with a resolution of 720p, while with 1080p playback isn't smooth anymore. Didn't test with the catalyst drivers, maybe a better playback could be achieved.<br />
<br />
== Power Management ==<br />
<br />
ACPI executes correctly and returns remaining battery life. Cpufreq doesn't seem to work, hence making it impossible for Jupiter ([http://sourceforge.net/projects/jupiter/]) to manage the Super Hybrid Engine. However, from the Jupiter tray icon, screen orientation, resolution and touchpad can be toggled and modified.<br />
<br />
By suggestion from the Debian mailing list, I tried loading "powernow-k8" with modprobe to get cpufreq working. This is apparently a bug in the driver detection mechanism of cpufreq, and should be reported upstream, I guess. After loading that module, cpufreq-info seems to work. Have not tried getting Jupiter to manage SHE yet after that.<br />
<br />
'''Suspend''' and '''hibernate''' work '''OK''', with one tiny bug: I can't seem to get the SD-card reader working after resuming from hibernate. After a reboot, it works fine.</div>AsmundErhttps://wiki.archlinux.org/index.php?title=Talk:Solid_state_drive&diff=181416Talk:Solid state drive2012-01-31T15:39:59Z<p>AsmundEr: /* GPT anyone? */ Updated the GPT and MBR sections</p>
<hr />
<div>@Aedit - thank you very much for the contribution to this article. Can you explain how you arrived at the numbers that relate to the head and cylinder choices? 2^8 times 49 and how does that translate into 2^8 times 512 = 128 KiB alignment?<br />
<br />
*Ted Tso recommends using a setting of 224*56 (=2^8*49) which results in (2^8*512=) 128 KiB alignment<br />
*While others advocate a setting of 32*32 (=2^10) which results in (2^10*512=) 512 KiB alignment<br />
<br />
@Graysky - you're welcome. The alignment number is the largest power-of-two divisor of the cylinder boundary positions on the disk. The size in bytes of the cylinders is H*S*512 = (tracks per cylinder) * (sectors per track) * (sector size). So factorize H, S and sector size (512=2^9) into prime factors, and take all the 2s. In the first case above we have to ignore the non-power-of-two factor of 7^2=49.<br />
<br />
@Aedit - interesting. I have an Intel X25-M G2 and I used the -H 32 -S 32 to give a 512 KiB alignment which should be fine, yet Ted suggests using the values that give a 128 KiB alignment (although 128 is a factor of 512). Is there any advantage to using the smaller number, or to put it another way, is there a disadvantage to using the larger number?<br />
<br />
@Graysky: As you say, a disk aligned to 512k is also aligned to 256k,128k... etc. The only disadvantage of larger alignment I know is that a little space is wasted by putting partition boundaries on the larger alignment. I suspect Ted thought the X25-M has a 128k erase block but I also have seen reports of 512k. Is there a definitive reference? Very nice wiki page btw - thanks.<br />
<br />
== GPT anyone? ==<br />
Did you ever think about directing the user to a painless partitionning scheme like GPT? You can just use <tt>gdisk /dev/sda</tt> and create as many partitions you want and it will be created at sector 2048 by default! Else you can also suggest using <tt>fdisk -cu /dev/sda</tt> (with a recent version of fdisk) which will do about the same except with logical partitions. Anyway, no one uses DOS anymore, just think about it twice, the famous extended partition was really a big big hack which should be forgotten. Booting XP with a partition starting at sector 2048 made with fdisk just works anyway. [[User:TiCPU|TiCPU]] 02:12, 9 July 2010 (EDT)<br />
<br />
@TiCPU: I just buy another SSD (the current one will go into the laptop) and I consider using GPT, since I won't install XP nor Seven on it and since after this article GPT allow the use of GPT and Gparted that do auto-alignement. So if either you could write something, or when I'll try to partion my drive I'll write what I do. [[User:Tcourbon|Tcourbon]] 09:56, 30 September 2010 (EDT)<br />
<br />
I write something based on my notes taken during my arch install using GPT and experimentation with gdisk and a raw disk image. Can someone review it ? [[User:Tcourbon|Tcourbon]] 16:31, 11 November 2010 (EST)<br />
<br />
While I think GPT is a good idea, it requires another bootloader than Grub. Since Grub2 is an unholy mess, and the other alternatives are far from common, I think it is a little harsh to call the fdisk/MBR approach "DEPRECATED". Especially since the latest fdisk has sane defaults for SSDs (with respect to alignment). I'm probably going to rewrite the fdisk/MBR section, to reflect changes in the latest version of fdisk, and change the wording to be less dramatic than "PREFERRED/DEPRECATED". Any objections? --[[User:AsmundEr|AsmundEr]] 11:40, 29 January 2012 (EST)<br />
<br />
I don't think grub2 is an unholy mess at all. Very usable and reliable. I dunno about the latest fdisk, but I agree with you about using less harse language giving users the two options. [[User:Graysky|Graysky]] 12:06, 29 January 2012 (EST)<br />
<br />
I guess we agree to disagree on grub2. Personally, I don't like it. But I've rewritten the GPT and the MBR sections, in what I hope is a fairly balanced way. In particular, I added a subsection at the start of the GPT section, which guides the user in choosing between GPT and MBR. Does this look OK to you? [[User:AsmundEr|AsmundEr]] 10:39, 31 January 2012 (EST)<br />
<br />
== ext4 discard option ==<br />
I believe ext4 is a sensible filesystem choice for an SSD as long as you enable the TRIMM command using the discard otpion in fstab (source : [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/filesystems/ext4.txt;h=e1def1786e5074e5d8f3cf89b5f14cbfc9fab4af;hb=HEAD ext4.txt in kernel doc]).<br />
Consequently I've added a paragraph about that. [[User:Tcourbon|Tcourbon]] 08:43, 18 September 2010 (EDT)<br />
<br />
== I/O Scheduler ==<br />
<br />
I don't understand why the part on I/O scheduler was changed : the new way to alter the scheduling on SSD is far from optimal since not every as a SSD as only drive. I think we should add that method to change the scheduler as a side note for this particular setup. [[User:Tcourbon|Tcourbon]] 19:22, 12 November 2010 (EST)<br />
<br />
Whoops, sorry about that...it hadn't occurred to me when I edited the section. At least all is well now, though. :) --[[User:Ichifish|Ichifish]] 22:00, 8 December 2010 (EST)<br />
<br />
== AHCI ==<br />
Dispite common practice and believes OCZ discourages the use of AHCI on (their) SSD drives [http://www.ocztechnology.com/res_old/images/Configuring-and-Setting-Up-SSDs.pdf] Both AHCI and IDE mode support the TRIM command, so it is recommended to use IDE SSD drives.<br />
--[[User:theking2]] 15:25, April 20, 2011<br />
<br />
This guide is 3 years old - I don't know if there is an actual one, but this guide was only for the OCZ Core Series back in 2008.<br />
<br />
--[[User:Evilandi666|Evilandi666]] 20:46, 14 June 2011 (EDT)<br />
<br />
== DONT USE NOOP ==<br />
<br />
The noop scheduler will perform slow but as a result it will greatly frees up CPU cycles. This in the real world will not increase the speed of your read/writes compared to CFS but instead consume less CPU resources. You can benchmark the deadline scheduler which MAY increase performance in some circumstances. By real world benchmarks, I mean anything but hdparm.<br />
=== response 1 ====<br />
Interesting assertion... do you have any data or a source to back it up?<br />
[[User:Graysky|Graysky]] 17:20, 21 December 2011 (EST)<br />
<br />
== fstab: none vs. tmpfs ==<br />
<br />
Is there any significance in the fact that the following two examples of fstab entries start differently?<br />
none /tmp tmpfs nodev,nosuid,noatime,size=1000M,mode=1777 0 0<br />
tmpfs /tmp tmpfs nodev,nosuid,size=7G 0 0<br />
I have a feeling I just needlessly switched an SSD system from the latter to the former... Not that it matters if they are equivalent but I'm just not clear from either this or the linked documentation on tmpfs if this is correct or not. --[[User:Margali|Margali]] 22:41, 3 January 2012 (EST)</div>AsmundErhttps://wiki.archlinux.org/index.php?title=Solid_state_drive&diff=181414Solid state drive2012-01-31T15:35:45Z<p>AsmundEr: /* Using MBR - Legacy Method */ Edited to reflect updates in fdisk, making the process simpler.</p>
<hr />
<div>[[Category: Storage (English)]]<br />
{{i18n|Solid State Drives}}<br />
{{Article summary start}}<br />
{{Article summary text|This article covers many aspects of SSDs (solid state drives) as they relate to Linux; however, the underlying principals and key learning presented within are general enough to be applicable to users running SSDs on other operating systems such as the Windows family of products as well as MacOS X. Beyond the aforementioned information, Linux users will benefit from the tweaks/optimization presented herein.}}<br />
{{Article summary heading|Related Articles}}<br />
{{Article summary wiki|SSD Benchmarking}}<br />
{{Article summary wiki|SSD Memory Cell Clearing}}<br />
{{Article summary end}}<br />
<br />
==Introduction==<br />
Solid State Drives (SSDs) are not PnP devices. Special considerations such as partition alignment, choice of file system, TRIM support, etc. are needed to setup SSDs for optimal performance. This article attempts to capture referenced, key learnings to enable users to get the most out of SSDs under Linux. Users are encouraged to read this article in its entirety before acting on recommendations as the content is organized by topic, not necessarily by any systematic or chronologically relevant order.<br />
<br />
{{Note|This article is targeted at users running Linux, but much of the content is also relevant to our friends using both Windows and Mac OS X.}}<br />
===Advantages over HDDs===<br />
*Fast read speeds - 2-3x faster than modern desktop HDDs (7,200 RPM using SATA2 interface).<br />
*Sustained read speeds - No decrease in read speed across the entirety of the device. HDD performance tapers off as the drive heads move from the outer edges to the center of HDD platters.<br />
*Minimal access time - Approx. 100x faster than an HDD. For example, 0.1 ms (100 ns) vs. 12-20 ms (12,000-20,000 ns) for desktop HDDs.<br />
*High degree of reliability.<br />
*No moving parts.<br />
*Minimal heat production.<br />
*Minimal power consumption - Fractions of a W at idle and 1-2 W while reading/writing vs. 10-30 W for a HDD depending on RPMs.<br />
*Light-weight - ideal for laptops.<br />
<br />
===Limitations===<br />
*Per-storage cost (dollars per GB, vs. pennies per GB for rotating media).<br />
*Capacity of marketed models is lower than that of HDDs.<br />
*Large cells require different filesystem optimizations than rotating media. The flash translation layer hides the raw flash access which a modern OS could use to optimize access.<br />
*Partitions and filesystems need some SSD-specific tuning. Page size and erase page size are not autodetected.<br />
*Cells wear out. Consumer MLC cells at mature 50nm processes can handle 10000 writes each; 35nm generally handles 5000 writes, and 25nm 3000 (smaller being higher density and cheaper). If writes are properly spread out, are not too small, and align well with cells, this translates into a lifetime write volume for the SSD that is a multiple of its capacity. Daily write volumes have to be balanced against life expectancy.<br />
*Firmwares and controllers are complex. They occasionally have bugs. Modern ones consume power comparable with HDDs. They [https://lwn.net/Articles/353411/ implement] the equivalent of a log-structured filesystem with garbage collection. They translate SATA commands traditionally intended for rotating media. Some of them do on the fly compression. They spread out repeated writes across the entire area of the flash, to prevent wearing out some cells prematurely. They also coalesce writes together so that small writes are not amplified into as many erase cycles of large cells. Finally they move cells containing data so that the cell does not lose its contents over time.<br />
*Performance can drop as the disk gets filled. Garbage collection is not universally well implemented, meaning freed space is not always collected into entirely free cells.<br />
<br />
==Pre-Purchase Considerations==<br />
There are several key features to look for prior to purchasing a contemporary SSD.<br />
===Key Features===<br />
*Native [http://en.wikipedia.org/wiki/TRIM TRIM] support is a vital feature that both prolongs SSD lifetime and reduces loss of performance for write operations over time.<br />
*Buying the right sized SSD is key. As with all filesystems, target <75 % occupancy for all SSD partitions to ensure efficient use by the kernel.<br />
<br />
===Reviews===<br />
This section is not meant to be all-inclusive, but does capture some key reviews.<br />
*[http://www.anandtech.com/show/2738 SSD Anthology (history lesson, a bit dated)]<br />
*[http://www.anandtech.com/show/2829 SSD Relapse (refresher and more up to date])<br />
*[http://forums.anandtech.com/showthread.php?t=2069761 One user's recommendations]<br />
*[http://techgage.com/article/enabling_and_testing_ssd_trim_support_under_linux/ Enabling and Testing SSD TRIM Support Under Linux]<br />
<br />
==Tips for Maximizing SSD Performance==<br />
===Partition Alignment ===<br />
===== High-level Overview =====<br />
'''Proper partition alignment is essential for optimal performance and longevity.''' Key to alignment is partitioning to (at least) the EBS (erase block size) of the SSD. <br />
<br />
{{Note|The EBS is largely vendor specific; a Google search on the model of interest would be a good idea! The Intel X25-M for example is thought to have an EBS of 512 KiB, but Intel has yet to publish anything officially to this end.}}<br />
{{Note|If you do not know the EBS of your SSD, you can still use a size of 512 KiB (or 1024 KiB if you want to be sure and you do not care losing the first MiB of your disk). Those numbers are greater or equal than all the current EBS. Aligning partitions for such an EBS will result in partitions also aligned for all lesser sizes. This is how Windows Seven and Ubuntu "optimizes" partitions to work with SSD.}}<br />
<br />
If the partitions are not aligned to begin at multiples of the EBS (512 KiB for example), aligning the file system is a pointless exercise because everything is skewed by the start offset of the partition. Traditionally, hard drives were addressed by indicating the ''cylinder'', the ''head'', and the ''sector'' at which data was to be read or written. These represented the radial position, the drive head (= platter and side) and the axial position of the data respectively. With LBA (logical block addressing), this is no longer the case. Instead, the entire hard drive is addressed as one continuous stream of data.<br />
<br />
==== Using GPT - Modern Method ====<br />
[[GPT]] is an alternative, contemporary partitioning style. It is intended to replace the old Master Boot Record ([[MBR]]) system. GPT has several advantages over MBR, which has quirks dating back to MS-DOS times. With recent developments to the formatting tools fdisk (MBR) and gdisk (GPT), it is equally easy to use GPT or MBR with your SSD and get maximum performance. <br />
<br />
===== Choosing between GPT and MBR =====<br />
The choice basically boils down to this: <br />
* If you want to use [[GRUB|GRUB Legacy]] as your bootloader, you must use MBR. See [[#Using MBR - Legacy Method]] further down.<br />
* If you want to dual-boot with Windows, you must use MBR. See [[#Using MBR - Legacy Method]] further down.<br />
** A special exception to this rule: If you want to dual-boot Windows Vista/7 64 bit, and you are using [[UEFI]] instead of BIOS, you must use GPT.<br />
* If none of the above apply to you, you can choose freely between GPT and MBR. Since GPT is more modern, it is recommended in this case.<br />
<br />
===== Gdisk Usage Summary=====<br />
<br />
The GPT-able tool equivalent to fdisk, gdisk, can perform partitions alignment automatically on a 2048 sectors (or 1024KiB) block size base which should be compatible with the vast majority of SSD if not all. GNU parted also support GPT, but is [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=601813 less user-friendly] for aligning partitions. A summary of the typical usage of gdisk:<br />
<br />
* Install gdisk (gptfdisk package) from the extra repository.<br />
* Simply start gdisk against your SSD.<br />
* If the SSD is brand new or if you want to start over, create a new empty GUID partition table (aka GPT) with the 'o' command.<br />
* Create a new partition with the 'n' command (primary type/1st partition).<br />
* Assuming your partition is new, gdisk will pick the highest possible alignment. Otherwise, it will pick the largest power of two that divides all partition offsets.<br />
* If you choose to start on a sector before the 2048th gdisk will automatically shift your partition start to the 2048th disk sector. This is to ensure a 2048-sectors alignment (as a sector is 512B, this is a 1024KiB alignment which should fit any SSD NAND erase block).<br />
* Use the +x{M,G} format to extend the partition x megabytes or gigabytes, if you choose a size that is not a multiple of the alignment size (1024kiB) gdisk will shrink the partition to the nearest inferior multiple).<br />
* Select the partition's type id, the default, 'Linux/Windows data' (code 0700), should be fine for most use. Press L to show the codes list.<br />
* Assign other partitions in a like fashion.<br />
* Write the table to disk and exit via the 'w' command.<br />
* Create the filesystems as usual.<br />
<br />
{{Warning|If you plan to use the GPT partitioned SSD as a boot-disk on a BIOS based system (most systems except Apple computers and some very rare motherboard models with Intel chipset) you may have to create, preferably at the disk's beginning, a 1 MiB partition with the partition type as BIOS boot or bios_grub partition (gdisk type code EF02) for booting from the disk using [[GRUB2]]. For [[Syslinux]], you do not need to create a separate 1 MiB bios_grub partition, but you need to have separate /boot partition and enable '''Legacy BIOS Bootable partition''' attribute for that partition (using gdisk). See [[GPT]] for more information.}}<br />
<br />
{{Warning|GRUB legacy does not support GUID partitioning scheme, you have to use [[burg]], [[GRUB2]] or [[Syslinux]].}}<br />
<br />
{{Warning|If you plan to dual boot with Windows (XP, Vista or 7) do NOT use GPT since they do NOT support booting from a GPT disk in BIOS systems! You will need to use the legacy MBR method described below for dual-boot in BIOS systems! This limitation does not apply if you boot in UEFI mode and using Windows Vista (64bits) or 7 (64bits). For 32-bit Windows Vista and 7, and 32 and 64-bit Windows XP, you need to use MBR partitioning and boot in BIOS mode only.}}<br />
<br />
===== Detailed Usage Example =====<br />
{{Note|The following section is meant to be illustrative of the process of partitioning a Crucial C300 Real SSD with a single partitions: 10GiB, Linux partition. Even if it should work on any SSD, with adapt it to your own partition scheme. Again, do not forget to add a 1MiB BIOS boot partition as the first partition if needed.}}<br />
Install gptfdisk package:<br />
# pacman -S gptfdisk<br />
<br />
Run gdisk against your SSD which we will assume to be /dev/sda:<br />
{{bc|[root@archlinux ~]# gdisk /dev/sda<br />
GPT fdisk (gdisk) version 0.6.13<br />
<br />
Partition table scan:<br />
MBR: not present<br />
BSD: not present<br />
APM: not present<br />
GPT: not present<br />
<br />
Creating new GPT entries.<br />
}}<br />
<br />
Now create a new GUID partition table:<br />
{{bc|Command (? for help): o<br />
This option deletes all partitions and creates a new protective MBR.<br />
Proceed? (Y/N): y}}<br />
<br />
Creating partition:<br />
{{bc|1=Command (? for help): n<br />
Partition number (1-128, default 1): #pressed enter to accept default#<br />
First sector (34-125045424, default = 34) or {+-}size{KMGTP}: #pressed enter to accept default#<br />
Information: Moved requested sector from 34 to 2048 in<br />
order to align on 2048-sector boundaries.<br />
Use 'l' on the experts' menu to adjust alignment<br />
Last sector (2048-125045424, default = 125045424) or {+-}size{KMGTP}: +10G <br />
Current type is 'Linux/Windows data'<br />
Hex code or GUID (L to show codes, Enter = 0700): #pressed enter to accept default#<br />
Changed type of partition to 'Linux/Windows data'<br />
}}<br />
<br />
Result:<br />
{{bc|Command (? for help): p<br />
Disk /dev/sda: 125045424 sectors, 59.6 GiB<br />
Logical sector size: 512 bytes<br />
Disk identifier (GUID): A89B4292-8ED7-40CB-BD45-58A160E090EE<br />
Partition table holds up to 128 entries<br />
First usable sector is 34, last usable sector is 125045390<br />
Partitions will be aligned on 2048-sector boundaries<br />
Total free space is 2014 sectors (1007.0 KiB)<br />
<br />
Number Start (sector) End (sector) Size Code Name<br />
1 2048 20973567 10.0 GiB 0700 Linux/Windows data}}<br />
<br />
Write the partition table and exit:<br />
{{bc|Command (? for help): w<br />
<br />
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING<br />
PARTITIONS!!<br />
<br />
Do you want to proceed, possibly destroying your data? (Y/N): y<br />
OK; writing new GUID partition table (GPT).<br />
Warning: The kernel is still using the old partition table.<br />
The new table will be used at the next reboot.<br />
The operation has completed successfully.<br />
[root@archlinux ~]#}}<br />
<br />
Now create the file system as usual:{{bc|# mkfs.ext4 /dev/sda1}}<br />
<br />
==== Using MBR - Legacy Method ====<br />
Using MBR, the utility for editing the partition table is called fdisk. Recent versions of fdisk have abandoned the deprecated system of using cylinders as the default display unit, as well as MS-DOS compatibility by default. This means that it is easy to get proper alignment with SSDs. '''One simply needs to choose a number of heads and sectors of which the SSD's erase block size is a multiple.''' This is accomplished by setting the number of heads and sectors (per track) to coincide with the EBS.<br />
<br />
Note that in the olden days, fdisk used cylinders as the default display unit, and retained an MS-DOS compatibility quirk that messed with SSD alignment. Therefore you will find many guides around the internet from around 2008-2009 making a big deal out of getting everything correct. With the latest fdisk, things are much simpler, as reflected in this guide.<br />
<br />
Ted Tso recommends using a setting of [http://ldn.linuxfoundation.org/blog-entry/aligning-filesystems-ssd%E2%80%99s-erase-block-size 224*56] (=2^8*49) which results in (2^8*512=) 128 KiB alignment:<br />
<br />
# fdisk -H 224 -S 56 /dev/sdX<br />
<br />
While others advocate a setting of [http://www.nuclex.org/blog/personal/80-aligning-an-ssd-on-linux 32*32] (=2^10) which results in (2^10*512=) 512 KiB alignment:<br />
<br />
# fdisk -H 32 -S 32 /dev/sdX<br />
<br />
How does the math work out? The alignment number is the largest power-of-two divisor of the cylinder boundary positions on the disk. The size in bytes of the cylinders is H*S*512 = (tracks per cylinder) * (sectors per track) * (sector size). Factorize H, S and sector size (512=2^9) into prime factors, and take all the 2s. In the first case above we have to ignore the non-power-of-two factor of 7^2=49.<br />
<br />
{{Note|If you are unsure about the EBR of your particular SSD, using the -H 32 -S 32 flags will give the correct result for almost all SSDs. This is because 512 KiB is a multiple of all commonly used EBR sizes (64, 128, 256).}}<br />
<br />
===== Fdisk Usage Summary =====<br />
*Start fdisk using the correct values for H and S specific to your SSD as described above.<br />
*If the SSD is brand new, create a new empty DOS partition table with the 'o' command.<br />
*Create a new partition with the 'n' command (primary type/1st partition).<br />
*Use the +xG format to extend the partition x gigabytes.<br />
*Change the partition's system id from the default type of Linux (type 83) to the desired type via the 't' command. This is an optional step should the user wish to create another type of partition for example, swap, NTFS, LVM, etc. Note that a complete listing of all valid partition types is available via the 'l' command.<br />
*Assign other partitions in a like fashion.<br />
*Write the table to disk and exit via the 'w' command.<br />
<br />
When finished, users may format their newly created partitions with the 'mkfs.x /dev/sdXN' where x is the filesystem, X is the drive letter, and N is the partition number.<br />
The following example will format the first partition on the first disk to ext4 using the defaults specified in {{ic|/etc/mke2fs.conf}}:<br />
# mkfs.ext4 /dev/sda1<br />
<br />
{{Warning|Using the mkfs command can be dangerous as a simple mistake can result in formatting the WRONG partition and in data loss! TRIPLE check the target of this command before hitting the Enter key!}}<br />
<br />
====== Detailed Usage Example ======<br />
{{Note|The following section is meant to be illustrative of the process of partitioning an OCZ Agility 3 with a single 200 MB, Linux partition. It is in no way the definitive method for doing so, nor are the switches used to start fdisk in this specific example necessarily the correct values for other brands/models of SSDs!}}<br />
<br />
{{bc|# fdisk -H 32 -S 32 /dev/sda<br />
<br />
Command (m for help): o<br />
Building a new DOS disklabel with disk identifier 0x8cb3d286.<br />
Changes will remain in memory only, until you decide to write them.<br />
After that, of course, the previous content will not be recoverable.<br />
<br />
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)<br />
<br />
Command (m for help): n<br />
Command action<br />
e extended<br />
p primary partition (1-4)<br />
p<br />
Partition number (1-4): 1<br />
First sector (2048-117231407, default 2048):<br />
Using default value of 2048<br />
Last sector, +sectors or +size{K,M,G} (2048-117231407, default 117231407): +200M<br />
<br />
Command (m for help): w<br />
The partition table has been altered!<br />
<br />
Calling ioctl() to re-read partition table.<br />
Syncing disks.}}<br />
<br />
The rest of the SSD was partitioned in a similar fashion, with the other partition taking the rest of the SSD drive. The first partition is used for /boot, the second for LVM. Here is the output of an fdisk list command:<br />
{{bc|1=# fdisk -l /dev/sda<br />
<br />
Disk /dev/sda: 60.0 GB, 60022480896 bytes<br />
255 heads, 63 sectors/track, 7297 cylinders, total 117231408 sectors<br />
Units = sectors of 1 * 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 512 bytes<br />
I/O size (minimum/optimal): 512 bytes / 512 bytes<br />
Disk identifier: 0xfffffff<br />
Device Boot Start End Blocks Id System<br />
/dev/sda1 * 2048 411647 204800 83 Linux<br />
/dev/sda2 411648 117231407 58409880 8e Linux LVM}}<br />
<br />
{{Note|1=For some reason, the heads/sectors displayed by this command is no longer 32/32. To verify that you still have alignment, check that the start of the second partition is still aligned: in this case, 411648/2048 = 201, which is not a decimal number, so we're good. This is thought to be a bug in fdisk when writing two or more partitions. If you are paranoid about really getting alignment, or the start of the second partition is not divisible, see the [[SSD_Memory_Cell_Clearing#Post_Process_Observation|using cfdisk/post process observation]] wiki page for a work around.}}<br />
<br />
====== Special Considerations for Logical Partitions ======<br />
<br />
---Place holder for content. <br />
<br />
====== Special Considerations for RAID0 Setups with Multiple SSDs ======<br />
<br />
---Place holder for content.<br />
<br />
===Encrypted partition===<br />
<br />
When using cryptsetup, define a sufficient payload ([http://www.spinics.net/lists/dm-crypt/msg02421.html see here]):<br />
cryptsetup luksFormat --align-payload=8192 ...<br />
But remember that DISCARD/TRIM feature is NOT SUPPORTED by device-mapper (but they are working on it, [http://news.gmane.org/find-root.php?group=gmane.linux.kernel.device-mapper.dm-crypt&article=4075 see here]. August 2011 news: support will be in Linux 3.1, and involves a userspace dm-crypt update as well [http://superuser.com/questions/302710/trim-support-via-dm-crypt-device-mapper#318847])<br />
<br />
===Mount Flags===<br />
There are several key mount flags to use in one's {{ic|/etc/fstab}} entries for SSD partitions.<br />
<br />
*'''noatime''' - Reading accesses to the file system will no longer result in an update to the atime information associated with the file. The importance of the noatime setting is that it eliminates the need by the system to make writes to the file system for files which are simply being read. Since writes can be somewhat expensive as mentioned in previous section, this can result in measurable performance gains. Note that the write time information to a file will continue to be updated anytime the file is written to with this option enabled.<br />
*'''discard''' - The discard flag will enable the benefits of the TRIM command so long as one is using kernel version >=2.6.33. It does not work with ext3; using the discard flag for an ext3 root partition will result in it being mounted read-only.<br />
<br />
/dev/sda1 / ext4 defaults,noatime,discard 0 1<br />
/dev/sda2 /home ext4 defaults,noatime,discard 0 1<br />
<br />
{{Note|You can also set the discard flag with tune2fs: tune2fs -o discard /dev/sda1.}}<br />
{{Accuracy}}<br />
{{Warning|It is critically important that users switch the controller driving the SSD to AHCI mode (not IDE mode) to ensure that the kernel is able to use the TRIM command.}} <br />
{{Warning|Users need to be certain that kernel version 2.6.33 or above is being used AND that their SSD supports TRIM before attempting to mount a partition with the discard flag. Data loss can occur otherwise!}}<br />
{{Warning|Using an OCZ Vertex II SSD (supports TRIM) and kernel 2.6.37.4 on Arch, some people experienced trouble with the '''discard''' option: all changes made to the filesystem would disappear after a reboot! According to [http://www.mjmwired.net/kernel/Documentation/filesystems/ext4.txt#356 this], '''discard''' is disabled by default because it not stable enough.}}<br />
<br />
====Special considerations for Mac computers====<br />
<br />
By default, Apple's firmware switches SATA drives into IDE mode (not AHCI mode) when booting any OS besides Mac OS. It is easy to switch back to AHCI if you are using [[GRUB2]] with an Intel SATA controller.<br />
<br />
First determine the PCI identifier of your SATA controller. Run the command<br />
# lspci -nn<br />
and find the line that says "SATA AHCI Controller". The PCI identifier is in square brackets and should look like 8086:27c4 (but the last digits may be different).<br />
<br />
Now edit /boot/grub/grub.cfg and add the line <br />
# setpci -d 8086:27c4 90.b=40<br />
right above the "set root" line of each OS you want to enable AHCI for. Be sure to substitute the appropriate PCI identifier.<br />
<br />
(credit: http://darkfader.blogspot.com/2010/04/windows-on-intel-mac-and-ahci-mode.html)<br />
<br />
=== I/O Scheduler ===<br />
<br />
Consider switching from the default scheduler, which under Arch is cfq (completely fair queuing), to the noop or deadline scheduler for an SSD. The later two offer performance boosts over cfq. Using the noop scheduler, for example, simply processes requests in the order they are received, without giving any consideration to where the data physically resides on the disk. This option is thought to be advantageous for SSDs since seek times are identical for all sectors on the SSD.<br />
<br />
However, for some SSDs, particularly earlier, JMicron-based ones, you may experience better performance sticking with the default scheduler (see [http://www.alphatek.info/2009/02/02/io-scheduler-and-ssd-part-2/ here]{{Linkrot|2011|09|04}} for one such benchmark); on these, while seek times are similar for all sectors, random access throughput is bad enough to offset any advantage. If your SSD was manufactured within the last year or so, or is made by Intel, this probably does not apply to you.<br />
<br />
For more on schedulers, see [http://www.linux-mag.com/id/7564/1 this] Linux Magazine article (needs registration).<br />
<br />
About the default scheduler for ssd drives: {{Bug|22605}}<br />
<br />
The cfq scheduler is enabled by default on Arch. Verify this by viewing the contents /sys/block/sda/queue/scheduler:<br />
$ cat /sys/block/sdX/queue/scheduler<br />
noop deadline [cfq]<br />
The scheduler currently in use is denoted from the available schedulers by the brackets. <br />
<br />
There are several ways to change the scheduler.<br />
<br />
{{Note|Only switch the scheduler to noop or deadline for SSDs. Keeping the cfq scheduler for all other physical HDDs is ''highly'' recommended.}}<br />
<br />
===== Using the sys virtual filesystem =====<br />
This method is preferred when the system has several physical storage devices (for example an SSD and an HDD).<br />
Add the following line in {{ic|/etc/rc.local}}:<br />
echo noop > /sys/block/sdX/queue/scheduler<br />
where X is the letter for the SSD device.<br />
<br />
Because of the potential for udev to assign different {{ic|/dev/}} nodes to drives before and after a kernel update, users must take care that the noop scheduler is applied to the correct device upon boot. One way to do this is by using the SSD's device ID to determine its {{ic|/dev/}} node. To do this automatically, use the following snippet instead of the line above and add it to {{ic|/etc/rc.local}}:<br />
SSD=(ata-OCZ-ONYX_XA1Y7CE3709UG79OTHVM ata-SAMSUNG_SSD_830_Series_S0VTNYABA01063)<br />
<br />
declare -i i=0<br />
while [ "${SSD[$i]}" != "" ]; do<br />
NODE=`ls -l /dev/disk/by-id/${SSD[$i]} | awk '{ print $NF }' | sed -e 's/[/\.]//g'`<br />
echo noop > /sys/block/$NODE/queue/scheduler<br />
i=i+1<br />
done<br />
where ''SSD'' is a Bash array containing the device IDs of all SSD devices. Device IDs are listed in {{ic|/dev/disk/by-id/}} as symbolic links pointing to their corresponding {{ic|/dev/}} nodes. To view the links listed with their targets, issue the following command:<br />
ls -l /dev/disk/by-id/<br />
<br />
===== Kernel parameter =====<br />
If the sole storage device in the system is an SSD, consider setting the I/O scheduler for the entire system via the elevator kernel parameter:<br />
elevator=noop<br />
<br />
For example, with GRUB, in {{ic|/boot/grub/menu.lst}}:<br />
kernel /vmlinuz26 root=/dev/sda3 ro elevator=noop<br />
or with GRUB2, in {{ic|/etc/default/grub}}: (remember to run update-grub afterwards)<br />
GRUB_CMDLINE_LINUX="elevator=noop"<br />
<br />
=== Swap Space on SSDs ===<br />
One can place a swap partition on an SSD. Note that most modern desktops with an excess of 2 Gigs of memory rarely use swap at all. The notable exception is systems which make use of the hibernate feature. The following is recommended tweak for SSDs using a swap partition that will reduce the "swapiness" of the system thus avoiding writes to swap.<br />
<br />
# echo 1 > /proc/sys/vm/swappiness<br />
<br />
Or one can simply modify {{ic|/etc/sysctl.conf}} as recommended in the [[Maximizing_performance#Swappiness|Maximizing Performance]] wiki article.<br />
<br />
vm.swappiness=1<br />
vm.vfs_cache_pressure=50<br />
<br />
=== SSD Memory Cell Clearing ===<br />
On occasion, users may wish to completely reset an SSD's cells to the same virgin state they were at the time he/she installed the device thus restoring it to its [http://www.anandtech.com/storage/showdoc.aspx?i=3531&p=8 factory default write performance]. Write performance is known to degrade over time even on SSDs with native TRIM support. TRIM only safeguards against file deletes, not replacements such as an incremental save.<br />
<br />
The reset is easily accomplished in a three step procedure denoted on the [[SSD Memory Cell Clearing]] wiki article.<br />
<br />
==Tips for Minimizing SSD Read/Writes==<br />
An overarching theme for SSD usage should be 'simplicity' in terms of locating high-read/write operations either in RAM (Random Access Memory) or on a physical HDD rather than on an SSD. Doing so will add longevity to an SSD. This is primarily due to the large erase block size (512 KiB in some cases); a lot of small writes result in huge effective writes.<br />
<br />
{{Note|A 32GB SSD with a mediocre 10x write amplification factor, a standard 10000 write/erase cycle, and '''10GB of data written per day''', would get an '''8 years life expectancy'''. It gets better with bigger SSDs and modern controllers with less write amplification.}}<br />
<br />
Use {{ic|iotop -oPa}} and sort by disk writes to see how much your programs are writing to disk.<br />
<br />
=== Intelligent Partition Scheme ===<br />
Consider relocating the /var partition to a physical disc on the system rather than on the SSD itself to avoid read/write wear. Many users elect to keep only /, and /home on the SSD (/boot is okay too) locating /var and /tmp on a physical HDD. <br />
<br />
{{bc|# SSD<br />
/<br />
/home<br />
<br />
# HDD<br />
/boot<br />
/var<br />
/media/data (and other extra partitions, etc.)}}<br />
<br />
If the SSD is the only storage device on the system (i.e. no HDDs), consider allocating a separate partition for /var to allow for better crash recovery for example in the event of a broken program wasting all the space on / or if some run away log file maxes out the space, etc.<br />
<br />
Another intelligent option is to locate /tmp is into RAM provided the system has enough to spare. See the next section for more on this procedure.<br />
<br />
=== The noatime Mount Flag ===<br />
Assign the '''noatime''' flag to partitions residing on SSDs. See the [[#Mount_Flags|Mount Flags]] section below for more.<br />
<br />
=== Locate Browser Profiles in RAM ===<br />
One can ''easily'' mount browser profile(s) such as chromium, firefox, opera, etc. into RAM via tmpfs and also use rsync to keep them synced with HDD-based backups. In addition to the obvious speed enhancements, users will also save read/write cycles on their SSD by doing so.<br />
<br />
The AUR contains several packages to automate this process, for example:<br />
*{{AUR|profile-sync-daemon}}<br />
<br />
=== Compiling in tmpfs ===<br />
Intentionally compiling in /tmp is a great idea to minimize this problem. For systems with >4 GB of memory, the tmp line in {{ic|/etc/fstab}} can be tweaked to use more than 1/2 the physical memory on the system via the size flag.<br />
<br />
Example of a machine with 8 GB of physical memory:<br />
tmpfs /tmp tmpfs nodev,nosuid,size=7G 0 0<br />
<br />
=== Disabling Journaling on the Filesystem? ===<br />
Using a journaling filesystem such as ext3 or ext4 on an SSD WITHOUT a journal is an option to decrease read/writes. The obvious drawback of using a filesystem with journaling disabled is data loss as a result of an ungraceful dismount (i.e. post power failure, kernel lockup, etc.). With modern SSDs, [http://thunk.org/tytso/blog/2009/03/01/ssds-journaling-and-noatimerelatime Ted Tso]{{Linkrot|2011|09|04}} advocates that journaling can be enabled with minimal extraneous read/write cycles under most circumstances:<br />
<br />
'''Amount of data written (in megabytes) on an ext4 file system mounted with noatime.'''<br />
{| border="1" cellpadding="5"<br />
! operation !! journal !! w/o journal !! percent change<br />
|-<br />
!git clone<br />
|367.0<br />
|353.0<br />
|3.81 %<br />
|-<br />
!make<br />
|207.6<br />
|199.4<br />
|3.95 %<br />
|-<br />
!make clean<br />
|6.45<br />
|3.73<br />
|42.17 %<br />
|}<br />
<br />
''"What the results show is that metadata-heavy workloads, such as make clean, do result in almost twice the amount data written to disk. This is to be expected, since all changes to metadata blocks are first written to the journal and the journal transaction committed before the metadata is written to their final location on disk. However, for more common workloads where we are writing data as well as modifying filesystem metadata blocks, the difference is much smaller."''<br />
<br />
{{Note|The make clean example from the table above typifies the importance of intentionally doing compiling in /dev/shm as recommended in the [[Solid_State_Drives#Compiling in /dev/shm|preceding section]] of this article!}}<br />
<br />
=== Choice of Filesystem ===<br />
Many options exist for file systems including ext2, ext3, ext4, btrfs, etc.<br />
<br />
==== Btrfs ====<br />
[http://en.wikipedia.org/wiki/Btrfs Btrfs] support has been included with the mainline 2.6.29 release of the Linux kernel. Some feel that it is not mature enough for production use while there are also early adopters of this potential successor to ext4. It should be noted that at the time this article was originally written (27-June-2010), a stable version of btrfs did not exist. See [http://www.madeo.co.uk/?p=346 this] blog entry for more on btrfs. Be sure to read the [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs wiki] as well.<br />
<br />
{{Warning|At the time this entry was written (21-Nov-2010) there is NO fsck utility to fix/diagnose errors on btrfs partitions. While Btrfs is stable on a stable machine, it is currently possible to corrupt a filesystem irrecoverably in the event of a crash or power loss on disks that do not handle flush requests correctly.}}<br />
<br />
==== Ext4 ====<br />
[http://en.wikipedia.org/wiki/Ext4 Ext4] is another filsesystem that has support for SSD. It is considered as stable since 2.6.28 and is mature enough for daily use. Contrary to Btrfs, ext4 does not automatically detect the disk nature and you have to explicitly enable the TRIM command support using the '''discard''' mounting option in your [[fstab]] (or with tune2fs -o discard /dev/sdaX).<br />
See the [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/filesystems/btrfs.txt;h=64087c34327fe0ba11e790e0a41224b8e7c1d30c;hb=HEAD official in kernel tree documentation] for further information on ext4.<br />
<br />
== SSD Benchmarking ==<br />
See the [[SSD Benchmarking]] article for a general process of benchmarking your SSD or to see some of the SSDs in the database.<br />
<br />
== Firmware Updates ==<br />
=== OCZ ===<br />
OCZ has a command line utility available for Linux (i686 and x86_64) on their forum [http://www.ocztechnology.com/ssd_tools/ here].</div>AsmundErhttps://wiki.archlinux.org/index.php?title=Solid_state_drive&diff=181409Solid state drive2012-01-31T14:55:17Z<p>AsmundEr: /* Using GPT - Modern Method */ Changed title and introductory paragraph to less harsh language. Added "Choosing between GPT and MBR" subsection.</p>
<hr />
<div>[[Category: Storage (English)]]<br />
{{i18n|Solid State Drives}}<br />
{{Article summary start}}<br />
{{Article summary text|This article covers many aspects of SSDs (solid state drives) as they relate to Linux; however, the underlying principals and key learning presented within are general enough to be applicable to users running SSDs on other operating systems such as the Windows family of products as well as MacOS X. Beyond the aforementioned information, Linux users will benefit from the tweaks/optimization presented herein.}}<br />
{{Article summary heading|Related Articles}}<br />
{{Article summary wiki|SSD Benchmarking}}<br />
{{Article summary wiki|SSD Memory Cell Clearing}}<br />
{{Article summary end}}<br />
<br />
==Introduction==<br />
Solid State Drives (SSDs) are not PnP devices. Special considerations such as partition alignment, choice of file system, TRIM support, etc. are needed to setup SSDs for optimal performance. This article attempts to capture referenced, key learnings to enable users to get the most out of SSDs under Linux. Users are encouraged to read this article in its entirety before acting on recommendations as the content is organized by topic, not necessarily by any systematic or chronologically relevant order.<br />
<br />
{{Note|This article is targeted at users running Linux, but much of the content is also relevant to our friends using both Windows and Mac OS X.}}<br />
===Advantages over HDDs===<br />
*Fast read speeds - 2-3x faster than modern desktop HDDs (7,200 RPM using SATA2 interface).<br />
*Sustained read speeds - No decrease in read speed across the entirety of the device. HDD performance tapers off as the drive heads move from the outer edges to the center of HDD platters.<br />
*Minimal access time - Approx. 100x faster than an HDD. For example, 0.1 ms (100 ns) vs. 12-20 ms (12,000-20,000 ns) for desktop HDDs.<br />
*High degree of reliability.<br />
*No moving parts.<br />
*Minimal heat production.<br />
*Minimal power consumption - Fractions of a W at idle and 1-2 W while reading/writing vs. 10-30 W for a HDD depending on RPMs.<br />
*Light-weight - ideal for laptops.<br />
<br />
===Limitations===<br />
*Per-storage cost (dollars per GB, vs. pennies per GB for rotating media).<br />
*Capacity of marketed models is lower than that of HDDs.<br />
*Large cells require different filesystem optimizations than rotating media. The flash translation layer hides the raw flash access which a modern OS could use to optimize access.<br />
*Partitions and filesystems need some SSD-specific tuning. Page size and erase page size are not autodetected.<br />
*Cells wear out. Consumer MLC cells at mature 50nm processes can handle 10000 writes each; 35nm generally handles 5000 writes, and 25nm 3000 (smaller being higher density and cheaper). If writes are properly spread out, are not too small, and align well with cells, this translates into a lifetime write volume for the SSD that is a multiple of its capacity. Daily write volumes have to be balanced against life expectancy.<br />
*Firmwares and controllers are complex. They occasionally have bugs. Modern ones consume power comparable with HDDs. They [https://lwn.net/Articles/353411/ implement] the equivalent of a log-structured filesystem with garbage collection. They translate SATA commands traditionally intended for rotating media. Some of them do on the fly compression. They spread out repeated writes across the entire area of the flash, to prevent wearing out some cells prematurely. They also coalesce writes together so that small writes are not amplified into as many erase cycles of large cells. Finally they move cells containing data so that the cell does not lose its contents over time.<br />
*Performance can drop as the disk gets filled. Garbage collection is not universally well implemented, meaning freed space is not always collected into entirely free cells.<br />
<br />
==Pre-Purchase Considerations==<br />
There are several key features to look for prior to purchasing a contemporary SSD.<br />
===Key Features===<br />
*Native [http://en.wikipedia.org/wiki/TRIM TRIM] support is a vital feature that both prolongs SSD lifetime and reduces loss of performance for write operations over time.<br />
*Buying the right sized SSD is key. As with all filesystems, target <75 % occupancy for all SSD partitions to ensure efficient use by the kernel.<br />
<br />
===Reviews===<br />
This section is not meant to be all-inclusive, but does capture some key reviews.<br />
*[http://www.anandtech.com/show/2738 SSD Anthology (history lesson, a bit dated)]<br />
*[http://www.anandtech.com/show/2829 SSD Relapse (refresher and more up to date])<br />
*[http://forums.anandtech.com/showthread.php?t=2069761 One user's recommendations]<br />
*[http://techgage.com/article/enabling_and_testing_ssd_trim_support_under_linux/ Enabling and Testing SSD TRIM Support Under Linux]<br />
<br />
==Tips for Maximizing SSD Performance==<br />
===Partition Alignment ===<br />
===== High-level Overview =====<br />
'''Proper partition alignment is essential for optimal performance and longevity.''' Key to alignment is partitioning to (at least) the EBS (erase block size) of the SSD. <br />
<br />
{{Note|The EBS is largely vendor specific; a Google search on the model of interest would be a good idea! The Intel X25-M for example is thought to have an EBS of 512 KiB, but Intel has yet to publish anything officially to this end.}}<br />
{{Note|If you do not know the EBS of your SSD, you can still use a size of 512 KiB (or 1024 KiB if you want to be sure and you do not care losing the first MiB of your disk). Those numbers are greater or equal than all the current EBS. Aligning partitions for such an EBS will result in partitions also aligned for all lesser sizes. This is how Windows Seven and Ubuntu "optimizes" partitions to work with SSD.}}<br />
<br />
If the partitions are not aligned to begin at multiples of the EBS (512 KiB for example), aligning the file system is a pointless exercise because everything is skewed by the start offset of the partition. Traditionally, hard drives were addressed by indicating the ''cylinder'', the ''head'', and the ''sector'' at which data was to be read or written. These represented the radial position, the drive head (= platter and side) and the axial position of the data respectively. With LBA (logical block addressing), this is no longer the case. Instead, the entire hard drive is addressed as one continuous stream of data.<br />
<br />
==== Using GPT - Modern Method ====<br />
[[GPT]] is an alternative, contemporary partitioning style. It is intended to replace the old Master Boot Record ([[MBR]]) system. GPT has several advantages over MBR, which has quirks dating back to MS-DOS times. With recent developments to the formatting tools fdisk (MBR) and gdisk (GPT), it is equally easy to use GPT or MBR with your SSD and get maximum performance. <br />
<br />
===== Choosing between GPT and MBR =====<br />
The choice basically boils down to this: <br />
* If you want to use [[GRUB|GRUB Legacy]] as your bootloader, you must use MBR. See [[#Using MBR - Legacy Method]] further down.<br />
* If you want to dual-boot with Windows, you must use MBR. See [[#Using MBR - Legacy Method]] further down.<br />
** A special exception to this rule: If you want to dual-boot Windows Vista/7 64 bit, and you are using [[UEFI]] instead of BIOS, you must use GPT.<br />
* If none of the above apply to you, you can choose freely between GPT and MBR. Since GPT is more modern, it is recommended in this case.<br />
<br />
===== Gdisk Usage Summary=====<br />
<br />
The GPT-able tool equivalent to fdisk, gdisk, can perform partitions alignment automatically on a 2048 sectors (or 1024KiB) block size base which should be compatible with the vast majority of SSD if not all. GNU parted also support GPT, but is [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=601813 less user-friendly] for aligning partitions. A summary of the typical usage of gdisk:<br />
<br />
* Install gdisk (gptfdisk package) from the extra repository.<br />
* Simply start gdisk against your SSD.<br />
* If the SSD is brand new or if you want to start over, create a new empty GUID partition table (aka GPT) with the 'o' command.<br />
* Create a new partition with the 'n' command (primary type/1st partition).<br />
* Assuming your partition is new, gdisk will pick the highest possible alignment. Otherwise, it will pick the largest power of two that divides all partition offsets.<br />
* If you choose to start on a sector before the 2048th gdisk will automatically shift your partition start to the 2048th disk sector. This is to ensure a 2048-sectors alignment (as a sector is 512B, this is a 1024KiB alignment which should fit any SSD NAND erase block).<br />
* Use the +x{M,G} format to extend the partition x megabytes or gigabytes, if you choose a size that is not a multiple of the alignment size (1024kiB) gdisk will shrink the partition to the nearest inferior multiple).<br />
* Select the partition's type id, the default, 'Linux/Windows data' (code 0700), should be fine for most use. Press L to show the codes list.<br />
* Assign other partitions in a like fashion.<br />
* Write the table to disk and exit via the 'w' command.<br />
* Create the filesystems as usual.<br />
<br />
{{Warning|If you plan to use the GPT partitioned SSD as a boot-disk on a BIOS based system (most systems except Apple computers and some very rare motherboard models with Intel chipset) you may have to create, preferably at the disk's beginning, a 1 MiB partition with the partition type as BIOS boot or bios_grub partition (gdisk type code EF02) for booting from the disk using [[GRUB2]]. For [[Syslinux]], you do not need to create a separate 1 MiB bios_grub partition, but you need to have separate /boot partition and enable '''Legacy BIOS Bootable partition''' attribute for that partition (using gdisk). See [[GPT]] for more information.}}<br />
<br />
{{Warning|GRUB legacy does not support GUID partitioning scheme, you have to use [[burg]], [[GRUB2]] or [[Syslinux]].}}<br />
<br />
{{Warning|If you plan to dual boot with Windows (XP, Vista or 7) do NOT use GPT since they do NOT support booting from a GPT disk in BIOS systems! You will need to use the legacy MBR method described below for dual-boot in BIOS systems! This limitation does not apply if you boot in UEFI mode and using Windows Vista (64bits) or 7 (64bits). For 32-bit Windows Vista and 7, and 32 and 64-bit Windows XP, you need to use MBR partitioning and boot in BIOS mode only.}}<br />
<br />
===== Detailed Usage Example =====<br />
{{Note|The following section is meant to be illustrative of the process of partitioning a Crucial C300 Real SSD with a single partitions: 10GiB, Linux partition. Even if it should work on any SSD, with adapt it to your own partition scheme. Again, do not forget to add a 1MiB BIOS boot partition as the first partition if needed.}}<br />
Install gptfdisk package:<br />
# pacman -S gptfdisk<br />
<br />
Run gdisk against your SSD which we will assume to be /dev/sda:<br />
{{bc|[root@archlinux ~]# gdisk /dev/sda<br />
GPT fdisk (gdisk) version 0.6.13<br />
<br />
Partition table scan:<br />
MBR: not present<br />
BSD: not present<br />
APM: not present<br />
GPT: not present<br />
<br />
Creating new GPT entries.<br />
}}<br />
<br />
Now create a new GUID partition table:<br />
{{bc|Command (? for help): o<br />
This option deletes all partitions and creates a new protective MBR.<br />
Proceed? (Y/N): y}}<br />
<br />
Creating partition:<br />
{{bc|1=Command (? for help): n<br />
Partition number (1-128, default 1): #pressed enter to accept default#<br />
First sector (34-125045424, default = 34) or {+-}size{KMGTP}: #pressed enter to accept default#<br />
Information: Moved requested sector from 34 to 2048 in<br />
order to align on 2048-sector boundaries.<br />
Use 'l' on the experts' menu to adjust alignment<br />
Last sector (2048-125045424, default = 125045424) or {+-}size{KMGTP}: +10G <br />
Current type is 'Linux/Windows data'<br />
Hex code or GUID (L to show codes, Enter = 0700): #pressed enter to accept default#<br />
Changed type of partition to 'Linux/Windows data'<br />
}}<br />
<br />
Result:<br />
{{bc|Command (? for help): p<br />
Disk /dev/sda: 125045424 sectors, 59.6 GiB<br />
Logical sector size: 512 bytes<br />
Disk identifier (GUID): A89B4292-8ED7-40CB-BD45-58A160E090EE<br />
Partition table holds up to 128 entries<br />
First usable sector is 34, last usable sector is 125045390<br />
Partitions will be aligned on 2048-sector boundaries<br />
Total free space is 2014 sectors (1007.0 KiB)<br />
<br />
Number Start (sector) End (sector) Size Code Name<br />
1 2048 20973567 10.0 GiB 0700 Linux/Windows data}}<br />
<br />
Write the partition table and exit:<br />
{{bc|Command (? for help): w<br />
<br />
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING<br />
PARTITIONS!!<br />
<br />
Do you want to proceed, possibly destroying your data? (Y/N): y<br />
OK; writing new GUID partition table (GPT).<br />
Warning: The kernel is still using the old partition table.<br />
The new table will be used at the next reboot.<br />
The operation has completed successfully.<br />
[root@archlinux ~]#}}<br />
<br />
Now create the file system as usual:{{bc|# mkfs.ext4 /dev/sda1}}<br />
<br />
==== Using MBR - DEPRECATED METHOD - Using GPT is Recommended ====<br />
<br />
The Linux utility fdisk, however, still uses a virtual C-H-S system where users can define any number of heads and sectors (the cylinders are calculated automatically from the drive's capacity), with partitions always starting and ending at intervals of heads x cylinders. '''Thus, one needs to choose a number of heads and sectors of which the SSD's erase block size is a multiple.''' This is accomplished by setting the number of heads (or tracks per cylinder) and sectors (per track) to coincide with the EBS.<br />
<br />
Ted Tso recommends using a setting of [http://ldn.linuxfoundation.org/blog-entry/aligning-filesystems-ssd%E2%80%99s-erase-block-size 224*56] (=2^8*49) which results in (2^8*512=) 128 KiB alignment:<br />
<br />
# fdisk -H 224 -S 56 /dev/sdX<br />
<br />
While others advocate a setting of [http://www.nuclex.org/blog/personal/80-aligning-an-ssd-on-linux 32*32] (=2^10) which results in (2^10*512=) 512 KiB alignment:<br />
<br />
# fdisk -H 32 -S 32 /dev/sdX<br />
<br />
How does the math work out? The alignment number is the largest power-of-two divisor of the cylinder boundary positions on the disk. The size in bytes of the cylinders is H*S*512 = (tracks per cylinder) * (sectors per track) * (sector size). Factorize H, S and sector size (512=2^9) into prime factors, and take all the 2s. In the first case above we have to ignore the non-power-of-two factor of 7^2=49.<br />
<br />
{{Note|In order to be compatible with MS-DOS, a partition starting on the first cylinder would skip one track, reducing its alignment to track level (4k for -S 56 and 16k for -S 32). The easiest way to maximally align the first partition is to start it at cylinder 2 rather than the default of cylinder 1 as shown in the example below.}}<br />
<br />
===== Fdisk Usage Summary =====<br />
*Start fdisk using the correct values for H and S specific to your SSD as described above.<br />
*If the SSD is brand new, create a new empty DOS partition table with the 'o' command.<br />
*Create a new partition with the 'n' command (primary type/1st partition).<br />
*Start on cylinder 2 rather than on cylinder 1 to ensure MS-DOS compatibility if this is required; accept the default value if not.<br />
*Use the +xG format to extend the partition x gigabytes.<br />
*Change the partition's system id from the default type of Linux (type 83) to the desired type via the 't' command. This is an optional step should the user wish to create another type of partition for example, swap, NTFS, etc. Note that a complete listing of all valid partition types is available via the 'l' command.<br />
*Assign other partitions in a like fashion.<br />
*Write the table to disk and exit via the 'w' command.<br />
<br />
When finished, users may format their newly created partitions with the 'mkfs.x /dev/sdXN' where x is the filesystem, X is the drive letter, and N is the partition number.<br />
The following example will format the first partition on the first disk to ext4 using the defaults specified in {{ic|/etc/mke2fs.conf}}:<br />
# mkfs.ext4 /dev/sda1<br />
<br />
{{Warning|Using the mkfs command can be dangerous as a simple mistake can result in formatting the WRONG partition and in data loss! TRIPLE check the target of this command before hitting the Enter key!}}<br />
<br />
====== Detailed Usage Example ======<br />
{{Note|The following section is meant to be illustrative of the process of partitioning an Intel X25-M SSD with a single 12 Gig, Linux partition. It is in no way the definitive method for doing so, nor are the switches used to start fdisk in this specific example necessarily the correct values for other brands/models of SSDs!}}<br />
<br />
{{bc|# fdisk -H 32 -S 32 /dev/sdb<br />
<br />
The number of cylinders for this disk is set to 15711.<br />
There is nothing wrong with that, but this is larger than 1024,<br />
and could in certain setups cause problems with:<br />
1) software that runs at boot time (e.g., old versions of LILO)<br />
2) booting and partitioning software from other OSs<br />
(e.g., DOS FDISK, OS/2 FDISK)<br />
<br />
Command (m for help): o<br />
Building a new DOS disklabel with disk identifier 0x8cb3d286.<br />
Changes will remain in memory only, until you decide to write them.<br />
After that, of course, the previous content will not be recoverable.<br />
<br />
The number of cylinders for this disk is set to 15711.<br />
There is nothing wrong with that, but this is larger than 1024,<br />
and could in certain setups cause problems with:<br />
1) software that runs at boot time (e.g., old versions of LILO)<br />
2) booting and partitioning software from other OSs<br />
(e.g., DOS FDISK, OS/2 FDISK)<br />
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)<br />
<br />
Command (m for help): n<br />
Command action<br />
e extended<br />
p primary partition (1-4)<br />
p<br />
Partition number (1-4): 1<br />
First cylinder (1-15711, default 1): 2<br />
Last cylinder, +cylinders or +size{K,M,G} (2-15711, default 15711): +12G<br />
<br />
Command (m for help): w<br />
The partition table has been altered!<br />
<br />
Calling ioctl() to re-read partition table.<br />
Syncing disks.}}<br />
<br />
The rest of the SSD was partitioned in a like fashion giving two partitions totally. Here is the output of an fdisk list command:<br />
{{bc|1=# fdisk -l /dev/sdb<br />
<br />
Disk /dev/sdb: 80.0 GB, 80026361856 bytes<br />
32 heads, 32 sectors/track, 152638 cylinders<br />
Units = cylinders of 1024 * 512 = 524288 bytes<br />
Sector size (logical/physical): 512 bytes / 512 bytes<br />
I/O size (minimum/optimal): 512 bytes / 512 bytes<br />
Disk identifier: 0x76b978dc<br />
<br />
Device Boot Start End Blocks Id System<br />
/dev/sdb1 2 24578 12583424 83 Linux<br />
/dev/sdb2 24579 152638 65566720 83 Linux}}<br />
<br />
And a fdisk -lu command:<br />
{{bc|1=# fdisk -lu /dev/sdb<br />
<br />
Disk /dev/sdb: 80.0 GB, 80026361856 bytes<br />
32 heads, 32 sectors/track, 152638 cylinders, total 156301488 sectors<br />
Units = sectors of 1 * 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 512 bytes<br />
I/O size (minimum/optimal): 512 bytes / 512 bytes<br />
Disk identifier: 0x76b978dc<br />
<br />
Device Boot Start End Blocks Id System<br />
/dev/sdb1 1024 25167871 12583424 83 Linux<br />
/dev/sdb2 25167872 156301311 65566720 83 Linux}}<br />
<br />
{{Warning| Pay attention to this last sanity check step. If the heads and sectors/track do not remain 32/32, it is either due to a bug in fdisk, or for an unknown reason, the partitions are not aligned! See the [[SSD_Memory_Cell_Clearing#Post_Process_Observation|using cfdisk/post process observation]] wiki page for a work around.}}<br />
<br />
====== Special Considerations for Logical Partitions ======<br />
<br />
---Place holder for content. <br />
<br />
====== Special Considerations for RAID0 Setups with Multiple SSDs ======<br />
<br />
---Place holder for content.<br />
<br />
===Encrypted partition===<br />
<br />
When using cryptsetup, define a sufficient payload ([http://www.spinics.net/lists/dm-crypt/msg02421.html see here]):<br />
cryptsetup luksFormat --align-payload=8192 ...<br />
But remember that DISCARD/TRIM feature is NOT SUPPORTED by device-mapper (but they are working on it, [http://news.gmane.org/find-root.php?group=gmane.linux.kernel.device-mapper.dm-crypt&article=4075 see here]. August 2011 news: support will be in Linux 3.1, and involves a userspace dm-crypt update as well [http://superuser.com/questions/302710/trim-support-via-dm-crypt-device-mapper#318847])<br />
<br />
===Mount Flags===<br />
There are several key mount flags to use in one's {{ic|/etc/fstab}} entries for SSD partitions.<br />
<br />
*'''noatime''' - Reading accesses to the file system will no longer result in an update to the atime information associated with the file. The importance of the noatime setting is that it eliminates the need by the system to make writes to the file system for files which are simply being read. Since writes can be somewhat expensive as mentioned in previous section, this can result in measurable performance gains. Note that the write time information to a file will continue to be updated anytime the file is written to with this option enabled.<br />
*'''discard''' - The discard flag will enable the benefits of the TRIM command so long as one is using kernel version >=2.6.33. It does not work with ext3; using the discard flag for an ext3 root partition will result in it being mounted read-only.<br />
<br />
/dev/sda1 / ext4 defaults,noatime,discard 0 1<br />
/dev/sda2 /home ext4 defaults,noatime,discard 0 1<br />
<br />
{{Note|You can also set the discard flag with tune2fs: tune2fs -o discard /dev/sda1.}}<br />
{{Accuracy}}<br />
{{Warning|It is critically important that users switch the controller driving the SSD to AHCI mode (not IDE mode) to ensure that the kernel is able to use the TRIM command.}} <br />
{{Warning|Users need to be certain that kernel version 2.6.33 or above is being used AND that their SSD supports TRIM before attempting to mount a partition with the discard flag. Data loss can occur otherwise!}}<br />
{{Warning|Using an OCZ Vertex II SSD (supports TRIM) and kernel 2.6.37.4 on Arch, some people experienced trouble with the '''discard''' option: all changes made to the filesystem would disappear after a reboot! According to [http://www.mjmwired.net/kernel/Documentation/filesystems/ext4.txt#356 this], '''discard''' is disabled by default because it not stable enough.}}<br />
<br />
====Special considerations for Mac computers====<br />
<br />
By default, Apple's firmware switches SATA drives into IDE mode (not AHCI mode) when booting any OS besides Mac OS. It is easy to switch back to AHCI if you are using [[GRUB2]] with an Intel SATA controller.<br />
<br />
First determine the PCI identifier of your SATA controller. Run the command<br />
# lspci -nn<br />
and find the line that says "SATA AHCI Controller". The PCI identifier is in square brackets and should look like 8086:27c4 (but the last digits may be different).<br />
<br />
Now edit /boot/grub/grub.cfg and add the line <br />
# setpci -d 8086:27c4 90.b=40<br />
right above the "set root" line of each OS you want to enable AHCI for. Be sure to substitute the appropriate PCI identifier.<br />
<br />
(credit: http://darkfader.blogspot.com/2010/04/windows-on-intel-mac-and-ahci-mode.html)<br />
<br />
=== I/O Scheduler ===<br />
<br />
Consider switching from the default scheduler, which under Arch is cfq (completely fair queuing), to the noop or deadline scheduler for an SSD. The later two offer performance boosts over cfq. Using the noop scheduler, for example, simply processes requests in the order they are received, without giving any consideration to where the data physically resides on the disk. This option is thought to be advantageous for SSDs since seek times are identical for all sectors on the SSD.<br />
<br />
However, for some SSDs, particularly earlier, JMicron-based ones, you may experience better performance sticking with the default scheduler (see [http://www.alphatek.info/2009/02/02/io-scheduler-and-ssd-part-2/ here]{{Linkrot|2011|09|04}} for one such benchmark); on these, while seek times are similar for all sectors, random access throughput is bad enough to offset any advantage. If your SSD was manufactured within the last year or so, or is made by Intel, this probably does not apply to you.<br />
<br />
For more on schedulers, see [http://www.linux-mag.com/id/7564/1 this] Linux Magazine article (needs registration).<br />
<br />
About the default scheduler for ssd drives: {{Bug|22605}}<br />
<br />
The cfq scheduler is enabled by default on Arch. Verify this by viewing the contents /sys/block/sda/queue/scheduler:<br />
$ cat /sys/block/sdX/queue/scheduler<br />
noop deadline [cfq]<br />
The scheduler currently in use is denoted from the available schedulers by the brackets. <br />
<br />
There are several ways to change the scheduler.<br />
<br />
{{Note|Only switch the scheduler to noop or deadline for SSDs. Keeping the cfq scheduler for all other physical HDDs is ''highly'' recommended.}}<br />
<br />
===== Using the sys virtual filesystem =====<br />
This method is preferred when the system has several physical storage devices (for example an SSD and an HDD).<br />
Add the following line in {{ic|/etc/rc.local}}:<br />
echo noop > /sys/block/sdX/queue/scheduler<br />
where X is the letter for the SSD device.<br />
<br />
Because of the potential for udev to assign different {{ic|/dev/}} nodes to drives before and after a kernel update, users must take care that the noop scheduler is applied to the correct device upon boot. One way to do this is by using the SSD's device ID to determine its {{ic|/dev/}} node. To do this automatically, use the following snippet instead of the line above and add it to {{ic|/etc/rc.local}}:<br />
SSD=(ata-OCZ-ONYX_XA1Y7CE3709UG79OTHVM ata-SAMSUNG_SSD_830_Series_S0VTNYABA01063)<br />
<br />
declare -i i=0<br />
while [ "${SSD[$i]}" != "" ]; do<br />
NODE=`ls -l /dev/disk/by-id/${SSD[$i]} | awk '{ print $NF }' | sed -e 's/[/\.]//g'`<br />
echo noop > /sys/block/$NODE/queue/scheduler<br />
i=i+1<br />
done<br />
where ''SSD'' is a Bash array containing the device IDs of all SSD devices. Device IDs are listed in {{ic|/dev/disk/by-id/}} as symbolic links pointing to their corresponding {{ic|/dev/}} nodes. To view the links listed with their targets, issue the following command:<br />
ls -l /dev/disk/by-id/<br />
<br />
===== Kernel parameter =====<br />
If the sole storage device in the system is an SSD, consider setting the I/O scheduler for the entire system via the elevator kernel parameter:<br />
elevator=noop<br />
<br />
For example, with GRUB, in {{ic|/boot/grub/menu.lst}}:<br />
kernel /vmlinuz26 root=/dev/sda3 ro elevator=noop<br />
or with GRUB2, in {{ic|/etc/default/grub}}: (remember to run update-grub afterwards)<br />
GRUB_CMDLINE_LINUX="elevator=noop"<br />
<br />
=== Swap Space on SSDs ===<br />
One can place a swap partition on an SSD. Note that most modern desktops with an excess of 2 Gigs of memory rarely use swap at all. The notable exception is systems which make use of the hibernate feature. The following is recommended tweak for SSDs using a swap partition that will reduce the "swapiness" of the system thus avoiding writes to swap.<br />
<br />
# echo 1 > /proc/sys/vm/swappiness<br />
<br />
Or one can simply modify {{ic|/etc/sysctl.conf}} as recommended in the [[Maximizing_performance#Swappiness|Maximizing Performance]] wiki article.<br />
<br />
vm.swappiness=1<br />
vm.vfs_cache_pressure=50<br />
<br />
=== SSD Memory Cell Clearing ===<br />
On occasion, users may wish to completely reset an SSD's cells to the same virgin state they were at the time he/she installed the device thus restoring it to its [http://www.anandtech.com/storage/showdoc.aspx?i=3531&p=8 factory default write performance]. Write performance is known to degrade over time even on SSDs with native TRIM support. TRIM only safeguards against file deletes, not replacements such as an incremental save.<br />
<br />
The reset is easily accomplished in a three step procedure denoted on the [[SSD Memory Cell Clearing]] wiki article.<br />
<br />
==Tips for Minimizing SSD Read/Writes==<br />
An overarching theme for SSD usage should be 'simplicity' in terms of locating high-read/write operations either in RAM (Random Access Memory) or on a physical HDD rather than on an SSD. Doing so will add longevity to an SSD. This is primarily due to the large erase block size (512 KiB in some cases); a lot of small writes result in huge effective writes.<br />
<br />
{{Note|A 32GB SSD with a mediocre 10x write amplification factor, a standard 10000 write/erase cycle, and '''10GB of data written per day''', would get an '''8 years life expectancy'''. It gets better with bigger SSDs and modern controllers with less write amplification.}}<br />
<br />
Use {{ic|iotop -oPa}} and sort by disk writes to see how much your programs are writing to disk.<br />
<br />
=== Intelligent Partition Scheme ===<br />
Consider relocating the /var partition to a physical disc on the system rather than on the SSD itself to avoid read/write wear. Many users elect to keep only /, and /home on the SSD (/boot is okay too) locating /var and /tmp on a physical HDD. <br />
<br />
{{bc|# SSD<br />
/<br />
/home<br />
<br />
# HDD<br />
/boot<br />
/var<br />
/media/data (and other extra partitions, etc.)}}<br />
<br />
If the SSD is the only storage device on the system (i.e. no HDDs), consider allocating a separate partition for /var to allow for better crash recovery for example in the event of a broken program wasting all the space on / or if some run away log file maxes out the space, etc.<br />
<br />
Another intelligent option is to locate /tmp is into RAM provided the system has enough to spare. See the next section for more on this procedure.<br />
<br />
=== The noatime Mount Flag ===<br />
Assign the '''noatime''' flag to partitions residing on SSDs. See the [[#Mount_Flags|Mount Flags]] section below for more.<br />
<br />
=== Locate Browser Profiles in RAM ===<br />
One can ''easily'' mount browser profile(s) such as chromium, firefox, opera, etc. into RAM via tmpfs and also use rsync to keep them synced with HDD-based backups. In addition to the obvious speed enhancements, users will also save read/write cycles on their SSD by doing so.<br />
<br />
The AUR contains several packages to automate this process, for example:<br />
*{{AUR|profile-sync-daemon}}<br />
<br />
=== Compiling in tmpfs ===<br />
Intentionally compiling in /tmp is a great idea to minimize this problem. For systems with >4 GB of memory, the tmp line in {{ic|/etc/fstab}} can be tweaked to use more than 1/2 the physical memory on the system via the size flag.<br />
<br />
Example of a machine with 8 GB of physical memory:<br />
tmpfs /tmp tmpfs nodev,nosuid,size=7G 0 0<br />
<br />
=== Disabling Journaling on the Filesystem? ===<br />
Using a journaling filesystem such as ext3 or ext4 on an SSD WITHOUT a journal is an option to decrease read/writes. The obvious drawback of using a filesystem with journaling disabled is data loss as a result of an ungraceful dismount (i.e. post power failure, kernel lockup, etc.). With modern SSDs, [http://thunk.org/tytso/blog/2009/03/01/ssds-journaling-and-noatimerelatime Ted Tso]{{Linkrot|2011|09|04}} advocates that journaling can be enabled with minimal extraneous read/write cycles under most circumstances:<br />
<br />
'''Amount of data written (in megabytes) on an ext4 file system mounted with noatime.'''<br />
{| border="1" cellpadding="5"<br />
! operation !! journal !! w/o journal !! percent change<br />
|-<br />
!git clone<br />
|367.0<br />
|353.0<br />
|3.81 %<br />
|-<br />
!make<br />
|207.6<br />
|199.4<br />
|3.95 %<br />
|-<br />
!make clean<br />
|6.45<br />
|3.73<br />
|42.17 %<br />
|}<br />
<br />
''"What the results show is that metadata-heavy workloads, such as make clean, do result in almost twice the amount data written to disk. This is to be expected, since all changes to metadata blocks are first written to the journal and the journal transaction committed before the metadata is written to their final location on disk. However, for more common workloads where we are writing data as well as modifying filesystem metadata blocks, the difference is much smaller."''<br />
<br />
{{Note|The make clean example from the table above typifies the importance of intentionally doing compiling in /dev/shm as recommended in the [[Solid_State_Drives#Compiling in /dev/shm|preceding section]] of this article!}}<br />
<br />
=== Choice of Filesystem ===<br />
Many options exist for file systems including ext2, ext3, ext4, btrfs, etc.<br />
<br />
==== Btrfs ====<br />
[http://en.wikipedia.org/wiki/Btrfs Btrfs] support has been included with the mainline 2.6.29 release of the Linux kernel. Some feel that it is not mature enough for production use while there are also early adopters of this potential successor to ext4. It should be noted that at the time this article was originally written (27-June-2010), a stable version of btrfs did not exist. See [http://www.madeo.co.uk/?p=346 this] blog entry for more on btrfs. Be sure to read the [https://btrfs.wiki.kernel.org/index.php/Main_Page btrfs wiki] as well.<br />
<br />
{{Warning|At the time this entry was written (21-Nov-2010) there is NO fsck utility to fix/diagnose errors on btrfs partitions. While Btrfs is stable on a stable machine, it is currently possible to corrupt a filesystem irrecoverably in the event of a crash or power loss on disks that do not handle flush requests correctly.}}<br />
<br />
==== Ext4 ====<br />
[http://en.wikipedia.org/wiki/Ext4 Ext4] is another filsesystem that has support for SSD. It is considered as stable since 2.6.28 and is mature enough for daily use. Contrary to Btrfs, ext4 does not automatically detect the disk nature and you have to explicitly enable the TRIM command support using the '''discard''' mounting option in your [[fstab]] (or with tune2fs -o discard /dev/sdaX).<br />
See the [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/filesystems/btrfs.txt;h=64087c34327fe0ba11e790e0a41224b8e7c1d30c;hb=HEAD official in kernel tree documentation] for further information on ext4.<br />
<br />
== SSD Benchmarking ==<br />
See the [[SSD Benchmarking]] article for a general process of benchmarking your SSD or to see some of the SSDs in the database.<br />
<br />
== Firmware Updates ==<br />
=== OCZ ===<br />
OCZ has a command line utility available for Linux (i686 and x86_64) on their forum [http://www.ocztechnology.com/ssd_tools/ here].</div>AsmundErhttps://wiki.archlinux.org/index.php?title=Talk:Solid_state_drive&diff=181061Talk:Solid state drive2012-01-29T16:40:15Z<p>AsmundEr: /* GPT anyone? */ Language too harsh?</p>
<hr />
<div>@Aedit - thank you very much for the contribution to this article. Can you explain how you arrived at the numbers that relate to the head and cylinder choices? 2^8 times 49 and how does that translate into 2^8 times 512 = 128 KiB alignment?<br />
<br />
*Ted Tso recommends using a setting of 224*56 (=2^8*49) which results in (2^8*512=) 128 KiB alignment<br />
*While others advocate a setting of 32*32 (=2^10) which results in (2^10*512=) 512 KiB alignment<br />
<br />
@Graysky - you're welcome. The alignment number is the largest power-of-two divisor of the cylinder boundary positions on the disk. The size in bytes of the cylinders is H*S*512 = (tracks per cylinder) * (sectors per track) * (sector size). So factorize H, S and sector size (512=2^9) into prime factors, and take all the 2s. In the first case above we have to ignore the non-power-of-two factor of 7^2=49.<br />
<br />
@Aedit - interesting. I have an Intel X25-M G2 and I used the -H 32 -S 32 to give a 512 KiB alignment which should be fine, yet Ted suggests using the values that give a 128 KiB alignment (although 128 is a factor of 512). Is there any advantage to using the smaller number, or to put it another way, is there a disadvantage to using the larger number?<br />
<br />
@Graysky: As you say, a disk aligned to 512k is also aligned to 256k,128k... etc. The only disadvantage of larger alignment I know is that a little space is wasted by putting partition boundaries on the larger alignment. I suspect Ted thought the X25-M has a 128k erase block but I also have seen reports of 512k. Is there a definitive reference? Very nice wiki page btw - thanks.<br />
<br />
== GPT anyone? ==<br />
Did you ever think about directing the user to a painless partitionning scheme like GPT? You can just use <tt>gdisk /dev/sda</tt> and create as many partitions you want and it will be created at sector 2048 by default! Else you can also suggest using <tt>fdisk -cu /dev/sda</tt> (with a recent version of fdisk) which will do about the same except with logical partitions. Anyway, no one uses DOS anymore, just think about it twice, the famous extended partition was really a big big hack which should be forgotten. Booting XP with a partition starting at sector 2048 made with fdisk just works anyway. [[User:TiCPU|TiCPU]] 02:12, 9 July 2010 (EDT)<br />
<br />
@TiCPU: I just buy another SSD (the current one will go into the laptop) and I consider using GPT, since I won't install XP nor Seven on it and since after this article GPT allow the use of GPT and Gparted that do auto-alignement. So if either you could write something, or when I'll try to partion my drive I'll write what I do. [[User:Tcourbon|Tcourbon]] 09:56, 30 September 2010 (EDT)<br />
<br />
I write something based on my notes taken during my arch install using GPT and experimentation with gdisk and a raw disk image. Can someone review it ? [[User:Tcourbon|Tcourbon]] 16:31, 11 November 2010 (EST)<br />
<br />
While I think GPT is a good idea, it requires another bootloader than Grub. Since Grub2 is an unholy mess, and the other alternatives are far from common, I think it is a little harsh to call the fdisk/MBR approach "DEPRECATED". Especially since the latest fdisk has sane defaults for SSDs (with respect to alignment). I'm probably going to rewrite the fdisk/MBR section, to reflect changes in the latest version of fdisk, and change the wording to be less dramatic than "PREFERRED/DEPRECATED". Any objections? --[[User:AsmundEr|AsmundEr]] 11:40, 29 January 2012 (EST)<br />
<br />
== ext4 discard option ==<br />
I believe ext4 is a sensible filesystem choice for an SSD as long as you enable the TRIMM command using the discard otpion in fstab (source : [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/filesystems/ext4.txt;h=e1def1786e5074e5d8f3cf89b5f14cbfc9fab4af;hb=HEAD ext4.txt in kernel doc]).<br />
Consequently I've added a paragraph about that. [[User:Tcourbon|Tcourbon]] 08:43, 18 September 2010 (EDT)<br />
<br />
== I/O Scheduler ==<br />
<br />
I don't understand why the part on I/O scheduler was changed : the new way to alter the scheduling on SSD is far from optimal since not every as a SSD as only drive. I think we should add that method to change the scheduler as a side note for this particular setup. [[User:Tcourbon|Tcourbon]] 19:22, 12 November 2010 (EST)<br />
<br />
Whoops, sorry about that...it hadn't occurred to me when I edited the section. At least all is well now, though. :) --[[User:Ichifish|Ichifish]] 22:00, 8 December 2010 (EST)<br />
<br />
== AHCI ==<br />
Dispite common practice and believes OCZ discourages the use of AHCI on (their) SSD drives [http://www.ocztechnology.com/res_old/images/Configuring-and-Setting-Up-SSDs.pdf] Both AHCI and IDE mode support the TRIM command, so it is recommended to use IDE SSD drives.<br />
--[[User:theking2]] 15:25, April 20, 2011<br />
<br />
This guide is 3 years old - I don't know if there is an actual one, but this guide was only for the OCZ Core Series back in 2008.<br />
<br />
--[[User:Evilandi666|Evilandi666]] 20:46, 14 June 2011 (EDT)<br />
<br />
== DONT USE NOOP ==<br />
<br />
The noop scheduler will perform slow but as a result it will greatly frees up CPU cycles. This in the real world will not increase the speed of your read/writes compared to CFS but instead consume less CPU resources. You can benchmark the deadline scheduler which MAY increase performance in some circumstances. By real world benchmarks, I mean anything but hdparm.<br />
=== response 1 ====<br />
Interesting assertion... do you have any data or a source to back it up?<br />
[[User:Graysky|Graysky]] 17:20, 21 December 2011 (EST)<br />
<br />
== fstab: none vs. tmpfs ==<br />
<br />
Is there any significance in the fact that the following two examples of fstab entries start differently?<br />
none /tmp tmpfs nodev,nosuid,noatime,size=1000M,mode=1777 0 0<br />
tmpfs /tmp tmpfs nodev,nosuid,size=7G 0 0<br />
I have a feeling I just needlessly switched an SSD system from the latter to the former... Not that it matters if they are equivalent but I'm just not clear from either this or the linked documentation on tmpfs if this is correct or not. --[[User:Margali|Margali]] 22:41, 3 January 2012 (EST)</div>AsmundErhttps://wiki.archlinux.org/index.php?title=ASUS_Eee_PC&diff=178101ASUS Eee PC2012-01-12T22:49:00Z<p>AsmundEr: /* Power Management */ Spelling chequer</p>
<hr />
<div>[[Category:ASUS (English)]]<br />
This should be the page to gather all information on installing and running arch on the Asus Eee. <br />
Why? Because the 'old' page is a bit confusing/outdated, wrongly named (makes finding it in a search hard) and the title limits it to just the install precedure.<br />
<br />
The 'old' page should be cleaned up and merged into this page, and any future information should also go on this page. If no one that actualy owns an Eee want to do it, then I (Mr.Elendig) can do it, but it will take some time.<br />
<br />
Until this page actualy get some contents, go to [[Installing Arch Linux on the Asus EEE PC]].<br />
<br />
= Eee 700 Series and 900=<br />
This should be filled with the majority of the content from [[Installing Arch Linux on the Asus EEE PC]].<br />
<br />
=== Installation ===<br />
Installation can be achieved from an external cdrom drive, or from a usb stick configured as described in [[Install from USB stick]]<br />
<br />
The wireless module (ath5k) is now part of the stock kernel. The stock kernel performs very well on the eeepc. You do not need to install any extra packages from AUR for wireless or install any special kernel.<br />
<br />
During installation make sure you add the following packages in addition to the base packages for wireless to work.<br />
<br />
wireless_tools<br />
netcfg<br />
<br />
Thats all you now need for a working eee.<br />
<br />
=== If you do want an optimized Pentium-M kernel ===<br />
toofishes created a repository for the Eee. You can find some basic packages like a Pentium-M optimized kernel. Add<br />
[eee]<br />
Server = http://code.toofishes.net/packages/eee<br />
to your {{Filename|/etc/pacman.conf}} to use the repository.<br />
<br />
Simply use pacman to install the package you need. Install the packages with this command:<br />
# pacman -S kernel-eee<br />
<br />
Then, add the following to {{Filename|/boot/grub/menu.lst}}; note that no initrd is needed:<br />
# (2) Arch Linux<br />
title Arch Linux EEE kernel<br />
root (hd0,0)<br />
kernel /boot/vmlinuzeee root=/dev/sda1 ro<br />
<br />
Restart and select Arch Linux EEE kernel from the grub boot menu.<br />
<br />
===Xorg===<br />
Xorg works without an xorg.conf on the eeepc fine with the new hotplugging system.<br />
<br />
# pacman -S xorg xf86-input-keyboard xf86-input-synaptics xf86-video-intel<br />
<br />
start hal<br />
<br />
# /etc/rc.d/hal start<br />
<br />
and add hal to the daemons line of your /etc/rc.conf file<br />
<br />
===Sound===<br />
If sound does not work in a new installation add the following line to {{Filename|/etc/modprobe.d/modprobe.conf}}<br />
options snd-hda-intel model=3stack-dig<br />
<br />
= Eee 900A =<br />
<br />
The 900A is a 900 with a Intel Atom CPU and new hardware (the most is like in 901), you can get help in [[Asus Eee PC 900A]].<br />
<br />
= Eee 901, 904, and 1000(H) =<br />
The 901, 904, and 1000(H) all seem to share much-of, if not all the same hardware. The steps for setting up Arch Linux are as follows.<br />
NB. There is a separate wiki page as well dedicated to the [[Asus_Eee_PC_901|901]].<br />
<br />
== Setting up the Network ==<br />
Two PKGBUILD files are available in the AUR to help you get your network interfaces up and running. The first is delcake's "atl1e" drivers for your wired ethernet, and the second is jbooth's "eeert2860" drivers for wireless.<br />
<br />
=== atl1e ===<br />
delcake's PKGBUILD is located [http://aur.archlinux.org/packages.php?ID=18663 here] in the AUR.<br />
Note that in order to build this package, you will need to get the unrar and unzip packages from the mirror of you choice, as well as the LinuxDrivers.zip source code linked on the AUR page unless you did your wireless drivers first.<br />
<br />
#Transfer the PKGBUILD to your Eee PC. Get the source files too if you do not have internet yet.<br />
#Install the unrar and unzip packages if you do not already have them.<br />
#Issue a 'makepkg' command at the location of the PKGBUILD.<br />
<br />
If all goes well, a .pkg.tar.gz file that starts with the name atl1e will have been created in the same folder.<br />
<br />
As root, run 'pacman -U <package name>.pkg.tar.gz' to install your newly created module.<br />
In order to detect it, run both 'depmod -a' and 'modprobe atl1e' as root in that order.<br />
<br />
At this point, you should be able to issue an 'ifconfig -a' command and see your brand new eth0 device staring back at you. Don't forget to add atl1e to your modules list in /etc/rc.conf to automatically load your ethernet module during boot.<br />
<br />
* '''WARNING:''' You will need to recompile this module any time you do a kernel upgrade, so hang on to that PKGBUILD and zip file.<br />
<br />
=== eeert2860 ===<br />
jbooth's PKGBUILD is located [http://aur.archlinux.org/packages.php?ID=18705 here] in the AUR.<br />
Note that in order to build this package, you will need to get the wireless_tools package from the mirror of your choice, as well as Ralink's drivers listed under the sources section unless you did your wired drivers first.<br />
<br />
#Transfer the PKGBUILD to your Eee PC. Get the source files too if you do not have internet yet.<br />
#Install the wireless_tools package if you do not already have it.<br />
#Issue a 'makepkg' command at the location of the PKGBUILD.<br />
<br />
Hopefully, the makepkg command went through without a hitch, and a .pkg.tar.gz file will have been created in the same folder.<br />
<br />
As root, run 'pacman -U <package name>.pkg.tar.gz' to install your newly created module.<br />
In order to detect it, run both 'depmod -a' and 'modprobe rt2860sta' as root in that order.<br />
<br />
Now you should see your ra0 wireless device in the output of 'ifconfig -a'. As root, run 'ifconfig ra0 up' to bring up the interface for configuration.<br />
<br />
*'''Still no ra0 device?''' Make sure that the WLAN device is enabled in your BIOS.<br />
<br />
* '''WARNING:''' You will need to recompile this module any time you do a kernel upgrade, so hang on to the PKGBUILD and .tar.bz2 file.<br />
<br />
==Eee 901 20G lsmod and lspci==<br />
'''<br />
Note :''' This section was moved from the 70x/900 page.<br />
<br />
The following are from a stock ASUS EeePC 901 20G Linux version:<br />
<br />
lsmod:<br />
<pre><br />
Module Size Used by<br />
acpi_cpufreq 5004 0 <br />
freq_table 1988 1 acpi_cpufreq<br />
usb_storage 22980 0 <br />
libusual 6352 1 usb_storage<br />
pciehp 31172 0 <br />
pci_hotplug 9672 1 pciehp<br />
ehci_hcd 25420 0 <br />
uhci_hcd 18636 0 <br />
usbhid 13444 0 <br />
usbcore 91992 6 usb_storage,libusual,ehci_hcd,uhci_hcd,usbhid<br />
snd_pcm_oss 33568 0 <br />
snd_mixer_oss 13056 1 snd_pcm_oss<br />
rt2860sta 468248 1 <br />
atl1e 26388 0 <br />
fuse 34516 0 <br />
asus_acpi 6560 0 <br />
button 5648 0 <br />
processor 19820 1 acpi_cpufreq<br />
battery 7940 0 <br />
ac 3524 0 <br />
autofs4 15876 0 <br />
sr_mod 13284 0 <br />
cdrom 30624 1 sr_mod<br />
snd_hda_intel 284112 0 <br />
snd_pcm 50696 2 snd_pcm_oss,snd_hda_intel<br />
snd_timer 15556 1 snd_pcm<br />
snd_page_alloc 6728 2 snd_hda_intel,snd_pcm<br />
snd_hwdep 6084 1 snd_hda_intel<br />
snd 34852 6 snd_pcm_oss,snd_mixer_oss,snd_hda_intel,snd_pcm,snd_timer,snd_hwdep<br />
soundcore 3744 1 snd<br />
genrtc 6028 0<br />
</pre><br />
<br />
lspci:<br />
<pre><br />
00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03)<br />
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03)<br />
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)<br />
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)<br />
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)<br />
00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02)<br />
00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02)<br />
00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02)<br />
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02)<br />
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02)<br />
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02)<br />
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02)<br />
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02)<br />
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)<br />
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)<br />
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 02)<br />
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02)<br />
01:00.0 Network controller: RaLink RT2790 Wireless 802.11n PCIe<br />
03:00.0 Ethernet controller: Atheros Corp. L1e Gigabit Ethernet Adapter (rev b0)<br />
</pre><br />
<br />
= Eee 904HA =<br />
[[Asus Eee PC 904HA]]<br />
<br />
= Eee T91MT =<br />
[[Asus Eee PC T91MT]]<br />
<br />
= Eee T101MT =<br />
[[Asus Eee PC T101MT]]<br />
<br />
= Eee 1000HA =<br />
[[Asus Eee PC 1000HA]]<br />
<br />
= Eee 1000HE =<br />
[[Asus Eee PC 1000HE]]<br />
<br />
= Eee 1001P =<br />
[[Asus Eee PC 1001p]]<br />
<br />
= Eee 1001PX =<br />
[[Asus Eee PC 1001px]]<br />
<br />
= Eee 1005HA =<br />
[[Asus Eee PC 1005HA]]<br />
<br />
= Eee 1005P(E) =<br />
[[Asus Eee PC 1005P]]<br />
<br />
= Eee 1015B =<br />
<br />
Things that "just work":<br />
* Wlan (ath9k is part of the kernel)<br />
* Ethernet<br />
* Graphics (with kms and dri2, using the xf86-video-ati driver)<br />
* Webcam (using v4l)<br />
* Suspend-to-RAM (after installing acpid)<br />
* Cardreader (but keucr is in staging, thus '''taints the kernel'''. PyroPeter experienced '''crashes''' while he inserted or removed sd cards)<br />
<br />
''/etc/modprobe.d/eeepc1015b.conf:''<br />
# supposed to help against following msg in dmesg:<br />
# SP5100 TCO timer: mmio address 0xbafe00 already in use<br />
blacklist sp5100_tco<br />
<br />
# if you don't need the sd-card reader you may want to blacklist<br />
# keucr. it is in staging, thus taints the kernel<br />
blacklist keucr<br />
<br />
== Audio ==<br />
<br />
After running alsaconf the graphics card was the default audio output, so I had to create {{Filename|/etc/asound.conf}} with the following contents:<br />
<br />
defaults.ctl.card 1<br />
defaults.pcm.card 1<br />
defaults.timer.card 1<br />
<br />
= Eee 1015 PE/PEM =<br />
[[Asus Eee PC 1015 PE/PEM]]<br />
<br />
<br />
== Hardware ==<br />
<br />
The Eee 1015 series laptops come with a 1024x600 LED display and a Dual Core Intel Atom processor (N550). They also have a Braodcom wireless card and an Atheros Ethernet port. <br />
<br />
== Installation ==<br />
<br />
(Work in progress)<br />
To install Arch on the Asus Eee 1015 series you need to use an external cd-rom drive or a usb-stick. The partition created by Asus on my 1015 PEM is as follows:<br />
<br />
Number Start End Size Type File System Flags<br />
1 1049kb 107Gb 107Gb primary NTFS <br />
2 107Gb 123Gb 16.1Gb primary fat32 hidden<br />
3 123Gb 250Gb 127Gb primary NTFS <br />
4 250Gb 250Gb 21.2Gb primary <br />
<br />
Results may vary. The first partition was the Windows 7 installation. The second is the recovery partition with splashtop. Removing this second partition will cause the fast-start Linux to stop working. The third is Windows D:\ drive and the last one is the boot partition for Windows 7.<br />
<br />
Due to the limitations of having 4 partitions per drive I installed arch on the first 107Gb partition and created a swap file instead of a partition as per [[Swap]]. <br />
<br />
=== ACPI ===<br />
<br />
To enable acpi you need to edit menu.lst and add acpi_osi=Linux to the kernel line like so:<br />
<br />
kernel /boot/vmlinuz26 root=/dev/sda1 ro acpi_osi=Linux<br />
<br />
This enabled you to trigger devices in /sys/devices/platform/eeepc/.<br />
<br />
{{Note|As far as I can tell, this is no longer required. If you do add it, the module eeepc-wmi will fail to load - kernel 2.6.39.2-1}}<br />
<br />
=== Modules ===<br />
<br />
In order to get CPU frequency scaling as well as the proper special-purpose Eee PC module loaded, you can use the following MODULES statement in /etc/rc.conf:<br />
<br />
MODULES=( acpi-cpufreq cpufreq_ondemand eeepc-wmi )<br />
<br />
If you get double keypresses for with your function keys (like the mute key, etc.), add the following into {{Filename|/etc/modprobe.d/blacklist.conf}} (Create this file if it isn't present)<br />
<pre>blacklist eeepc-laptop</pre><br />
{{Note|As long as you do not add acpi_osi-Linux to menu.lst, the eeepc modules load automagically and are not required in MODULES}}<br />
<br />
= Eee 1015 PX =<br />
[[Asus_Eee_PC_1015PX]]<br />
<br />
= Eee 1015 PN =<br />
[[Asus_EEE_PC_1015pn]]<br />
<br />
= Eee 1201T =<br />
[[Asus Eee PC 1201T]]<br />
<br />
= Eee 1201NL =<br />
[[Asus Eee PC 1201NL]]<br />
<br />
= Eee 1215n =<br />
[[Asus EEE PC 1215n]]<br />
<br />
= Eee 1215P =<br />
[[Asus EEE PC 1215p]]<br />
<br />
= Eee 1215B =<br />
<br />
Things that work out of the box: Wifi, Ethernet, Video (max resolution available with basic Xorg and xfce packages installed), Touchpad, Keyboard (Fn keys not working).<br />
<br />
{{Note|Since kernel 3.0, you may need to blacklist the "bcma" module for '''Wifi''' to work! If iwconfig does not list your wireless card, this means you. See [[Broadcom_wireless#Wi-Fi_card_does_not_work_or_show_up_since_kernel_upgrade_.28brcmsmac.29]].}}<br />
<br />
Things that need work: Audio, Fn keys, Power management.<br />
<br />
== Installation ==<br />
<br />
Arch setup encountered no problems, GRUB installed successfully with no damages to Windows (need to uncomment the windows lines in in /boot/grub/menu.lst) and Express Gate.<br />
<br />
== Audio ==<br />
<br />
With the xfce4 desktop environment audio doesn't work by default (didn't test with other de). <br />
To fix this, add the following lines in your ~/.asoundrc:<br />
{{bc|defaults.pcm.card 1<br />
defaults.ctl.card 1}}<br />
<br />
(Credit to Touko Korpela from the Debian mailing list)<br />
<br />
== Video ==<br />
<br />
Youtube videos with the default ati driver work flawlessly with a resolution of 720p, while with 1080p playback isn't smooth anymore. Didn't test with the catalyst drivers, maybe a better playback could be achieved.<br />
<br />
== Power Management ==<br />
<br />
ACPI executes correctly and returns remaining battery life. Cpufreq doesn't seem to work, hence making it impossible for Jupiter ([http://sourceforge.net/projects/jupiter/]) to manage the Super Hybrid Engine. However, from the Jupiter tray icon, screen orientation, resolution and touchpad can be toggled and modified.<br />
<br />
By suggestion from the Debian mailing list, I tried loading "powernow-k8" with modprobe to get cpufreq working. This is apparently a bug in the driver detection mechanism of cpufreq, and should be reported upstream, I guess. After loading that module, cpufreq-info seems to work. Have not tried getting Jupiter to manage SHE yet after that.</div>AsmundErhttps://wiki.archlinux.org/index.php?title=ASUS_Eee_PC&diff=178100ASUS Eee PC2012-01-12T22:48:30Z<p>AsmundEr: /* Power Management */ Remark about loading powernow-k8 module for cpufreq</p>
<hr />
<div>[[Category:ASUS (English)]]<br />
This should be the page to gather all information on installing and running arch on the Asus Eee. <br />
Why? Because the 'old' page is a bit confusing/outdated, wrongly named (makes finding it in a search hard) and the title limits it to just the install precedure.<br />
<br />
The 'old' page should be cleaned up and merged into this page, and any future information should also go on this page. If no one that actualy owns an Eee want to do it, then I (Mr.Elendig) can do it, but it will take some time.<br />
<br />
Until this page actualy get some contents, go to [[Installing Arch Linux on the Asus EEE PC]].<br />
<br />
= Eee 700 Series and 900=<br />
This should be filled with the majority of the content from [[Installing Arch Linux on the Asus EEE PC]].<br />
<br />
=== Installation ===<br />
Installation can be achieved from an external cdrom drive, or from a usb stick configured as described in [[Install from USB stick]]<br />
<br />
The wireless module (ath5k) is now part of the stock kernel. The stock kernel performs very well on the eeepc. You do not need to install any extra packages from AUR for wireless or install any special kernel.<br />
<br />
During installation make sure you add the following packages in addition to the base packages for wireless to work.<br />
<br />
wireless_tools<br />
netcfg<br />
<br />
Thats all you now need for a working eee.<br />
<br />
=== If you do want an optimized Pentium-M kernel ===<br />
toofishes created a repository for the Eee. You can find some basic packages like a Pentium-M optimized kernel. Add<br />
[eee]<br />
Server = http://code.toofishes.net/packages/eee<br />
to your {{Filename|/etc/pacman.conf}} to use the repository.<br />
<br />
Simply use pacman to install the package you need. Install the packages with this command:<br />
# pacman -S kernel-eee<br />
<br />
Then, add the following to {{Filename|/boot/grub/menu.lst}}; note that no initrd is needed:<br />
# (2) Arch Linux<br />
title Arch Linux EEE kernel<br />
root (hd0,0)<br />
kernel /boot/vmlinuzeee root=/dev/sda1 ro<br />
<br />
Restart and select Arch Linux EEE kernel from the grub boot menu.<br />
<br />
===Xorg===<br />
Xorg works without an xorg.conf on the eeepc fine with the new hotplugging system.<br />
<br />
# pacman -S xorg xf86-input-keyboard xf86-input-synaptics xf86-video-intel<br />
<br />
start hal<br />
<br />
# /etc/rc.d/hal start<br />
<br />
and add hal to the daemons line of your /etc/rc.conf file<br />
<br />
===Sound===<br />
If sound does not work in a new installation add the following line to {{Filename|/etc/modprobe.d/modprobe.conf}}<br />
options snd-hda-intel model=3stack-dig<br />
<br />
= Eee 900A =<br />
<br />
The 900A is a 900 with a Intel Atom CPU and new hardware (the most is like in 901), you can get help in [[Asus Eee PC 900A]].<br />
<br />
= Eee 901, 904, and 1000(H) =<br />
The 901, 904, and 1000(H) all seem to share much-of, if not all the same hardware. The steps for setting up Arch Linux are as follows.<br />
NB. There is a separate wiki page as well dedicated to the [[Asus_Eee_PC_901|901]].<br />
<br />
== Setting up the Network ==<br />
Two PKGBUILD files are available in the AUR to help you get your network interfaces up and running. The first is delcake's "atl1e" drivers for your wired ethernet, and the second is jbooth's "eeert2860" drivers for wireless.<br />
<br />
=== atl1e ===<br />
delcake's PKGBUILD is located [http://aur.archlinux.org/packages.php?ID=18663 here] in the AUR.<br />
Note that in order to build this package, you will need to get the unrar and unzip packages from the mirror of you choice, as well as the LinuxDrivers.zip source code linked on the AUR page unless you did your wireless drivers first.<br />
<br />
#Transfer the PKGBUILD to your Eee PC. Get the source files too if you do not have internet yet.<br />
#Install the unrar and unzip packages if you do not already have them.<br />
#Issue a 'makepkg' command at the location of the PKGBUILD.<br />
<br />
If all goes well, a .pkg.tar.gz file that starts with the name atl1e will have been created in the same folder.<br />
<br />
As root, run 'pacman -U <package name>.pkg.tar.gz' to install your newly created module.<br />
In order to detect it, run both 'depmod -a' and 'modprobe atl1e' as root in that order.<br />
<br />
At this point, you should be able to issue an 'ifconfig -a' command and see your brand new eth0 device staring back at you. Don't forget to add atl1e to your modules list in /etc/rc.conf to automatically load your ethernet module during boot.<br />
<br />
* '''WARNING:''' You will need to recompile this module any time you do a kernel upgrade, so hang on to that PKGBUILD and zip file.<br />
<br />
=== eeert2860 ===<br />
jbooth's PKGBUILD is located [http://aur.archlinux.org/packages.php?ID=18705 here] in the AUR.<br />
Note that in order to build this package, you will need to get the wireless_tools package from the mirror of your choice, as well as Ralink's drivers listed under the sources section unless you did your wired drivers first.<br />
<br />
#Transfer the PKGBUILD to your Eee PC. Get the source files too if you do not have internet yet.<br />
#Install the wireless_tools package if you do not already have it.<br />
#Issue a 'makepkg' command at the location of the PKGBUILD.<br />
<br />
Hopefully, the makepkg command went through without a hitch, and a .pkg.tar.gz file will have been created in the same folder.<br />
<br />
As root, run 'pacman -U <package name>.pkg.tar.gz' to install your newly created module.<br />
In order to detect it, run both 'depmod -a' and 'modprobe rt2860sta' as root in that order.<br />
<br />
Now you should see your ra0 wireless device in the output of 'ifconfig -a'. As root, run 'ifconfig ra0 up' to bring up the interface for configuration.<br />
<br />
*'''Still no ra0 device?''' Make sure that the WLAN device is enabled in your BIOS.<br />
<br />
* '''WARNING:''' You will need to recompile this module any time you do a kernel upgrade, so hang on to the PKGBUILD and .tar.bz2 file.<br />
<br />
==Eee 901 20G lsmod and lspci==<br />
'''<br />
Note :''' This section was moved from the 70x/900 page.<br />
<br />
The following are from a stock ASUS EeePC 901 20G Linux version:<br />
<br />
lsmod:<br />
<pre><br />
Module Size Used by<br />
acpi_cpufreq 5004 0 <br />
freq_table 1988 1 acpi_cpufreq<br />
usb_storage 22980 0 <br />
libusual 6352 1 usb_storage<br />
pciehp 31172 0 <br />
pci_hotplug 9672 1 pciehp<br />
ehci_hcd 25420 0 <br />
uhci_hcd 18636 0 <br />
usbhid 13444 0 <br />
usbcore 91992 6 usb_storage,libusual,ehci_hcd,uhci_hcd,usbhid<br />
snd_pcm_oss 33568 0 <br />
snd_mixer_oss 13056 1 snd_pcm_oss<br />
rt2860sta 468248 1 <br />
atl1e 26388 0 <br />
fuse 34516 0 <br />
asus_acpi 6560 0 <br />
button 5648 0 <br />
processor 19820 1 acpi_cpufreq<br />
battery 7940 0 <br />
ac 3524 0 <br />
autofs4 15876 0 <br />
sr_mod 13284 0 <br />
cdrom 30624 1 sr_mod<br />
snd_hda_intel 284112 0 <br />
snd_pcm 50696 2 snd_pcm_oss,snd_hda_intel<br />
snd_timer 15556 1 snd_pcm<br />
snd_page_alloc 6728 2 snd_hda_intel,snd_pcm<br />
snd_hwdep 6084 1 snd_hda_intel<br />
snd 34852 6 snd_pcm_oss,snd_mixer_oss,snd_hda_intel,snd_pcm,snd_timer,snd_hwdep<br />
soundcore 3744 1 snd<br />
genrtc 6028 0<br />
</pre><br />
<br />
lspci:<br />
<pre><br />
00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03)<br />
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03)<br />
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)<br />
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)<br />
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)<br />
00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02)<br />
00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02)<br />
00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02)<br />
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02)<br />
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02)<br />
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02)<br />
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02)<br />
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02)<br />
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)<br />
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)<br />
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 02)<br />
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02)<br />
01:00.0 Network controller: RaLink RT2790 Wireless 802.11n PCIe<br />
03:00.0 Ethernet controller: Atheros Corp. L1e Gigabit Ethernet Adapter (rev b0)<br />
</pre><br />
<br />
= Eee 904HA =<br />
[[Asus Eee PC 904HA]]<br />
<br />
= Eee T91MT =<br />
[[Asus Eee PC T91MT]]<br />
<br />
= Eee T101MT =<br />
[[Asus Eee PC T101MT]]<br />
<br />
= Eee 1000HA =<br />
[[Asus Eee PC 1000HA]]<br />
<br />
= Eee 1000HE =<br />
[[Asus Eee PC 1000HE]]<br />
<br />
= Eee 1001P =<br />
[[Asus Eee PC 1001p]]<br />
<br />
= Eee 1001PX =<br />
[[Asus Eee PC 1001px]]<br />
<br />
= Eee 1005HA =<br />
[[Asus Eee PC 1005HA]]<br />
<br />
= Eee 1005P(E) =<br />
[[Asus Eee PC 1005P]]<br />
<br />
= Eee 1015B =<br />
<br />
Things that "just work":<br />
* Wlan (ath9k is part of the kernel)<br />
* Ethernet<br />
* Graphics (with kms and dri2, using the xf86-video-ati driver)<br />
* Webcam (using v4l)<br />
* Suspend-to-RAM (after installing acpid)<br />
* Cardreader (but keucr is in staging, thus '''taints the kernel'''. PyroPeter experienced '''crashes''' while he inserted or removed sd cards)<br />
<br />
''/etc/modprobe.d/eeepc1015b.conf:''<br />
# supposed to help against following msg in dmesg:<br />
# SP5100 TCO timer: mmio address 0xbafe00 already in use<br />
blacklist sp5100_tco<br />
<br />
# if you don't need the sd-card reader you may want to blacklist<br />
# keucr. it is in staging, thus taints the kernel<br />
blacklist keucr<br />
<br />
== Audio ==<br />
<br />
After running alsaconf the graphics card was the default audio output, so I had to create {{Filename|/etc/asound.conf}} with the following contents:<br />
<br />
defaults.ctl.card 1<br />
defaults.pcm.card 1<br />
defaults.timer.card 1<br />
<br />
= Eee 1015 PE/PEM =<br />
[[Asus Eee PC 1015 PE/PEM]]<br />
<br />
<br />
== Hardware ==<br />
<br />
The Eee 1015 series laptops come with a 1024x600 LED display and a Dual Core Intel Atom processor (N550). They also have a Braodcom wireless card and an Atheros Ethernet port. <br />
<br />
== Installation ==<br />
<br />
(Work in progress)<br />
To install Arch on the Asus Eee 1015 series you need to use an external cd-rom drive or a usb-stick. The partition created by Asus on my 1015 PEM is as follows:<br />
<br />
Number Start End Size Type File System Flags<br />
1 1049kb 107Gb 107Gb primary NTFS <br />
2 107Gb 123Gb 16.1Gb primary fat32 hidden<br />
3 123Gb 250Gb 127Gb primary NTFS <br />
4 250Gb 250Gb 21.2Gb primary <br />
<br />
Results may vary. The first partition was the Windows 7 installation. The second is the recovery partition with splashtop. Removing this second partition will cause the fast-start Linux to stop working. The third is Windows D:\ drive and the last one is the boot partition for Windows 7.<br />
<br />
Due to the limitations of having 4 partitions per drive I installed arch on the first 107Gb partition and created a swap file instead of a partition as per [[Swap]]. <br />
<br />
=== ACPI ===<br />
<br />
To enable acpi you need to edit menu.lst and add acpi_osi=Linux to the kernel line like so:<br />
<br />
kernel /boot/vmlinuz26 root=/dev/sda1 ro acpi_osi=Linux<br />
<br />
This enabled you to trigger devices in /sys/devices/platform/eeepc/.<br />
<br />
{{Note|As far as I can tell, this is no longer required. If you do add it, the module eeepc-wmi will fail to load - kernel 2.6.39.2-1}}<br />
<br />
=== Modules ===<br />
<br />
In order to get CPU frequency scaling as well as the proper special-purpose Eee PC module loaded, you can use the following MODULES statement in /etc/rc.conf:<br />
<br />
MODULES=( acpi-cpufreq cpufreq_ondemand eeepc-wmi )<br />
<br />
If you get double keypresses for with your function keys (like the mute key, etc.), add the following into {{Filename|/etc/modprobe.d/blacklist.conf}} (Create this file if it isn't present)<br />
<pre>blacklist eeepc-laptop</pre><br />
{{Note|As long as you do not add acpi_osi-Linux to menu.lst, the eeepc modules load automagically and are not required in MODULES}}<br />
<br />
= Eee 1015 PX =<br />
[[Asus_Eee_PC_1015PX]]<br />
<br />
= Eee 1015 PN =<br />
[[Asus_EEE_PC_1015pn]]<br />
<br />
= Eee 1201T =<br />
[[Asus Eee PC 1201T]]<br />
<br />
= Eee 1201NL =<br />
[[Asus Eee PC 1201NL]]<br />
<br />
= Eee 1215n =<br />
[[Asus EEE PC 1215n]]<br />
<br />
= Eee 1215P =<br />
[[Asus EEE PC 1215p]]<br />
<br />
= Eee 1215B =<br />
<br />
Things that work out of the box: Wifi, Ethernet, Video (max resolution available with basic Xorg and xfce packages installed), Touchpad, Keyboard (Fn keys not working).<br />
<br />
{{Note|Since kernel 3.0, you may need to blacklist the "bcma" module for '''Wifi''' to work! If iwconfig does not list your wireless card, this means you. See [[Broadcom_wireless#Wi-Fi_card_does_not_work_or_show_up_since_kernel_upgrade_.28brcmsmac.29]].}}<br />
<br />
Things that need work: Audio, Fn keys, Power management.<br />
<br />
== Installation ==<br />
<br />
Arch setup encountered no problems, GRUB installed successfully with no damages to Windows (need to uncomment the windows lines in in /boot/grub/menu.lst) and Express Gate.<br />
<br />
== Audio ==<br />
<br />
With the xfce4 desktop environment audio doesn't work by default (didn't test with other de). <br />
To fix this, add the following lines in your ~/.asoundrc:<br />
{{bc|defaults.pcm.card 1<br />
defaults.ctl.card 1}}<br />
<br />
(Credit to Touko Korpela from the Debian mailing list)<br />
<br />
== Video ==<br />
<br />
Youtube videos with the default ati driver work flawlessly with a resolution of 720p, while with 1080p playback isn't smooth anymore. Didn't test with the catalyst drivers, maybe a better playback could be achieved.<br />
<br />
== Power Management ==<br />
<br />
ACPI executes correctly and returns remaining battery life. Cpufreq doesn't seem to work, hence making it impossible for Jupiter ([http://sourceforge.net/projects/jupiter/]) to manage the Super Hybrid Engine. However, from the Jupiter tray icon, screen orientation, resolution and touchpad can be toggled and modified.<br />
<br />
By suggestion from the Debain mailing list, I tried loading "powernow-k8" with modprobe to get cpufreq working. This is apparently a bug in the driver detection mechanism of cpufreq, and should be reported upstream, I guess. After loading that module, cpufreq-info seems to work. Have not tried getting Jupiter to manage SHE yet after that.</div>AsmundErhttps://wiki.archlinux.org/index.php?title=ASUS_Eee_PC&diff=177842ASUS Eee PC2012-01-11T13:12:36Z<p>AsmundEr: /* Eee 1215B */ Formatting edit</p>
<hr />
<div>[[Category:ASUS (English)]]<br />
This should be the page to gather all information on installing and running arch on the Asus Eee. <br />
Why? Because the 'old' page is a bit confusing/outdated, wrongly named (makes finding it in a search hard) and the title limits it to just the install precedure.<br />
<br />
The 'old' page should be cleaned up and merged into this page, and any future information should also go on this page. If no one that actualy owns an Eee want to do it, then I (Mr.Elendig) can do it, but it will take some time.<br />
<br />
Until this page actualy get some contents, go to [[Installing Arch Linux on the Asus EEE PC]].<br />
<br />
= Eee 700 Series and 900=<br />
This should be filled with the majority of the content from [[Installing Arch Linux on the Asus EEE PC]].<br />
<br />
=== Installation ===<br />
Installation can be achieved from an external cdrom drive, or from a usb stick configured as described in [[Install from USB stick]]<br />
<br />
The wireless module (ath5k) is now part of the stock kernel. The stock kernel performs very well on the eeepc. You do not need to install any extra packages from AUR for wireless or install any special kernel.<br />
<br />
During installation make sure you add the following packages in addition to the base packages for wireless to work.<br />
<br />
wireless_tools<br />
netcfg<br />
<br />
Thats all you now need for a working eee.<br />
<br />
=== If you do want an optimized Pentium-M kernel ===<br />
toofishes created a repository for the Eee. You can find some basic packages like a Pentium-M optimized kernel. Add<br />
[eee]<br />
Server = http://code.toofishes.net/packages/eee<br />
to your {{Filename|/etc/pacman.conf}} to use the repository.<br />
<br />
Simply use pacman to install the package you need. Install the packages with this command:<br />
# pacman -S kernel-eee<br />
<br />
Then, add the following to {{Filename|/boot/grub/menu.lst}}; note that no initrd is needed:<br />
# (2) Arch Linux<br />
title Arch Linux EEE kernel<br />
root (hd0,0)<br />
kernel /boot/vmlinuzeee root=/dev/sda1 ro<br />
<br />
Restart and select Arch Linux EEE kernel from the grub boot menu.<br />
<br />
===Xorg===<br />
Xorg works without an xorg.conf on the eeepc fine with the new hotplugging system.<br />
<br />
# pacman -S xorg xf86-input-keyboard xf86-input-synaptics xf86-video-intel<br />
<br />
start hal<br />
<br />
# /etc/rc.d/hal start<br />
<br />
and add hal to the daemons line of your /etc/rc.conf file<br />
<br />
===Sound===<br />
If sound does not work in a new installation add the following line to {{Filename|/etc/modprobe.d/modprobe.conf}}<br />
options snd-hda-intel model=3stack-dig<br />
<br />
= Eee 900A =<br />
<br />
The 900A is a 900 with a Intel Atom CPU and new hardware (the most is like in 901), you can get help in [[Asus Eee PC 900A]].<br />
<br />
= Eee 901, 904, and 1000(H) =<br />
The 901, 904, and 1000(H) all seem to share much-of, if not all the same hardware. The steps for setting up Arch Linux are as follows.<br />
NB. There is a separate wiki page as well dedicated to the [[Asus_Eee_PC_901|901]].<br />
<br />
== Setting up the Network ==<br />
Two PKGBUILD files are available in the AUR to help you get your network interfaces up and running. The first is delcake's "atl1e" drivers for your wired ethernet, and the second is jbooth's "eeert2860" drivers for wireless.<br />
<br />
=== atl1e ===<br />
delcake's PKGBUILD is located [http://aur.archlinux.org/packages.php?ID=18663 here] in the AUR.<br />
Note that in order to build this package, you will need to get the unrar and unzip packages from the mirror of you choice, as well as the LinuxDrivers.zip source code linked on the AUR page unless you did your wireless drivers first.<br />
<br />
#Transfer the PKGBUILD to your Eee PC. Get the source files too if you do not have internet yet.<br />
#Install the unrar and unzip packages if you do not already have them.<br />
#Issue a 'makepkg' command at the location of the PKGBUILD.<br />
<br />
If all goes well, a .pkg.tar.gz file that starts with the name atl1e will have been created in the same folder.<br />
<br />
As root, run 'pacman -U <package name>.pkg.tar.gz' to install your newly created module.<br />
In order to detect it, run both 'depmod -a' and 'modprobe atl1e' as root in that order.<br />
<br />
At this point, you should be able to issue an 'ifconfig -a' command and see your brand new eth0 device staring back at you. Don't forget to add atl1e to your modules list in /etc/rc.conf to automatically load your ethernet module during boot.<br />
<br />
* '''WARNING:''' You will need to recompile this module any time you do a kernel upgrade, so hang on to that PKGBUILD and zip file.<br />
<br />
=== eeert2860 ===<br />
jbooth's PKGBUILD is located [http://aur.archlinux.org/packages.php?ID=18705 here] in the AUR.<br />
Note that in order to build this package, you will need to get the wireless_tools package from the mirror of your choice, as well as Ralink's drivers listed under the sources section unless you did your wired drivers first.<br />
<br />
#Transfer the PKGBUILD to your Eee PC. Get the source files too if you do not have internet yet.<br />
#Install the wireless_tools package if you do not already have it.<br />
#Issue a 'makepkg' command at the location of the PKGBUILD.<br />
<br />
Hopefully, the makepkg command went through without a hitch, and a .pkg.tar.gz file will have been created in the same folder.<br />
<br />
As root, run 'pacman -U <package name>.pkg.tar.gz' to install your newly created module.<br />
In order to detect it, run both 'depmod -a' and 'modprobe rt2860sta' as root in that order.<br />
<br />
Now you should see your ra0 wireless device in the output of 'ifconfig -a'. As root, run 'ifconfig ra0 up' to bring up the interface for configuration.<br />
<br />
*'''Still no ra0 device?''' Make sure that the WLAN device is enabled in your BIOS.<br />
<br />
* '''WARNING:''' You will need to recompile this module any time you do a kernel upgrade, so hang on to the PKGBUILD and .tar.bz2 file.<br />
<br />
==Eee 901 20G lsmod and lspci==<br />
'''<br />
Note :''' This section was moved from the 70x/900 page.<br />
<br />
The following are from a stock ASUS EeePC 901 20G Linux version:<br />
<br />
lsmod:<br />
<pre><br />
Module Size Used by<br />
acpi_cpufreq 5004 0 <br />
freq_table 1988 1 acpi_cpufreq<br />
usb_storage 22980 0 <br />
libusual 6352 1 usb_storage<br />
pciehp 31172 0 <br />
pci_hotplug 9672 1 pciehp<br />
ehci_hcd 25420 0 <br />
uhci_hcd 18636 0 <br />
usbhid 13444 0 <br />
usbcore 91992 6 usb_storage,libusual,ehci_hcd,uhci_hcd,usbhid<br />
snd_pcm_oss 33568 0 <br />
snd_mixer_oss 13056 1 snd_pcm_oss<br />
rt2860sta 468248 1 <br />
atl1e 26388 0 <br />
fuse 34516 0 <br />
asus_acpi 6560 0 <br />
button 5648 0 <br />
processor 19820 1 acpi_cpufreq<br />
battery 7940 0 <br />
ac 3524 0 <br />
autofs4 15876 0 <br />
sr_mod 13284 0 <br />
cdrom 30624 1 sr_mod<br />
snd_hda_intel 284112 0 <br />
snd_pcm 50696 2 snd_pcm_oss,snd_hda_intel<br />
snd_timer 15556 1 snd_pcm<br />
snd_page_alloc 6728 2 snd_hda_intel,snd_pcm<br />
snd_hwdep 6084 1 snd_hda_intel<br />
snd 34852 6 snd_pcm_oss,snd_mixer_oss,snd_hda_intel,snd_pcm,snd_timer,snd_hwdep<br />
soundcore 3744 1 snd<br />
genrtc 6028 0<br />
</pre><br />
<br />
lspci:<br />
<pre><br />
00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03)<br />
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03)<br />
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)<br />
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)<br />
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)<br />
00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02)<br />
00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02)<br />
00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02)<br />
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02)<br />
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02)<br />
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02)<br />
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02)<br />
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02)<br />
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)<br />
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)<br />
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 02)<br />
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02)<br />
01:00.0 Network controller: RaLink RT2790 Wireless 802.11n PCIe<br />
03:00.0 Ethernet controller: Atheros Corp. L1e Gigabit Ethernet Adapter (rev b0)<br />
</pre><br />
<br />
= Eee 904HA =<br />
[[Asus Eee PC 904HA]]<br />
<br />
= Eee T91MT =<br />
[[Asus Eee PC T91MT]]<br />
<br />
= Eee T101MT =<br />
[[Asus Eee PC T101MT]]<br />
<br />
= Eee 1000HA =<br />
[[Asus Eee PC 1000HA]]<br />
<br />
= Eee 1000HE =<br />
[[Asus Eee PC 1000HE]]<br />
<br />
= Eee 1001P =<br />
[[Asus Eee PC 1001p]]<br />
<br />
= Eee 1001PX =<br />
[[Asus Eee PC 1001px]]<br />
<br />
= Eee 1005HA =<br />
[[Asus Eee PC 1005HA]]<br />
<br />
= Eee 1005P(E) =<br />
[[Asus Eee PC 1005P]]<br />
<br />
= Eee 1015B =<br />
<br />
Things that "just work":<br />
* Wlan (ath9k is part of the kernel)<br />
* Ethernet<br />
* Graphics (with kms and dri2, using the xf86-video-ati driver)<br />
* Webcam (using v4l)<br />
* Suspend-to-RAM (after installing acpid)<br />
* Cardreader (but keucr is in staging, thus '''taints the kernel'''. PyroPeter experienced '''crashes''' while he inserted or removed sd cards)<br />
<br />
''/etc/modprobe.d/eeepc1015b.conf:''<br />
# supposed to help against following msg in dmesg:<br />
# SP5100 TCO timer: mmio address 0xbafe00 already in use<br />
blacklist sp5100_tco<br />
<br />
# if you don't need the sd-card reader you may want to blacklist<br />
# keucr. it is in staging, thus taints the kernel<br />
blacklist keucr<br />
<br />
== Audio ==<br />
<br />
After running alsaconf the graphics card was the default audio output, so I had to create {{Filename|/etc/asound.conf}} with the following contents:<br />
<br />
defaults.ctl.card 1<br />
defaults.pcm.card 1<br />
defaults.timer.card 1<br />
<br />
= Eee 1015 PE/PEM =<br />
[[Asus Eee PC 1015 PE/PEM]]<br />
<br />
<br />
== Hardware ==<br />
<br />
The Eee 1015 series laptops come with a 1024x600 LED display and a Dual Core Intel Atom processor (N550). They also have a Braodcom wireless card and an Atheros Ethernet port. <br />
<br />
== Installation ==<br />
<br />
(Work in progress)<br />
To install Arch on the Asus Eee 1015 series you need to use an external cd-rom drive or a usb-stick. The partition created by Asus on my 1015 PEM is as follows:<br />
<br />
Number Start End Size Type File System Flags<br />
1 1049kb 107Gb 107Gb primary NTFS <br />
2 107Gb 123Gb 16.1Gb primary fat32 hidden<br />
3 123Gb 250Gb 127Gb primary NTFS <br />
4 250Gb 250Gb 21.2Gb primary <br />
<br />
Results may vary. The first partition was the Windows 7 installation. The second is the recovery partition with splashtop. Removing this second partition will cause the fast-start Linux to stop working. The third is Windows D:\ drive and the last one is the boot partition for Windows 7.<br />
<br />
Due to the limitations of having 4 partitions per drive I installed arch on the first 107Gb partition and created a swap file instead of a partition as per [[Swap]]. <br />
<br />
=== ACPI ===<br />
<br />
To enable acpi you need to edit menu.lst and add acpi_osi=Linux to the kernel line like so:<br />
<br />
kernel /boot/vmlinuz26 root=/dev/sda1 ro acpi_osi=Linux<br />
<br />
This enabled you to trigger devices in /sys/devices/platform/eeepc/.<br />
<br />
{{Note|As far as I can tell, this is no longer required. If you do add it, the module eeepc-wmi will fail to load - kernel 2.6.39.2-1}}<br />
<br />
=== Modules ===<br />
<br />
In order to get CPU frequency scaling as well as the proper special-purpose Eee PC module loaded, you can use the following MODULES statement in /etc/rc.conf:<br />
<br />
MODULES=( acpi-cpufreq cpufreq_ondemand eeepc-wmi )<br />
<br />
If you get double keypresses for with your function keys (like the mute key, etc.), add the following into {{Filename|/etc/modprobe.d/blacklist.conf}} (Create this file if it isn't present)<br />
<pre>blacklist eeepc-laptop</pre><br />
{{Note|As long as you do not add acpi_osi-Linux to menu.lst, the eeepc modules load automagically and are not required in MODULES}}<br />
<br />
= Eee 1015 PX =<br />
[[Asus_Eee_PC_1015PX]]<br />
<br />
= Eee 1015 PN =<br />
[[Asus_EEE_PC_1015pn]]<br />
<br />
= Eee 1201T =<br />
[[Asus Eee PC 1201T]]<br />
<br />
= Eee 1201NL =<br />
[[Asus Eee PC 1201NL]]<br />
<br />
= Eee 1215n =<br />
[[Asus EEE PC 1215n]]<br />
<br />
= Eee 1215P =<br />
[[Asus EEE PC 1215p]]<br />
<br />
= Eee 1215B =<br />
<br />
Things that work out of the box: Wifi, Ethernet, Video (max resolution available with basic Xorg and xfce packages installed), Touchpad, Keyboard (Fn keys not working).<br />
<br />
{{Note|Since kernel 3.0, you may need to blacklist the "bcma" module for '''Wifi''' to work! If iwconfig does not list your wireless card, this means you. See [[Broadcom_wireless#Wi-Fi_card_does_not_work_or_show_up_since_kernel_upgrade_.28brcmsmac.29]].}}<br />
<br />
Things that need work: Audio, Fn keys, Power management.<br />
<br />
== Installation ==<br />
<br />
Arch setup encountered no problems, GRUB installed successfully with no damages to Windows (need to uncomment the windows lines in in /boot/grub/menu.lst) and Express Gate.<br />
<br />
== Audio ==<br />
<br />
With the xfce4 desktop environment audio doesn't work by default (didn't test with other de). <br />
To fix this, add the following lines in your ~/.asoundrc:<br />
{{bc|defaults.pcm.card 1<br />
defaults.ctl.card 1}}<br />
<br />
(Credit to Touko Korpela from the Debian mailing list)<br />
<br />
== Video ==<br />
<br />
Youtube videos with the default ati driver work flawlessly with a resolution of 720p, while with 1080p playback isn't smooth anymore. Didn't test with the catalyst drivers, maybe a better playback could be achieved.<br />
<br />
== Power Management ==<br />
<br />
ACPI executes correctly and returns remaining battery life. Cpufreq doesn't seem to work, hence making it impossible for Jupiter ([http://sourceforge.net/projects/jupiter/]) to manage the Super Hybrid Engine. However, from the Jupiter tray icon, screen orientation, resolution and touchpad can be toggled and modified.</div>AsmundErhttps://wiki.archlinux.org/index.php?title=ASUS_Eee_PC&diff=177841ASUS Eee PC2012-01-11T13:10:53Z<p>AsmundEr: /* Eee 1215B */ Comment about Wifi on kernel 3.0 and later</p>
<hr />
<div>[[Category:ASUS (English)]]<br />
This should be the page to gather all information on installing and running arch on the Asus Eee. <br />
Why? Because the 'old' page is a bit confusing/outdated, wrongly named (makes finding it in a search hard) and the title limits it to just the install precedure.<br />
<br />
The 'old' page should be cleaned up and merged into this page, and any future information should also go on this page. If no one that actualy owns an Eee want to do it, then I (Mr.Elendig) can do it, but it will take some time.<br />
<br />
Until this page actualy get some contents, go to [[Installing Arch Linux on the Asus EEE PC]].<br />
<br />
= Eee 700 Series and 900=<br />
This should be filled with the majority of the content from [[Installing Arch Linux on the Asus EEE PC]].<br />
<br />
=== Installation ===<br />
Installation can be achieved from an external cdrom drive, or from a usb stick configured as described in [[Install from USB stick]]<br />
<br />
The wireless module (ath5k) is now part of the stock kernel. The stock kernel performs very well on the eeepc. You do not need to install any extra packages from AUR for wireless or install any special kernel.<br />
<br />
During installation make sure you add the following packages in addition to the base packages for wireless to work.<br />
<br />
wireless_tools<br />
netcfg<br />
<br />
Thats all you now need for a working eee.<br />
<br />
=== If you do want an optimized Pentium-M kernel ===<br />
toofishes created a repository for the Eee. You can find some basic packages like a Pentium-M optimized kernel. Add<br />
[eee]<br />
Server = http://code.toofishes.net/packages/eee<br />
to your {{Filename|/etc/pacman.conf}} to use the repository.<br />
<br />
Simply use pacman to install the package you need. Install the packages with this command:<br />
# pacman -S kernel-eee<br />
<br />
Then, add the following to {{Filename|/boot/grub/menu.lst}}; note that no initrd is needed:<br />
# (2) Arch Linux<br />
title Arch Linux EEE kernel<br />
root (hd0,0)<br />
kernel /boot/vmlinuzeee root=/dev/sda1 ro<br />
<br />
Restart and select Arch Linux EEE kernel from the grub boot menu.<br />
<br />
===Xorg===<br />
Xorg works without an xorg.conf on the eeepc fine with the new hotplugging system.<br />
<br />
# pacman -S xorg xf86-input-keyboard xf86-input-synaptics xf86-video-intel<br />
<br />
start hal<br />
<br />
# /etc/rc.d/hal start<br />
<br />
and add hal to the daemons line of your /etc/rc.conf file<br />
<br />
===Sound===<br />
If sound does not work in a new installation add the following line to {{Filename|/etc/modprobe.d/modprobe.conf}}<br />
options snd-hda-intel model=3stack-dig<br />
<br />
= Eee 900A =<br />
<br />
The 900A is a 900 with a Intel Atom CPU and new hardware (the most is like in 901), you can get help in [[Asus Eee PC 900A]].<br />
<br />
= Eee 901, 904, and 1000(H) =<br />
The 901, 904, and 1000(H) all seem to share much-of, if not all the same hardware. The steps for setting up Arch Linux are as follows.<br />
NB. There is a separate wiki page as well dedicated to the [[Asus_Eee_PC_901|901]].<br />
<br />
== Setting up the Network ==<br />
Two PKGBUILD files are available in the AUR to help you get your network interfaces up and running. The first is delcake's "atl1e" drivers for your wired ethernet, and the second is jbooth's "eeert2860" drivers for wireless.<br />
<br />
=== atl1e ===<br />
delcake's PKGBUILD is located [http://aur.archlinux.org/packages.php?ID=18663 here] in the AUR.<br />
Note that in order to build this package, you will need to get the unrar and unzip packages from the mirror of you choice, as well as the LinuxDrivers.zip source code linked on the AUR page unless you did your wireless drivers first.<br />
<br />
#Transfer the PKGBUILD to your Eee PC. Get the source files too if you do not have internet yet.<br />
#Install the unrar and unzip packages if you do not already have them.<br />
#Issue a 'makepkg' command at the location of the PKGBUILD.<br />
<br />
If all goes well, a .pkg.tar.gz file that starts with the name atl1e will have been created in the same folder.<br />
<br />
As root, run 'pacman -U <package name>.pkg.tar.gz' to install your newly created module.<br />
In order to detect it, run both 'depmod -a' and 'modprobe atl1e' as root in that order.<br />
<br />
At this point, you should be able to issue an 'ifconfig -a' command and see your brand new eth0 device staring back at you. Don't forget to add atl1e to your modules list in /etc/rc.conf to automatically load your ethernet module during boot.<br />
<br />
* '''WARNING:''' You will need to recompile this module any time you do a kernel upgrade, so hang on to that PKGBUILD and zip file.<br />
<br />
=== eeert2860 ===<br />
jbooth's PKGBUILD is located [http://aur.archlinux.org/packages.php?ID=18705 here] in the AUR.<br />
Note that in order to build this package, you will need to get the wireless_tools package from the mirror of your choice, as well as Ralink's drivers listed under the sources section unless you did your wired drivers first.<br />
<br />
#Transfer the PKGBUILD to your Eee PC. Get the source files too if you do not have internet yet.<br />
#Install the wireless_tools package if you do not already have it.<br />
#Issue a 'makepkg' command at the location of the PKGBUILD.<br />
<br />
Hopefully, the makepkg command went through without a hitch, and a .pkg.tar.gz file will have been created in the same folder.<br />
<br />
As root, run 'pacman -U <package name>.pkg.tar.gz' to install your newly created module.<br />
In order to detect it, run both 'depmod -a' and 'modprobe rt2860sta' as root in that order.<br />
<br />
Now you should see your ra0 wireless device in the output of 'ifconfig -a'. As root, run 'ifconfig ra0 up' to bring up the interface for configuration.<br />
<br />
*'''Still no ra0 device?''' Make sure that the WLAN device is enabled in your BIOS.<br />
<br />
* '''WARNING:''' You will need to recompile this module any time you do a kernel upgrade, so hang on to the PKGBUILD and .tar.bz2 file.<br />
<br />
==Eee 901 20G lsmod and lspci==<br />
'''<br />
Note :''' This section was moved from the 70x/900 page.<br />
<br />
The following are from a stock ASUS EeePC 901 20G Linux version:<br />
<br />
lsmod:<br />
<pre><br />
Module Size Used by<br />
acpi_cpufreq 5004 0 <br />
freq_table 1988 1 acpi_cpufreq<br />
usb_storage 22980 0 <br />
libusual 6352 1 usb_storage<br />
pciehp 31172 0 <br />
pci_hotplug 9672 1 pciehp<br />
ehci_hcd 25420 0 <br />
uhci_hcd 18636 0 <br />
usbhid 13444 0 <br />
usbcore 91992 6 usb_storage,libusual,ehci_hcd,uhci_hcd,usbhid<br />
snd_pcm_oss 33568 0 <br />
snd_mixer_oss 13056 1 snd_pcm_oss<br />
rt2860sta 468248 1 <br />
atl1e 26388 0 <br />
fuse 34516 0 <br />
asus_acpi 6560 0 <br />
button 5648 0 <br />
processor 19820 1 acpi_cpufreq<br />
battery 7940 0 <br />
ac 3524 0 <br />
autofs4 15876 0 <br />
sr_mod 13284 0 <br />
cdrom 30624 1 sr_mod<br />
snd_hda_intel 284112 0 <br />
snd_pcm 50696 2 snd_pcm_oss,snd_hda_intel<br />
snd_timer 15556 1 snd_pcm<br />
snd_page_alloc 6728 2 snd_hda_intel,snd_pcm<br />
snd_hwdep 6084 1 snd_hda_intel<br />
snd 34852 6 snd_pcm_oss,snd_mixer_oss,snd_hda_intel,snd_pcm,snd_timer,snd_hwdep<br />
soundcore 3744 1 snd<br />
genrtc 6028 0<br />
</pre><br />
<br />
lspci:<br />
<pre><br />
00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03)<br />
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03)<br />
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)<br />
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)<br />
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)<br />
00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02)<br />
00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02)<br />
00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02)<br />
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02)<br />
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02)<br />
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02)<br />
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02)<br />
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02)<br />
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)<br />
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)<br />
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 02)<br />
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02)<br />
01:00.0 Network controller: RaLink RT2790 Wireless 802.11n PCIe<br />
03:00.0 Ethernet controller: Atheros Corp. L1e Gigabit Ethernet Adapter (rev b0)<br />
</pre><br />
<br />
= Eee 904HA =<br />
[[Asus Eee PC 904HA]]<br />
<br />
= Eee T91MT =<br />
[[Asus Eee PC T91MT]]<br />
<br />
= Eee T101MT =<br />
[[Asus Eee PC T101MT]]<br />
<br />
= Eee 1000HA =<br />
[[Asus Eee PC 1000HA]]<br />
<br />
= Eee 1000HE =<br />
[[Asus Eee PC 1000HE]]<br />
<br />
= Eee 1001P =<br />
[[Asus Eee PC 1001p]]<br />
<br />
= Eee 1001PX =<br />
[[Asus Eee PC 1001px]]<br />
<br />
= Eee 1005HA =<br />
[[Asus Eee PC 1005HA]]<br />
<br />
= Eee 1005P(E) =<br />
[[Asus Eee PC 1005P]]<br />
<br />
= Eee 1015B =<br />
<br />
Things that "just work":<br />
* Wlan (ath9k is part of the kernel)<br />
* Ethernet<br />
* Graphics (with kms and dri2, using the xf86-video-ati driver)<br />
* Webcam (using v4l)<br />
* Suspend-to-RAM (after installing acpid)<br />
* Cardreader (but keucr is in staging, thus '''taints the kernel'''. PyroPeter experienced '''crashes''' while he inserted or removed sd cards)<br />
<br />
''/etc/modprobe.d/eeepc1015b.conf:''<br />
# supposed to help against following msg in dmesg:<br />
# SP5100 TCO timer: mmio address 0xbafe00 already in use<br />
blacklist sp5100_tco<br />
<br />
# if you don't need the sd-card reader you may want to blacklist<br />
# keucr. it is in staging, thus taints the kernel<br />
blacklist keucr<br />
<br />
== Audio ==<br />
<br />
After running alsaconf the graphics card was the default audio output, so I had to create {{Filename|/etc/asound.conf}} with the following contents:<br />
<br />
defaults.ctl.card 1<br />
defaults.pcm.card 1<br />
defaults.timer.card 1<br />
<br />
= Eee 1015 PE/PEM =<br />
[[Asus Eee PC 1015 PE/PEM]]<br />
<br />
<br />
== Hardware ==<br />
<br />
The Eee 1015 series laptops come with a 1024x600 LED display and a Dual Core Intel Atom processor (N550). They also have a Braodcom wireless card and an Atheros Ethernet port. <br />
<br />
== Installation ==<br />
<br />
(Work in progress)<br />
To install Arch on the Asus Eee 1015 series you need to use an external cd-rom drive or a usb-stick. The partition created by Asus on my 1015 PEM is as follows:<br />
<br />
Number Start End Size Type File System Flags<br />
1 1049kb 107Gb 107Gb primary NTFS <br />
2 107Gb 123Gb 16.1Gb primary fat32 hidden<br />
3 123Gb 250Gb 127Gb primary NTFS <br />
4 250Gb 250Gb 21.2Gb primary <br />
<br />
Results may vary. The first partition was the Windows 7 installation. The second is the recovery partition with splashtop. Removing this second partition will cause the fast-start Linux to stop working. The third is Windows D:\ drive and the last one is the boot partition for Windows 7.<br />
<br />
Due to the limitations of having 4 partitions per drive I installed arch on the first 107Gb partition and created a swap file instead of a partition as per [[Swap]]. <br />
<br />
=== ACPI ===<br />
<br />
To enable acpi you need to edit menu.lst and add acpi_osi=Linux to the kernel line like so:<br />
<br />
kernel /boot/vmlinuz26 root=/dev/sda1 ro acpi_osi=Linux<br />
<br />
This enabled you to trigger devices in /sys/devices/platform/eeepc/.<br />
<br />
{{Note|As far as I can tell, this is no longer required. If you do add it, the module eeepc-wmi will fail to load - kernel 2.6.39.2-1}}<br />
<br />
=== Modules ===<br />
<br />
In order to get CPU frequency scaling as well as the proper special-purpose Eee PC module loaded, you can use the following MODULES statement in /etc/rc.conf:<br />
<br />
MODULES=( acpi-cpufreq cpufreq_ondemand eeepc-wmi )<br />
<br />
If you get double keypresses for with your function keys (like the mute key, etc.), add the following into {{Filename|/etc/modprobe.d/blacklist.conf}} (Create this file if it isn't present)<br />
<pre>blacklist eeepc-laptop</pre><br />
{{Note|As long as you do not add acpi_osi-Linux to menu.lst, the eeepc modules load automagically and are not required in MODULES}}<br />
<br />
= Eee 1015 PX =<br />
[[Asus_Eee_PC_1015PX]]<br />
<br />
= Eee 1015 PN =<br />
[[Asus_EEE_PC_1015pn]]<br />
<br />
= Eee 1201T =<br />
[[Asus Eee PC 1201T]]<br />
<br />
= Eee 1201NL =<br />
[[Asus Eee PC 1201NL]]<br />
<br />
= Eee 1215n =<br />
[[Asus EEE PC 1215n]]<br />
<br />
= Eee 1215P =<br />
[[Asus EEE PC 1215p]]<br />
<br />
= Eee 1215B =<br />
<br />
Things that work out of the box: Wifi, Ethernet, Video (max resolution available with basic Xorg and xfce packages installed), Touchpad, Keyboard (Fn keys not working).<br />
<br />
'''NOTE:''' Since Kernel 3.0, you may need to blacklist the "bcma" module for Wifi to work! If iwconfig does not list your wireless card, this means you. See [[Broadcom_wireless#Wi-Fi_card_does_not_work_or_show_up_since_kernel_upgrade_.28brcmsmac.29]].<br />
<br />
Things that need work: Audio, Fn keys, Power management.<br />
<br />
== Installation ==<br />
<br />
Arch setup encountered no problems, GRUB installed successfully with no damages to Windows (need to uncomment the windows lines in in /boot/grub/menu.lst) and Express Gate.<br />
<br />
== Audio ==<br />
<br />
With the xfce4 desktop environment audio doesn't work by default (didn't test with other de). <br />
To fix this, add the following lines in your ~/.asoundrc:<br />
{{bc|defaults.pcm.card 1<br />
defaults.ctl.card 1}}<br />
<br />
(Credit to Touko Korpela from the Debian mailing list)<br />
<br />
== Video ==<br />
<br />
Youtube videos with the default ati driver work flawlessly with a resolution of 720p, while with 1080p playback isn't smooth anymore. Didn't test with the catalyst drivers, maybe a better playback could be achieved.<br />
<br />
== Power Management ==<br />
<br />
ACPI executes correctly and returns remaining battery life. Cpufreq doesn't seem to work, hence making it impossible for Jupiter ([http://sourceforge.net/projects/jupiter/]) to manage the Super Hybrid Engine. However, from the Jupiter tray icon, screen orientation, resolution and touchpad can be toggled and modified.</div>AsmundErhttps://wiki.archlinux.org/index.php?title=Mutt&diff=113449Mutt2010-08-07T09:45:16Z<p>AsmundEr: /* Tips & Tricks */ Added tip for viewing another mail while composing.</p>
<hr />
<div>[[Category:Internet and Email (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|Mutt}}<br />
<br />
'''Mutt''' is a text-based mail client renowned for its powerful features. Mutt, though over a decade old, remains the mail client of choice for great number of power-users. Unfortunately, a default Mutt install is plagued by complex keybindings along a daunting amount of documentation. This guide will help the average user get Mutt up and running, and begin customizing as deemed fit.<br />
<br />
==Overview==<br />
Mutt focuses on being a Mail User Agent (MUA), and was originally written to only view mail. Because of this, later implemented mail retrieval, sending and filtering features are basic compared to other applications. Most Mutt setups rely on external programs to do those tasks. <br />
<br />
In any case, the Arch {{Package Official|mutt}} package has been compiled with IMAP, POP3 and SMTP support, and thus does not need external programs to deal with mail.<br />
<br />
This article will cover using both native IMAP mail sending/retrival, and a setup depending on [[OfflineIMAP]] or [[getmail]] (POP3) to retrieve mail, [[procmail]] to filter it in the case of POP3, and [[msmtp]] to send it.<br />
<br />
==Installing==<br />
Install Mutt:<br />
# pacman -S mutt<br />
<br />
Optionally install external helper applications for an IMAP setup:<br />
# pacman -S offlineimap msmtp<br />
<br />
Or if using POP3:<br />
# pacman -S getmail procmail<br />
<br />
===Notes===<br />
*If you just need the authentication methods LOGIN and PLAIN, these are satisfied with the dependency {{Package Official|libsasl}}.<br />
*If you want to (or have to) use CRAM-MD5, GSSAPI or DIGEST-MD5, install also the package {{Package Official|cyrus-sasl-plugins}}, and you're done. <br />
*if you are using Gmail as your smtp server, you may need to install the package {{Package Official|cyrus-sasl}}.<br />
<br />
==Configuring==<br />
This section covers IMAP, [[#POP3]], [[#MailDir]] and [[#SMTP]] configuration.<br />
<br />
Note that Mutt will recognize two locations for its configuration file; {{filename|~/.muttrc}} and {{filename|~/.mutt/muttrc}}. Either location will work.<br />
<br />
===IMAP===<br />
''Native and external setups''<br />
<br />
====Using native IMAP support====<br />
The pacman version of Mutt is compiled with IMAP support. At the very least you need to have 4 lines in your muttrc file to be able to access your mail.<br />
<br />
=====spoolfile=====<br />
Instead of a local mail spool, specify {{codeline|imap}} server. <br />
set spoolfile=imap[s]://imap.server.domain[:port]/folder<br />
<br />
Use {{codeline|imaps}} for SSL encryption or {{codeline|imap}} for no encryption. The port number is only needed when your server's port is non-standard. End with the folder name where new mail arrives, which is almost always INBOX. For example:<br />
set spoolfile=imaps://imap.gmail.com/INBOX<br />
<br />
=====imap_user=====<br />
set imap_user=USERNAME<br />
<br />
Continuing with the previous example, remember that gmail requires your full email address (this is not standard):<br />
set imap_user=your.username@gmail.com<br />
<br />
=====folder=====<br />
Instead of a local directory which contains all your mail (and directories), use your server (and the highest folder in the hierarchy, if needed).<br />
set folder=imap[s]://imap.server.domain[:port]/[folder/]<br />
<br />
You don't have to use a folder, but it might be convenient if you have all your other folders inside your INBOX, for example. Whatever you set here as your folder can be accessed later in Mutt with just an equal sign (=). Example:<br />
set folder=imaps://imap.gmail.com/<br />
<br />
=====mailboxes=====<br />
Any imap folders that should be checked regularly for new mail should be listed here (all on the same line).<br />
mailboxes <list of folders><br />
<br />
You can now use '=' or '+' as a substitution for the full {{codeline|folder}} path that was configured above. For example:<br />
mailboxes =INBOX =family<br />
mailboxes imaps://imap.gmail.com/INBOX imaps://imap.gmail.com/family<br />
<br />
These two versions are equivalent, but the first is much more convenient. Also, Mutt is configured by default to include a macro bound to the 'y' key which will allow you to change to any of the folders listed under mailboxes.<br />
<br />
=====Summary=====<br />
Using these options, you'll be able to start mutt, enter your IMAP password, and start reading your mail. Here is a muttrc snippet (for Gmail) with some other lines you might consider adding for better IMAP support.<br />
<pre><br />
set folder = imaps://imap.gmail.com/<br />
set spoolfile = imaps://imap.gmail.com/INBOX<br />
set imap_user = your.username@gmail.com<br />
set imap_pass = your-imap-password<br />
mailboxes = +INBOX<br />
<br />
# store message headers locally to speed things up<br />
set header_cache = ~/.mutt/hcache<br />
<br />
# specify where to save and/or look for postponed messages<br />
set postponed = +[Gmail]/Drafts<br />
<br />
# allow mutt to open new imap connection automatically<br />
set imap_passive = no<br />
<br />
# keep imap connection alive by polling intermittently (time in seconds)<br />
set imap_keepalive = 300<br />
<br />
# how often to check for new mail (time in seconds)<br />
set mail_check = 120<br />
</pre><br />
<br />
====External IMAP support====<br />
While IMAP-functionality is built into Mutt, it does not download mail for offline-use. The [[OfflineIMAP]] article describes how to download your emails to a local folder which can then be processed by Mutt.<br />
<br />
Consider using applications such as [[spamassassin]] or [[imapfilter]] to sort mail.<br />
<br />
===POP3===<br />
''Retrieving and sorting mail with external applications''<br />
<br />
====Retrieving mail====<br />
Create the directory <code>~/.getmail/</code>. Open the file <code>~/.getmail/getmailrc</code> in your favorite text editor.<br />
<br />
Here is an example <code>getmailrc</code> used with a gmail account.<br />
<pre><br />
[retriever]<br />
type = SimplePOP3SSLRetriever<br />
server = pop.gmail.com<br />
username = username@gmail.com<br />
port = 995<br />
password = password<br />
<br />
[destination]<br />
type = Maildir<br />
path = ~/mail/<br />
</pre><br />
<br />
You can tweak this to your POP3 service's specification.<br />
<br />
For this guide we will be storing our mail in the <code>maildir</code> format. The two main mailbox formats are <code>mbox</code> and <code>maildir</code>. The main difference between the two is that <code>mbox</code> is one file, with all of your mails and their headers stored in it, whereas a <code>maildir</code> is a directory tree. Each mail is its own file, which will often speed things up.<br />
<br />
A <code>maildir</code> is just a folder with the folders <code>cur</code>, <code>new</code> and <code>tmp</code> in it.<br />
mkdir -p ~/mail/{cur,new,tmp}<br />
<br />
Now, run getmail. If it works fine, you can create a cronjob for getmail to run every n hours/minutes. Type <code>crontab -e</code> to edit cronjobs, and enter the following:<br />
*/30 * * * * /usr/bin/getmail<br />
That will run <code>getmail</code> every 30 minutes.<br />
<br />
====Sorting mail====<br />
[http://www.procmail.org/ Procmail] is an extremely powerful sorting tool. For the purposes of this wiki, we will do some primitive sorting to get started.<br />
<br />
You must edit your getmailrc to pass retrieved mail to procmail:<br />
<pre><br />
[destination]<br />
type = MDA_external<br />
path = /usr/bin/procmail<br />
</pre><br />
<br />
Now, open up <code>.procmailrc</code> in your favorite editor. The following will sort all mail from the happy-kangaroos mailing list, and all mail from your lovey-dovey friend in their own maildirs.<br />
<pre><br />
MAILDIR=$HOME/mail<br />
DEFAULT=$MAILDIR/inbox/<br />
LOGFILE=$MAILDIR/log<br />
<br />
:0:<br />
* ^To: happy-kangaroos@nicehost.com<br />
happy-kangaroos/<br />
<br />
:0:<br />
* ^From: loveydovey@iheartyou.net<br />
lovey-dovey/<br />
</pre><br />
After you've saved your <code>.procmailrc</code>, run getmail and see if procmail succeeds in sorting your mail into the appropriate directories.<br />
<br />
'''Note:''' One easy to make mistake with .procmailrc is the permission. procmail require it to have permission 644 and won't give meaningless error message if you don't.<br />
<br />
===MailDir===<br />
MailDir is a generic and standardized format. Almost every MUA is able to handle MailDirs and Mutt's support is excellent. There are just a few simple things that you need to do to get Mutt to use them. Open your muttrc with and add the following lines:<br />
<pre><br />
set mbox_type=Maildir<br />
set folder=$HOME/Mail<br />
set spoolfile=+/INBOX<br />
set header_cache=~/.hcache<br />
</pre><br />
<br />
This is a minimal Configuration that enables you to access your Maildir and checks for new local Mails in INBOX. This configuration also caches the headers of the eMails to speed up directory-listings. It might not be enabled in your build (but it sure is in the Arch-Package) Note that this does not affect OfflineIMAP in any way. It always syncs the all directories on a Server. <code>spoolfile</code> tells Mutt which local directories to poll for new Mail. You might want to add more Spoolfiles (for example the Directories of Mailing-Lists) and maybe other things. But this is subject to the Mutt manual and beyond the scope of this document.<br />
<br />
===SMTP===<br />
Whether you use POP or IMAP to receive mail you will probably still send mail using SMTP.<br />
<br />
====Using native SMTP support====<br />
The pacman version of Mutt is also compiled with SMTP support. Just check the online manual [http://manual.cream.org/index.cgi/muttrc.5 muttrc], or <code>man muttrc</code> for more information.<br />
<br />
For example:<br />
<pre><br />
set my_pass='mysecretpass'<br />
set my_user=myname@gmail.com<br />
<br />
set smtp_url=smtps://$my_user:$my_pass@smtp.gmail.com<br />
set ssl_force_tls = yes<br />
</pre><br />
<br />
====External SMTP support====<br />
An external SMTP agenta such as [[msmtp]] or [[SSMTP]] can also be used. This section exclusively covers configuring Mutt for msmtp.<br />
<br />
Edit Mutt's configuration file or create it if unpresent:<br />
{{file|name=muttrc|content=<br />
set realname='Disgruntled Kangaroo'<br />
<br />
set sendmail="/usr/bin/msmtp"<br />
<br />
set edit_headers=yes<br />
set folder=~/mail<br />
set mbox=+mbox<br />
set spoolfile=+inbox<br />
set record=+sent<br />
set postponed=+drafts<br />
set mbox_type=Maildir<br />
<br />
mailboxes +inbox +lovey-dovey +happy-kangaroos<br />
}}<br />
<br />
Now, startup {{codeline|mutt}}:<br />
$ mutt<br />
<br />
You should see all the mail in {{filename|~/mail/inbox}}. Press {{keypress|m}} to compose mail; it will use the editor defined by your {{codeline|EDITOR}} environment variable. If this variable is not set, type:<br />
$ export EDITOR=editorbin<br />
<br />
For testing purposes, address the letter to yourself. After you have written the letter, save and exit the editor. You will return to Mutt, which will now show information about your e-mail. Press {{keypress|y}} to send it.<br />
<br />
==Customizing==<br />
Guides to get you started with using & customizing Mutt : <br />
* [http://mutt.blackfish.org.uk/ My first mutt] (maintained by Bruno Postle) <br />
* [http://www.therandymon.com/woodnotes/mutt/using-mutt.html The Woodnotes Guide to the Mutt Email Client] (maintained by Randall Wood)<br />
<br />
If you have any Mutt specific questions, feel free to ask in [[ArchChannel|the irc channel]].<br />
<br />
===Printing===<br />
You can install {{package AUR|muttprint}} from the [[AUR]] for a fancier printing quality.<br />
In your muttrc file, insert:<br />
set print_command="/usr/bin/muttprint %s -p {PrinterName}"<br />
<br />
===Signature block===<br />
Create a .signature in your home directory. Your signature will be appended at the end of your email.<br />
<br />
====Random signature====<br />
You can use fortune to add a random signature to mutt.<br />
<pre>$ pacman -S fortune-mod</pre><br />
<br />
Create a fortune file and then add the following line to your .muttrc:<br />
<pre>set signature="fortune pathtofortunefile"</pre><br />
<br />
===Viewing URLs & opening Firefox===<br />
Your should start by creating a .mutt directory in $HOME if not done yet. There, create a file named macros. Insert the following:<br />
macro pager \cb <pipe-entry>'urlview'<enter> 'Follow links with urlview'<br />
<br />
Then install urlview with:<br />
pacman -S urlview<br />
<br />
Create a .urlview in $HOME and insert the following:<br />
REGEXP (((http|https|ftp|gopher)|mailto)[.:][^ >"\t]*|www\.[-a-z0-9.]+)[^ .,;\t>">\):]<br />
COMMAND firefox %s <br />
<br />
When you read an email on the pager, hitting ctrl+b will list all the urls from the email. Navigate up or down with arrow keys and hit enter on the desired url. Firefox will start and go to the selected site.<br />
<br />
*Note - urlview has been moved to unsupported and is available in AUR here[http://aur.archlinux.org/packages.php?ID=16703]<br />
<br />
*Note - If you have some problems with urlview due to Mutt's url encoding you can try [http://www.memoryhole.net/~kyle/extract_url/ extract_url.pl]<br />
<br />
===Mutt and Vim===<br />
*To limit the width of text to 72 characters, edit your .[[vim]]rc file and add:<br />
au BufRead /tmp/mutt-* set tw=72<br />
<br />
*Another choice is to use Vim's mail filetype plugin to enable other mail-centric options besides 72 character width. Edit {{filename|~/.vim/filetype.vim}}, creating it if unpresent, and add:<br />
<pre> <br />
augroup filetypedetect<br />
" Mail<br />
autocmd BufRead,BufNewFile *mutt-* setfiletype mail<br />
augroup END<br />
</pre><br />
<br />
*To set a different tmp directory, e.g. ~/.tmp, add a line to your muttrc as follows:<br />
set tmpdir="~/.tmp"<br />
<br />
*To reformat a modified text see the Vim context help<br />
:h 10.7<br />
<br />
===Viewing HTML within a Vim/Mutt setup===<br />
This setup will pass the html body to lynx and then dump it in Vim, keeping email viewing uniform and unobtrusive.<br />
<br />
Install lynx:<br />
pacman -S lynx<br />
<br />
If ''~/.mutt/mailcap'' does not exist you will need to create it and save the following to it.<br />
text/html; lynx -dump %s; nametemplate=%s.html; copiousoutput<br />
<br />
Edit muttrc and add the following,<br />
set mailcap_path = ~/.mutt/mailcap<br />
<br />
To automatically open HTML messages in lynx, add this additional line to the muttrc:<br />
auto_view text/html<br />
<br />
The beauty of this is, instead of seeing an html body as source or being opened by a separate program, in this case lynx, it gets parsed to Vim as html, any url links within the email can be displayed with Ctrl+b.<br />
<br />
===Mutt and GNU nano===<br />
[[nano]] is another nice console editor to use with Mutt. <br />
<br />
To limit the width of text to 72 characters, edit your .nanorc file and add:<br />
set fill 72<br />
<br />
Also, in muttrc file, you can specify the line to start editing so that you will skip the mail header:<br />
set editor="nano +7"<br />
<br />
==Tips & Tricks==<br />
<br />
===Use Mutt to send mail from command line===<br />
Man pages will show all available commands and how to use them, but here are a couple of examples. You could use Mutt to send alerts, logs or some other system information, triggered by login through .bash_profile, or as a regular cron job.<br />
<br />
Send a message:<br />
mutt -s "Subject" somejoeorjane@someserver.com < /var/log/somelog<br />
<br />
Send a message with attachment:<br />
mutt -s "Subject" -a somefile somejoeorjane@someserver.com < /tmp/sometext.txt<br />
<br />
===How to display another email while composing===<br />
A common complaint with Mutt is that when composing a new mail (or reply), you cannot open another mail (i.e. for checking with another correspondant) without closing the current mail (postponing). The following describes a solution:<br />
<br />
First, fire up Mutt as usual. Then, launch another terminal window. Now start a new Mutt with <br />
mutt -R<br />
This starts Mutt in read-only mode, and you can browse other emails at your convenience. It is strongly recommended to always launch a second Mutt in read-only mode, as conflicts will easily arise otherwise.<br />
<br />
Now, this solution calls for a bit of typing, so we would like to automate this. The following works with [[Awesome]], in other WM's or DE's similar solutions are probably available: just google how to add a key binding, and make the desired key execute <br />
$TERM -e mutt -R <br />
where $TERM is your terminal.<br />
<br />
As for Awesome: edit your rc.lua, and add the following on one of the first lines, after terminal = "yourTerminal" etc.<br />
mailview = terminal .. " -e mutt -R"<br />
This automatically uses your preferred terminal, ".." is concatenation in Lua. Note the space before -e.<br />
<br />
Then add the following inside --{{{ Key bindings<br />
awful.key({ modkey, }, "m", function() awful.util.spawn(mailview) end),<br />
<br />
Omit the final comma if this is the last line. You can, of course use another key than "m". Now, save&quit, and check your syntax with <br />
awesome -k<br />
If this is good, restart awesome and give it a try!<br />
<br />
Now, a usage example: Launch mutt as usual. Start a new mail, and then press "Mod4"+"m". This opens your mailbox in a new terminal, and you can browse around and read other emails. Now, a neat bonus: exit this read-only-Mutt with "q", and the terminal window it created disappears!<br />
<br />
== Additional resources ==<br />
* [http://www.mutt.org/ The official Mutt website]<br />
* [http://wiki.mutt.org/ The Mutt wiki]<br />
* [http://pbrisbin.com:8080/pages/mutt2.html Brisbin's great guide on how to setup different IMAP accounts with mutt + offlineimap + msmtp]</div>AsmundEr