https://wiki.archlinux.org/api.php?action=feedcontributions&user=Mistofvongola&feedformat=atomArchWiki - User contributions [en]2024-03-19T07:34:31ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Irssi/irssi-otr&diff=398171Irssi/irssi-otr2015-09-04T03:08:37Z<p>Mistofvongola: Fix broken link to irssiotr README</p>
<hr />
<div>[[Category:Internet applications]]<br />
[[Category:Internet Relay Chat]]<br />
The [http://irssi-otr.tuxfamily.org/ irssi-otr] module brings<br />
[http://www.cypherpunks.ca/otr/ Off-the-Record Messaging] to your<br />
[http://irssi.org/ favorite IRC client].<br />
<br />
==Installing==<br />
<br />
You can install the {{AUR|irssi-otr}} module from the [[AUR]].<br />
If you like to test bleeding edge software, there is also {{AUR|irssi-otr-git}}.<br />
<br />
==Usage==<br />
<br />
See the<br />
[http://git.tuxfamily.org/irssiotr/irssiotr.git/plain/README README].<br />
<br />
==Loading the module on startup==<br />
<br />
If you are tired of typing {{Ic|/LOAD otr}} you can put the following<br />
in your {{Ic|~/.irssi/startup}}:<br />
<br />
LOAD otr<br />
<br />
==Stripping HTML==<br />
<br />
If you are using irssi-otr with [[Bitlbee|BitlBee]] you will notice<br />
that some clients send you HTML formatted messages. Normally BitlBee<br />
automatically strips the HTML formatting, but since the messages are<br />
encrypted this does not work anymore. Nevertheless you can achieve<br />
the same by stripping the HTML with regular expressions using the<br />
[http://wouter.coekaerts.be/site/irssi/trigger Trigger script]. Just make<br />
sure you load the script before the otr module. You can either do this<br />
manually or again make your {{Ic|~/.irssi/startup}} look like this:<br />
<br />
SCRIPT LOAD trigger.pl<br />
LOAD otr<br />
<br />
Also make sure that {{Ic|trigger.pl}} is not in<br />
{{Ic|~/.irssi/scripts/autorun}} since the files from this directory<br />
are loaded after {{Ic|~/.irssi/startup}}.<br />
<br />
Since it is not possible to perfectly match HTML code with regular<br />
expressions we will take a somewhat conservative approach. We will only<br />
strip HTML tags we explicitly specified from PRIVMSGS from the BitlBee<br />
network, where we assume you added you server.<br />
<br />
You can {{Ic|/TRIGGER add}} the following lines or copy them to<br />
{{Ic|~/.irssi/triggers}}.<br />
<br />
{{bc|<nowiki><br />
-privmsgs -nocase -tags 'BitlBee' -regexp '</?(a|b|body|div|em|font|i|s|u)( +\w+=".*?")*>' -replace '' <br />
</nowiki>}}<br />
<br />
You can even make HTML line breaks look like multiple messages:<br />
<br />
-privmsgs -nocase -tags 'BitlBee' -regexp '(\s*&lt;br&gt;\s*)+' -replace '\n�8/<�g�</$N�8/>�g �e' <br />
<br />
Where {{Ic|�}} is the non-printable character {{Ic|^D}}. In vi(m)<br />
you can get it by pressing {{Ic|Ctrl-v Ctrl-d}} in insert mode.<br />
If your are using a theme different than the default one you probably<br />
have to adapt the replacing string to match color and indentation.<br />
<br />
And finally we convert some escaped HTML characters:<br />
<br />
-privmsgs -nocase -tags 'BitlBee' -regexp '&amp;amp;' -replace '&' <br />
-privmsgs -nocase -tags 'BitlBee' -regexp '&amp;gt;' -replace '>' <br />
-privmsgs -nocase -tags 'BitlBee' -regexp '&amp;lt;' -replace '<' <br />
-privmsgs -nocase -tags 'BitlBee' -regexp '&amp;quot;' -replace '"' <br />
<br />
These are just some basic replaces, just extend them if you need more.</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=User:Mistofvongola&diff=301061User:Mistofvongola2014-02-24T04:09:38Z<p>Mistofvongola: </p>
<hr />
<div>* [[Special:Contributions/mistofvongola|Wiki Contributions]]<br />
* [https://bbs.archlinux.org/search.php?action=show_user_posts&user_id=71365 Forum Posts]<br />
* [http://davidpalma.me Personal Blog]<br />
<br />
== Notes ==<br />
<br />
* '''[[:Template:hc|hc]]''' - <code><nowiki>{{hc|/boot/grub/menu.lst|<nowiki># (0) Arch Linux...</nowiki>}}</nowiki></code><br />
<div style="border-left:3em solid #FFF"><br />
{{hc|/boot/grub/menu.lst|<nowiki>kernel /vmlinuz26 root=/dev/disk/by-label/ROOT ro console=tty1 splash=silent,fadein,fadeout,theme:arch-black logo.nologo quiet<br />
initrd /kernel26.img</nowiki>}}</div><br />
<br />
* '''[[:Template:bc|bc]]''' - <code><nowiki>{{bc|&lt;nowiki>for _a in {A..Z}...&lt;/nowiki>|&lt;nowiki>BASH: /bin/bash...&lt;/nowiki>}}</nowiki></code><br />
<div style="border-left:3em solid #FFF"><br />
{{bc|<nowiki>for _a in {A..Z} {a..z};do _z=\${!${_a}*};for _i in `eval echo "${_z}"`;do echo -e "$_i: ${!_i}";done;done|cat -Tsv</nowiki>|2=<nowiki>BASH: /bin/bash<br />
BASH_COMMAND: echo -e "$_i: ${!_i}"</nowiki>}}</div><br />
<br />
* '''[[:Template:Note|Note]]''' - <code><nowiki>{{Note|Note should be noted.}}</nowiki></code><br />
<div style="border-left:3em solid #FFF"><br />
{{Note|Note should be noted.}}</div><br />
<br />
* '''[[:Template:Tip|Tip]]''' - <code><nowiki>{{Tip|Tip should be considered.}}</nowiki></code><br />
<div style="border-left:3em solid #FFF"><br />
{{Tip|Tip should be considered.}}</div><br />
<br />
* '''[[:Template:Warning|Warning]]''' - <code><nowiki>{{Warning|Warning should be heeded.}}</nowiki></code><br />
<div style="border-left:3em solid #FFF"><br />
{{Warning|Warning should be heeded.}}</div><br />
<br />
== About ==<br />
<br />
Linux sysadmin, hacker, anime nerd, and tea drinker. Formerly computational high energy physics (ATLAS/CERN). I hang out in #tor, #virt (OFTC) and #archlinux, #reddit-sysadmin (Freenode).<br />
<br />
* Linux/FOSS<br />
* Hacking/DIY<br />
* Physics<br />
* Cryptography</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=XScreenSaver_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=301060XScreenSaver (简体中文)2014-02-24T04:00:31Z<p>Mistofvongola: /* 安装XScreenSaver */ Fix Gentoo Wiki link</p>
<hr />
<div>[[Category:X Server (简体中文)]]<br />
[[en:Xscreensaver]]<br />
[[es:Xscreensaver]]<br />
[[it:Xscreensaver]]<br />
{{TranslationStatus (简体中文)|Xscreensaver|2013-02-08|226394}}<br />
Xscreensaver 是 X 窗口系统的屏保和锁屏工具。<br />
==安装XScreenSaver==<br />
你可以使用[[pacman (简体中文)|pacman]]安装位于[[Official Repositories (简体中文)|软件仓库]] 的 {{Pkg|xscreensaver}}软件包.<br />
<br />
或者,你可以安装[[Arch User Repository (简体中文)|AUR]]中的一个修改版的xcreensaver({{AUR|xscreensaver-arch-logo}}),安装{{AUR|xscreensaver-arch-logo}}相比于前者,有以下几个好处:<br />
# 因为[[makepkg (简体中文)]]使用源码编译,因此最后得到的软件包会包含针对你机器的优化(前提是你的{{ic|/etc/makepkg.conf}}中有优化的[http://wiki.gentoo.org/wiki/Safe_CFLAGS CFLAGS] 和 CXXFLAGS 设置)<br />
# 该软件包含有Archlinux标识<br />
# 如果使用的是[[GNOME (简体中文)]], 该软件包会在系统设置中提供XScreenSaver的设置项([[Official Repositories (简体中文)|软件仓库]]中软件包没有提供)。<br />
<br />
==配置XScreenSaver==<br />
全局配置位于{{ic|/usr/share/X11/app-defaults/XScreenSaver}}。一般标准安装无需编辑该文件。你可以运行xscreensaver-demo个性化配置大部分选项(非全局)。<br />
<br />
$ xscreensaver-demo<br />
<br />
===DPMS 设置===<br />
XScreenSaver 独立进行显示设备的电源管理 ([[DPMS]]),会覆盖 X 本身的设置。要设置挂起、关闭显示器的时间,可以使用 xscreensaver-demo 或编辑配置文件{{ic|~/.xscreensaver}},<br />
{{bc|<br />
timeout: 1:00:00<br />
cycle: 0:05:00<br />
lock: False<br />
lockTimeout: 0:00:00<br />
passwdTimeout: 0:00:30<br />
fade: True<br />
unfade: False<br />
fadeSeconds: 0:00:03<br />
fadeTicks: 20<br />
dpmsEnabled: True<br />
dpmsStandby: 2:00:00<br />
dpmsSuspend: 2:00:00<br />
dpmsOff: 4:00:00<br />
}}<br />
<br />
==启动XScreenSaver==<br />
<br />
=== 单用户环境 ===<br />
安装软件包之后,xscreensaver需要配置开机自启动。编辑{{ic|~/.xinitrc}},加入下面一行代码,这样{{ic|xscreensaver}}程序就会由桌面环境启动。<br />
<br />
/usr/bin/xscreensaver -no-splash &<br />
<br />
注意最后的{{ic|&}}符号必须添加,这样xscreensaver才会在后台运行。<br />
<br />
{{注意|[[Xfce (简体中文)|Xfce]]会自启动XScreenSaver,设置在{{ic|/etc/xdg/xfce4/xinitrc}},为了保证该设置有效,切记.xinitrc中使用的是 {{ic|startxfce4}},而非 {{ic|xfce4-session}} <br />
exec startxfce4 --with-ck-launch<br />
}}<br />
<br />
=== 多用户环境 ===<br />
<br />
如果你使用了[[Display_Manager_(简体中文)|登录管理器]] (比如 [[SLiM (简体中文)|SLiM]], [[GDM (简体中文)|GDM]], [[KDM]]),启动XScreenSaver最好是通过登录管理器提供的接口,从而实现多用户之间的切换。例如,使用的是[[GNOME (简体中文)|GNOME]],则安装 {{Pkg|gnome-screensaver}} 和 {{Pkg|xscreensaver}},然后仅激活{{ic|gnome-screensaver}} ,这样当用户离开,屏幕锁定之后,其他用户可以通过XScreenSaver锁屏窗口切换登录。<br />
<br />
{{注意|登录管理器的screensaver可能不具备某些原生XScreenSaver自带功能(例如截屏,使用预定义路径下的照片等)}}<br />
<br />
除了上述办法(即安装登录管理器定制的screensaver),也可以修改{{ic|~/.xscreensaver}}(用户设置)或者{{ic|/usr/share/X11/app-defaults/XScreenSaver}}(全局设置)实现多用户支持。只需要在配置文件中添加:<br />
{{bc|newLoginCommand: /usr/bin/gdmflexiserver}}<br />
{{注意|该命令用于[[GDM (简体中文)|GDM]]登录管理器,如果使用的是不同的登录管理器,需要对其做相应的更改}}<br />
<br />
== 锁屏 ==<br />
当{{ic|xscreensaver}}已经启动,你通过下面的命令触发锁屏:<br />
$ xscreensaver-command --lock<br />
<br />
==多媒体程序设置禁用XScreenSaver==<br />
===MPlayer===<br />
在{{ic|~/.mplayer/config}}中加入下面一行代码:<br />
heartbeat-cmd="xscreensaver-command -deactivate >&- 2>&- &"<br />
<br />
===XBMC===<br />
XBMC本身并不支持禁用XScreenSaver(尽管XBMC本身具备自己的screensaver)。[[Arch User Repository|AUR]]中有第三方程序叫做{{AUR|caffeine-bzr}}的可以实现禁用锁屏的功能。程序启动之后将{{ic|xbmc.bin}}加入到自动激活应用列表中即可。<br />
<br />
===Adobe Flash/MPlayer/VLC===<br />
flash本身不支持禁用XScreenSaver,一个叫做[https://github.com/iye/lightsOn lightsOn]的脚本可以很好的完成这一功能,该脚本支持Firefox、Chromium的flash插件以及Mplayer和VLC。<br />
<br />
==XScreenSaver用作动态壁纸==<br />
你可以像桌面壁纸一样后台运行{{ic|xscreensaver}}<br />
首先停止所有控制桌面背景的程序(the root window),之后找到XScreenSaver的目录(通常在{{ic|/usr/lib/xscreensaver/}}),执行下面的命令:<br />
$ /usr/lib/xscreensaver/glslideshow -root &<br />
<br />
===使用xcompmgr实现XScreenSaver做动态壁纸===<br />
直接运行{{ic|xcompmgr}}可能会引起错误,所以需要使用{{ic|xwinwrap}}来运行{{ic|xcompmgr}}。 你可以在[[Arch User Repository|AUR]]中找到,名称是{{AUR|shantz-xwinwrap-bzr}}。<br />
<br />
通过下面的命令执行{{ic|xwinwrap}}<br />
$ xwinwrap -b -fs -sp -fs -nf -ov -- /usr/lib/xscreensaver/glslideshow -root -window-id WID &<br />
<br />
== 主题设置 ==<br />
XScreenSaver的解锁屏幕可以用[[X resources|X resources]]设置主题效果(参考[[X resources#XScreenSaver_resources|XScreenSaver resources]])<br />
<br />
== 从锁屏画面切换登录用户 ==<br />
当使用[[GDM (简体中文)|GDM]]或者[[KDM]])登录管理器时,通常xscreensaver锁屏画面中“切换用户”按钮会调用{{ic|/usr/bin/gdmflexiserver}}来切换登录。其他登录管理器如[[LightDM]],[[LXDM_(简体中文)|LXDM]]也支持该功能。<br />
<br />
=== LXDM ===<br />
只需将下面的代码贴到{{ic|~/.xscreensaver}}就能使用lxdm的切换用户功能。<br />
<br />
*newLoginCommand: lxdm -c USER_SWITCH<br />
<br />
=== Lightdm ===<br />
类似地,将下面的代码贴到{{ic|~/.xscreensaver}}启用多用户切换功能。<br />
<br />
*newLoginCommand: dm-tool switch-to-greeter<br />
<br />
==更多信息==<br />
[http://wiki.gotux.net/downloads/paniclock PanicLock] -- 锁定屏幕并后台关闭任何选定的程序(英文)</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=XScreenSaver_(Italiano)&diff=301059XScreenSaver (Italiano)2014-02-24T04:00:06Z<p>Mistofvongola: /* Installazione */ Fix Gentoo Wiki link</p>
<hr />
<div>[[Category:X Server (Italiano)]]<br />
XScreenSaver è uno screensaver e locker per il server X.<br />
[[en:Xscreensaver]]<br />
[[es:Xscreensaver]]<br />
[[zh-CN:Xscreensaver]]<br />
==Installazione==<br />
Il pacchetto {{pkg|xscrensaver}} è presente nei [[Official Repositories (Italiano)|repository ufficiali]], quindi è facilmente con [[Pacman (Italiano)|Pacman]].<br />
<br />
In alternativa, esiste una versione patchata con il logo Archlinux su [[Arch User Repository (Italiano)|AUR]] che si chiama {{aur|xscreensaver-arch-logo}}. L'utilizzo di questo pacchetto al posto della versione del repository '''extra''' è vantaggioso per diversi motivi:<br />
# Dal momento che makepkg compila da codice sorgente, il pacchetto risultante conterrà ottimizzazioni specifiche uniche per il ''proprio'' sistema, supponendo che si configuri il [[makepkg (Italiano)|makepkg.conf]] con le apposite [http://wiki.gentoo.org/wiki/Safe_CFLAGS CFLAGS] e CXXFLAGS.<br />
# Questo pacchetto è marchiato Arch (screensaver, schermata di blocco, ecc.)<br />
# Se si utilizza [[GNOME (Italiano)|Gnome]], questo pacchetto fornirà un'icona per accedere alle preferenze di xscreensaver da Sistema>Preferenze>Screensaver, a differenza del pacchetto del [[Official Repositories (Italiano)|repository ufficiale]].<br />
<br />
==Configurazione di Xscreensaver==<br />
Le impostazioni globali si trovano in {{ic|/usr/share/X11/app-defaults/XScreenSaver}}. Se si vuole usare una configurazione standard non è necessario toccare questo file. Inoltre molte impostazioni sono modificabili via gui per ogni utente semplicemente lanciando<br />
$ xscreensaver-demo<br />
<br />
===DPMS settings===<br />
XScreenSaver gestisce il risparmio energetico del display ([[DPMS]]) independentemente da X, di cui ne sovrascrive i parametri. Per configurare il tempo di standby, spegnimento dello schermo e altro, usare {{ic|xscreensaver-demo}} o editare il file {{ic|~/.xscreensaver}},<br />
{{bc|<br />
timeout: 1:00:00<br />
cycle: 0:05:00<br />
lock: False<br />
lockTimeout: 0:00:00<br />
passwdTimeout: 0:00:30<br />
fade: True<br />
unfade: False<br />
fadeSeconds: 0:00:03<br />
fadeTicks: 20<br />
dpmsEnabled: True<br />
dpmsStandby: 2:00:00<br />
dpmsSuspend: 2:00:00<br />
dpmsOff: 4:00:00<br />
}}<br />
<br />
==Avvio di Xscreensaver==<br />
<br />
=== Sistemi con utente unico ===<br />
La sola [[Pacman (Italiano)|installazione]] del pacchetto {{pkg|xscreensaver}} non è sufficiente a farlo avviare automaticamente. Il programma {{ic|xscreensaver}} deve essere avviato, operazione eseguita in genere dall'ambiente desktop, su sistemi ad utente unico, tramite una riga in {{ic|~/.xinitrc}} così:<br />
/usr/bin/xscreensaver -no-splash &<br />
<br />
La e commerciale {{ic|&}} fa eseguire xscreensaver in background, ed è quindi necessaria.<br />
<br />
{{note|Xscreensaver viene avviato automaticamente da [[Xfce (Italiano)|Xfce]] per mezzo di {{ic|/etc/xdg/xfce4/xinitrc}}: assicurarsi che venga eseguito con {{Ic|startxfce4}} e non {{Ic|xfce4-session}}.<br />
exec startxfce4 --with-ck-launch<br />
}}<br />
<br />
=== Sistemi con più utenti ===<br />
<br />
Se si opera su un sistema multi-utente con un [[Display Manager (Italiano)|display manager]] (es. [[SLiM (Italiano)|SLiM]], [[GDM]], [[KDM (Italiano)|KDM]]) è meglio avviare xscreensaver tramite l'interfaccia di gestione screensaver nativa. Questo permette la gestione completa al cambio utenti. Per esempio, se si utilizza [[GNOME (Italiano)|Gnome]], e si installa {{pkg|gnome-screensaver}} e {{pkg|xscreensaver}}, solo {{ic|gnome-screensaver}} risulta attivo. Questo permette di poter selezionare tutti gli screensaver, e mantenere la funzionalità di "switch-user, in caso un utente abbia lo schermo bloccato, e un altro utente vuole "cambiare utente" accedendo alla casella.<br />
<br />
{{Note|Alcune funzionalità native di xscreensaver andranno perdute, come il cattura schermo, l'utilizzo di foto in un percorso predefinito, e/o la visualizzazione di testi personalizzati durante l'esecuzione dello screensaver specifico del DM in uso con un sottoinsieme di funzionalità di xscreensaver (per esempio, schermo 3D Flip, photopile, ecc.)}}<br />
<br />
Un'altra opzione per mantenere il supporto multi-utente, senza dover installare un secondo salvaschermo, è quello di modificare o {{ic|~/.xscreensaver}}, cioè le impostazioni personali dell'utente, o {{ic|/usr/share/X11/app-defaults/XScreenSaver}}, cioè le impostazioni per l'intero sistema. Aggiungere la seguente riga:<br />
{{bc|newLoginCommand: /usr/bin/gdmflexiserver}}<br />
{{Note|Il comando è valido per gdm; per gestori di accesso differenti, sarà necessario modificare il comando con l'opzione adeguata corrispondente.}}<br />
<br />
==Blocca schermo==<br />
Si può immediatamente attivare {{ic|xscreensaver}}, se è in esecuzione, e bloccare lo schermo con il seguente comando<br />
$ xscreensaver-command --lock<br />
<br />
==Disabilitare Xscreensaver per le applicazioni multimediali==<br />
===mplayer===<br />
Aggiungere quanto segue a {{ic|~/.mplayer/config}}<br />
heartbeat-cmd="xscreensaver-command -deactivate >&- 2>&- &"<br />
<br />
===XBMC===<br />
Non c'è supporto nativo all'interno di XBMC per disabilitare xscreensaver (tuttavia XBMC è fornito con un proprio screensaver). Un'applicazione di terze parti è disponibile su [[Arch User Repository (Italiano)|AUR]], ed è chiamata {{AUR|caffeine-bzr}}. Una volta in esecuzione, è sufficiente aggiungere {{ic|xbmc.bin}} alla lista delle applicazioni per ottenerne l'attivazione automatica.<br />
<br />
===Adobe Flash/MPlayer/VLC===<br />
Non esiste un metodo che nativamente impedisca l'avvio di xscreensaver per i filmati flash, ma è possibile usare uno script chiamato [https://github.com/iye/lightsOn lightsOn] sviluppato per il flashplugin di Firefox, Chromium, MPlayer, e VLC.<br />
<br />
==Usare xscreensaver come wallpaper animato==<br />
È possibile lanciare {{ic|xscreensaver}} in background, come fosse un wallpaper.<br />
Prima di tutto sarà necessario killare ogni tipo di processo che stia controllando lo sfondo del desktop.<br />
Localizzare l'eseguibile di xscreensaver (generalmente {{ic|/usr/lib/xscreensaver/}}) e lanciarlo con il flag {{ic|-root}}. Un esempio:<br />
$ /usr/lib/xscreensaver/glslideshow -root &<br />
<br />
===Usare xscreensaver come wallpaper sotto xcompmgr===<br />
xcompmgr potrebbe causare dei problemi con xscreensaver. È necessario usare xwinwrap per lanciare il wallpaper. Il pacchetto in questione è {{AUR|shantz-xwinwrap-bzr}} ed è presente in [[Arch User Repository (Italiano)|AUR]].<br />
<br />
Lanciare con in seguente comando:<br />
$ xwinwrap -b -fs -sp -fs -nf -ov -- /usr/lib/xscreensaver/glslideshow -root -window-id WID &<br />
<br />
==Temi==<br />
La schermata di sblocco di XScreensaver può essere personalizzata con temi [[X resources]] (vedere: [[X resources#Xscreensaver resources|Xscreensaver resources]]).<br />
<br />
== Cambio utente da "look screen" ==<br />
Di default, il bottone "New Login" di Xscreensaver nella schermata di sblocco richiama {{ic|/usr/bin/gdmflexiserver}} a permettere tale operazione. Ciò funziona tuttavia solo con se si usa GDM. Altri display manager come lightdm e lxdm supportano questa funzionalità ma va configurata.<br />
<br />
=== LXDM ===<br />
Incollare questa stringa in {{ic|~/.Xresources}} per poter usare la funzionalità di cambio utente di LXDM:<br />
<br />
*newLoginCommand: lxdm -c USER_SWITCH<br />
<br />
=== Lightdm ===<br />
Incollare questa stringa in {{ic|~/.Xresource}} per poter usare la funzionalità di cambio utente di lightdm:<br />
<br />
*newLoginCommand: dm-tool switch-to-greeter<br />
<br />
==Risorse esterne==<br />
<br />
[http://wiki.gotux.net/downloads/paniclock PanicLock] -- Bloccare lo schermo e chiudere programmi determinati in background.</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=GNU_Screen_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=301058GNU Screen (简体中文)2014-02-24T03:58:35Z<p>Mistofvongola: Fix Gentoo wiki link</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:Software (简体中文)]]<br />
[[en:GNU Screen]]<br />
[[ru:GNU Screen]]<br />
[http://www.gnu.org/s/screen/ GNU Screen] 是一个封装器,允许命令行程序和启动它的shell相分离。例如,可以在X下的终端中启动一个程序,关闭X,而继续使用此程序。以下有技巧和提示。<br />
<br />
如果想看教程,Gentoo的维基有一个很好的教程:http://wiki.gentoo.org/wiki/Screen<br />
<br />
== 安装 ==<br />
<br />
可以用[[Official Repositories (简体中文)|官方软件仓库]]中的 {{pkg|screen}} 包来[[pacman (简体中文)|安装]] GNU Screen.<br />
<br />
== 基础 == <br />
可以通过 {{ic|Ctrl+a}} 和其他键来输入命令。通过 {{ic|~/.screenrc}} 中的''escape''选项来改变 escape 键。例如:<br />
escape ``<br />
<br />
将 escape 键设为 {{ic|`}}。<br />
<br />
=== 常见命令 ===<br />
C-a ?<br />
:列出命令和默认按键(非常重要)<br />
C-a "<br />
:窗口列表<br />
C-a 0<br />
:打开窗口 0<br />
C-a A<br />
:重命名当前窗口<br />
C-a c<br />
:创建新窗口<br />
C-a S<br />
:将当前区域划分为两个区域<br />
C-a <TAB><br />
:将输入焦点转至下一区域<br />
C-a C-a<br />
:在当前区域和之前区域间转换<br />
C-a <ESC> <br />
:进入复制模式(用 {{ic|enter}} 键来选择一段文本)<br />
C-a ]<br />
:粘贴文本<br />
C-a Q<br />
:关闭除当前区域外所有区域<br />
C-a d<br />
:从当前 screen 会话断开,并保持其运行。用 {{ic|screen -r}} 来恢复。<br />
<br />
== 从窗口 1 开始 ==<br />
默认的第一个窗口是 0 号。如果不想要窗口 0,而是从 1 号开始,将以下内容写入 {{ic|~/.screenrc}}:<br />
bind c screen 1<br />
bind ^c screen 1<br />
bind 0 select 10 <br />
screen 1<br />
<br />
== 嵌套的 Screen 会话 ==<br />
在一个嵌套的 screen 会话中卡住是非常容易的。一个常见的情况是:你从一个 screen 会话内启动了一个 ssh 会话,在这个 ssh 会话中,你又启动了 screen。默认地,响应 C-a 命令的是最先启动的外层screen。如果要向内层 screen 输入命令,用 C-a a 加上你的命令。例如:<br />
C-a a d<br />
:断开内层 screen 会话<br />
C-a a K<br />
:杀死内层 screen 会话<br />
<br />
== 消除残余的编辑文本 ==<br />
当你在 screen 内打开文本编辑器再关掉它,文本内容仍然会在终端上显示。要解决这点,将下列内容加入 {{ic|~/.screenrc}} 中:<br />
altscreen on<br />
<br />
== 使用 256 色 ==<br />
默认地,screen 使用 8 色终端模拟器。如果你用的是支持 256 色的终端,可以通过如下命令来支持更多的色彩:<br />
term screen-256color<br />
<br />
如果在 [[xterm]] 中仍不能显示 256 色,试试下面的命令:<br />
attrcolor b ".I" # 允许加粗色彩--由于某些原因是必须的<br />
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' # 告诉screen如何设置颜色。AB 指背景,AF 指前景<br />
defbce on # 使用当前背景色来显示删除的字符<br />
<br />
== 在 Rxvt-Unicode (urxvt) 中使用 256 色 ==<br />
如果你用的是[[Official Repositories (简体中文)|官方软件仓库]]中的 {{pkg|rxvt-unicode}},你可以将下面这行加入你的 {{ic|~/.screenrc}} 来启用256色:<br />
terminfo rxvt-unicode 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'<br />
<br />
== 信息状态栏 ==<br />
默认的信息状态栏可能会有些简单。你可以使它变得更有用:<br />
hardstatus off<br />
hardstatus alwayslastline<br />
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W} %c %{g}]'<br />
<br />
== 关闭欢迎信息 == <br />
将下面这行加入到 {{ic|~/.screenrc}}:<br />
startup_message off<br />
<br />
== 让标题栏动态显示 urxvt|xterm|aterm 窗口名称 ==<br />
这非常简单,只是将你当前的 {{ic|hardstatus}} 栏变成 {{ic|caption}} 栏,并编辑对应项:<br />
backtick 1 5 5 true<br />
termcapinfo rxvt* 'hs:ts=\E]2;:fs=\007:ds=\E]2;\007'<br />
hardstatus string "screen (%n: %t)"<br />
caption string "%{= kw}%Y-%m-%d;%c %{= kw}%-Lw%{= kG}%{+b}[%n %t]%{-b}%{= kw}%+Lw%1`"<br />
caption always<br />
<br />
这会在你的终端模拟器标题栏显示 "screen (0 bash)" 之类的内容。标题栏提供日期、当前时间,并给 screen 窗口加上颜色。<br />
<br />
== 使用 X 滚动机制 ==<br />
滚动缓存可以用 C-a [ 来查看。但是这很不方便。要使用滚动条,如 xterm 或 konsole,将下面这行加入 {{ic|~/.screenrc}}:<br />
termcapinfo xterm* ti@:te@<br />
<br />
== 添加 GRUB 条目来启动进入 Screen ==<br />
如果你主要使用 [[Xorg|X]],但偶尔将Screen作为窗口管理器运行,这里有种通过为 Screen 添加 [[GRUB]] 条目的方法。<br />
<br />
GRUB 允许你指明想要的运行级别,因此在这里我们使用运行级别 4。复制一条合适的 GRUB 条目,并给内核选项表添加 {{ic|4}},像这样:<br />
<br />
# (0) Arch Linux<br />
title Arch Linux Screen<br />
root (hd0,2)<br />
kernel /vmlinuz-linux root=/dev/disk/your_disk ro acpi_no_auto_ssdt irqpoll 4<br />
initrd /initramfs-linux.img<br />
<br />
给 {{ic|/etc/inittab}} 添加一些条目来指明哪些将在运行级别 4 下进行,将 <user> 换为你的用户名:<br />
# GNU Screen on runlevel 4<br />
scr2:4:respawn:/sbin/mingetty --autologin <user> tty1 linux<br />
<br />
上面这行使用 mingetty 来[[Automatic login to virtual console|启动时自动登陆]]。你需要安装[Official Repositories (简体中文)|官方软件仓库]]中的 ({{pkg|mingetty}}。inittab 的行分隔符是冒号。第一部分(scr*)仅仅是一个id。第二部分是运行级别:只在运行级别 4 下进行(默认地 4 没有被使用--3 是默认的字符界面登陆,5 是 X 登陆)。'Respawn' 让 init 重复这条命令(即自动登陆),如果用户注销。<br />
当我们使用运行级别 4 时,我们需要没有其他任何程序在虚拟终端 1 下运行。所以将 {{ic|4}}从 agetty 的第一行移去: <br />
<br />
c1:235:respawn:/sbin/agetty -8 38400 vc/1 linux<br />
<br />
一旦我们登陆,我们想要保证 screen 已经启动。将下列内容添加到你的{{ic|~/.bash_profile}}:<br />
vico="$(tty | grep -oE ....$)"<br />
case "$vico" in<br />
tty1) TERM=screen; exec /usr/bin/screen -R arch;;<br />
esac<br />
<br />
这会检查当前运行级别,如果是 4 就在自动登陆后立即启动一个 screen 会话。<br />
<br />
也可以改成 X 之后在一个虚拟终端里运行 screen,只需检查当前的 tty 而不是运行级别即可。下面是检查我们是否在虚拟终端 3 上:<br />
vico="$(tty | grep -oE ....$)"<br />
case "$vico" in<br />
vc/3) TERM=screen; exec /usr/bin/screen;;<br />
esac<br />
<br />
将 inittab/mingetty 设为在运行级别 5 下自动登陆到 vc/3 即可。<br />
<br />
== 修正启动 screen 时 Midnight Commander 无反应的问题 ==<br />
这个问题在某些情况下(需要进一步检查)[https://bugzilla.redhat.com/show_bug.cgi?id=168076 old gpm bug] 会出现。所以在 screen 内运行 mc,会得到无反应的 screen 窗口。尝试在运行 mc 之前杀死 gpm 守护进程,或是在 {{ic|/etc/[[rc.conf]]}} 中禁止 gpm。<br />
In some cases (need deeper inspection) [https://bugzilla.redhat.com/show_bug.cgi?id=168076 old gpm bug] gets alive. So, then you try to run mc inside screen, you get a frozen screen window. Try to kill gpm daemon before starting mc and/or disable it in {{ic|/etc/[[rc.conf]]}}.<br />
<br />
== See Also ==<br />
* [http://www.macosxhints.com/article.php?story=20021114055617124 MacOSX Hints - Automatically using screen in your shell]<br />
* [http://wiki.gentoo.org/wiki/Screen Gentoo Wiki - Tutorial for screen]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=50647 Arch Forums - Regarding 256 color issue with urxvt]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=55618 Arch Forums - .screenrc configs with screenshots]<br />
* [[tmux]], another multiplexer</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=GNU_Screen_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)&diff=301057GNU Screen (Русский)2014-02-24T03:58:20Z<p>Mistofvongola: </p>
<hr />
<div>[[Category:Software (Русский)]]<br />
[[Category:Русский]]<br />
[[en:GNU Screen]]<br />
[[zh-CN:GNU Screen]]<br />
[http://www.gnu.org/s/screen/ GNU Screen] - обертка, которая позволяет отделить консольную программу от терминала. Например, screen позволяется пользователям запустить консольную программу в одном из терминальных эмуляторов под X, закрыть его и продолжить работу с программой в другом терминале. В данной статье приведены различные советы и рекомендации по использованию screen.<br />
<br />
Если вы ищете пошаговое руководство, то его можно найти на gentoo wiki: http://wiki.gentoo.org/wiki/Screen<br />
<br />
== Установка ==<br />
<br />
GNU Screen можно установить из репозитория extra:<br />
<br />
# pacman -S screen<br />
<br />
== Основы ==<br />
Команды вводятся после нажатия Ctrl+A. Данная комбинация настраивается опцией ''escape'' в ~/.screenrc. Пример:<br />
<pre><br />
escape ``<br />
</pre><br />
устанавливает escape-команду на клавишу `<br />
<br />
=== Стандартные команды ===<br />
* {{ic|ctrl+a}} {{ic|?}} Отображает список команд и их параметры по умолчанию<br />
* {{ic|ctrl+a}} {{ic|:}} Ввод команды для screen<br />
* {{ic|ctrl+a}} {{ic|"}} Список окон<br />
* {{ic|ctrl+a}} {{ic|0}} Открыть окно 0<br />
* {{ic|ctrl+a}} {{ic|A}} Переименовать текущее окно<br />
* {{ic|ctrl+a}} {{ic|a}} Отправить {{ic|ctrl+a}} в текущее окно<br />
* {{ic|ctrl+a}} {{ic|c}} Создать новое окно<br />
* {{ic|ctrl+a}} {{ic|S}} Разделить текущее окно на два региона<br />
* {{ic|ctrl+a}} {{ic|tab}} Переключить фокус ввода на следующий регион<br />
* {{ic|ctrl+a}} {{ic|ctrl+a}} Переключение между текущим и предыдущим регионами<br />
* {{ic|ctrl+a}} {{ic|Esc}} Перейти в режим копирования (используйте enter для выделения текста)<br />
* {{ic|ctrl+a}} {{ic|]}} Вставка текста<br />
* {{ic|ctrl+a}} {{ic|Q}} Закрыть все регионы кроме текущего<br />
* {{ic|ctrl+a}} {{ic|X}} Закрыть текущий регион<br />
* {{ic|ctrl+a}} {{ic|d}} Отключиться от текущей сессии screen, оставив ее работающей. Для переподключения используйте {{ic|screen -r}}<br />
<br />
== Запуск в окне 1 ==<br />
По умолчанию, первое окно screen имеет номер 0. Возможно, вы предпочтете начать с нумерацию с единицы, добавьте это в ~/.screenrc:<br />
<pre><br />
bind c screen 1<br />
bind ^c screen 1<br />
bind 0 select 10 <br />
screen 1<br />
</pre><br />
<br />
== Вложенные сессии screen ==<br />
It's possible to get stuck in a nested screen session. A common scenario: you start an ssh session from within a screen session. Within the ssh session, you start screen. By default, the outer screen session that was launched first responds to C-a commands. To send a command to the inner screen session, use C-a a, followed by your command. For example:<br />
<br />
C-a a d<br />
:Detaches the inner screen session.<br />
C-a a K<br />
:Kills the inner screen session.<br />
<br />
== Исправление проблемы с остатками текста ==<br />
When you open a text editor like nano in screen and then close it, the text may stay visible in your terminal. To fix this, put the following in your ~/.screenrc:<br />
<pre><br />
altscreen on<br />
</pre><br />
<br />
== Используем 256 цветов ==<br />
By default, screen uses an 8-color terminal emulator. Use the following line to enable more colors, which is useful if you are using a more-capable terminal emulator:<br />
<pre><br />
term screen-256color<br />
</pre><br />
<br />
If this fails to render 256 colors in [[xterm]], try the following instead:<br />
<pre><br />
attrcolor b ".I" # allow bold colors - necessary for some reason<br />
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' # tell screen how to set colors. AB = background, AF=foreground<br />
defbce on # use current bg color for erased chars<br />
</pre><br />
<br />
== Используем 256 цветов в Rxvt-Unicode (urxvt) ==<br />
If you are using {{ic|rxvt-unicode-256color}} from {{ic|[community]}}, you may need to add this line in your {{ic|~/.screenrc}} to enable 256 colors while in screen.<br />
terminfo rxvt-unicode 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'<br />
<br />
== Информационный статус-бар ==<br />
The default statusbar may be a little lacking. You may find this one more helpful:<br />
<pre><br />
hardstatus off<br />
hardstatus alwayslastline<br />
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d<br />
%{W} %c %{g}]'<br />
</pre><br />
<br />
== Отключаем приветственное сообщение == <br />
Add to ~/.screenrc:<br />
<pre><br />
startup_message off<br />
</pre><br />
<br />
== Превращаем строку хард-статуса в динамический заголовок окна urxvt|xterm|aterm ==<br />
This one's pretty simple; just switch your current hardstatus line into a caption line with notification, and edit accordingly:<br />
<br />
<pre><br />
backtick 1 5 5 true<br />
termcapinfo rxvt* 'hs:ts=\E]2;:fs=\007:ds=\E]2;\007'<br />
hardstatus string "screen (%n: %t)"<br />
caption string "%{= kw}%Y-%m-%d;%c %{= kw}%-Lw%{= kG}%{+b}[%n %t]%{-b}%{= kw}%+Lw%1`"<br />
caption always<br />
</pre><br />
<br />
This will give you something like "screen (0 bash)" in the title of your terminal emulator. The caption supplies the date, current time, and colorizes your screen window collection.<br />
<br />
==Используем механизм прокрутки X==<br />
The scroll buffer of GNU Screen can be accessed with C-a. However, this is very inconvenient. To use the scroll bar of e.g. xterm or konsole, add the following line to ~/.screenrc<br />
termcapinfo xterm* ti@:te@<br />
<br />
==Добавляем пункт в GRUB для загрузки в Screen==<br />
If you mostly use X but occasionally want to run a Screen-as-window-manager session, here's one way to do it by adding a GRUB entry for Screen on a virtual console (text terminal). <br />
<br />
GRUB allows you to designate what runlevel you want so we'll use runlevel 4 for this purpose. Clone an appropriate GRUB entry and add a '4' to the kernel boot parameters list, like so:<br />
<br />
<pre><br />
# (0) Arch Linux<br />
title Arch Linux Screen<br />
root (hd0,2)<br />
kernel /boot/vmlinuz26 root=/dev/disk/your_disk ro acpi_no_auto_ssdt irqpoll 4<br />
initrd /boot/kernel26.img<br />
</pre><br />
<br />
Add some entries to /etc/inittab to indicate what should happen on runlevel 4, substituting your user name for <user>:<br />
<pre><br />
# gnu screen on rl4<br />
scr2:4:respawn:/sbin/mingetty --autologin <user> tty1 linux<br />
</pre><br />
The line uses mingetty to [[automatically login some user to a virtual console on startup]]. You will need to install the [https://aur.archlinux.org/packages.php?ID=13793 mingetty package] (AUR). The inittab line segments are separated by colons. The first part (scr*) is simply an id. The second part is the runlevel: This should only happen on runlevel 4 (which isn't used in any default setup - 3 is by default for a tty login and 5 is for X). 'Respawn' causes init to repeat the command (i.e. autologin) if the user logs out. <br />
We'll need to see that nothing else happens on virtual console 1 when we use runlevel 4, so remove '4' from the the first of the agetty lines:<br />
<br />
<pre>c1:235:respawn:/sbin/agetty -8 38400 vc/1 linux</pre><br />
<br />
Once logged in we want to ensure that screen is started. Add the following to the end of your .bash_profile:<br />
<pre><br />
vico="$(tty | grep -oE ....$)"<br />
case "$vico" in<br />
tty1) TERM=screen; exec /usr/bin/screen -R arch;;<br />
esac<br />
<br />
</pre><br />
This checks for the current runlevel and will launch a screen session immediately after the autologin if the runlevel is 4.<br />
<br />
This can also be adapted to run screen on a virtual console next to X, simply checking for the current tty instead of the current runlevel. This check to see if we're on virtual console 3:<br />
<pre><br />
vico="$(tty | grep -oE ....$)"<br />
case "$vico" in<br />
vc/3) TERM=screen; exec /usr/bin/screen;;<br />
esac<br />
</pre><br />
Set inittab/mingetty to automaically log in to vc/3 on runlevel 5 and you're set.<br />
<br />
== Исправляем зависание Midnight Commander при запуске в screen ==<br />
In some cases (need deeper inspection) [https://bugzilla.redhat.com/show_bug.cgi?id=168076 old gpm bug] gets alive. So, then you try to run mc inside screen, you get a frozen screen's window. Try to kill gpm daemon before starting mc and/or disable it in ''/etc/rc.conf''.<br />
<br />
== См. также ==<br />
* [http://www.macosxhints.com/article.php?story=20021114055617124 MacOSX Hints - Automatically using screen in your shell]<br />
* [http://wiki.gentoo.org/wiki/Screen Gentoo Wiki - Tutorial for screen]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=50647 Arch Forums - Regarding 256 color issue with urxvt]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=55618 Arch Forums - .screenrc configs with screenshots]<br />
* [[tmux]], еще один консольный мультиплексор</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=Synergy_(Italiano)&diff=301056Synergy (Italiano)2014-02-24T03:57:04Z<p>Mistofvongola: /* Altre risorse */ Remove dead link. Gentoo Wiki doesn't have a Synergy page anymore.</p>
<hr />
<div>[[Category:Input devices (Italiano)]]<br />
[[en:Synergy]]<br />
[http://synergy-foss.org/ Synergy] permette di condividere facilmente un mouse ed una tastiera tra più computer (anche con differenti sistemi operativi) senza la necessità di hardware specifico.<br />
È stato concepito per utenti con più computer sulla propria scrivania, dato che ogni sistema utilizza il proprio (o i propri) monitor.<br />
<br />
Per reindirizzare mouse e tastiera è sufficiente muovere il mouse oltre il bordo dello schermo. Synergy, poi, unifica la funzione del copia-incolla tra i vari sistemi, in maniera da poter copiare qualcosa da un computer ed incollarlo su un altro. Inoltre sincronizza gli screen saver in maniera che si avviino e terminino insieme e, se il blocco dello schermo è abilitato, è sufficiente inserire la password in uno solo per sbloccarli tutti.<br />
<br />
==Installazione==<br />
<br />
===Arch Linux===<br />
È possibile [[pacman (Italiano)|installare]] il pacchetto {{pkg|synergy}} dai [[Official Repositories (Italiano)|repository ufficiali]].<br />
<br />
===Windows e Mac OS X===<br />
Scaricare ed eseguire [http://synergy-foss.org/download l'installatore più recente] dal sito ufficiale.<br />
<br />
===Compilare i sorgenti===<br />
Anzitutto scaricare e compilare il codice sorgente per creare i binari synergyc e synergys dal [http://synergy-foss.org/pm/projects/synergy/tabs/source repo svn].<br />
<br />
{{hc|$ <nowiki>svn co http://synergy-plus.googlecode.com/svn/trunk/ synergy-trunk && cd synergy-trunk && cmake . && make</nowiki>|<nowiki>...<br />
[ 0%] Built target gtest<br />
[ 94%] Built target synergy<br />
Linking CXX executable synergyc<br />
[ 96%] Built target synergyc<br />
Linking CXX executable synergys<br />
[ 98%] Built target synergys<br />
[100%] Built target tests</nowiki>}}<br />
<br />
Poi cambiare l'owner;group a {{ic|root:root}} e copiare i binari creati nel proprio {{ic|$PATH}}, ad esempio {{ic|/usr/local/bin}}.<br />
{{hc|$ <nowiki>sudo chown root:root synergyc synergys && sudo cp -v synerygyc synergys /usr/local/bin</nowiki>|<nowiki>changed ownership of `synergyc' to root:root<br />
changed ownership of `synergys' to root:root<br />
`synergyc' -> `/usr/local/bin/synergyc'<br />
`synergys' -> `/usr/local/bin/synergys'</nowiki>}}<br />
<br />
{{Suggerimento|Sono anche disponibili le versioni BETA di Synergy.}}<br />
<br />
*Leggere [http://synergy-foss.org/pm/projects/synergy/wiki/Compiling la guida ufficiale per la compilazione].<br />
<br />
==Pre-configurazione==<br />
Determinare gli indirizzi IP e gli [[Configuring_Network_(Italiano)#Impostare_il_nome_del_PC|hostname]] per ogni macchina ed assicurarsi che ognuna abbia un file hosts settato correttamente.<br />
<br />
* Arch Linux - {{ic|/etc/hosts}}<br />
* Windows - {{ic|C:\WINDOWS\system32\drivers\etc\hosts}}<br />
* Mac OS X - [http://support.apple.com/kb/TA27291?viewlocale=en_US Come aggiungere degli host al file hosts locale].<br />
<br />
{{hc|/etc/hosts|<br />
10.10.66.1 archserver.localdomain archserver<br />
10.10.66.100 archleft.localdomain archleft<br />
10.10.66.105 archright.localdomain archright}}<br />
<br />
{{Nota|Controllare che i client riescano a comunicare con il server.}}<br />
<br />
==Configurazione del server==<br />
<br />
Leggere [http://synergy2.sourceforge.net/configuration.html Formato del File di Configurazione di Synergy] per una descrizione dettagliata di tutte le sezioni ed opzioni disponibili.<br />
<br />
===Arch Linux===<br />
<br />
Il file di configurazione per Arch Linux si trova in {{ic|/etc/synergy.conf}}. Se tale file non esiste, crearlo basandosi su {{ic|/etc/synergy.conf.example}}, i cui commenti dovrebbero fornire sufficienti informazioni per una configurazione di base; se si ha bisogno di approfondimenti, leggere la guida citata sopra.<br />
<br />
{{Suggerimento|1=È anche possibile usare {{Pkg|qsynergy}} dai [[Official Repositories (Italiano)|repository ufficiali]] oppure {{aur|quicksynergy}} dall'[[AUR (Italiano)|AUR]], che forniscono una GUI per semplificare la procedura di configurazione.}}<br />
<br />
Per avviare il demone server, eseguire:<br />
<br />
# rc.d start synergys<br />
<br />
Se si verificano dei problemi e si desidera eseguire il server in foreground (mostrando l'output nella console), si può invece eseguire:<br />
<br />
# synergys -f<br />
<br />
Se si vuole avviare il demone server di Synergy ad ogni avvio di Arch Linux, si può aggiungere {{ic|synergys}} all'array dei demoni in {{ic|/etc/rc.conf}}:<br />
<br />
{{hc|/etc/rc.conf|2=...<br />
DAEMONS=(... synergys ...)}}<br />
<br />
===Windows===<br />
<br />
# Aprire il programma Synergy<br />
# Selezionare l'opzione ''Server (share this computer's mouse and keyboard)''<br />
# Selezionare ''Configure interactively''<br />
# Cliccare il pulsante ''Configure Server...''<br />
# Questo apre una finestra nella quale si possono aggiungere schermi a seconda di quanti computer/schermi si hanno: basta trascinare l'icona dello schermo dall'angolo in alto a destra fino nell'area degli schermi, e poi farci doppio click per modificare la sua configurazione<br />
# Cliccare su ''OK'' per chiudere la finestra degli schermi quando si è pronti, poi cliccare su ''Start'' per avviare il client<br />
<br />
Su Windows, la configurazione viene salvata per default in un file {{ic|synergy.sgc}}, ma il suo nome e il percorso possono essere modificati a piacere.<br />
<br />
Se si vuole avviare il server ad ogni avvio di Windows bisogna lanciare Synergy '''come amministratore''', poi andare se ''Edit -> Services'' e selezionare ''Install'' nella sezione ''Server''; notare che al riavvio seguente Synergy sarà sì autoavviato, ma l'icona nell'area notifiche non si mostrerà automaticamente (almeno nella versione 1.4.2 beta su Windows 7). Per disinstallare il servizio bisogna fare la stessa cosa ma ovviamente selezionando ''Uninstall''.<br />
<br />
Se si vuole avviare il server dalla linea di comando, questa è una linea che si può mettere in un file {{ic|.bat}} o semplicemente eseguirla da {{ic|cmd.exe}}:<br />
<br />
{{bc|C:\Program Files\Synergy+\bin\synergys.exe -f --debug ERROR --name left --log c:\windows\synergy.log -c C:/windows/synergy.sgc --address 10.66.66.2:24800}}<br />
<br />
Consultare [http://synergy-foss.org/docs la documentazione ufficiale] per maggiori informazioni.<br />
<br />
===Mac OS X===<br />
<br />
Mac OS X ha una configurazione simile a Unix: consultare [http://synergy-foss.org/docs la documentazione ufficiale] per maggiori informazioni.<br />
<br />
===Esempi di configurazione===<br />
<br />
Questo è un esempio per una configurazione a 3 computer:<br />
<br />
{{hc|/etc/synergy.conf|<nowiki><br />
section: screens<br />
server-fire:<br />
archright-fire:<br />
archleft-fire:<br />
end<br />
<br />
section: links<br />
archleft-fire:<br />
right = server-fire<br />
server-fire:<br />
right = archright-fire<br />
left = archleft-fire<br />
archright-fire:<br />
left = server-fire<br />
end<br />
</nowiki>}}<br />
<br />
Questo dovrebbe essere l'esempio fornito insieme al pacchetto di Arch Linux:<br />
<br />
{{hc|/etc/synergy.conf|2=<br />
section: screens<br />
# three hosts named: moe, larry, and curly<br />
moe:<br />
larry:<br />
curly:<br />
end<br />
<br />
section: links<br />
# larry is to the right of moe and curly is above moe<br />
moe:<br />
right = larry<br />
up = curly<br />
<br />
# moe is to the left of larry and curly is above larry.<br />
# note that curly is above both moe and larry and moe<br />
# and larry have a symmetric connection (they're in<br />
# opposite directions of each other).<br />
larry:<br />
left = moe<br />
up = curly<br />
<br />
# larry is below curly. if you move up from moe and then<br />
# down, you'll end up on larry.<br />
curly:<br />
down = larry<br />
end<br />
<br />
section: aliases<br />
# curly is also known as shemp<br />
curly:<br />
shemp<br />
end<br />
<br />
}}<br />
<br />
Il seguente è un esempio più personalizzato:<br />
<br />
{{hc|synergy.sgc|2=<br />
section: screens<br />
leftpc:<br />
halfDuplexCapsLock = false<br />
halfDuplexNumLock = false<br />
halfDuplexScrollLock = false<br />
xtestIsXineramaUnaware = false<br />
switchCorners = none +top-left +top-right +bottom-left +bottom-right <br />
switchCornerSize = 0<br />
rightpc:<br />
halfDuplexCapsLock = false<br />
halfDuplexNumLock = false<br />
halfDuplexScrollLock = false<br />
xtestIsXineramaUnaware = false<br />
switchCorners = none +top-left +top-right +bottom-left +bottom-right <br />
switchCornerSize = 0<br />
end<br />
<br />
section: aliases<br />
leftpc:<br />
10.66.66.2<br />
rightpc:<br />
10.66.66.1<br />
end<br />
<br />
section: links<br />
leftpc:<br />
right = rightpc<br />
rightpc:<br />
left = leftpc<br />
end<br />
<br />
section: options<br />
heartbeat = 1000<br />
relativeMouseMoves = false<br />
screenSaverSync = false<br />
win32KeepForeground = false<br />
switchCorners = none +top-left +top-right +bottom-left +bottom-right <br />
switchCornerSize = 4<br />
end<br />
}}<br />
<br />
==Configurazione dei client==<br />
{{Nota|Si presuppone che sia stato correttamente configurato un server. Assicurarsi che ci sia già un server pronto ad accettare dei client prima di continuare.}}<br />
<br />
===Arch Linux===<br />
Nella finestra di un terminale, digitare:<br />
<br />
$ synergyc server-host-name<br />
<br />
Oppure, per eseguire synergy in foreground (mostrando l'output nella console):<br />
<br />
$ synergyc -f server-host-name<br />
<br />
In queste linee, {{ic|server-host-name}} è l'hostname del server.<br />
<br />
====Autoavvio====<br />
Esistono vari modi per autoavviare il client per Synergy, ed effettivamente sono i soliti metodi che possono essere usati per ogni altra applicazione.<br />
<br />
{{Nota|In ognuno dei seguenti esempi bisogna sempre sostituire {{ic|server-host-name}} con il nome reale del server.}}<br />
<br />
* Si può aggiungere la seguente linea al proprio [[xinitrc|{{ic|~/.xinitrc}}]]:<br />
<br />
{{hc|~/.xinitrc|<br />
...<br />
<br />
#replace server-host-name with the real name<br />
synergyc server-host-name<br />
<br />
...}}<br />
<br />
Il seguente codice è un'alternativa:<br />
<br />
{{hc|~/.xinitrc|<nowiki>XINIT_CMD='/usr/bin/synergyc -d FATAL -n galileo-fire 10.66.66.2:24800'<br />
/usr/bin/pgrep -lxf "$XINIT_CMD" || ( ( $XINIT_CMD ) & )</nowiki>}}<br />
<br />
* Altrimenti, se si sta usando un [[display manager]] (kdm, gdm, [[SLiM]], ...), oppure un [[window manager]] standalone (Openbox, ...), è possibile sfruttare il suo script di startup e aggiungerci:<br />
<br />
synergyc server-host-name<br />
<br />
o, nel caso si sia creato il demone ''synergyc'' daemon (leggere più sotto):<br />
<br />
/etc/rc.d/synergyc stop #verify synergy is closed<br />
/etc/rc.d/synergyc start<br />
<br />
Ad esempio, se si usa ''kdm'' si dovrebbe modificare {{ic|/usr/share/config/kdm/Xsetup}}.<br />
<br />
* Si può anche avviare ''synergyc'' direttamente nella init chain aggiungendo le righe seguenti a {{ic|/etc/rc.local}}:<br />
<br />
{{hc|/etc/rc.local|<br />
...<br />
<br />
echo "Starting Synergy client"<br />
#replace server-host-name with the real name<br />
synergyc server-host-name}}<br />
<br />
* Un risultato simile può essere ottenuto creando un demone e aggiungendolo all'array dei demoni in {{ic|/etc/rc.conf}}; basta creare un file {{ic|/etc/rc.d/synergyc}} con il contenuto seguente, assicurandosi di settare i suoi permessi con {{ic|chmod 755}}:<br />
<br />
{{hc|/etc/rc.d/synergyc|2=<br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
#Put the server host name in the following line<br />
SERVERALIAS="server-host-name"<br />
<br />
PID=`pidof -o %PPID /usr/bin/synergyc`<br />
case "$1" in<br />
start)<br />
stat_busy "Starting Synergy Client"<br />
[ -z "$PID" ] && /usr/bin/synergyc "$SERVERALIAS"<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
/usr/bin/xset r on<br />
add_daemon synergyc<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping Synergy Client"<br />
[ ! -z "$PID" ] && kill -9 $PID<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon synergyc<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
<nowiki> echo "usage: $0 {start|stop|restart}"</nowiki><br />
esac<br />
exit 0}}<br />
<br />
L'autoavvio di Synergy è documentato anche nella sua [http://synergy2.sourceforge.net/autostart.html pagina ufficiale di riferimento].<br />
<br />
===Windows===<br />
<br />
Dopo l'installazione, aprire il programma Synergy, selezionare l'opzione ''Client (use another computer's keyboard and mouse)'' e digitare l'hostname del server nella casella di testo, poi cliccare su ''Start'' per avviare il client.<br />
<br />
{{Nota|Per terminare il client si può usare l'icona nell'area notifiche.}}<br />
<br />
Se si vuole avviare il client ad ogni avvio di Windows bisogna lanciare Synergy '''come amministratore''', poi andare su ''Edit -> Services'' e selezionare ''Install'' nella sezione ''Client''.<br />
<br />
Se si vuole avviare il client dalla linea di comando, questa è una linea che si può mettere in un file {{ic|.bat}} o semplicemente eseguirla da {{ic|cmd.exe}}. Questa punta ad un file di configurazione in {{ic|C:\synergy.sgc}} e viene eseguita in background come un servizio.<br />
<br />
{{bc|<nowiki>START /MIN /D"C:\Program Files\Synergy+\bin" synergys.exe -d ERROR -n m6300 -c C:\synergy.sgc -a 10.66.66.2:24800</nowiki>}}<br />
<br />
===Mac OS X===<br />
<br />
Individuare il programma synergyc nella cartella synergyc e trascinarlo nella finestra del terminale: vi apparirà in suo percorso completo.<br />
Ora aggiungere in fondo l'hostname del server in maniera che il comando completo somigli a questo:<br />
<br />
{{bc|/path/to/synergyc/synergyc server-host-name}}<br />
<br />
Poi premere {{ic|Invio}}.<br />
<br />
==Problemi conosciuti==<br />
Se Arch viene usato come client in un'installazione di Synergy, il server potrebbe non essere in grado di riattivare il monitor del client. Ci sono alcune soluzioni per questo, come eseguire il comando seguente via [[Secure Shell (Italiano)|SSH]], se ACPI è abilitato (leggere: [[Display_Power_Management_Signaling#Modifing_DPMS_and_screensaver_settings_using_xset|modificare la configurazione di DPMS e ScreenSaver con xset]]):<br />
{{bc|# xset dpms force on}}<br />
<br />
==Risoluzione di problemi==<br />
La documentazione ufficiale ha [http://synergy-foss.org/pm/projects/synergy/wiki/UserFAQ una pagina per le FAQ] e [http://synergy2.sourceforge.net/trouble.html una per la risoluzione dei problemi].<br />
<br />
===Ripetizione dei tasti===<br />
Se si hanno problemi con la ripetizione dei tasti sul computer client (host Linux), digita semplicemente:<br />
{{bc|# /usr/bin/xset r on}}<br />
in una console.<br />
<br />
===Mappatura della tastiera===<br />
Se si hanno problemi con la mappatura della tastiera usando la tastiera del server in una finestra del client (ad esempio un terminale), riconfigurare la mappatura della tastiera in X dopo aver avviato synergyc potrebbe risolvere il problema. Il seguente comando configura la mappatura della tastiera al suo valore attuale:<br />
<br />
# setxkbmap $(setxkbmap -query | grep "^layout:" | awk -F ": *" '{print $2}')<br />
<br />
===messages.log viene spammato da synergyc===<br />
Se si esegue ''synergyc'' come descritto sopra, il proprio file {{ic|/var/log/messages.log}} sarà spammato con messagi del genere:<br />
<br />
May 26 22:30:46 localhost Synergy 1.4.6: 2012-05-26T22:30:46 INFO: entering screen<br />
/build/src/synergy-1.4.6-Source/src/lib/synergy/CScreen.cpp,103<br />
May 26 22:30:47 localhost Synergy 1.4.6: 2012-05-26T22:30:47 INFO: leaving screen<br />
/build/src/synergy-1.4.6-Source/src/lib/synergy/CScreen.cpp,121<br />
<br />
Per evitare ciò eseguire ''synergyc'' con l'opzione {{ic|-d WARNING}}. Quest'opzione del ''livello di debug'' istruisce synergy a loggare solamente i messaggi che sono del livello ''WARNING'' o superiore.<br />
<br />
synergyc -d WARNING server-host-name<br />
<br />
È anche possibile editare la linea che lancia ''synergyc'' se si usa un file {{ic|/etc/rc.d/synergyc}}.<br />
<br />
[ -z "$PID" ] && /usr/bin/synergyc -d WARNING "$SERVERALIAS"<br />
<br />
==Altre risorse==<br />
* Sito ufficiale di Synergy: http://synergy-foss.org<br />
* Documentazione ufficiale: http://synergy-foss.org/docs</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=Input_Leap&diff=301055Input Leap2014-02-24T03:56:50Z<p>Mistofvongola: /* External Links */ Remove dead link. Gentoo Wiki doesn't have a Synergy page anymore.</p>
<hr />
<div>[[Category:Input devices]]<br />
[[fr:Synergy]]<br />
[[it:Synergy]]<br />
[http://synergy-foss.org/ Synergy] lets you easily share a single mouse and keyboard between multiple computers (even with different operating systems) without the need for special hardware. It is intended for users with multiple computers on their desk since each system uses its own monitor(s).<br />
<br />
Redirecting the mouse and keyboard is as simple as moving the mouse off the edge of your screen. Synergy also merges the clipboards of all the systems into one, allowing cut-and-paste between systems. Furthermore, it synchronizes screen savers so they all start and stop together and, if screen locking is enabled, only one screen requires a password to unlock them all. <br />
<br />
==Installation==<br />
<br />
===Arch Linux===<br />
You can [[pacman|install]] the {{pkg|synergy}} package from the [[Official Repositories|official repositories]].<br />
<br />
===Windows and Mac OS X===<br />
Download and run [http://synergy-foss.org/download the newest installer] from the official website.<br />
<br />
{{Tip|You can also try the BETA versions of Synergy.}}<br />
<br />
*Read [http://synergy-foss.org/pm/projects/synergy/wiki/Compiling the official compiling help].<br />
<br />
==Pre-configuration==<br />
First determine the IP addresses and [[Configuring_Network#Set_the_host_name|host names]] for each machine and make sure each has a correct hosts file.<br />
<br />
* Arch Linux - {{ic|/etc/hosts}}<br />
* Windows - {{ic|C:\WINDOWS\system32\drivers\etc\hosts}}<br />
* Mac OS X - [http://support.apple.com/kb/TA27291?viewlocale=en_US How to Add Hosts to Local Hosts File].<br />
<br />
{{hc|/etc/hosts|<br />
10.10.66.1 archserver.localdomain archserver<br />
10.10.66.100 archleft.localdomain archleft<br />
10.10.66.105 archright.localdomain archright}}<br />
<br />
{{Note|Check that the clients can reach the server.}}<br />
<br />
==Server configuration==<br />
In synergy, the computer with keyboard and mouse you want to share is called server.<br />
See [http://synergy2.sourceforge.net/configuration.html Synergy Configuration File Format] for a detailed description of all available sections and options.<br />
<br />
===Arch Linux===<br />
<br />
The configuration file for Arch Linux is {{ic|/etc/synergy.conf}}. If it does not exist, create it using {{ic|/etc/synergy.conf.example}}, whose comments should give you enough information for a basic configuration; if you need further reference, read the guide mentioned above.<br />
{{Tip|1=You may also use either {{Pkg|qsynergy}} from the [[official repositories]] or {{AUR|quicksynergy}} from the [[AUR]] which provide a GUI to simplify the configuration process.}}<br />
{{Tip|1=Need to open tcp port 24800}}<br />
<br />
If you experience problems and you wish to run the server in the foreground, you can run the following command instead:<br />
# synergys -f<br />
<br />
The synergy server process needs to attach to your user's X session, which means it needs to run as your user otherwise you will see errors like this in your logs:<br />
<br />
Synergy 1.4.12: 2013-06-18T18:45:45 DEBUG: XOpenDisplay(":0.0")<br />
Synergy 1.4.12: 2013-06-18T18:45:45 WARNING: primary screen unavailable: unable to open screen<br />
Synergy 1.4.12: 2013-06-18T18:45:45 DEBUG: retry in 60 seconds<br />
<br />
To get around this, you can create a custom systemd service file to start the daemon as your user. Create the file '''/etc/systemd/system/synergys@.service'''<br />
<br />
[Unit]<br />
Description=Synergy Server Daemon<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
ExecStart=/usr/bin/synergys --config /etc/synergy.conf<br />
User=%i<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
Then enable it as the appropriate user (replacing 'mary' with your username):<br />
<br />
# systemctl enable synergys@mary<br />
# systemctl start synergys@mary<br />
<br />
===Windows===<br />
<br />
# Open the Synergy program<br />
# Select the option ''Server (share this computer's mouse and keyboard)''<br />
# Select ''Configure interactively''<br />
# Click the ''Configure Server...'' button<br />
# This opens a window in which you can add screens depending on how many computers/screens you have: just drag the screen icon in the top-right corner to the screens area, and double-click it to edit its settings<br />
# Click ''OK'' to close the screens window when you are ready, then click on ''Start'' to start the server<br />
<br />
On Windows, configuration is saved by default in a {{ic|synergy.sgc}} file, but its name and location can of course be changed at pleasure.<br />
<br />
If you want to start the Synergy server everytime Windows starts, you have to launch the program '''as administrator''', then go to ''Edit -> Services'' and select ''Install'' in the ''Server'' section; note that at the following reboot Synergy will indeed automatically start, but the tray icon will not display automatically (at least for version 1.4.2 beta on Windows 7). To uninstall the service, do the same thing but obviously select ''Uninstall''.<br />
<br />
If you want to start the server from the command-line, here is a Windows command you can place in a {{ic|.bat}} file or just run from {{ic|cmd.exe}}:<br />
<br />
{{bc|C:\Program Files\Synergy+\bin\synergys.exe -f --debug ERROR --name left --log c:\windows\synergy.log -c C:/windows/synergy.sgc --address 10.66.66.2:24800}}<br />
<br />
===Mac OS X===<br />
<br />
Mac OS X has a similar configuration as Unix: check [http://synergy-foss.org/docs the official documentation] for more information.<br />
<br />
===Configuration examples===<br />
<br />
This is an example for a basic 3-computers setup:<br />
<br />
{{hc|/etc/synergy.conf|<nowiki><br />
section: screens<br />
server-fire:<br />
archright-fire:<br />
archleft-fire:<br />
end<br />
<br />
section: links<br />
archleft-fire:<br />
right = server-fire<br />
server-fire:<br />
right = archright-fire<br />
left = archleft-fire<br />
archright-fire:<br />
left = server-fire<br />
end<br />
</nowiki>}}<br />
<br />
This should be the example bundled with the Arch Linux package:<br />
<br />
{{hc|/etc/synergy.conf|2=<br />
section: screens<br />
# three hosts named: moe, larry, and curly<br />
moe:<br />
larry:<br />
curly:<br />
end<br />
<br />
section: links<br />
# larry is to the right of moe and curly is above moe<br />
moe:<br />
right = larry<br />
up = curly<br />
<br />
# moe is to the left of larry and curly is above larry.<br />
# note that curly is above both moe and larry and moe<br />
# and larry have a symmetric connection (they're in<br />
# opposite directions of each other).<br />
larry:<br />
left = moe<br />
up = curly<br />
<br />
# larry is below curly. if you move up from moe and then<br />
# down, you'll end up on larry.<br />
curly:<br />
down = larry<br />
end<br />
<br />
section: aliases<br />
# curly is also known as shemp<br />
curly:<br />
shemp<br />
end<br />
<br />
}}<br />
<br />
The following is a more customized example:<br />
<br />
{{hc|synergy.sgc|2=<br />
section: screens<br />
leftpc:<br />
halfDuplexCapsLock = false<br />
halfDuplexNumLock = false<br />
halfDuplexScrollLock = false<br />
xtestIsXineramaUnaware = false<br />
switchCorners = none +top-left +top-right +bottom-left +bottom-right <br />
switchCornerSize = 0<br />
rightpc:<br />
halfDuplexCapsLock = false<br />
halfDuplexNumLock = false<br />
halfDuplexScrollLock = false<br />
xtestIsXineramaUnaware = false<br />
switchCorners = none +top-left +top-right +bottom-left +bottom-right <br />
switchCornerSize = 0<br />
end<br />
<br />
section: aliases<br />
leftpc:<br />
10.66.66.2<br />
rightpc:<br />
10.66.66.1<br />
end<br />
<br />
section: links<br />
leftpc:<br />
right = rightpc<br />
rightpc:<br />
left = leftpc<br />
end<br />
<br />
section: options<br />
heartbeat = 1000<br />
relativeMouseMoves = false<br />
screenSaverSync = false<br />
win32KeepForeground = false<br />
switchCorners = none +top-left +top-right +bottom-left +bottom-right <br />
switchCornerSize = 4<br />
end<br />
}}<br />
<br />
==Clients configuration==<br />
<br />
{{Note|This assumes a server has been set up and configured '''properly'''. Make sure the server is already configured to accept the client(s) before continuing.}}<br />
<br />
===Arch Linux===<br />
In a console window, type:<br />
$ synergyc server-host-name<br />
<br />
Or, to run synergy in the foreground:<br />
$ synergyc -f server-host-name<br />
<br />
Here, {{ic|server-host-name}} is the host name of the server.<br />
<br />
====Use Encryption====<br />
To use the encryption feature type:<br />
$ synergyc --crypto-pass <pass> <server-host-name><br />
<pass> is not the choosen passphrase of the server!<br />
It can be found in the servers log in DEBUG2 mode.<br />
<br />
====Autostart====<br />
<br />
There exist several ways to automatically start the Synergy client, and they are actually the same that can be used for every other application.<br />
<br />
{{Note|In all of the following examples, you always have to substitute {{ic|server-host-name}} with the real server host name.}}<br />
<br />
* You can add the next line to your [[xinitrc|{{ic|~/.xinitrc}}]]:<br />
<br />
{{hc|~/.xinitrc|<br />
...<br />
<br />
#replace server-host-name with the real name<br />
synergyc server-host-name<br />
}}<br />
<br />
The following is an alternative:<br />
<br />
{{hc|~/.xinitrc|<br />
<nowiki>XINIT_CMD='/usr/bin/synergyc -d FATAL -n galileo-fire 10.66.66.2:24800'<br />
/usr/bin/pgrep -lxf "$XINIT_CMD" || ( ( $XINIT_CMD ) & )</nowiki><br />
}}<br />
<br />
* Otherwise, if you are using a [[Display Manager|display manager]] (kdm, gdm, [[SLiM]], ...), or a stand-alone [[Window Manager|window manager]] (Openbox, ...), you could exploit its start-up script and add the following:<br />
synergyc server-host-name<br />
<br />
For example, using ''kdm'' you should edit {{ic|/usr/share/config/kdm/Xsetup}}.<br />
<br />
* To start the Synergy client with systemd, create a service file, '''/etc/systemd/system/synergyc@.service''' and optionally a config file, '''/etc/conf.d/synergyc.conf'''<br />
<br />
{{hc| /etc/systemd/system/synergyc@.service|2=<br />
[Unit]<br />
Description=Synergy Client Daemon<br />
After=network.target<br />
<br />
[Service]<br />
EnvironmentFile=/etc/conf.d/synergyc.conf<br />
ExecStart=/usr/bin/synergyc --no-daemon --debug ${DEBUGLEVEL:-INFO} ${SERVERALIAS}<br />
User=%i<br />
<br />
[Install]<br />
WantedBy=multi-user.target}}<br />
<br />
{{hc|/etc/conf.d/synergyc.conf|2=<br />
DEBUGLEVEL=WARNING<br />
SERVERALIAS=server-name}}<br />
<br />
To start the service for your user,<br />
<br />
# systemctl start synergyc@mary<br />
<br />
Automatically starting Synergy is also documented in its [http://synergy2.sourceforge.net/autostart.html official reference page].<br />
<br />
===Windows===<br />
<br />
After installation, open the Synergy program, select the option ''Client (use another computer's keyboard and mouse)'' and type the host name of the server computer in the text box, then click ''Start'' to start the client.<br />
{{Note|You can use the tray icon to stop the client.}}<br />
<br />
If you want to start the Synergy client every time Windows starts, you have to launch the program '''as an administrator''', then go to ''Edit -> Services'' and select ''Install'' in the ''Client'' section.<br />
<br />
If you want to start the client from the command-line, here is a Windows command you can place in a {{ic|.bat}} file or just run from {{ic|cmd.exe}}. This points to a configuration file in {{ic|C:\synergy.sgc}} and runs in the background like a service.<br />
<br />
{{bc|<nowiki>START /MIN /D"C:\Program Files\Synergy+\bin" synergys.exe -d ERROR -n m6300 -c C:\synergy.sgc -a 10.66.66.2:24800</nowiki>}}<br />
<br />
===Mac OS X===<br />
<br />
Locate the synergyc program in the synergyc folder and drag it onto the terminal window: the full path will appear in the terminal.<br />
Now append the host name of the server, so that the complete command will look like this:<br />
<br />
{{bc|/path/to/synergyc/synergyc server-host-name}}<br />
<br />
Then press {{ic|Enter}}.<br />
<br />
==Known Issues==<br />
If Arch is being used as a client in a Synergy installation, the server may not be able to wake the client monitor. There are some workarounds, such as executing the following via [[Secure Shell|SSH]], if ACPI is enabled (see: [[Display_Power_Management_Signaling#Modifing_DPMS_and_screensaver_settings_using_xset|Modifying DPMS and ScreenSaver settings with xset]]):<br />
{{bc|# xset dpms force on}}<br />
<br />
==Troubleshooting==<br />
The official documentation has a [http://synergy-foss.org/pm/projects/synergy/wiki/UserFAQ FAQ] and also a [http://synergy2.sourceforge.net/trouble.html troubleshooting page].<br />
<br />
===Keyboard repeat===<br />
If you experience problems with your keyboard repeat on the client machine (Linux host), simply type:<br />
{{bc|# /usr/bin/xset r on}}<br />
in any console.<br />
<br />
===Keyboard mapping===<br />
If you experience problems with the keyboard mapping when using the server's keyboard in a client window (e.g a terminal) then re-setting the X key map after starting synergyc may help. The following command sets the keymap to its current value:<br />
<br />
# setxkbmap $(setxkbmap -query | grep "^layout:" | awk -F ": *" '{print $2}')<br />
<br />
===messages.log being spammed with by synergyc===<br />
If you run ''synergyc'' as described above then your {{ic|/var/log/messages.log}} file will get spammed with messages like these:<br />
<br />
May 26 22:30:46 localhost Synergy 1.4.6: 2012-05-26T22:30:46 INFO: entering screen<br />
/build/src/synergy-1.4.6-Source/src/lib/synergy/CScreen.cpp,103<br />
May 26 22:30:47 localhost Synergy 1.4.6: 2012-05-26T22:30:47 INFO: leaving screen<br />
/build/src/synergy-1.4.6-Source/src/lib/synergy/CScreen.cpp,121<br />
<br />
To prevent this run ''synergyc'' with the {{ic|-d WARNING}} option. This ''debug level'' option tells synergy to only log messages if they are level ''WARNING'' or above.<br />
<br />
synergyc -d WARNING server-host-name<br />
<br />
You can also edit the line that calls ''synergyc'' if you use a {{ic|/etc/rc.d/synergyc}} file.<br />
<br />
[ -z "$PID" ] && /usr/bin/synergyc -d WARNING "$SERVERALIAS"<br />
<br />
==External Links==<br />
* Synergy website: http://synergy-foss.org<br />
* Official documentation: http://synergy-foss.org/docs</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=GNU_Screen_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)&diff=301054GNU Screen (Русский)2014-02-24T03:55:34Z<p>Mistofvongola: /* См. также */ Update link</p>
<hr />
<div>[[Category:Software (Русский)]]<br />
[[Category:Русский]]<br />
[[en:GNU Screen]]<br />
[[zh-CN:GNU Screen]]<br />
[http://www.gnu.org/s/screen/ GNU Screen] - обертка, которая позволяет отделить консольную программу от терминала. Например, screen позволяется пользователям запустить консольную программу в одном из терминальных эмуляторов под X, закрыть его и продолжить работу с программой в другом терминале. В данной статье приведены различные советы и рекомендации по использованию screen.<br />
<br />
Если вы ищете пошаговое руководство, то его можно найти на gentoo wiki: http://en.gentoo-wiki.com/wiki/Screen<br />
<br />
== Установка ==<br />
<br />
GNU Screen можно установить из репозитория extra:<br />
<br />
# pacman -S screen<br />
<br />
== Основы ==<br />
Команды вводятся после нажатия Ctrl+A. Данная комбинация настраивается опцией ''escape'' в ~/.screenrc. Пример:<br />
<pre><br />
escape ``<br />
</pre><br />
устанавливает escape-команду на клавишу `<br />
<br />
=== Стандартные команды ===<br />
* {{ic|ctrl+a}} {{ic|?}} Отображает список команд и их параметры по умолчанию<br />
* {{ic|ctrl+a}} {{ic|:}} Ввод команды для screen<br />
* {{ic|ctrl+a}} {{ic|"}} Список окон<br />
* {{ic|ctrl+a}} {{ic|0}} Открыть окно 0<br />
* {{ic|ctrl+a}} {{ic|A}} Переименовать текущее окно<br />
* {{ic|ctrl+a}} {{ic|a}} Отправить {{ic|ctrl+a}} в текущее окно<br />
* {{ic|ctrl+a}} {{ic|c}} Создать новое окно<br />
* {{ic|ctrl+a}} {{ic|S}} Разделить текущее окно на два региона<br />
* {{ic|ctrl+a}} {{ic|tab}} Переключить фокус ввода на следующий регион<br />
* {{ic|ctrl+a}} {{ic|ctrl+a}} Переключение между текущим и предыдущим регионами<br />
* {{ic|ctrl+a}} {{ic|Esc}} Перейти в режим копирования (используйте enter для выделения текста)<br />
* {{ic|ctrl+a}} {{ic|]}} Вставка текста<br />
* {{ic|ctrl+a}} {{ic|Q}} Закрыть все регионы кроме текущего<br />
* {{ic|ctrl+a}} {{ic|X}} Закрыть текущий регион<br />
* {{ic|ctrl+a}} {{ic|d}} Отключиться от текущей сессии screen, оставив ее работающей. Для переподключения используйте {{ic|screen -r}}<br />
<br />
== Запуск в окне 1 ==<br />
По умолчанию, первое окно screen имеет номер 0. Возможно, вы предпочтете начать с нумерацию с единицы, добавьте это в ~/.screenrc:<br />
<pre><br />
bind c screen 1<br />
bind ^c screen 1<br />
bind 0 select 10 <br />
screen 1<br />
</pre><br />
<br />
== Вложенные сессии screen ==<br />
It's possible to get stuck in a nested screen session. A common scenario: you start an ssh session from within a screen session. Within the ssh session, you start screen. By default, the outer screen session that was launched first responds to C-a commands. To send a command to the inner screen session, use C-a a, followed by your command. For example:<br />
<br />
C-a a d<br />
:Detaches the inner screen session.<br />
C-a a K<br />
:Kills the inner screen session.<br />
<br />
== Исправление проблемы с остатками текста ==<br />
When you open a text editor like nano in screen and then close it, the text may stay visible in your terminal. To fix this, put the following in your ~/.screenrc:<br />
<pre><br />
altscreen on<br />
</pre><br />
<br />
== Используем 256 цветов ==<br />
By default, screen uses an 8-color terminal emulator. Use the following line to enable more colors, which is useful if you are using a more-capable terminal emulator:<br />
<pre><br />
term screen-256color<br />
</pre><br />
<br />
If this fails to render 256 colors in [[xterm]], try the following instead:<br />
<pre><br />
attrcolor b ".I" # allow bold colors - necessary for some reason<br />
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' # tell screen how to set colors. AB = background, AF=foreground<br />
defbce on # use current bg color for erased chars<br />
</pre><br />
<br />
== Используем 256 цветов в Rxvt-Unicode (urxvt) ==<br />
If you are using {{ic|rxvt-unicode-256color}} from {{ic|[community]}}, you may need to add this line in your {{ic|~/.screenrc}} to enable 256 colors while in screen.<br />
terminfo rxvt-unicode 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'<br />
<br />
== Информационный статус-бар ==<br />
The default statusbar may be a little lacking. You may find this one more helpful:<br />
<pre><br />
hardstatus off<br />
hardstatus alwayslastline<br />
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d<br />
%{W} %c %{g}]'<br />
</pre><br />
<br />
== Отключаем приветственное сообщение == <br />
Add to ~/.screenrc:<br />
<pre><br />
startup_message off<br />
</pre><br />
<br />
== Превращаем строку хард-статуса в динамический заголовок окна urxvt|xterm|aterm ==<br />
This one's pretty simple; just switch your current hardstatus line into a caption line with notification, and edit accordingly:<br />
<br />
<pre><br />
backtick 1 5 5 true<br />
termcapinfo rxvt* 'hs:ts=\E]2;:fs=\007:ds=\E]2;\007'<br />
hardstatus string "screen (%n: %t)"<br />
caption string "%{= kw}%Y-%m-%d;%c %{= kw}%-Lw%{= kG}%{+b}[%n %t]%{-b}%{= kw}%+Lw%1`"<br />
caption always<br />
</pre><br />
<br />
This will give you something like "screen (0 bash)" in the title of your terminal emulator. The caption supplies the date, current time, and colorizes your screen window collection.<br />
<br />
==Используем механизм прокрутки X==<br />
The scroll buffer of GNU Screen can be accessed with C-a. However, this is very inconvenient. To use the scroll bar of e.g. xterm or konsole, add the following line to ~/.screenrc<br />
termcapinfo xterm* ti@:te@<br />
<br />
==Добавляем пункт в GRUB для загрузки в Screen==<br />
If you mostly use X but occasionally want to run a Screen-as-window-manager session, here's one way to do it by adding a GRUB entry for Screen on a virtual console (text terminal). <br />
<br />
GRUB allows you to designate what runlevel you want so we'll use runlevel 4 for this purpose. Clone an appropriate GRUB entry and add a '4' to the kernel boot parameters list, like so:<br />
<br />
<pre><br />
# (0) Arch Linux<br />
title Arch Linux Screen<br />
root (hd0,2)<br />
kernel /boot/vmlinuz26 root=/dev/disk/your_disk ro acpi_no_auto_ssdt irqpoll 4<br />
initrd /boot/kernel26.img<br />
</pre><br />
<br />
Add some entries to /etc/inittab to indicate what should happen on runlevel 4, substituting your user name for <user>:<br />
<pre><br />
# gnu screen on rl4<br />
scr2:4:respawn:/sbin/mingetty --autologin <user> tty1 linux<br />
</pre><br />
The line uses mingetty to [[automatically login some user to a virtual console on startup]]. You will need to install the [https://aur.archlinux.org/packages.php?ID=13793 mingetty package] (AUR). The inittab line segments are separated by colons. The first part (scr*) is simply an id. The second part is the runlevel: This should only happen on runlevel 4 (which isn't used in any default setup - 3 is by default for a tty login and 5 is for X). 'Respawn' causes init to repeat the command (i.e. autologin) if the user logs out. <br />
We'll need to see that nothing else happens on virtual console 1 when we use runlevel 4, so remove '4' from the the first of the agetty lines:<br />
<br />
<pre>c1:235:respawn:/sbin/agetty -8 38400 vc/1 linux</pre><br />
<br />
Once logged in we want to ensure that screen is started. Add the following to the end of your .bash_profile:<br />
<pre><br />
vico="$(tty | grep -oE ....$)"<br />
case "$vico" in<br />
tty1) TERM=screen; exec /usr/bin/screen -R arch;;<br />
esac<br />
<br />
</pre><br />
This checks for the current runlevel and will launch a screen session immediately after the autologin if the runlevel is 4.<br />
<br />
This can also be adapted to run screen on a virtual console next to X, simply checking for the current tty instead of the current runlevel. This check to see if we're on virtual console 3:<br />
<pre><br />
vico="$(tty | grep -oE ....$)"<br />
case "$vico" in<br />
vc/3) TERM=screen; exec /usr/bin/screen;;<br />
esac<br />
</pre><br />
Set inittab/mingetty to automaically log in to vc/3 on runlevel 5 and you're set.<br />
<br />
== Исправляем зависание Midnight Commander при запуске в screen ==<br />
In some cases (need deeper inspection) [https://bugzilla.redhat.com/show_bug.cgi?id=168076 old gpm bug] gets alive. So, then you try to run mc inside screen, you get a frozen screen's window. Try to kill gpm daemon before starting mc and/or disable it in ''/etc/rc.conf''.<br />
<br />
== См. также ==<br />
* [http://www.macosxhints.com/article.php?story=20021114055617124 MacOSX Hints - Automatically using screen in your shell]<br />
* [http://wiki.gentoo.org/wiki/Screen Gentoo Wiki - Tutorial for screen]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=50647 Arch Forums - Regarding 256 color issue with urxvt]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=55618 Arch Forums - .screenrc configs with screenshots]<br />
* [[tmux]], еще один консольный мультиплексор</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=GNU_Screen_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=301053GNU Screen (简体中文)2014-02-24T03:55:10Z<p>Mistofvongola: /* See Also */ Fix Gentoo wiki link</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:Software (简体中文)]]<br />
[[en:GNU Screen]]<br />
[[ru:GNU Screen]]<br />
[http://www.gnu.org/s/screen/ GNU Screen] 是一个封装器,允许命令行程序和启动它的shell相分离。例如,可以在X下的终端中启动一个程序,关闭X,而继续使用此程序。以下有技巧和提示。<br />
<br />
如果想看教程,Gentoo的维基有一个很好的教程:http://en.gentoo-wiki.com/wiki/Screen<br />
<br />
== 安装 ==<br />
<br />
可以用[[Official Repositories (简体中文)|官方软件仓库]]中的 {{pkg|screen}} 包来[[pacman (简体中文)|安装]] GNU Screen.<br />
<br />
== 基础 == <br />
可以通过 {{ic|Ctrl+a}} 和其他键来输入命令。通过 {{ic|~/.screenrc}} 中的''escape''选项来改变 escape 键。例如:<br />
escape ``<br />
<br />
将 escape 键设为 {{ic|`}}。<br />
<br />
=== 常见命令 ===<br />
C-a ?<br />
:列出命令和默认按键(非常重要)<br />
C-a "<br />
:窗口列表<br />
C-a 0<br />
:打开窗口 0<br />
C-a A<br />
:重命名当前窗口<br />
C-a c<br />
:创建新窗口<br />
C-a S<br />
:将当前区域划分为两个区域<br />
C-a <TAB><br />
:将输入焦点转至下一区域<br />
C-a C-a<br />
:在当前区域和之前区域间转换<br />
C-a <ESC> <br />
:进入复制模式(用 {{ic|enter}} 键来选择一段文本)<br />
C-a ]<br />
:粘贴文本<br />
C-a Q<br />
:关闭除当前区域外所有区域<br />
C-a d<br />
:从当前 screen 会话断开,并保持其运行。用 {{ic|screen -r}} 来恢复。<br />
<br />
== 从窗口 1 开始 ==<br />
默认的第一个窗口是 0 号。如果不想要窗口 0,而是从 1 号开始,将以下内容写入 {{ic|~/.screenrc}}:<br />
bind c screen 1<br />
bind ^c screen 1<br />
bind 0 select 10 <br />
screen 1<br />
<br />
== 嵌套的 Screen 会话 ==<br />
在一个嵌套的 screen 会话中卡住是非常容易的。一个常见的情况是:你从一个 screen 会话内启动了一个 ssh 会话,在这个 ssh 会话中,你又启动了 screen。默认地,响应 C-a 命令的是最先启动的外层screen。如果要向内层 screen 输入命令,用 C-a a 加上你的命令。例如:<br />
C-a a d<br />
:断开内层 screen 会话<br />
C-a a K<br />
:杀死内层 screen 会话<br />
<br />
== 消除残余的编辑文本 ==<br />
当你在 screen 内打开文本编辑器再关掉它,文本内容仍然会在终端上显示。要解决这点,将下列内容加入 {{ic|~/.screenrc}} 中:<br />
altscreen on<br />
<br />
== 使用 256 色 ==<br />
默认地,screen 使用 8 色终端模拟器。如果你用的是支持 256 色的终端,可以通过如下命令来支持更多的色彩:<br />
term screen-256color<br />
<br />
如果在 [[xterm]] 中仍不能显示 256 色,试试下面的命令:<br />
attrcolor b ".I" # 允许加粗色彩--由于某些原因是必须的<br />
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' # 告诉screen如何设置颜色。AB 指背景,AF 指前景<br />
defbce on # 使用当前背景色来显示删除的字符<br />
<br />
== 在 Rxvt-Unicode (urxvt) 中使用 256 色 ==<br />
如果你用的是[[Official Repositories (简体中文)|官方软件仓库]]中的 {{pkg|rxvt-unicode}},你可以将下面这行加入你的 {{ic|~/.screenrc}} 来启用256色:<br />
terminfo rxvt-unicode 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'<br />
<br />
== 信息状态栏 ==<br />
默认的信息状态栏可能会有些简单。你可以使它变得更有用:<br />
hardstatus off<br />
hardstatus alwayslastline<br />
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W} %c %{g}]'<br />
<br />
== 关闭欢迎信息 == <br />
将下面这行加入到 {{ic|~/.screenrc}}:<br />
startup_message off<br />
<br />
== 让标题栏动态显示 urxvt|xterm|aterm 窗口名称 ==<br />
这非常简单,只是将你当前的 {{ic|hardstatus}} 栏变成 {{ic|caption}} 栏,并编辑对应项:<br />
backtick 1 5 5 true<br />
termcapinfo rxvt* 'hs:ts=\E]2;:fs=\007:ds=\E]2;\007'<br />
hardstatus string "screen (%n: %t)"<br />
caption string "%{= kw}%Y-%m-%d;%c %{= kw}%-Lw%{= kG}%{+b}[%n %t]%{-b}%{= kw}%+Lw%1`"<br />
caption always<br />
<br />
这会在你的终端模拟器标题栏显示 "screen (0 bash)" 之类的内容。标题栏提供日期、当前时间,并给 screen 窗口加上颜色。<br />
<br />
== 使用 X 滚动机制 ==<br />
滚动缓存可以用 C-a [ 来查看。但是这很不方便。要使用滚动条,如 xterm 或 konsole,将下面这行加入 {{ic|~/.screenrc}}:<br />
termcapinfo xterm* ti@:te@<br />
<br />
== 添加 GRUB 条目来启动进入 Screen ==<br />
如果你主要使用 [[Xorg|X]],但偶尔将Screen作为窗口管理器运行,这里有种通过为 Screen 添加 [[GRUB]] 条目的方法。<br />
<br />
GRUB 允许你指明想要的运行级别,因此在这里我们使用运行级别 4。复制一条合适的 GRUB 条目,并给内核选项表添加 {{ic|4}},像这样:<br />
<br />
# (0) Arch Linux<br />
title Arch Linux Screen<br />
root (hd0,2)<br />
kernel /vmlinuz-linux root=/dev/disk/your_disk ro acpi_no_auto_ssdt irqpoll 4<br />
initrd /initramfs-linux.img<br />
<br />
给 {{ic|/etc/inittab}} 添加一些条目来指明哪些将在运行级别 4 下进行,将 <user> 换为你的用户名:<br />
# GNU Screen on runlevel 4<br />
scr2:4:respawn:/sbin/mingetty --autologin <user> tty1 linux<br />
<br />
上面这行使用 mingetty 来[[Automatic login to virtual console|启动时自动登陆]]。你需要安装[Official Repositories (简体中文)|官方软件仓库]]中的 ({{pkg|mingetty}}。inittab 的行分隔符是冒号。第一部分(scr*)仅仅是一个id。第二部分是运行级别:只在运行级别 4 下进行(默认地 4 没有被使用--3 是默认的字符界面登陆,5 是 X 登陆)。'Respawn' 让 init 重复这条命令(即自动登陆),如果用户注销。<br />
当我们使用运行级别 4 时,我们需要没有其他任何程序在虚拟终端 1 下运行。所以将 {{ic|4}}从 agetty 的第一行移去: <br />
<br />
c1:235:respawn:/sbin/agetty -8 38400 vc/1 linux<br />
<br />
一旦我们登陆,我们想要保证 screen 已经启动。将下列内容添加到你的{{ic|~/.bash_profile}}:<br />
vico="$(tty | grep -oE ....$)"<br />
case "$vico" in<br />
tty1) TERM=screen; exec /usr/bin/screen -R arch;;<br />
esac<br />
<br />
这会检查当前运行级别,如果是 4 就在自动登陆后立即启动一个 screen 会话。<br />
<br />
也可以改成 X 之后在一个虚拟终端里运行 screen,只需检查当前的 tty 而不是运行级别即可。下面是检查我们是否在虚拟终端 3 上:<br />
vico="$(tty | grep -oE ....$)"<br />
case "$vico" in<br />
vc/3) TERM=screen; exec /usr/bin/screen;;<br />
esac<br />
<br />
将 inittab/mingetty 设为在运行级别 5 下自动登陆到 vc/3 即可。<br />
<br />
== 修正启动 screen 时 Midnight Commander 无反应的问题 ==<br />
这个问题在某些情况下(需要进一步检查)[https://bugzilla.redhat.com/show_bug.cgi?id=168076 old gpm bug] 会出现。所以在 screen 内运行 mc,会得到无反应的 screen 窗口。尝试在运行 mc 之前杀死 gpm 守护进程,或是在 {{ic|/etc/[[rc.conf]]}} 中禁止 gpm。<br />
In some cases (need deeper inspection) [https://bugzilla.redhat.com/show_bug.cgi?id=168076 old gpm bug] gets alive. So, then you try to run mc inside screen, you get a frozen screen window. Try to kill gpm daemon before starting mc and/or disable it in {{ic|/etc/[[rc.conf]]}}.<br />
<br />
== See Also ==<br />
* [http://www.macosxhints.com/article.php?story=20021114055617124 MacOSX Hints - Automatically using screen in your shell]<br />
* [http://wiki.gentoo.org/wiki/Screen Gentoo Wiki - Tutorial for screen]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=50647 Arch Forums - Regarding 256 color issue with urxvt]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=55618 Arch Forums - .screenrc configs with screenshots]<br />
* [[tmux]], another multiplexer</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=GNU_Screen_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)&diff=301052GNU Screen (Русский)2014-02-24T03:54:27Z<p>Mistofvongola: /* См. также */ Fix Gentoo wiki link</p>
<hr />
<div>[[Category:Software (Русский)]]<br />
[[Category:Русский]]<br />
[[en:GNU Screen]]<br />
[[zh-CN:GNU Screen]]<br />
[http://www.gnu.org/s/screen/ GNU Screen] - обертка, которая позволяет отделить консольную программу от терминала. Например, screen позволяется пользователям запустить консольную программу в одном из терминальных эмуляторов под X, закрыть его и продолжить работу с программой в другом терминале. В данной статье приведены различные советы и рекомендации по использованию screen.<br />
<br />
Если вы ищете пошаговое руководство, то его можно найти на gentoo wiki: http://en.gentoo-wiki.com/wiki/Screen<br />
<br />
== Установка ==<br />
<br />
GNU Screen можно установить из репозитория extra:<br />
<br />
# pacman -S screen<br />
<br />
== Основы ==<br />
Команды вводятся после нажатия Ctrl+A. Данная комбинация настраивается опцией ''escape'' в ~/.screenrc. Пример:<br />
<pre><br />
escape ``<br />
</pre><br />
устанавливает escape-команду на клавишу `<br />
<br />
=== Стандартные команды ===<br />
* {{ic|ctrl+a}} {{ic|?}} Отображает список команд и их параметры по умолчанию<br />
* {{ic|ctrl+a}} {{ic|:}} Ввод команды для screen<br />
* {{ic|ctrl+a}} {{ic|"}} Список окон<br />
* {{ic|ctrl+a}} {{ic|0}} Открыть окно 0<br />
* {{ic|ctrl+a}} {{ic|A}} Переименовать текущее окно<br />
* {{ic|ctrl+a}} {{ic|a}} Отправить {{ic|ctrl+a}} в текущее окно<br />
* {{ic|ctrl+a}} {{ic|c}} Создать новое окно<br />
* {{ic|ctrl+a}} {{ic|S}} Разделить текущее окно на два региона<br />
* {{ic|ctrl+a}} {{ic|tab}} Переключить фокус ввода на следующий регион<br />
* {{ic|ctrl+a}} {{ic|ctrl+a}} Переключение между текущим и предыдущим регионами<br />
* {{ic|ctrl+a}} {{ic|Esc}} Перейти в режим копирования (используйте enter для выделения текста)<br />
* {{ic|ctrl+a}} {{ic|]}} Вставка текста<br />
* {{ic|ctrl+a}} {{ic|Q}} Закрыть все регионы кроме текущего<br />
* {{ic|ctrl+a}} {{ic|X}} Закрыть текущий регион<br />
* {{ic|ctrl+a}} {{ic|d}} Отключиться от текущей сессии screen, оставив ее работающей. Для переподключения используйте {{ic|screen -r}}<br />
<br />
== Запуск в окне 1 ==<br />
По умолчанию, первое окно screen имеет номер 0. Возможно, вы предпочтете начать с нумерацию с единицы, добавьте это в ~/.screenrc:<br />
<pre><br />
bind c screen 1<br />
bind ^c screen 1<br />
bind 0 select 10 <br />
screen 1<br />
</pre><br />
<br />
== Вложенные сессии screen ==<br />
It's possible to get stuck in a nested screen session. A common scenario: you start an ssh session from within a screen session. Within the ssh session, you start screen. By default, the outer screen session that was launched first responds to C-a commands. To send a command to the inner screen session, use C-a a, followed by your command. For example:<br />
<br />
C-a a d<br />
:Detaches the inner screen session.<br />
C-a a K<br />
:Kills the inner screen session.<br />
<br />
== Исправление проблемы с остатками текста ==<br />
When you open a text editor like nano in screen and then close it, the text may stay visible in your terminal. To fix this, put the following in your ~/.screenrc:<br />
<pre><br />
altscreen on<br />
</pre><br />
<br />
== Используем 256 цветов ==<br />
By default, screen uses an 8-color terminal emulator. Use the following line to enable more colors, which is useful if you are using a more-capable terminal emulator:<br />
<pre><br />
term screen-256color<br />
</pre><br />
<br />
If this fails to render 256 colors in [[xterm]], try the following instead:<br />
<pre><br />
attrcolor b ".I" # allow bold colors - necessary for some reason<br />
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' # tell screen how to set colors. AB = background, AF=foreground<br />
defbce on # use current bg color for erased chars<br />
</pre><br />
<br />
== Используем 256 цветов в Rxvt-Unicode (urxvt) ==<br />
If you are using {{ic|rxvt-unicode-256color}} from {{ic|[community]}}, you may need to add this line in your {{ic|~/.screenrc}} to enable 256 colors while in screen.<br />
terminfo rxvt-unicode 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'<br />
<br />
== Информационный статус-бар ==<br />
The default statusbar may be a little lacking. You may find this one more helpful:<br />
<pre><br />
hardstatus off<br />
hardstatus alwayslastline<br />
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d<br />
%{W} %c %{g}]'<br />
</pre><br />
<br />
== Отключаем приветственное сообщение == <br />
Add to ~/.screenrc:<br />
<pre><br />
startup_message off<br />
</pre><br />
<br />
== Превращаем строку хард-статуса в динамический заголовок окна urxvt|xterm|aterm ==<br />
This one's pretty simple; just switch your current hardstatus line into a caption line with notification, and edit accordingly:<br />
<br />
<pre><br />
backtick 1 5 5 true<br />
termcapinfo rxvt* 'hs:ts=\E]2;:fs=\007:ds=\E]2;\007'<br />
hardstatus string "screen (%n: %t)"<br />
caption string "%{= kw}%Y-%m-%d;%c %{= kw}%-Lw%{= kG}%{+b}[%n %t]%{-b}%{= kw}%+Lw%1`"<br />
caption always<br />
</pre><br />
<br />
This will give you something like "screen (0 bash)" in the title of your terminal emulator. The caption supplies the date, current time, and colorizes your screen window collection.<br />
<br />
==Используем механизм прокрутки X==<br />
The scroll buffer of GNU Screen can be accessed with C-a. However, this is very inconvenient. To use the scroll bar of e.g. xterm or konsole, add the following line to ~/.screenrc<br />
termcapinfo xterm* ti@:te@<br />
<br />
==Добавляем пункт в GRUB для загрузки в Screen==<br />
If you mostly use X but occasionally want to run a Screen-as-window-manager session, here's one way to do it by adding a GRUB entry for Screen on a virtual console (text terminal). <br />
<br />
GRUB allows you to designate what runlevel you want so we'll use runlevel 4 for this purpose. Clone an appropriate GRUB entry and add a '4' to the kernel boot parameters list, like so:<br />
<br />
<pre><br />
# (0) Arch Linux<br />
title Arch Linux Screen<br />
root (hd0,2)<br />
kernel /boot/vmlinuz26 root=/dev/disk/your_disk ro acpi_no_auto_ssdt irqpoll 4<br />
initrd /boot/kernel26.img<br />
</pre><br />
<br />
Add some entries to /etc/inittab to indicate what should happen on runlevel 4, substituting your user name for <user>:<br />
<pre><br />
# gnu screen on rl4<br />
scr2:4:respawn:/sbin/mingetty --autologin <user> tty1 linux<br />
</pre><br />
The line uses mingetty to [[automatically login some user to a virtual console on startup]]. You will need to install the [https://aur.archlinux.org/packages.php?ID=13793 mingetty package] (AUR). The inittab line segments are separated by colons. The first part (scr*) is simply an id. The second part is the runlevel: This should only happen on runlevel 4 (which isn't used in any default setup - 3 is by default for a tty login and 5 is for X). 'Respawn' causes init to repeat the command (i.e. autologin) if the user logs out. <br />
We'll need to see that nothing else happens on virtual console 1 when we use runlevel 4, so remove '4' from the the first of the agetty lines:<br />
<br />
<pre>c1:235:respawn:/sbin/agetty -8 38400 vc/1 linux</pre><br />
<br />
Once logged in we want to ensure that screen is started. Add the following to the end of your .bash_profile:<br />
<pre><br />
vico="$(tty | grep -oE ....$)"<br />
case "$vico" in<br />
tty1) TERM=screen; exec /usr/bin/screen -R arch;;<br />
esac<br />
<br />
</pre><br />
This checks for the current runlevel and will launch a screen session immediately after the autologin if the runlevel is 4.<br />
<br />
This can also be adapted to run screen on a virtual console next to X, simply checking for the current tty instead of the current runlevel. This check to see if we're on virtual console 3:<br />
<pre><br />
vico="$(tty | grep -oE ....$)"<br />
case "$vico" in<br />
vc/3) TERM=screen; exec /usr/bin/screen;;<br />
esac<br />
</pre><br />
Set inittab/mingetty to automaically log in to vc/3 on runlevel 5 and you're set.<br />
<br />
== Исправляем зависание Midnight Commander при запуске в screen ==<br />
In some cases (need deeper inspection) [https://bugzilla.redhat.com/show_bug.cgi?id=168076 old gpm bug] gets alive. So, then you try to run mc inside screen, you get a frozen screen's window. Try to kill gpm daemon before starting mc and/or disable it in ''/etc/rc.conf''.<br />
<br />
== См. также ==<br />
* [http://www.macosxhints.com/article.php?story=20021114055617124 MacOSX Hints - Automatically using screen in your shell]<br />
* [http://wiki.gentoo.org/wiki/Screen Tutorial for screen]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=50647 Arch Forums - Regarding 256 color issue with urxvt]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=55618 Arch Forums - .screenrc configs with screenshots]<br />
* [[tmux]], еще один консольный мультиплексор</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=GNU_Screen&diff=301051GNU Screen2014-02-24T03:53:01Z<p>Mistofvongola: /* See Also */ Fix Gentoo wiki link</p>
<hr />
<div>[[Category:System administration]]<br />
[[ru:GNU Screen]]<br />
[[zh-CN:GNU Screen]]<br />
[http://www.gnu.org/s/screen/ GNU Screen] is a wrapper that allows separation between the text program and the shell from which it was launched. This allows the user to, for example, start a text program in a terminal in X, kill X, and continue to interact with the program. Here are a couple of tips and tricks you may be interested in.<br />
<br />
== Installation ==<br />
<br />
GNU Screen can be [[pacman|installed]] using the {{pkg|screen}} package found in the [[Official Repositories|official repositories]].<br />
<br />
== Usage == <br />
Commands are entered pressing {{ic|ctrl+a}} and then the key binding.<br />
<br />
=== Common Commands ===<br />
* {{ic|ctrl+a}} {{ic|?}} Displays commands and its defaults (VERY important)<br />
* {{ic|ctrl+a}} {{ic|:}} Enter to the command prompt of screen<br />
* {{ic|ctrl+a}} {{ic|"}} Window list<br />
* {{ic|ctrl+a}} {{ic|0}} opens window 0<br />
* {{ic|ctrl+a}} {{ic|A}} Rename the current window<br />
* {{ic|ctrl+a}} {{ic|a}} Sends {{ic|ctrl+a}} to the current window<br />
* {{ic|ctrl+a}} {{ic|c}} Create a new window (with shell)<br />
* {{ic|ctrl+a}} {{ic|S}} Split current region into two regions<br />
* {{ic|ctrl+a}} {{ic|tab}} Switch the input focus to the next region<br />
* {{ic|ctrl+a}} {{ic|ctrl+a}} Toggle between current and previous region<br />
* {{ic|ctrl+a}} {{ic|Esc}} Enter Copy Mode (use enter to select a range of text)<br />
* {{ic|ctrl+a}} {{ic|]}} Paste text<br />
* {{ic|ctrl+a}} {{ic|Q}} Close all regions but the current one<br />
* {{ic|ctrl+a}} {{ic|X}} Close the current region<br />
* {{ic|ctrl+a}} {{ic|d}} Detach from the current screen session, and leave it running. Use {{ic|screen -r}} to resume<br />
<br />
=== Command Prompt Commands ===<br />
* {{ic|ctrl+a}} {{ic|:quit}} Closes all windows and closes screen session<br />
* {{ic|ctrl+a}} {{ic|:source ~/.screenrc}} Reloads screenrc configuration file (can alternatively use /etc/screenrc)<br />
<br />
=== Named sessions ===<br />
To create a named session, run screen with the following command:<br />
$ screen -S ''session_name''<br />
<br />
To prints a list of ''pid.tty.host'' strings identifying your screen sessions:<br />
$ screen -list<br />
<br />
To attach to a named screen session, run this command:<br />
$ screen -x ''session_name''<br />
<br />
== Tips and tricks ==<br />
=== Change the escape key ===<br />
The escape key can be changed with the {{ic|escape}} option in {{ic|~/.screenrc}}. For example:<br />
{{bc|escape ``}}<br />
<br />
sets the escape key to {{ic|`}}.<br />
<br />
=== Start at window 1 ===<br />
By default, the first screen window is 0. If you'd rather never have a window 0 and start instead with 1, add the following lines on your configuration:<br />
{{hc|~/.screenrc|<br />
bind c screen 1<br />
bind ^c screen 1<br />
bind 0 select 10 <br />
screen 1<br />
}}<br />
=== Nested Screen Sessions ===<br />
It is possible to get stuck in a nested screen session. A common scenario: you start an ssh session from within a screen session. Within the ssh session, you start screen. By default, the outer screen session that was launched first responds to {{ic|ctrl+a}} commands. To send a command to the inner screen session, use {{ic|ctrl+a}} {{ic|a}}, followed by your command. For example:<br />
* {{ic|ctrl+a}} {{ic|a}} {{ic|d}} Detaches the inner screen session.<br />
* {{ic|ctrl+a}} {{ic|a}} {{ic|K}} Kills the inner screen session.<br />
<br />
=== Use 256 colors ===<br />
By default, screen uses an 8-color terminal emulator. Use the following line to enable more colors, which is useful if you are using a more-capable terminal emulator:<br />
{{hc|~/.screenrc|<br />
term screen-256color<br />
}}<br />
<br />
If this fails to render 256 colors in [[xterm]], try the following instead:<br />
{{hc|~/.screenrc|<nowiki><br />
attrcolor b ".I" # allow bold colors - necessary for some reason<br />
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' # tell screen how to set colors. AB = background, AF=foreground<br />
defbce on # use current bg color for erased chars<br />
</nowiki>}}<br />
<br />
=== Use 256 Colors with Rxvt-Unicode (urxvt) ===<br />
If you are using {{pkg|rxvt-unicode}} from the [[Official Repositories|official repositories]], you may need to add this line in your {{ic|~/.screenrc}} to enable 256 colors while in screen.<br />
{{hc|~/.screenrc|<nowiki><br />
terminfo rxvt-unicode 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'<br />
</nowiki>}}<br />
<br />
=== Informative statusbar ===<br />
The default statusbar may be a little lacking. You may find this one more helpful:<br />
{{hc|~/.screenrc|<nowiki><br />
hardstatus off<br />
hardstatus alwayslastline<br />
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W} %c %{g}]'<br />
</nowiki>}}<br />
=== Turn welcome message off ===<br />
{{hc|~/.screenrc|<br />
startup_message off<br />
}}<br />
<br />
=== Turn your hardstatus line into a dynamic urxvt|xterm|aterm window title ===<br />
This one is pretty simple; just switch your current {{ic|hardstatus}} line into a {{ic|caption}} line with notification, and edit accordingly:<br />
{{hc|~/.screenrc|<nowiki><br />
backtick 1 5 5 true<br />
termcapinfo rxvt* 'hs:ts=\E]2;:fs=\007:ds=\E]2;\007'<br />
hardstatus string "screen (%n: %t)"<br />
caption string "%{= kw}%Y-%m-%d;%c %{= kw}%-Lw%{= kG}%{+b}[%n %t]%{-b}%{= kw}%+Lw%1`"<br />
caption always<br />
</nowiki>}}<br />
<br />
This will give you something like {{ic|screen (0 bash)}} in the title of your terminal emulator. The caption supplies the date, current time, and colorizes your screen window collection.<br />
<br />
===Use X scrolling mechanism===<br />
The scroll buffer of GNU Screen can be accessed with {{ic|ctrl+a}} {{ic|[}}. However, this is very inconvenient. To use the scroll bar of e.g. xterm or konsole, add the following line:<br />
{{hc|~/.screenrc|<br />
termcapinfo xterm* ti@:te@<br />
}}<br />
<br />
=== Attach an existing running program to screen ===<br />
If you started a program outside screen, but now you would like it to be inside, you can use '''reptyr''' to reparent the process from it's current tty to one inside screen.<br />
<br />
[[Pacman|Install]] the package {{Pkg|reptyr}} from the [[Official Repositories]]. <br />
<br />
Get the PID of the process (you can use {{ic|ps ax}} for that). Now just enter the PID as argument to reptyr inside a screen window.<br />
{{bc|$ reptyr ''<pid>''}}<br />
<br />
===Add a GRUB entry to boot into Screen===<br />
{{Out of date|[https://www.archlinux.org/news/end-of-initscripts-support/ Initscripts] is deprecated, and the use of runlevels as well. Also, this instructions are for legacy GRUB}}<br />
If you mostly use [[Xorg|X]] but occasionally want to run a Screen-as-window-manager session, here is one way to do it by adding a [[GRUB]] entry for Screen on a virtual console (text terminal). <br />
<br />
GRUB allows you to designate what runlevel you want so we will use runlevel 4 for this purpose. Clone an appropriate GRUB entry and add a {{ic|4}} to the kernel boot parameters list, like so:<br />
{{bc|1=<br />
# (0) Arch Linux<br />
title Arch Linux Screen<br />
root (hd0,2)<br />
kernel /vmlinuz-linux root=/dev/disk/your_disk ro acpi_no_auto_ssdt irqpoll 4<br />
initrd /initramfs-linux.img<br />
}}<br />
<br />
Add some entries to {{ic|/etc/inittab}} to indicate what should happen on runlevel 4, substituting your user name for <user>:<br />
{{bc|# GNU Screen on runlevel 4<br />
scr2:4:respawn:/sbin/mingetty --autologin <user> tty1 linux<br />
}}<br />
<br />
The above line uses {{AUR|mingetty}} to [[automatically login some user to a virtual console on startup]]. The inittab line segments are separated by colons. The first part (scr*) is simply an id. The second part is the runlevel: This should only happen on runlevel 4 (which is not used in any default setup - 3 is by default for a tty login and 5 is for X). 'Respawn' causes init to repeat the command (i.e. autologin) if the user logs out. <br />
We will need to see that nothing else happens on virtual console 1 when we use runlevel 4, so remove {{ic|4}} from the the first of the agetty lines:<br />
<br />
{{bc|c1:235:respawn:/sbin/agetty -8 38400 vc/1 linux}}<br />
<br />
Once we are logged in, we want to ensure that screen is started. Add the following to the end of your {{ic|~/.bash_profile}}:<br />
{{bc|<nowiki><br />
vico="$(tty | grep -oE ....$)"<br />
case "$vico" in<br />
tty1) TERM=screen; exec /usr/bin/screen -R arch;;<br />
esac<br />
</nowiki>}}<br />
This checks for the current runlevel and will launch a screen session immediately after the automatic login if the runlevel is 4.<br />
<br />
This can also be adapted to run screen on a virtual console next to X, simply checking for the current tty instead of the current runlevel. This checks to see if we are on virtual console 3:<br />
{{bc|<nowiki><br />
vico="$(tty | grep -oE ....$)"<br />
case "$vico" in<br />
vc/3) TERM=screen; exec /usr/bin/screen;;<br />
esac<br />
</nowiki>}}<br />
Set inittab/mingetty to automatically log in to vc/3 on runlevel 5 and you are set.<br />
<br />
===Setting a different bash prompt while in screen===<br />
If you want a different bash prompt when in a screen session, add the following to your .bashrc:<br />
{{bc|<nowiki><br />
if [ -z $STY ]<br />
then<br />
PS1="YOUR REGULAR PROMPT"<br />
else <br />
PS1="YOUR SCREEN PROMPT"<br />
fi<br />
</nowiki>}}<br />
[http://serverfault.com/questions/257975/how-to-check-if-im-in-screen-session]<br />
<br />
===Turn off visual bell===<br />
With this setting, screen will not make an ugly screen flash instead of a bell sound.<br />
{{hc|~/.screenrc|<br />
vbell off<br />
}}<br />
<br />
== Troubleshooting ==<br />
=== Fix Midnight Commander hard hang when starting in screen ===<br />
In some cases (need deeper inspection) [https://bugzilla.redhat.com/show_bug.cgi?id=168076 old gpm bug] gets alive. So, then you try to run mc inside screen, you get a frozen screen window. Try to kill gpm daemon before starting mc and/or disable it in {{ic|/etc/[[rc.conf]]}}.<br />
<br />
=== Fix for residual editor text ===<br />
When you open a text editor like nano in screen and then close it, the text may stay visible in your terminal. To fix this, put the following:<br />
{{hc|~/.screenrc|<br />
altscreen on<br />
}}<br />
<br />
== See Also ==<br />
* [http://www.macosxhints.com/article.php?story=20021114055617124 MacOSX Hints - Automatically using screen in your shell]<br />
* [http://wiki.gentoo.org/wiki/Screen Gentoo Wiki - Tutorial for screen]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=50647 Arch Forums - Regarding 256 color issue with urxvt]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=55618 Arch Forums - .screenrc configs with screenshots]<br />
* [[tmux]], another multiplexer<br />
* [[Ratpoison|Ratpoison - A window manager based on gnu screen]]<br />
* [[Xpra|Xpra - An utility to detach/reattach X programs, in a way similar as screen does for command line based programs]]</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=Unofficial_user_repositories/Repo-ck&diff=301050Unofficial user repositories/Repo-ck2014-02-24T03:51:07Z<p>Mistofvongola: /* How to Determine Which CPU Optimized Package Set to Select */ Fix Gentoo wiki links</p>
<hr />
<div>[[Category:Kernel]]<br />
{{Related articles start}}<br />
{{Related|Linux-ck}}<br />
{{Related|Linux-ck/Changelog}}<br />
{{Related articles end}}<br />
<br />
Article details setup and usage of an unofficial Arch Linux repo containing generic and CPU-optimized kernel and support packages containing the ck1 patchset featuring the Brain Fuck Scheduler by Con Kolivas.<br />
<br />
== Packages in repo-ck ==<br />
The repo contains generic packages as well as CPU-specific packages for the linux-ck family. Many Arch users are familiar with the concept of a generic kernel package. The official Arch kernel is available in two flavors (either i686 or x86_64) which are ''generic'' packages in that i686 will work with ''any'' compatible x86 CPU and x86_64 will work with ''any'' compatible x86_64 CPU. Users have a choice between the corresponding generic linux-ck packages or CPU-specific and optimized linux-ck packages:<br />
<br />
{| class="wikitable" align="center"<br />
|-<br />
! CPU Type !! Group Alias !! Details<br />
|-<br />
| rowspan="1" bgcolor=#e3f7e6| '''<span style="color: #409044;">Generic</span>'''<br />
| ''ck-generic'' || Compiled with generic optimizations suitable for ''any'' compatible CPU just like the official Arch linux package. This is true for both Intel and AMD processors.<br />
|-<br />
| rowspan="8" bgcolor=#e3ecf7| '''<span style="color: #2a6dc8;">Intel</span>'''<br />
| ''ck-atom'' || Intel Atom platform specific optimizations. Intel Atom CPUs have an in-order pipelining architecture and thus can benefit from accordingly optimized code.<br />
|- <br />
| ''ck-core2'' || Intel Core 2-family including Dual and Quads (Core 2/Newer Xeon/Mobile Celeron based on Core2).<br />
|- <br />
| ''ck-nehalem'' || Intel 1st Generation Core i3/i5/i7-family specific optimizations.<br />
|- <br />
| ''ck-sandybridge'' || Intel 2nd Generation Core i3/i5/i7-family specific optimizations.<br />
|- <br />
| ''ck-ivybridge'' || Intel 3rd Generation Core i3/i5/i7-family specific optimizations.<br />
|- <br />
| ''ck-haswell'' || Intel 4th Generation Core i3/i5/i7-family specific optimizations.<br />
|- <br />
| ''ck-p4'' || Intel Pentium-4 specific optimizations (P4/P4-based Celeron/Pentium-4 M/Older Xeon).<br />
|- <br />
| ''ck-pentm'' || Intel Pentium-M specific optimizations (Pentium-M notebook chips/not Pentium-4 M).<br />
|- <br />
| rowspan="6" bgcolor=#f7e3e3| '''<span style="color: #e62c2c;">AMD</span>'''<br />
| ''ck-kx'' || AMD K7/K8-family specific optimizations.<br />
|- <br />
| ''ck-k10'' || AMD K10-family specific optimizations including: 61xx Eight-Core Magny-Cours, Athlon X2 7x50, Phenom X3/X4/II, Athlon II X2/X3/X4, or Turion II-family processor.<br />
|- <br />
| ''ck-barcelona'' || CPUs based on AMD Family 10h cores with x86-64 instruction set support.<br />
|-<br />
|''ck-bobcat''|| CPUs based on AMD Family 14h cores with x86-64 instruction set support.<br />
|-<br />
|''ck-bulldozer''|| CPUs based on AMD Family 15h cores with x86-64 instruction set support.<br />
|-<br />
| ''ck-piledriver'' || CPUs based on AMD Family 15h cores with x86-64 instruction set support.<br />
|- <br />
|}<br />
<br />
CPU-specific optimization are invoked at compilation by selecting the corresponding option under '''Processor type and features>Processor family''' or by setting-up the .config file accordingly. These changes setup make specific gcc options including the $CFLAGS. <br />
<br />
Repo-ck also contains packages for {{AUR|chromium-scroll-pixels}} for each arch.<br />
<br />
{| class="wikitable" align="center"<br />
|-<br />
! CPU Type !! Package !! Details<br />
|-<br />
| rowspan="1" bgcolor=#e3f7e6| '''<span style="color: #409044;">Generic</span>'''<br />
| ''chromium-scroll-pixels'' || Current stable version of chromium browser patched to maintain the {{ic|--scroll-pixel}} functionality allowing users to set the speed of their wheel mouse's scrolling functions.<br />
|-<br />
|}<br />
<br />
== Setup ==<br />
<br />
Add the [[Unofficial user repositories#repo-ck|repo-ck]] repository into {{ic|pacman.conf}} and [[Pacman-key#Adding_unofficial_keys|sign]] Graysky's key.<br />
<br />
== Installation Examples ==<br />
Use the '''ck-X''' group and select the desired packages for installation. There are 6 groups corresponding to the 13 package sets: '''ck-generic, ck-atom, ck-core2, ck-nehalem, ck-sandybridge, ck-ivybridge, ck-haswell, ck-p4, ck-pentm, ck-kx, ck-k10, ck-barcelona, ck-bulldozer, ck-piledriver'''<br />
<br />
{{bc|1=# pacman -S ck-generic<br />
:: There are 7 members in group ck-generic:<br />
:: Repository repo-ck<br />
1) broadcom-wl-ck 2) linux-ck 3) linux-ck-headers 4) nvidia-304xx-ck 5) nvidia-ck<br />
6) virtualbox-ck-guest-modules 7) virtualbox-ck-host-modules<br />
<br />
Enter a selection (default=all):}}<br />
<br />
Alternatively, simply direct pacman to install the packages directly:<br />
# pacman -S linux-ck linux-ck-headers<br />
<br />
== How to Determine Which CPU Optimized Package Set to Select ==<br />
Users unsure which package set to use can always install the '''ck-generic''' group which will drive any compatible CPU. For those wanting CPU-specific optimized packages, run the following command (assuming that base-devel is installed):<br />
<br />
# gcc -c -Q -march=native --help=target | grep march<br />
<br />
The resulting value is what gcc would use as the march CFLAG. Refer to the table below for a mapping of this value to the correct group.<br />
<br />
{| class="wikitable" align="center"<br />
|-<br />
! Brand !! Group !! March<br />
|-<br />
| rowspan="8" bgcolor=#e3ecf7| '''<span style="color: #2a6dc8;">Intel</span>'''<br />
| ''ck-atom'' || atom<br />
|- <br />
| ''ck-core2'' || core2<br />
|- <br />
| ''ck-nehalem'' || corei7<br />
|- <br />
| ''ck-sandybridge'' || corei7-avx<br />
|- <br />
| ''ck-ivybridge'' || core-avx-i<br />
|- <br />
| ''ck-haswell'' || core-avx2<br />
|- <br />
| ''ck-p4'' || pentium4, nocona<br />
|- <br />
| ''ck-pentm'' || pentm, pentium-m<br />
|- <br />
| rowspan="6" bgcolor=#f7e3e3| '''<span style="color: #e62c2c;">AMD</span>'''<br />
| ''ck-kx'' || athlon, athlon-4, athlon-tbird, athlon-mp, athlon-xp, k8-sse3<br />
|- <br />
| ''ck-k10'' || amdfam10<br />
|- <br />
| ''ck-barcelona'' || barcelona<br />
|-<br />
|''ck-bobcat''|| btver1<br />
|-<br />
|''ck-bulldozer''|| bdver1<br />
|-<br />
| ''ck-piledriver'' || bdver2<br />
|- <br />
|}<br />
<br />
{{Note|Users are encouraged to add additional entries to this table based on their experience.}}<br />
<br />
Additional links can be used to help determine which package set to select:<br />
<br />
*http://wiki.gentoo.org/wiki/Safe_CFLAGS#Intel<br />
*http://wiki.gentoo.org/wiki/Safe_CFLAGS#AMD<br />
*http://www.linuxforge.net/docs/linux/linux-gcc.php <br />
*http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html<br />
<br />
== How Much Faster Are the CPU Optimized Packages ==<br />
The answer is not ''that'' much faster. Extensive testing comparing the effect of gcc compile options on resulting binaries have been conducted by others with varying result from no change to rather significant speed ups.<br />
<br />
*[http://www.phoronix.com/scan.php?page=home phoronix labs]<br />
*[https://bbs.archlinux.org/viewtopic.php?id=154333 Kernel patch for more CPU families offers measurable speed increases].<br />
<br />
Readers are encouraged to add to this list.<br />
<br />
== How to Enable the BFQ I/O Scheduler ==<br />
Since release 3.0.4-2, the BFQ patchset is applied to the package by default. Users must enable the BFQ scheduler to use it; it is dormant by default.<br />
<br />
=== Globally (for all devices) ===<br />
<br />
Add {{ic|1=elevator=bfq}} to boot loader [[Kernel parameters]].<br />
{{Note|Users building the PKG from the AUR have an option in the PKGBUILD itself to globally use the BFQ as the default I/O scheduler.}}<br />
<br />
=== Selectively (for only specified devices) ===<br />
<br />
Direct the kernel to use it on a device-by-device basis. For example, to enable it for {{ic|/dev/sda}} simply:<br />
# echo bfq > /sys/block/sda/queue/scheduler<br />
<br />
To confirm, simply ''cat'' the same file:<br />
# cat /sys/block/sda/queue/scheduler<br />
noop deadline cfq [bfq] <br />
<br />
Setting this way will not survive a reboot. To make the change automatically at the next system boot, create the following tmpfile where "X" is the letter for the SSD device.<br />
<br />
{{hc| /etc/tmpfiles.d/set_IO_scheduler.conf |<nowiki><br />
w /sys/block/sdX/queue/scheduler - - - - noop<br />
</nowiki>}}<br />
<br />
== Package Trivia/Repo Statistics ==<br />
*Repo [http://repo-ck.com/stats.pdf statistics] are available (popularity of packages, which CPU is most popular, # of downloads, etc.).<br />
{{Note|The statistics are not updated daily but do give a snapshot of the data.}}<br />
<br />
== Troubleshooting ==<br />
=== Forum Support ===<br />
Please use [https://bbs.archlinux.org/viewtopic.php?id=111715 this discussion thread] to voice comments, questions, suggestions, requests, etc. Note from graysky, "I can add other CPU-specific builds upon request. I just wanna be sure people will actually use them if I take the time to compile them."</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=Compiling_KDE_snapshots&diff=301049Compiling KDE snapshots2014-02-24T03:50:31Z<p>Mistofvongola: /* makepkg.conf */ Fix Gentoo wiki links</p>
<hr />
<div>[[Category:KDE]]<br />
This article provides step-by-step guide how to compile your own KDE git/svn snapshot from sources using [https://gitorious.org/kde-snapshots-repo kde-snapshots] scripts. These scripts are used for [https://bbs.archlinux.org/viewtopic.php?pid=994402 <nowiki>[kde-snapshots]</nowiki> repo].<br />
<br />
== Introduction ==<br />
The {{ic|<nowiki>[kde-snapshots]</nowiki>}} used is an unofficial repository with weekly development snapshots of KDE SC. After more the two years the repository was abandoned due to lack of time of the original maintainer and later picked up by member Zolnierz. The scripts are also available in git repository and this article will show you how to use them to build your own snapshots.<br />
<br />
Compilation of entire KDE SC takes 4 to 5 hours on quad-core @2.8GHz Intel Core i5 processor. When compiled with debug symbols (RelWithDebInfo) and unstripped, packages have about 1.3 GiB, extracted about 4.5 GiB.<br />
<br />
== Why? ==<br />
KDE is a very big project. Every project contains lot of bugs and issues. The bigger the project is the more bugs it contains. Repository like {{ic|<nowiki>[kde-snapshots]</nowiki>}} are important, because this way users can test the software during development period and provide useful feedback to developers, who can then fix and improve the software before official release. <br />
<br />
Another reason is that many people who are developing KDE applications might find it useful to see what's coming in next official release and thus adapt their software to possible API changes etc.<br />
<br />
== Preparations ==<br />
=== Preparing build chroot ===<br />
It is recommended to use a new clear build chroot for every new snapshot. For purposes of this article, chroots will be located in {{ic|/home/build/chroots/<nowiki>{i686,x86_64}</nowiki>}}. <br />
<br />
To prepare 32bit chroot, run<br />
<br />
$ CHROOTDIR=/home/build/chroots/i686<br />
$ mkdir -p ${CHROOTDIR}{/var/lib/pacman,home/build}<br />
$ pacman -Syy -r ${CHROOTDIR} -b ${CHROOTDIR}/var/lib/pacman \<br />
> --arch i686 --ignore linux \<br />
> base base-devel cmake sudo svn git<br />
<br />
It is recommended to have {{ic|[testing]}} and {{ic|[community-testing]}} repositories enabled.<br />
<br />
When chroot is installed, mount necessary folders into the chroot and copy some configuration files<br />
<br />
$ mount /dev ${CHROOTDIR}/dev -o bind<br />
$ mount /proc ${CHROOTDIR}/proc -o bind<br />
$ mount none ${CHROOTDIR}/sys -t sysfs<br />
$ mount /home/build ${CHROOTDIR}/home/build -o bind<br />
$ cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf<br />
<br />
Now you can switch to the chroot and create a new user {{ic|build}}:<br />
<br />
$ screen<br />
$ linux32 chroot ${CHROOTDIR}<br />
# useradd -d /home/build -M -g build build<br />
<br />
It is '''really''' good idea to run the chroot from {{Pkg|screen}}, so that when you accidentally close your terminal or X crashes the compilation won't be interrupted.<br />
<br />
If you want to have full access to the buildroot even from outside the chroot, it's good practice to create a user with the same UID and GID as your normal user. This can make things easier later.<br />
<br />
==== pacman.conf ====<br />
At this point you need to configure pacman mirrors in {{ic|/etc/pacman.d/mirrorlist}}. You can also enable {{ic|[testing]}} and {{ic|[community-testing]}} repositories. Sometimes the git snapshots depend on a pre-release or brand new release of some library or program. Thanks to our great devs and TUs, these updates are usually already waiting for you in testing repositories, so it's good to have them enabled.<br />
<br />
==== makepkg.conf ====<br />
If you intend to use the packages only on your computer, you can change CFLAGS and CXXFLAGS to match your processor. There is a very nice page with safe CFLAGS for individual processors on Gentoo Wiki - [http://wiki.gentoo.org/wiki/Safe_CFLAGS#Intel Intel], [http://wiki.gentoo.org/wiki/Safe_CFLAGS#AMD AMD]. See also [http://wiki.gentoo.org/wiki/CFLAGS here].<br />
<br />
Also to speed up packaging, you can change {{ic|PKGEXT}} to {{ic|pkg.tar.gz}}. Gzipp'ed tarballs are bigger then XZ'ed, but it takes much less time to compress and decompress them.<br />
<br />
To achieve maximum performance during compilations, set {{ic|MAKEFLAGS}} to number of your cores + 1.<br />
<br />
If you want to publish your packages somewhere, it is good to set {{ic|PACKAGER}} variable too.<br />
<br />
==== sudoers ====<br />
Since we are in a chroot, we can allow some little security risks. We will grant unlimited password-less sudo privileges to the {{ic|build}} user by adding following line to {{ic|/etc/sudoers}}:<br />
<br />
build ALL=(ALL) NOPASSWD:ALL<br />
<br />
If you are really paranoid, you can use<br />
<br />
build ALL=NOPASSWD: /usr/bin/pacman<br />
<br />
to limit the 'unlimited' access only to pacman.<br />
<br />
=== Build scripts ===<br />
To automate the build process a bit, the [https://projects.archlinux.de/kde-build.git/ kde-build scripts] were originally taken and modified to work with the latest development snapshots. The "new" scripts can be obtained from their [https://gitorious.org/kde-snapshots-repo gitorious page] by command<br />
<br />
git clone https://git.gitorious.org/kde-snapshots-repo/kde-snapshots-repo.git<br />
<br />
Here are the most important scripts and files:<br />
<br />
* build-packages - the main script that will compile all the packages.<br />
* create-sources - this script fetches sources from KDE git and SVN repos<br />
* config - main configuration<br />
* extra/ - this folder contains additional ''extra'' packages (see [[#Extra Packages|Extra Packages]] section)<br />
* packages - contains list of GIT and SVN packages and their submodules<br />
* run-namcap - runs namcap on all packages<br />
* setup-chroot - not-completely-working script to automatically prepare and setup [[#Preparing build chroot|build chroot]]<br />
* update-pkgbuilds - updates {{ic|pkgver}} and resets {{ic|pkgrel}} in all PKGBUILDS<br />
<br />
There are other scripts as well, but they mostly not working against the current ''config'' and ''packages'' file. since I didn't use them when making the repository, they are left after the original kde-build scripts.<br />
<br />
=== Folders Layout ===<br />
By default, the scripts expect following directory structure:<br />
<br />
/home<br />
`- build<br />
|- build # here will the compilations take place<br />
|- build-scripts # build scripts and PKGBUILDS<br />
| |- build # contains subfolders with PKGBUILDs<br />
| |- extra # [[#Extra Packages|extra packages]] needed to build KDE<br />
|- logs # makepkg logs<br />
|- namcap # namcap logs (optional)<br />
|- packages # new packages are moved in here<br />
`- sources # sources of KDE<br />
<br />
You can adjust the layout to your needs in the {{ic|config}} file by modifying {{ic|$*dir}} variables. It is suggested to change only {{ic|$buildroot}}, because the scripts are not tested with another folder layout and may not work properly.<br />
<br />
=== Getting KDE sources ===<br />
You may want to check {{ic|packages}} file first and make sure that no new modules were migrated from SVN to git. Syntax of the file is explained in detail in the [[#Advanced Configuration|Advanced Configuration]] section at the end of this article.<br />
<br />
To pull sources from SVN and git repositories, enter the scripts dir and run<br />
<br />
$ ./create-sources<br />
<br />
Despite it's name, the script will only call {{ic|git pull}} or {{ic|svn up}} if a source is already available. The initial cloning will take some time though, so you can go get your first coffee.<br />
<br />
=== Setting KDE version ===<br />
Before you can start building, it's good to specify a version of KDE snapshot. You can find current version of the KDE SC in kdelibs/CMakeLists.txt. The snapshots are usually numbered 4.X.Y where X is next release - 1 and Y is development snapshot version, somewhere between 40 and 60 or 70. Beta releases are usually between 80 and 90, Alphas and RCs are 90 through 99.<br />
<br />
The version is specified in {{ic|config}} file in {codeline|kdever}} variable. Update it to match the KDE version and update the git date as well. When you do it, save the changes and run<br />
<br />
$ ./update-pkgbuilds<br />
<br />
This script will update pkgver in all PKGBUILDS to the value you just set and will reset all pkgrel's to 1. It will also add {{ic|<nowiki>options=(!strip)</nowiki>}} to every PKGBUILD. If you do not want to have debug symbols in your KDE, you need to comment it in the {{ic|update-pkgbuilds}} script.<br />
<br />
{{Note|Installed KDE with full debug symbols has about 4.2 GiB, KDE from {{ic|<nowiki>[extra]</nowiki>}} has about 600 MiB. <br />
<br />
If you can, please build KDE with full debug symbols. You will get more useful backtraces from crashed programs which can be very helpful to KDE developers. Testing and providing feedback during the development cycle is very important, this way many bugs can be found and fixed before official release.}}<br />
<br />
== Extra Packages ==<br />
The ''extra'' subfolder contains some packages that might be needed to successfully compile KDE or that provide additional useful or interesting KDE-related packages. <br />
<br />
You may want to compile and install {{ic|create-svn}}, {{ic|dbusmenu-qt-git}}, {{ic|gluon-git}}, {{ic|kwebkitpart-git}}, {{ic|libktorrent-git}} and {{ic|qhull} packages before building KDE. It is very well possible, that you will have no troubles compiling against packages from official repositories.<br />
<br />
== Building KDE ==<br />
Before starting the compilation make sure you do not have any old KDE packages installed in the chroot. You can verify this by running<br />
<br />
$ ./uninstall-packages<br />
<br />
Now we can finally start the compilation:<br />
<br />
$ ./build-packages<br />
<br />
<br />
=== Base packages ===<br />
==== kdesupport ====<br />
Sometimes kdesupport-phonon-{gstreamer,vlc} won't compile, unless an older version of the package is already installed. You can work around this by installing kdesupport-phonon from your previous snapshot, or {{Pkg|phonon}} from {{ic|<nowiki>[extra]</nowiki>}} if you are build snapshot for the very first time.<br />
<br />
Possible fix: split the kdesupport-phonon to a separate PKGBUILD so that it would be installed before the backends will be compiled.<br />
<br />
==== kdelibs ====<br />
Usually compiles without problems.<br />
<br />
==== kdepimlibs ====<br />
No problems here.<br />
<br />
==== kdebase-runtime ====<br />
OK.<br />
<br />
==== kdebindings ====<br />
Make sure you do not have {{Pkg|qwt}} installed in the chroot. kdebindings-smokegen will compile against Qwt, but Qt bindings (for any language) will fail with Qwt 6. There seems to be no switch to make smokegen ignore Qwt, so the only solution is to have it not installed.<br />
<br />
{{Note|Please update this section when Qt bindings will compile against Qwt 6}}<br />
<br />
==== kdebase-workspace ====<br />
Builds without trouble.<br />
<br />
==== kdebase ====<br />
Smooth and soft...<br />
<br />
==== kdegraphics ====<br />
Works like a charm.<br />
<br />
==== kdeedu ====<br />
Some submodules (namely {{ic|kanagram,}} {{ic|khangman}}, {{ic|parley}} and {{ic|kwordquiz}}) use hardcoded location of {{ic|libkeduvocdocument.so}} and {{ic|libkdeedu}} include directory. This values are modified in the source codes from PKGBUILD during compilation. Make sure you will never compile kdeedu for both architectures at the same time. The compilations are running on top of same sources (symlinked from {{ic|/home/build/sources}}), so they would be overwriting the changes each other.<br />
<br />
<br />
Possible fix: move libkdeedu to separate PKGBUILD that would be installed before compiling other kdeedu submodules.<br />
<br />
{{Note|Please update this section when the locations can be set manually or when libkdeedu is moved to a separate PKGBUILD}}<br />
<br />
=== Optional Packages ===<br />
<br />
==== kdeaccessibility ====<br />
Builds OK.<br />
<br />
==== kdeartwork ====<br />
Builds OK.<br />
<br />
==== kdegames ====<br />
Builds OK.<br />
<br />
==== kdemultimedia ====<br />
Builds OK.<br />
<br />
==== kdenetwork ====<br />
Builds OK.<br />
<br />
==== kdepim ====<br />
Builds OK.<br />
<br />
Fails to compile when kdelibs are built without Nepomuk, so make sure Nepomuk is properly compiled.<br />
<br />
==== kdeplasma-addons ====<br />
Builds OK.<br />
<br />
==== kdesdk ====<br />
Builds OK.<br />
<br />
==== kdetoys ====<br />
Builds OK.<br />
<br />
==== kdeutils ====<br />
Builds OK.<br />
<br />
==== kdewebdev ====<br />
Builds OK.<br />
<br />
=== Final checks ===<br />
Cool, your own KDE snapshot is now compiled. If some of the optional packages failed to compile, check the logs for errors and try to rebuild them manually.<br />
<br />
== Creating a repository ==<br />
This is an optional step. If you want to have a (not necessarily public) repository with KDE, enter the {{ic|packages}} directory in build root and in the architecture sub folder run<br />
<br />
$ repo-add my-repo-name.db.tar.gz *.pkg.tar.xz<br />
<br />
This will create a DB file to be fetched by pacman. Now just upload it somewhere together with the packages and you are done.<br />
<br />
<br />
=== Advanced Configuration ===<br />
==== ''packages'' file ====<br />
Since KDE is now in the middle of SVN->git migration, it's necessary to check {{ic|packages}} file before pulling sources. The syntax of the file is quite simple:<br />
<br />
* base_pkgs - Packages that are mandatory and other packages depend on them. When compilation of a base_pkg fails, the entire compilation process is interrupted.<br />
* opt_pkgs - Packages that are not mandatory. When compilation of a opt_pkg fails, the scripts will automatically proceed to next package. After all packages are compiled, you will be displayed list of broken packages.<br />
* ${pkgbase}_${scm}_pkgs is array of ${pkgbase}'s submodules located in ${scm} (git or svn) repository. For example, all kdesupport submodules are in git already, so the array kdesupport_git_pkgs will fetch all submodules from {{ic|<nowiki>git://anongit.kde.org/${submodule}</nowiki>}} to {{ic|<nowiki>${srcdir}/${pkgbase}/${submodule}</nowiki>}}. When the submodule is named like {{ic|<nowiki>${submodule}:${alternative_name}</nowiki>}}, it will be cloned from {{ic|<nowiki>git://anongit.kde.org/${submodule}</nowiki>}} to {{ic|<nowiki>${srcdir}/${pkgbase}/${alternative_name}</nowiki>}}. You can specify alternative URL of a submodule by entering {{ic|<nowiki>@git://alternative.git/repository</nowiki>}}. When the base package does not have any submodules, like for example kdelibs, a {{ic|<nowiki>@${pkgbase}</nowiki>}} must be provided in the submodules.</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=Makepkg_(%D0%A1%D1%80%D0%BF%D1%81%D0%BA%D0%B8)&diff=301048Makepkg (Српски)2014-02-24T03:49:08Z<p>Mistofvongola: /* Architecture, compile flags */ Fix Gentoo Wiki link</p>
<hr />
<div>[[Category:Package development (Српски)]]<br />
[[Category:About Arch (Српски)]]<br />
[[ar:Makepkg]]<br />
[[el:Makepkg]]<br />
[[en:Makepkg]]<br />
[[es:Makepkg]]<br />
[[fr:makepkg]]<br />
[[it:Makepkg]]<br />
[[ja:Makepkg]]<br />
[[nl:Makepkg]]<br />
[[pt:Makepkg]]<br />
[[ru:Makepkg]]<br />
[[tr:Makepkg]]<br />
[[zh-CN:Makepkg]]<br />
{{DISPLAYTITLE:makepkg}}<br />
<br />
<br />
{{Article summary start}}<br />
{{Article summary text|makepkg is a script used to compile and package software for use with pacman. This article details its configuration and usage.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{:Category:Package management}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Creating Packages}}<br />
{{Article summary heading|Resources}}<br />
{{Article summary link|makepkg(8) Manual Page|https://www.archlinux.org/pacman/makepkg.8.html}}<br />
{{Article summary link|makepkg.conf(5) Manual Page|https://www.archlinux.org/pacman/makepkg.conf.5.html}}<br />
{{Article summary end}}<br />
<br />
makepkg is used for compiling and building packages suitable for installation with [[pacman]], Arch Linux's package manager. makepkg is a script that automates the building of packages; it can download and validate source files, check dependencies, configure build-time settings, compile the sources, install into a temporary root, make customizations, generate meta-info, and package everything together.<br />
<br />
makepkg is provided by the {{Pkg|pacman}} package.<br />
<br />
== Configuration ==<br />
<br />
{{ic|/etc/makepkg.conf}} is the main configuration file for makepkg. Most users will wish to fine-tune makepkg configuration options prior to building any packages. <br />
<br />
=== Architecture, compile flags ===<br />
<br />
The MAKEFLAGS, CFLAGS and CXXFLAGS options are used by ''make'', ''gcc'', and ''g++'' whilst compiling software with makepkg. By default, these options generate generic packages that can be installed on a wide range of machines. A performance improvement can be achieved by tuning compilation for the host machine. The downside is that packages compiled specifically for the host's processor may not run on others.<br />
<br />
{{hc|/etc/makepkg.conf|<nowiki><br />
...<br />
<br />
#########################################################################<br />
# ARCHITECTURE, COMPILE FLAGS<br />
#########################################################################<br />
#<br />
CARCH="x86_64"<br />
CHOST="x86_64-unknown-linux-gnu"<br />
<br />
#-- Exclusive: will only run on x86_64<br />
# -march (or -mcpu) builds exclusively for an architecture<br />
# -mtune optimizes for an architecture, but builds for whole processor family<br />
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe"<br />
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe"<br />
LDFLAGS="-Wl,--hash-style=gnu -Wl,--as-needed"<br />
#-- Make Flags: change this for DistCC/SMP systems<br />
#MAKEFLAGS="-j2"<br />
<br />
...<br />
</nowiki>}}<br />
<br />
The default makepkg.conf CFLAGS and CXXFLAGS are compatible with all machines within their respective architectures. <br />
<br />
Further optimizing for CPU type can theoretically enhance performance since {{ic|-march&#61;}} enables all available instruction sets and improves scheduling for a particular CPU. This is especially noticeable when rebuilding optimized applications (For example: Audio/Video encoding tools.) that take heavy advantage of newer instructions sets not enabled when using the default options (or packages) provided by Arch Linux.<br />
<br />
On 64bit, there are rarely measurable real world performance gains for "typical" unoptimized programs (i.e bash) since the bulk of instructions that end up getting generated for those are most likely already used anyway.<br />
<br />
As of version 4.3.0, the gcc compiler offers the {{ic|-march&#61;native}} switch that enables CPU auto-detection and automatically selects optimizations supported by the local machine at gcc runtime. To use it, just modify the default settings by changing the CFLAGS and CXXFLAGS lines as follows:<br />
<br />
CFLAGS="-march=native -O2 -pipe"<br />
CXXFLAGS="${CFLAGS}"<br />
<br />
To see the difference between the default options provided (on 64bit) and {{ic|-march&#61;native}} use something like this: <br />
<br />
echo | gcc -E -dM -march=x86-64 -mtune=generic - > /tmp/gccflags1<br />
echo | gcc -E -dM -march=native - > /tmp/gccflags2<br />
diff /tmp/gccflags1 /tmp/gccflags2<br />
<br />
diff results on a AMD Barcelona CPU:<br />
<br />
> #define __POPCNT__ 1<br />
48a50<br />
> #define __ABM__ 1<br />
81a84<br />
> #define __amdfam10__ 1<br />
91a95<br />
> #define __3dNOW__ 1<br />
94a99,100<br />
> #define __SSE4A__ 1<br />
> #define __amdfam10 1<br />
97a104<br />
> #define __3dNOW_A__ 1<br />
111d117<br />
< #define __k8 1<br />
143d148<br />
< #define __k8__ 1<br />
178a184<br />
> #define __tune_amdfam10__ 1<br />
194a201<br />
> #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 1<br />
203a211<br />
> #define __SSE3__ 1<br />
<br />
As you can see, using {{ic|-march&#61;native}} instead of the defaults enabled SSE3 among quite a few other things.<br />
<br />
See the gcc man page for a complete list of available options. The Gentoo [http://www.gentoo.org/doc/en/gcc-optimization.xml Compilation Optimization Guide] and [http://wiki.gentoo.org/wiki/Safe_CFLAGS Safe Cflags] wiki article provide more in-depth information.<br />
<br />
The MAKEFLAGS option can be used to specify additional options for make. Users with multi-core/multi-processor systems can specify the number of jobs to run simultaneously. Generally {{ic|-j2}}, plus 1 for each additional core/processor is an adequate choice. Some PKGBUILD's specifically override this with {{ic|-j1}}, because of race conditions in certain versions or simply because it's not supported in the first place. Packages that fail to build because of this should be reported on the bug tracker after making sure that the error is indeed being caused by your MAKEFLAGS.<br />
<br />
MAKEFLAGS="-j3"<br />
<br />
See the make man page for a complete list of available options.<br />
<br />
{{Note|Do keep in mind that not all package Makefiles will use your exported variables. Some of them override them in the original Makefiles or the PKGBUILD.}}<br />
<br />
=== Package output ===<br />
<br />
Next, one can configure where source files and packages should be placed and identify themselves as the packager. This step is optional; packages will be created in the working directory where makepkg is run by default.<br />
<br />
{{hc|/etc/makepkg.conf|<nowiki><br />
...<br />
<br />
#########################################################################<br />
# PACKAGE OUTPUT<br />
#########################################################################<br />
#<br />
# Default: put built package and cached source in build directory<br />
#<br />
#-- Destination: specify a fixed directory where all packages will be placed<br />
#PKGDEST=/home/packages<br />
#-- Source cache: specify a fixed directory where source files will be cached<br />
#SRCDEST=/home/sources<br />
#-- Source packages: specify a fixed directory where all src packages will be placed<br />
#SRCPKGDEST=/home/srcpackages<br />
#-- Packager: name/email of the person or organization building packages<br />
#PACKAGER="John Doe <john@doe.com>"<br />
<br />
...<br />
</nowiki>}}<br />
<br />
For example, create the directory:<br />
<br />
$ mkdir /home/$USER/packages<br />
<br />
Then modify the PKGDEST variable in {{ic|/etc/makepkg.conf}} accordingly.<br />
<br />
The PACKAGER variable will set the ''packager'' value within compiled packages' {{ic|.PKGINFO}} metadata file. By default, user-compiled packages will display:<br />
<br />
{{hc|$ pacman -Qi package|<nowiki><br />
...<br />
Packager : Unknown Packager<br />
...<br />
</nowiki>}}<br />
<br />
Afterwards:<br />
<br />
{{hc|$ pacman -Qi package|<nowiki><br />
...<br />
Packager : John Doe <john@doe.com><br />
...<br />
</nowiki>}}<br />
<br />
This is useful if multiple users will be compiling packages on a system, or you are otherwise distributing your packages to other users.<br />
<br />
== Usage ==<br />
<br />
Before continuing, ensure the "base-devel" group is installed. Packages belonging to this group are not required to be listed as dependencies in [[PKGBUILD]] files. Install the "base-devel" group by issuing (as root):<br />
<br />
# pacman -S base-devel<br />
<br />
{{Note|Before complaining about missing (make)dependencies, remember that the "base" group is assumed to be installed on all Arch Linux systems. The group "base-devel" is assumed to be installed when building with makepkg.}}<br />
<br />
To build a package, one must first create a [[PKGBUILD]], or build script, as described in [[Creating Packages]], or obtain one from the [[Arch Build System|ABS tree]], [[Arch User Repository]], or some other source. <br />
<br />
{{Warning|Only build/install packages from trusted sources.}}<br />
<br />
Once in possession of a {{ic|PKGBUILD}}, change to the directory where it is saved and issue the following command to build the package described by said {{ic|PKGBUILD}}:<br />
<br />
$ makepkg<br />
<br />
To have makepkg clean out leftover files and folders, such as files extracted to the $srcdir, add the following option. This is useful for multiple builds of the same package or updating the package version, while using the same build folder. It prevents obsolete and remnant files from carrying over to the new builds.<br />
<br />
$ makepkg -c<br />
<br />
If required dependencies are missing, makepkg will issue a warning before failing. To build the package and install needed dependencies automatically, simply use the command:<br />
<br />
$ makepkg -s<br />
<br />
Note that these dependencies must be available in the configured repositories; see [[pacman#Repositories]] for details. Alternatively, one can manually install dependencies prior to building ({{ic|pacman -S --asdeps dep1 dep2}}).<br />
<br />
Once all dependencies are satisfied and the package builds successfully, a package file ({{ic|pkgname-pkgver.pkg.tar.xz}}) will be created in the working directory. To install, run (as root):<br />
<br />
# pacman -U pkgname-pkgver.pkg.tar.xz<br />
<br />
Alternatively, to install, using the {{ic|-i}} flag is an easier way of running {{ic|pacman -U pkgname-pkgver.pkg.tar.xz}}, as in:<br />
<br />
$ makepkg -i<br />
<br />
== Tips and Tricks ==<br />
=== WARNING:Referencing $srcdir in PKGBUILD ===<br />
Somehow, $srcdir of $pkgdir ended up in one of the installed files in your package.<br />
<br />
To identify which files, run the following from the makepkg build dir:<br />
grep -R "$(pwd)/src" pkg/<br />
<br />
[[http://www.mail-archive.com/arch-general@archlinux.org/msg15561.html Link]] to discussion thread.</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=Makepkg_(Italiano)&diff=301047Makepkg (Italiano)2014-02-24T03:48:45Z<p>Mistofvongola: /* Flag di compilazione e architettura */ Fix Gentoo Wiki link</p>
<hr />
<div>[[Category:Package development (Italiano)]]<br />
[[Category:About Arch (Italiano)]]<br />
{{lowercase title}}<br />
[[ar:Makepkg]]<br />
[[el:Makepkg]]<br />
[[en:Makepkg]]<br />
[[es:Makepkg]]<br />
[[fr:makepkg]]<br />
[[ja:Makepkg]]<br />
[[nl:Makepkg]]<br />
[[pt:Makepkg]]<br />
[[ru:Makepkg]]<br />
[[sr:Makepkg]]<br />
[[tr:Makepkg]]<br />
[[zh-CN:Makepkg]]<br />
{{Related articles start (Italiano)}}<br />
{{Related2|Creating Packages (Italiano)|Creare Pacchetti}}<br />
{{Related2|PKGBUILD (Italiano)|PKGBUILD}}<br />
{{Related2|Arch User Repository (Italiano)|Arch User Repository}}<br />
{{Related2|pacman (Italiano)|Pacman}}<br />
{{Related2|Official Repositories|Repository Ufficiali}}<br />
{{Related2|Arch Build System (Italiano)|Arch Build System}}<br />
{{Related articles end}}<br />
makepkg è utilizzato per compilare e creare pacchetti installabili da [[Pacman (Italiano)|Pacman]], il gestore pacchetti di Arch Linux. makepkg è uno script che automatizza la creazione dei pacchetti; esso può scaricare e verificare i sorgenti dei file, controllare le dipendenze, configurare le impostazioni, compilare i sorgenti, installare in una directory temporanea, personalizzare i pacchetti, generare meta-informazioni e pacchettizzare il tutto. <br />
<br />
makepkg è incluso nel pacchetto {{Pkg|pacman}}.<br />
<br />
== Configurazione ==<br />
<br />
{{ic|/etc/makepkg.conf}} è il principale file di configurazione di makepkg. La maggior parte degli utenti vorrà personalizzare il file di configurazione di makepkg prima di iniziare a compilare qualsiasi pacchetto. <br />
<br />
=== Flag di compilazione e architettura ===<br />
<br />
Le variabili {{ic|MAKEFLAGS}}, {{ic|CFLAGS}} e {{ic|CXXFLAGS}} vengono usate da {{Pkg|make}}, {{Pkg|gcc}}, e {{ic|g++}} mentre eseguono la compilazione del software con makepkg. Per impostazione predefinita, queste opzioni creano pacchetti generici che possono essere poi installati su una vasta gamma di macchine. Un miglioramento delle prestazioni può essere ottenuto mediante l'ottimizzazione della opzioni di compilazione per il computer host. Il rovescio della medaglia è che i pacchetti compilati appositamente per il processore host potrebbero non funzionare su altre macchine.<br />
<br />
{{Nota|Tenere a mente che non tutti i sistemi di compilazione utilizzeranno le variabili esportate. Alcune di esse potrebbero essere sovrascritte nei Makefiles originali o nel [[PKGBUILD]].}}<br />
<br />
{{hc|/etc/makepkg.conf|<nowiki><br />
...<br />
<br />
#########################################################################<br />
# ARCHITECTURE, COMPILE FLAGS<br />
#########################################################################<br />
#<br />
CARCH="x86_64"<br />
CHOST="x86_64-unknown-linux-gnu"<br />
<br />
#-- Exclusive: will only run on x86_64<br />
# -march (or -mcpu) builds exclusively for an architecture<br />
# -mtune optimizes for an architecture, but builds for whole processor family<br />
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"<br />
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"<br />
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu"<br />
#-- Make Flags: change this for DistCC/SMP systems<br />
#MAKEFLAGS="-j2"<br />
<br />
...<br />
</nowiki>}}<br />
<br />
I {{ic|CFLAGS}} e i {{ic|CXXFLAGS}} predefiniti di makepkg.conf sono compatibili con tutte le macchine e le loro rispettive architetture.<br />
<br />
Su machcine x86_64, raramente ci sono vantaggi in termini di prestazioni che giustifichino il tempo di ricompilazione dei pacchetti ufficiali.<br />
<br />
A partire dalla versione 4.3.0, GCC offre lo switch {{ic|1=-march=native}} che abilita l'autorilevamento della CPU e seleziona automaticamente le ottimizzazioni supportate dalla macchina locale in fase di runtime GCC. Per utilizzarlo, è sufficiente modificare le impostazioni di default modificando le linee {{ic|CFLAGS}} e {{ic|CXXFLAGS}} come segue:<br />
<br />
# -march=native also sets the correct -mtune=<br />
CFLAGS="-march=native -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"<br />
CXXFLAGS="${CFLAGS}"<br />
<br />
Le opzioni CFLAGS and CXXFLAGS di default su makepkg.conf, sono compatibili con tutte le macchine delle loro rispettive architetture. <br />
<br />
Ulteriori ottimizzazioni per tipo di CPU, possono teoricamente migliorare le prestazioni {{ic|-march&#61;}} abilitando tutti i set di istruzioni disponibili e migliorando lo scheduling per particolari CPU. Ciò è evidente specialmente quando si creano pacchetti (ad esempio strumenti di codifica audio/video, applicazioni scientifiche, semplici programmi matematici, ecc..) che potrebbero sfruttare pesantemente i nuovi set di istruzioni, non abilitati quando si utilizzano le opzioni predefinite (o i pacchetti) forniti da Arch Linux.<br />
<br />
E' molto facile ridurre le prestazioni utilizzando CFLAGS fuori standard, perchè GCC il più delle volte manderà in loop codice di grande dimensioni, vettorizzandolo in maniera errata, ecc.., a seconda delle opzioni del compilatore. Finchè non si verificherà/misurerà che qualcosa è più veloce, c'è una buona possibilità che non lo sia!<br />
<br />
Vedere la pagina man di GCC per una lista completa delle opzioni disponibili. La[http://www.gentoo.org/doc/en/gcc-optimization.xml Compilation Optimization Guide] di Gentoo e l'articolo wiki [http://wiki.gentoo.org/wiki/Safe_CFLAGS Safe Cflags] forniscono informazioni più dettagliate.<br />
<br />
====MAKEFLAGS====<br />
<br />
L'opzione {{ic|MAKEFLAGS}} può essere utilizzata per specificare delle opzioni aggiuntive a "make". Gli utenti con sistemi multi-core/multi-processore possono specificare il numero di operazioni da eseguire simultaneamente. Generalmente {{ic|-j2}}, più 1 per ogni core/processore aggiuntivo, è una scelta ragionevole. Alcuni [[PKGBUILD (Italiano)|PKGBUILD]] sono specificatamente contraddistinti con {{ic|-j1}}, richiesto da alcune versioni, o semplicemente perchè non supportati. I pacchetti che, a causa di questo, non si riescono a compilare, vanno [[Reporting Bug Guidelines|segnalati]] tramite il bug tracker, dopo essersi assicurati che l'errore non è causato dal proprio MAKEFLAGS. <br />
<br />
Consultare {{ic|man make}} per un elenco completo delle opzioni disponibili.<br />
<br />
=== Output del pacchetto ===<br />
<br />
Si può quindi impostare dove mettere i sorgenti ed i pacchetti per farli riconoscere dal packager. Questo passaggio è opzionale; i pacchetti verranno creati nella directory di lavoro dove makepkg viene eseguito di default.<br />
<br />
{{hc|/etc/makepkg.conf|<nowiki><br />
...<br />
<br />
#########################################################################<br />
# PACKAGE OUTPUT<br />
#########################################################################<br />
#<br />
# Default: put built package and cached source in build directory<br />
#<br />
#-- Destination: specify a fixed directory where all packages will be placed<br />
#PKGDEST=/home/packages<br />
#-- Source cache: specify a fixed directory where source files will be cached<br />
#SRCDEST=/home/sources<br />
#-- Source packages: specify a fixed directory where all src packages will be placed<br />
#SRCPKGDEST=/home/srcpackages<br />
#-- Packager: name/email of the person or organization building packages<br />
#PACKAGER="John Doe <john@doe.com>"<br />
<br />
...<br />
</nowiki>}}<br />
<br />
Ad esempio, creare la directory:<br />
<br />
$ mkdir /home/$USER/packages<br />
<br />
Poi modificare di conseguenza la variabile {{ic|PKGDEST}} in {{ic|/etc/makepkg.conf}}.<br />
<br />
La variabile {{ic|PACKAGER}} imposterà il valore del {{ic|packager}} all'interno del file metadata dei pacchetti compilati {{ic|.PKGINFO}}. Per impostazione predefinita, i pacchetti compilati dagli utenti indicheranno:<br />
<br />
{{hc|pacman -Qi package|<nowiki><br />
...<br />
Packager : Unknown Packager<br />
...<br />
</nowiki>}}<br />
<br />
Poi:<br />
<br />
{{hc|pacman -Qi package|<nowiki><br />
...<br />
Packager : John Doe <john@doe.com><br />
...<br />
</nowiki>}}<br />
<br />
Ciò è utile se più utenti compilano pacchetti su un sistema, o si stanno distribuendo i propri pacchetti ad altri utenti.<br />
<br />
=== Controllo firma ===<br />
<br />
La procedura che segue non è necessaria per compilare con makepkg, per la configurazione iniziale procedere con [[#Usage (Italiano)|Utilizzo]]. Per disabilitare temporaneamente il controllo della firma, richiamare il comando di makpkg con l'opzione {{ic|--skippgpcheck}}.<br />
<br />
Se il file della firma con estensione .sig è parte dell'array sorgenti del [[PKGBUILD (Italiano)|PKGBUILD]], makepkg valida l'autenticità dei file sorgente. Ad esempio, la firma pkgname-pkgver.tar.gz.sig è utilizzata per controllare l'integrità del file pkgname-pkgver.tar.gz con il programma gpg. Se si vuole, le firme di altri sviluppatori possono essere aggiunte manualmente al keyring gpg. Per maggiori informazioni vedere l'articolo [[GnuPG]].<br />
<br />
{{Nota|Il controllo della firma implementato in makepkg non utilizza il keyring di pacman. Per consentire a makepkg di leggere il keyring di pacman, configurare gpg come spiegato di seguito.}}<br />
<br />
Le chiavi gpg dovrebbero essere memorizzate nel file utente {{ic|~/.gnupg/pubring.gpg}}. Nel caso in cui non dovesse contenerle, makepkg mostrerà un avviso.<br />
<br />
{{hc|makepkg|<nowiki><br />
...<br />
==> Verifying source file signatures with gpg...<br />
pkgname-pkgver.tar.gz ... FAILED (unknown public key 1234567890)<br />
==> WARNING: Warnings have occurred while verifying the signatures.<br />
Please make sure you really trust them.<br />
...<br />
</nowiki>}}<br />
<br />
Per visualizzare la lista corrente delle chiavi gpg, utilizzare il comando gpg.<br />
<br />
{{bc|gpg --list-keys}}<br />
<br />
Se il file pubring.gpg non esiste, esso verrà creato immediatamente.<br />
<br />
E' possibile procedere con la configurazione di gpg per consentire la compilazione dei pacchetti AUR inviati dagli sviluppatori Arch Linux con la firma verificata con successo.<br />
<br />
Aggiungere la seguente linea alla fine del file di configurazione gpg, per includere il keyring di pacman nel keyring personale utente.<br />
<br />
{{hc|~/.gnupg/gpg.conf|<nowiki><br />
...<br />
keyring /etc/pacman.d/gnupg/pubring.gpg<br />
</nowiki>}}<br />
<br />
Una volta configurato come indicato, l'output di {{ic|gpg --list-keys}} contiene una lista di chiavi e sviluppatori. Ora makepkg può compilare i pacchetti AUR inviati dagli sviluppatori Arch Linux con la firma verificata con successo.<br />
<br />
== Utilizzo ==<br />
<br />
Prima di continuare, assicurarsi che sia installato il gruppo di strumenti {{Grp|base-devel}}<br />
siano installati. I pacchetti appartenenti a questo gruppo non sono tenuti ad essere elencati come dipendenze nei file [[PKGBUILD (Italiano)|PKGBUILD]]. Installare "base-devel" con il comando (da root):<br />
<br />
# pacman -S base-devel<br />
<br />
{{Nota|Prima di lamentarsi di eventuali mancanze di (make)dipendenze, ricordare che si assume che il gruppo di pacchetti {{Grp|base}} sia correttamente installato sul sistema Arch Linux. Il gruppo "base-devel" è fondamentale per poter compilare e creare pacchetti con '''makepkg'''.}}<br />
<br />
Per creare un pacchetto, si deve innanzitutto creare un [[PKGBUILD (Italiano)|PKGBUILD]], o creare uno script, così come descritto in [https://wiki.archlinux.org/index.php/Creating_Packages_%28Italiano%29 Creating Packages], oppure ottenerne uno da [[Arch Build System (Italiano)|ABS]], da [[Arch User Repository (Italiano)|AUR]], o da altre fonti.<br />
<br />
{{Attenzione|Compilare e/o installare pacchetti solo da fonti sicure.}}<br />
<br />
Una volta in possesso di un {{ic|PKGBUILD}}, spostarsi nella cartella nel quale è posizionato e digitare il seguente comando per creare il pacchetto descritto nel {{ic|PKGBUILD}} stesso:<br />
<br />
$ makepkg<br />
<br />
Per pulire makepkg da file e cartelle, come ad esempio i file estratti in $srcdir, aggiungere l'opzione che segue. Ciò è utile per molteplici compilazioni dello stesso pacchetto o per l'aggiornamento di versione, utilizzando la stessa cartella di compilazione. Esso impedisce che i file residui ed obsoleti vengano riportati nel nuovo processo di compilazione.<br />
<br />
$ makepkg -c<br />
<br />
Se non verranno rilevate tutte le dipendenze richieste, makepkg darà un avviso, prima di fallire la compilazione. Per compilare il pacchetto a installare automaticamente le dipendenze necessarie, utilizzare il comando:<br />
<br />
$ makepkg -s<br />
<br />
Si noti che queste dipendenze devono essere disponibili nei repository configurati; vedere [https://wiki.archlinux.org/index.php/Pacman_%28Italiano%29#Repositories pacman#Repositories] per i dettagli. Altrimenti, si si possono installare manualmente le dipendenze prima della compilazione ({{ic|pacman -S --asdeps dep1 dep2}}).<br />
<br />
Quando tutte le dipendenze sono soddisfatte ed il pacchetto compilato correttamente, verrà creato, nella directory di lavoro, il file del pacchetto ({{ic|pkgname-pkgver.pkg.tar.gz}}). Per installarlo, eseguire (da root):<br />
<br />
# pacman -U pkgname-pkgver.pkg.tar.gz<br />
<br />
In alternativa, un metodo più semplice è utilizzare il flag {{ic|-i}}, anzichè {{ic|pacman -U pkgname-pkgver.pkg.tar.xz}}, come riportato di seguito:<br />
$ makepkg -i<br />
<br />
== Trucchi e consigli ==<br />
<br />
=== Sostituzione automatica checksums nel PKGBUILD ===<br />
<br />
==== Opzione 1 ====<br />
<br />
Di seguito uno script molto utile che genererà nuovi checksum per i file aggiornati e li sosituirà dentro il PKGBUILD in un'unica fase.<br />
<br />
{{bc|<nowiki>#!/bin/bash<br />
# Script by Falconindy<br />
# https://bbs.archlinux.org/viewtopic.php?id=131666<br />
<br />
awk -v newsums="$(makepkg -g)" '<br />
BEGIN {<br />
if (!newsums) exit 1<br />
}<br />
<br />
/^[[:blank:]]*(md|sha)[[:digit:]]+sums=/,/\)[[:blank:]]*$/ {<br />
if (!i) print newsums; i++<br />
next<br />
}<br />
<br />
1<br />
' PKGBUILD > PKGBUILD.new && mv PKGBUILD{.new,}</nowiki>}}<br />
<br />
==== Opzione 2 ====<br />
<br />
{{bc|<nowiki><br />
setconf PKGBUILD $(makepkg -g 2>/dev/null | pee "head -1 | cut -d= -f1" "cut -d= -f2") ')'<br />
</nowiki>}} <br />
<br />
Questo funziona bene, ma ha lo svantaggio di richiedere il paccketto setconf (appena 364 KiB) e non funziona con sum multipli (ad esempio, sia md5sums che sha256sums nello stesso PKGBUILD).<br />
<br />
La velocità è buona o migliore rispetto agli script che utilizzano awk, anche se makepkg viene chiamato due volte.<br />
<br />
=== ATTENZIONE: Il pacchetto contiene riferimenti a $srcdir ===<br />
<br />
In qualche modo, le stringhe letterali {{ic|$srcdir}} o {{ic|$pkgdir}} sono finite in uno dei file installati nel pacchetto.<br />
<br />
Per individuare tale file, eseguire il seguente comando nella cartella di compilazione del makepkg:<br />
<br />
grep -R "$(pwd)/src" pkg/<br />
<br />
[http://www.mail-archive.com/arch-general@archlinux.org/msg15561.html Link] al thread della discussione.<br />
<br />
== Altre risorse ==<br />
* [https://www.archlinux.org/pacman/makepkg.8.html makepkg(8) Manual Page]<br />
* [https://www.archlinux.org/pacman/makepkg.conf.5.html makepkg.conf(5) Manual Page]</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=Makepkg_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)&diff=301046Makepkg (Русский)2014-02-24T03:48:21Z<p>Mistofvongola: /* Настройка: архитектура и флаги компиляции */ Fix Gentoo Wiki link</p>
<hr />
<div>[[Category:Package management (Русский)]]<br />
[[Category:Русский]]<br />
[[ar:Makepkg]]<br />
[[el:Makepkg]]<br />
[[en:Makepkg]]<br />
[[es:Makepkg]]<br />
[[fr:makepkg]]<br />
[[it:Makepkg]]<br />
[[ja:Makepkg]]<br />
[[nl:Makepkg]]<br />
[[pt:Makepkg]]<br />
[[sr:Makepkg]]<br />
[[tr:Makepkg]]<br />
[[zh-CN:Makepkg]]<br />
'''makepkg''' - это базовая утилита для сборки собственных пакетов, которые могут быть использованы менеджером '''pacman'''. Основанный на скриптовой системе сборки пакетов, makepkg способен загрузить из интернета и проверить на целостность исходники (например архивы tar.gz и bz2), установить параметры сборки пакета (т.к флаги CFLAGS и другие параметры компилятора), собрать пакет во временную папку и создать готовый архив соответствующий стандарту Arch, удалив все ненужное.<br />
<br />
==Установка и настройка==<br />
===ABS - Система автоматической сборки пакетов Arch===<br />
Для начала, убедитесь что у вас установлены утилиты для сборки собственных пакетов, в их список входят: компилятор, линкер, некоторые базовые библиотеки и вспомогательные приложения типа automake и autoconf. Чтобы загрузить и установить их последние версии, наберите в командной строке эти команды с привилегиями '''root'''-пользователя:<br />
<br />
# pacman -S base-devel<br />
# pacman -S abs<br />
<br />
Впишите '''Y''' для всех вопросов и pacman закачает и установит (или обновит) средства необходимые для создания собственных пакетов. Затем, опять-же с привилегиями '''root'''-пользователя, выполните:<br />
<br />
# abs<br />
<br />
Этот скрипт подсоединится к ближайшему серверу, закачает и установит дерево ABS в каталог '''/var/abs'''. По умолчанию, некоторые репозитории отключены, вы можете установить свои настройки редактируя файл '''/etc/abs.conf'''<br />
<br />
Теперь необходимо создать папку в которой будут содержаться исходники, скрипты, патчи или прочие файлы для будущего пакета. Папку можно создать, например, в корне вашего домашнего каталога:<br />
<br />
$ mkdir ~/abs<br />
==Makepkg==<br />
Если вы хотите иметь возможность устанавливать недостающие для сборки пакета зависимости, установите утилиту '''sudo''' и добавьте вашего пользователя в файл настройки утилиты: '''/etc/sudoers'''.<br />
<br />
''ЗАМЕТКА:'' в состав пакета sudo входит утилита '''visudo''' которая запускает редактор '''vi''' в особом режиме, позволяющем сразу-же отредактировать файл без изменения прав доступа.<br />
<br />
USER_NAME ALL=(ALL) NOPASSWD: /usr/bin/pacman<br />
<br />
Добавив эту строку и заменив USER_NAME именем вашего пользователя, у вас появится возможность запускать pacman без необходимости ввода пароля.<br />
<br />
Следующий шаг - это определения папки в которой будут перемещены "свежесобранные" пакеты, например вы можете назначить здесь папку в вашем домашнем каталоге. Если этот параметр не был установлен, то пакеты будут расположены в той-же папке откуда был запущен makepkg.<br />
<br />
Например, создайте такую папку:<br />
<br />
$ mkdir /home/$USER/packages<br />
<br />
и установите переменную '''PKGDEST''' в файле '''/etc/makepkg.conf''' соотвествующим образом.<br />
<br />
Пока вы редактируете его, можете посмотреть на другие переменные влияющие на сборку ваших пакетов. Например вы можете установить переменную '''PACKAGER''', при этом ваше имя будет добавлено к собранным пакетам, либо убрать '''!''' перед параметром '''docs''' в массиве '''OPTIONS''', в случае если вы не хотите чтобы makepkg удалял папку с документацией к вашему пакету. Просмотрите статью [[Makepkg.conf]] для подробной информации по возможным параметрам.<br />
<br />
==Сборка пакета==<br />
Для сборки пакета вы можете создать собственный "с нуля" следуя указаниям [[Creating Packages (Русский)|Руководства по сборке пакетов Arch]], либо, если кто-то уже сделал это за вас, поискать на странице [https://aur.archlinux.org/ AUR] или в дереве [[ABS]].<br />
<br />
Например, вы нашли какой-то очень интересующий вас пакет в AUR и хотите собрать его и установить (в этом примере будет приведен '''rufus''', клиент bittorrent основанный на Python). Вы можете достать '''PKGBUILD''' и все необходимые для сборки файлы (в некоторых случаях это патчи или дополнительные скрипты) нажав на ссылку "Tarball" или "Архив", для пользователей просматривающих страницу на русском языке.<br />
<br />
$ cd /path/to/tarball<br />
$ tar -zxf rufus.tar.gz<br />
$ cd rufus<br />
<br />
Обратите внимание на то, что в папке rufus появились несколько файлов, один из них называется PKGBUILD, именно он и содержит инструкции для сборки пакета. Для сборки пакета введите (под управлением вашего пользователя) команду:<br />
<br />
$ makepkg<br />
<br />
Утилита загрузит все необходимые для сборки исходники и попытается собрать пакет. Если не хватает каких-то зависимостей, makepkg сообщит об этом прежде чем завершить работу с ошибкой. Если вы хотите собрать пакет и дать возможность makepkg самому загрузить и установить необходимые зависимости, то введите эту команду:<br />
<br />
$ makepkg -s<br />
<br />
Обратите внимание, что зависимости должны быть доступны в заранее настроенных вами репозитариях. С другой стороны, вы можете собственноручно установить их командой<br />
<br />
$ sudo pacman -S dep1 dep2 depN<br />
<br />
После того как все необходимые зависимости были установлены и ваш пакет был собран удачно, у вас появится файл '''rufus-0.7.0-1.pkg.tar.gz'''. Вы можете установить его командой<br />
<br />
$ sudo pacman -U rufus-0.7.0-1.pkg.tar.gz<br />
<br />
=== Настройка: архитектура и флаги компиляции ===<br />
Основные настройки makepkg находятся в файле {{ic|/etc/makepkg.conf}}.<br />
<br />
Опции {{ic|MAKEFLAGS}}, {{ic|CFLAGS}} и {{ic|CXXFLAGS}} используются программами {{Pkg|make}}, {{Pkg|gcc}} и {{ic|g++}} во время компиляции программ через makepkg. По умолчанию, эти опции направлена на генерацию «обычных» (generic) пакетов, которые могут устанавливаться и работать на различных аппаратных конфигурациях. Тонкой настройкой опций компиляции может быть достигнут прирост производительности на конкретной машине. Но пакет, скомпилированный под конкретный процессор, может не работать на других машинах.<br />
<br />
{{Note|Имейте в виду, что не все пакеты и/или системы сборки пакетов будут использовать эти опции компиляции. Иногда опции задаются жёстко в настройках оригинальных Makefiles или в [[PKGBUILD (Русский)|PKGBUILD]].}}<br />
<br />
{{hc|/etc/makepkg.conf|<nowiki><br />
...<br />
<br />
#########################################################################<br />
# ARCHITECTURE, COMPILE FLAGS<br />
#########################################################################<br />
#<br />
CARCH="x86_64"<br />
CHOST="x86_64-unknown-linux-gnu"<br />
<br />
#-- Exclusive: will only run on x86_64<br />
# -march (or -mcpu) builds exclusively for an architecture<br />
# -mtune optimizes for an architecture, but builds for whole processor family<br />
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"<br />
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"<br />
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro"<br />
#-- Make Flags: change this for DistCC/SMP systems<br />
#MAKEFLAGS="-j2"<br />
<br />
...<br />
</nowiki>}}<br />
<br />
Изначальные опции {{ic|CFLAGS}} and {{ic|CXXFLAGS}} файла makepkg.conf совместимы с любой машиной соответствующей архитектуры. <br />
<br />
Начиная с версии 4.3.0, GCC содержит настройку {{ic|1=-march=native}}, которая включает автонастройку под конкретный процессор и автоматически включает соответствующие оптимизации при сборке. Чтобы использовать эту настройку, измените начальные опции {{ic|CFLAGS}} и {{ic|CXXFLAGS}} следующим образом:<br />
<br />
# -march=native also sets the correct -mtune=<br />
CFLAGS="-march=native -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"<br />
CXXFLAGS="${CFLAGS}"<br />
<br />
Посмотрите {{ic|man gcc}} для полного списка доступных опций. Дополнительную информацию можно найти в вики проекта Gentoo: [http://www.gentoo.org/doc/en/gcc-optimization.xml Compilation Optimization Guide] и [http://wiki.gentoo.org/wiki/Safe_CFLAGS Safe Cflags].<br />
<br />
====Опция MAKEFLAGS====<br />
Опция {{ic|MAKEFLAGS}} используется для дополнительной настройки процесса сборки. Владельцы многоядерных или многопроцессорных систем могут определить количество одновременных потоков компиляции. Обычно нормальная настройка — {{ic|-j2}}, плюс 1 на каждое дополнительное ядро или процессор. Некоторые [[PKGBUILD (Русский)|PKGBUILD]]'ы специально обходят эту настройку своей опцией {{ic|-j1}} из-за ограничений конкретной программы, или просто потому, что изначально эта опция не поддерживалась, а впоследствии её забыли убрать. Иногда из-за этого сборка может кончиться неудачей, пожалуйста, [[Reporting Bug Guidelines|сообщайте]] о таких случаях на баг-трекер, но сначала убедитесь, что дело именно в использовании ваших MAKEFLAGS.<br />
<br />
Смотрите {{ic|man make}} для полного списка доступных опций.<br />
<br />
==Установка через скрипты сборки==<br />
Иногда со сторонних репозитариев вы можете обнаружить только файлы типа *.pkgbuild. В этом случае добавьте параметр '''-p''' к makepkg указав имя нужного вам сборочного скрипта:<br />
<br />
$ makepkg -p <buildscript><br />
<br />
Поздравляем! Теперь вы успешно собрали и установили ваш собственный пакет!<br />
<br />
==Полезные ссылки==<br />
* [https://bbs.archlinux.org/viewtopic.php?t=1590 Полезное руководство по makepkg/ABS]<br />
* [[Creating Packages (Русский)|Руководство по созданию пакетов Arch]]<br />
* [https://aur.archlinux.org AUR]<br />
* [https://www.archlinux.org/pacman/makepkg.8.html Страница man для makepkg]<br />
* [[Arch CVS & SVN PKGBUILD guidelines|Напутствия по созданию PKGBUILD-скриптов в Arch CVS & SVN]]<br />
* [[Makepkg.conf]]</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=LVM_(%E6%97%A5%E6%9C%AC%E8%AA%9E)&diff=301045LVM (日本語)2014-02-24T03:46:43Z<p>Mistofvongola: /* 参照 */ Fix Gentoo wiki link</p>
<hr />
<div>[[Category:Getting and installing Arch (日本語)]]<br />
[[Category:File systems (日本語)]]<br />
[[cs:LVM]]<br />
[[de:LVM]]<br />
[[en:LVM]]<br />
[[es:LVM]]<br />
[[fr:LVM]]<br />
[[it:LVM]]<br />
[[ru:LVM]]<br />
[[tr:LVM]]<br />
[[zh-CN:LVM]]<br />
{{Related articles start (日本語)}}<br />
{{Related|Software RAID and LVM}}<br />
{{Related|System Encryption with LUKS}}<br />
{{Related|dm-crypt/Encrypting an Entire System#LVM on LUKS}}<br />
{{Related|dm-crypt/Encrypting an Entire System#LUKS on LVM}}<br />
{{Related articles end}}<br />
[[Wikipedia:ja:論理ボリュームマネージャ|Wikipedia]] より:<br />
:LVM は [[Wikipedia:ja:Linuxカーネル|Linux カーネル]]の[[Wikipedia:logical volume management|論理ボリュームマネージャ]]です。ディスクドライブと大容量記憶装置を管理します。<br />
<br />
=== LVM の構成要素 ===<br />
<br />
Logical Volume Management は Linux カーネルの [http://sources.redhat.com/dm/ device-mapper] 機能を利用して基になっているディスクレイアウトから独立したパーティションのシステムを提供します。LVM を使うことで記憶領域を抽象化することで、(使っているファイルシステムで可能な限り)簡単にパーティションを拡大・縮小したり、物理ディスク上に十分な連続した領域があるかどうか心配することなく、また、fdisk したいディスクが使用中だったり (そしてカーネルが新旧どちらのパーティションテーブルを使っているのかわからなかったり) 他のパーティションをどけなくてはならないという問題に煩わされることなく、パーティションを追加・削除することが可能になります。これは厳密に言えば管理のしやすさの問題です: LVM はセキュリティを追加することはありません。しかしながら、私達の使っている他の2つの技術と上手く収まりがつきます。<br />
<br />
LVM の基本的な構成要素は以下の通りです:<br />
<br />
* '''物理ボリューム (PV, Physical volume)''': ハードディスク上のパーティション (もしくはハードディスクそれ自体、ループバックファイル) です。これをまとめてボリュームグループを作ることができます。特別なヘッダーがあり物理エクステントに分割されます。物理ボリュームについてはハードドライブを構成するための大きなブロックとして考えて下さい。<br />
* '''ボリュームグループ (VG, Volume group)''': ストレージボリューム(つまり一つのディスク)として使われる物理ボリュームの集まりです。ボリュームグループには論理ボリュームが含められます。ボリュームグループはハードドライブとして考えて下さい。<br />
* '''論理ボリューム (LV, Logical volume)''': ボリュームグループの中にある"仮想/論理パーティション"であり、物理エクステントで構成されます。論理ボリュームのことは通常のパーティションみたいなものと考えて下さい。<br />
* '''物理エクステント (PE, Physical extent)''': 論理ボリュームに割り当てるごとができるディスクの欠片 (通常 4MiB) です。物理エクステントはどのパーティションにも割り当てることが出来るディスクのパーツと考えて下さい。<br />
<br />
例:<br />
'''Physical disks'''<br />
<br />
Disk1 (/dev/sda):<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br />
|Partition1 50GB (Physical volume) |Partition2 80GB (Physical volume) |<br />
|/dev/sda1 |/dev/sda2 |<br />
|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |<br />
<br />
Disk2 (/dev/sdb):<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br />
|Partition1 120GB (Physical volume) |<br />
|/dev/sdb1 |<br />
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ _|<br />
<br />
'''LVM logical volumes'''<br />
<br />
Volume Group1 (/dev/MyStorage/ = /dev/sda1 + /dev/sda2 + /dev/sdb1):<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ <br />
|Logical volume1 15GB |Logical volume2 35GB |Logical volume3 200GB |<br />
|/dev/MyStorage/rootvol|/dev/MyStorage/homevol |/dev/MyStorage/mediavol |<br />
|_ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |<br />
<br />
=== 利点 ===<br />
<br />
LVM には通常のハードドライブのパーティションを使うよりも幅広い柔軟性があります:<br />
* 多数のディスクを一つの大きなディスクとして使えます。<br />
* 複数のディスクにまたがる論理ボリュームを作れます。<br />
* 小さな論理ボリュームを作成し、満杯になったら"動的に"リサイズできます。<br />
* ディスクの順番と関係なく論理ボリュームをリサイズできます。VG における LV の位置に依存しないので、周辺に空き容量を取る必要がありません。<br />
* オンラインで論理・物理ボリュームをリサイズ・作成・削除できます。ボリューム上のファイルシステムもリサイズする必要がありますが、オンラインリサイズをサポートしているファイルシステムもあります。<br />
* サービスによって使われている LV を、サービスを再起動する必要なく他のディスクへオンラインで移行することができます。<br />
* スナップショットを使うことでファイルシステムのフローズンコピーをバックアップすることができます。サービスを落とす時間を最小限にできます。<br />
<br />
以上のことはサーバー環境でとても役に立ちます。デスクトップでは利点が薄れるかもしれませんが、これらの機能を使う価値があるかどうか決めるのはあなたです。<br />
<br />
=== 欠点 ===<br />
<br />
* (ほとんど) Linux でしか使えない。他の OS (FreeBSD, Windows..) には公式なサポートがない。<br />
* システムのセットアップに追加の手順が必要で、やや複雑。<br />
* [[Btrfs (日本語)|btrfs]] ファイルシステムを使用する場合、サブボリューム機能があるので柔軟性のあるレイアウトを作ることができる。そのため、LVM の抽象レイヤーを使う必要性が少なくなる。<br />
<br />
== Arch Linux を LVM にインストールする ==<br />
<br />
インストール作業の[[Partitioning (日本語)|パーティション分割]]と[[File Systems (日本語)#デバイスのフォーマット|フォーマット]]の手順の間に LVM ボリュームを作成する必要があります。root ファイルシステムにするパーティションを直接フォーマットする代わりに、論理ボリューム (LV) の中に作成します。<br />
<br />
{{pkg|lvm2}} パッケージを[[pacman (日本語)|インストール]]してください。<br />
<br />
概略: <br />
* PV を入れるパーティションを作成します。パーティションのタイプは 'Linux LVM' に設定してください、MBR を使っている場合は 8e、GPT の場合は 8e00 です。<br />
* 物理ボリューム (PV) を作成します。ディスクが一つしかない場合は一つの大きなパーティションに一つの PV を作成するのが良いでしょう。ディスクが複数ある場合はそれぞれにパーティションを作成してパーティション毎に PV を作ることができます。<br />
* ボリュームグループ (VG) を作成して全ての PV を追加します。<br />
* VG の中に論理ボリューム (LV) を作成します。<br />
* [[ビギナーズガイド]]の "パーティションのフォーマット" の手順に進んで下さい。<br />
* ビギナーズガイドの “Initial ramdisk 環境の作成” まで行ったら、{{ic|mkinitcpio.conf}} に lvm フックを追加してください (詳細は下を見て下さい)。<br />
<br />
{{Warning|[[GRUB Legacy]] は LVM をサポートしていないため、LVM の中に {{ic|/boot}} を置くことはできません。[[GRUB (日本語)|GRUB]] を使っている場合はこの制限はありません。GRUB Legacy を使う必要があるときは、{{ic|/boot}} パーティションを分割して作成し直接フォーマットするようにしてください。}}<br />
<br />
=== 物理ボリュームの作成 ===<br />
<br />
適切なパーティションを指定するようにしてください。'Linux LVM' タイプのパーティションを見つけるには:<br />
* MBR システム: {{Ic|fdisk -l}}<br />
* GPT システム: {{Ic|lsblk}} からの {{Ic|gdisk -l ''disk-device''}}<br />
<br />
パーティションに物理ボリュームを作成してください:<br />
# pvcreate ''disk-device''<br />
''disk-device'' は {{ic|/dev/sda2}} などに置き換えてください。このコマンドはパーティションにヘッダーを作成し LVM に使えるようにします。次のコマンドで作成した物理ボリュームを確認できます:<br />
# pvdisplay<br />
<br />
{{Note|SSD を使っているなら {{ic|pvcreate --dataalignment 1m /dev/sda2}} を使用してください (1MiB 境界で整列させる)、[http://serverfault.com/questions/356534/ssd-erase-block-size-lvm-pv-on-raw-device-alignment ここ] を参照。}}<br />
<br />
=== ボリュームグループの作成 ===<br />
<br />
次は物理ボリュームの上にボリュームグループを作成します。まず新しいパーティションの一つにボリュームグループを作成してから、そこに入れたい他の全ての物理ボリュームを追加します:<br />
# vgcreate VolGroup00 /dev/sda2<br />
# vgextend VolGroup00 /dev/sdb1<br />
また、ボリュームグループを作成する際に、VolGroup00 以外の好きな名前を付けることもできます。ボリュームグループがどうなっているか確認するには次のコマンドを使います:<br />
# vgdisplay<br />
<br />
{{Note|必要ならば複数のボリュームグループを作成することもできますが、それだと全てのストレージを一つのディスクにまとめることはできなくなります。}}<br />
<br />
=== 論理ボリュームの作成 ===<br />
<br />
そしてボリュームグループには論理ボリュームを作る必要があります。論理ボリュームを作成するには次のコマンドを使います。新しい論理ボリュームの名前、サイズ、そしてどのボリュームグループに作るかを指定してください:<br />
# lvcreate -L 10G VolGroup00 -n lvolhome<br />
これで論理ボリュームが作成され {{ic|/dev/mapper/Volgroup00-lvolhome}} や {{ic|/dev/VolGroup00/lvolhome}} でアクセスできるようになります。ボリュームグループと同じく、論理ボリュームには好きな名前を命名できます。<br />
<br />
論理ボリュームにスワップを作成するには、引数を追加する必要があります:<br />
# lvcreate -C y -L 10G VolGroup00 -n lvolswap<br />
{{Ic|-C y}} を使うことで連続するパーティションが作られます。スワップ領域を複数のディスクや飛び飛びの物理エクステントにまたがってパーティション分けすることはできません。<br />
<br />
ボリュームグループに残っている空き容量全てを使う論理ボリュームを作成するには、次のコマンドを使って下さい:<br />
# lvcreate -l +100%FREE VolGroup00 -n lvolmedia<br />
<br />
作成した論理ボリュームは次のコマンドで確認できます:<br />
# lvdisplay<br />
<br />
{{Note|上のコマンドを実行するために ''device-mapper'' カーネルモジュールをロード ({{ic|modprobe dm-mod}}) しなくてはならない場合があります。}}<br />
<br />
{{Tip|比較的小さな論理ボリュームを作ってから、後で必要になったときに拡大することも可能です。シンプリシティを尊ぶのなら、ボリュームグループに拡大のための空き容量をいくらか残しておきましょう。}}<br />
<br />
=== ファイルシステムの作成と論理ボリュームのマウント ===<br />
<br />
論理ボリュームは {{ic|/dev/mapper/}} や {{ic|/dev/''YourVolumeGroupName''}} に配置されているはずです。論理ボリュームを見つけられないときは、以下のコマンドを使ってデバイスノードを作成するためのモジュールをロードしてボリュームグループが使えるようにしてください:<br />
# modprobe dm-mod<br />
# vgscan<br />
# vgchange -ay<br />
さて論理ボリュームにファイルシステムを作成して通常のパーティションとしてマウントすることが可能になりました (Arch linux のインストールをしているのならば、詳しくは[[Beginners' Guide (日本語)#パーティションのマウント|パーティションのマウント]]を参照してください):<br />
# mkfs.ext4 /dev/mapper/VolGroup00-lvolhome<br />
# mount /dev/mapper/VolGroup00-lvolhome /home<br />
<br />
{{Warning|マウントポイントを選択する時は、新しく作成した論理ボリュームを選択してください (次を使って下さい: {{ic|/dev/mapper/Volgroup00-lvolhome}})。論理ボリュームが作られている実際のパーティションを'''選択してはいけません''' (次は使わないで下さい: {{ic|/dev/sda2}})。}}<br />
<br />
=== lvm フックを mkinitcpio.conf に追加する ===<br />
<br />
{{Ic|udev}} と {{Ic|lvm2}} の [[mkinitcpio (日本語)|mkinitcpio]] フックを有効にする必要があります。<br />
<br />
{{Ic|udev}} はデフォルトで有効になっています。以下のようにファイルを編集して {{Ic|block}} と {{Ic|filesystem}} の間に {{Ic|lvm2}} を入れて下さい:<br />
<br />
{{hc|/etc/mkinitcpio.conf:|<nowiki>HOOKS="base udev ... block lvm2 filesystems"</nowiki>}}<br />
<br />
その後、[[Mkinitcpio (日本語)#イメージ作成とアクティベーション|initial ramdisk の作成]]を行なってから通常のインストールの手順に戻ることができます。<br />
<br />
== 設定 ==<br />
<br />
=== 高度なオプション ===<br />
<br />
(スナップショットに必要な)モニタリングが必要な場合は lvmetad を有効にしてください。{{ic|/etc/lvm/lvm.conf}} の {{ic|1=use_lvmetad = 1}} を設定することで有効にできます。現在はデフォルトで有効になっています。<br />
<br />
自動的に有効になるボリュームを制限するには {{Ic|/etc/lvm/lvm.conf}} の {{Ic|auto_activation_volume_list}} を設定します。よくわからないときは、このオプションはコメントアウトしたままにしてください。<br />
<br />
=== 論理ボリュームを拡大する ===<br />
<br />
論理ボリュームを拡大するには、まず論理ボリュームを拡大させてから次に新しく作られた空き容量を使うようにファイルシステムを拡大させる必要があります。例えば ext3 が載った 15GB の論理ボリュームがあり 20G まで拡大したいとします。そうすると以下のコマンドを実行しなくてはなりません: <br />
# lvextend -L 20G VolGroup00/lvolhome (or lvresize -L +5G VolGroup00/lvolhome)<br />
# resize2fs /dev/VolGroup00/lvolhome<br />
{{Ic|lvextend}} の代わりに {{Ic|lvresize}} を使うことも可能です。<br />
<br />
ボリュームグループにある全ての空き容量を使うようにしたい場合は、次のコマンドを使って下さい:<br />
# lvextend -l +100%FREE VolGroup00/lvolhome<br />
<br />
{{Warning|ファイルシステムによっては拡大するとデータが消失したり、オンラインでの拡大をサポートしていません。}}<br />
<br />
{{Note|ファイルシステムのリサイズを行わないと、以前のボリュームと同じサイズしか使えません (ボリュームは大きくなっていますが部分的にしか使えません)。}}<br />
<br />
=== 論理ボリュームを縮小する ===<br />
<br />
基本的にファイルシステムは論理ボリュームと同じ大きさになっているので、まずファイルシステムを縮小してから次に論理ボリュームを縮小する必要があります。ファイルシステムによっては、先にファイルシステムをアンマウントする必要があるかもしれません。例えば ext3 が載った 15GB の論理ボリュームがあり 10G まで縮小したいとします。そうすると以下のコマンドを実行することになります: <br />
# resize2fs /dev/VolGroup00/lvolhome 9G<br />
# lvreduce -L 10G VolGroup00/lvolhome<br />
<br />
ここでファイルシステムを必要以上に縮小しているのは論理ボリュームを縮小するときにファイルシステムの末尾を偶発的に切り落とすことがないようにするためです。論理ボリュームを縮小した後に、論理ボリュームに残っている空き容量を満たすようにファイルシステムを拡大してください。{{Ic|lvreduce}} の代わりに {{Ic|lvresize}} を使うことも可能です。<br />
# lvresize -L -5G VolGroup00/lvolhome<br />
# resize2fs /dev/VolGroup00/lvolhome<br />
<br />
{{Warning|<br />
* ファイルシステムのサイズをデータによって占められている容量よりも削減してはいけません、データを消失する可能性があります。<br />
* ファイルシステムによっては縮小するとデータが消失したり、オンラインでの縮小をサポートしていません。<br />
}}<br />
<br />
=== 論理ボリュームを削除する ===<br />
<br />
{{Warning|論理ボリュームを削除する前に、データは全て他の場所に退避させてください、残っているデータは消去されます!}}<br />
<br />
まず、削除したい論理ボリュームの名前を確認してください。システムにインストールされている全ての論理ボリュームのリストを表示するには次のコマンドを使います:<br />
<br />
# lvs<br />
<br />
次に、削除する論理ボリュームのマウントポイントを確認して:<br />
<br />
$ df -h<br />
<br />
アンマウントしてください:<br />
<br />
# umount /your_mountpoint<br />
<br />
最後に、論理ボリュームを削除してください:<br />
<br />
# lvremove /dev/yourVG/yourLV<br />
<br />
{{ic|y}} を入力することで実際に削除が実行されます。<br />
<br />
{{ic|/etc/fstab}} を更新することを忘れないようにしましょう。<br />
<br />
論理ボリュームの削除を確認するには root で {{ic|lvs}} を実行します (このセクションの一番最初を参照)。<br />
<br />
=== ボリュームグループに物理ボリュームを追加する ===<br />
<br />
まず使いたいブロックデバイスに新しい物理ボリュームを作成して、それからボリュームグループに追加してください:<br />
<br />
{{bc|1=<br />
# pvcreate /dev/sdb1<br />
# vgextend VolGroup00 /dev/sdb1<br />
}}<br />
<br />
これでボリュームグループの物理エクステントの総量が増えて、自由に論理ボリュームに割り当てることができるようになります。<br />
<br />
{{Note|ストレージメディアの[[Partitioning (日本語)|パーティションテーブル]]は LVM の下に置くのが良いと考えられています。適切なタイプコードを使って下さい: MBR なら {{ic|8e}}、GPT なら {{ic|8e00}}。}}<br />
<br />
=== ボリュームグループからパーティションを削除する ===<br />
<br />
パーティションにあるデータを全て他のパーティションに移動する必要があります。ありがたいことに、LVM では簡単にできます:<br />
# pvmove /dev/sdb1<br />
データを特定の物理ボリュームに移したい場合は、{{Ic|pvmove}} の二番目の引数に物理ボリュームを指定してください:<br />
# pvmove /dev/sdb1 /dev/sdf1<br />
次に物理ボリュームをボリュームグループから削除する必要があります:<br />
# vgreduce myVg /dev/sdb1<br />
もしくは、空の物理ボリュームを全て削除してください:<br />
# vgreduce --all vg0<br />
<br />
そして最後に、パーティションを他のことに使うために、LVM にパーティションを物理ボリュームとして扱わせないようにするには:<br />
# pvremove /dev/sdb1<br />
<br />
=== ボリュームグループを無効化する ===<br />
<br />
次を実行してください:<br />
# vgchange -a n my_volume_group<br />
<br />
これでボリュームグループが無効になりボリュームグループが入っていたコンテナをアンマウントできるようになります。<br />
<br />
=== スナップショット ===<br />
<br />
==== 説明 ====<br />
<br />
LVM を使うことで伝統的なバックアップよりも効率的なシステムのスナップショットを作ることができます。COW (copy-on-write) ポリシーを使うことによって効率化を実現しています。最初に作成したスナップショットには実際のデータの inode のハードリンクだけが含まれます。データに変更が加えられない間は、スナップショットには inode ポインターしかなくデータ自体は入りません。スナップショット先のファイルやディレクトリに変更が入ると、スナップショットによって古いコピーが参照され、新しいコピーは実行中のシステムによって参照されます。このため、35GB のデータがあるシステムでも 2GB 以下しか (オリジナルとスナップショット両方に) 変更を加えない限り、スナップショットに消費する空き容量は 2GB だけです。<br />
<br />
==== 設定 ====<br />
<br />
スナップショットの論理ボリュームは通常の論理ボリュームと同じように作れます:<br />
<br />
# lvcreate --size 100M --snapshot --name snap01 /dev/mapper/vg0-pv<br />
上記のボリュームでは、スナップショットボリュームが一杯になるまで、データの 100M まで変更を加えることができます。<br />
<br />
次のコマンドを使うことによって変更が入った後の 'pv' 論理ボリュームを 'snap01' スナップショットが作られた状態まで戻すことが可能です:<br />
<br />
# lvconvert --merge /dev/vg0/snap01<br />
<br />
オリジナルの論理ボリュームが使用中の場合は、次のブート時にマージされます (LiveCD からマージすることもできます)。<br />
<br />
マージが行われるとスナップショットはもう存在しなくなります。<br />
<br />
また、複数のスナップショットを作成して、それぞれを自由にオリジナルの論理ボリュームにマージすることも可能です。<br />
<br />
スナップショットはマウントして ''dd'' や ''tar'' を使うことでバックアップできます。''dd'' で作られるバックアップファイルのサイズはスナップショットボリュームに入っているファイルのサイズになります。<br />
復元は、スナップショットを作成してマウントして、バックアップをそこに書き込むか展開するだけです。そしてオリジナルのボリュームにマージしてください。<br />
<br />
{{ic|/etc/mkinitcpio.conf}} の MODULES 変数に ''dm_snapshot'' モジュールを入れることが必要で、これがないとシステムが起動しなくなります。インストールしたシステムに既に記述してある場合は、次のコマンドでイメージを再生成してください:<br />
# mkinitcpio -g /boot/initramfs-linux.img<br />
<br />
スナップショットは主にバックアップのためのファイルシステムのフローズンコピーを作るのに使われます; 2時間かかるバックアップはパーティションを直接バックアップするよりも一貫性のあるファイルシステムのイメージを提供します。<br />
<br />
バックアップやロールバックのためシステム起動時に root ファイルシステムのスナップショットを自動的に作成する方法は [[Create root filesystem snapshots with LVM]] を見て下さい。<br />
<br />
[[Mkinitcpio (日本語)|initramfs]] によって有効にならない LVM ボリュームがある場合は、{{pkg|lvm2}} パッケージに入っている ''lvm-monitoring'' サービスを[[systemd (日本語)#ユニットを使う|有効化]]してください。<br />
<br />
== トラブルシューティング ==<br />
<br />
=== Arch-Linux のデフォルトの変更のためにする必要がある変更 ===<br />
<br />
{{ic|/etc/lvm/lvm.conf}} には {{ic|1=use_lvmetad = 1}} を設定する必要があります。現在はデフォルトで設定されています。{{ic|lvm.conf.pacnew}} ファイルがある場合は、この変更を適用してください。<br />
<br />
=== LVM コマンドが機能しない ===<br />
<br />
* 適切なモジュールをロードしてください:<br />
# modprobe dm_mod<br />
<br />
{{ic|dm_mod}} モジュールは自動的にロードされるはずです。そうならない場合は、次を試してみて下さい:<br />
<br />
{{hc|/etc/mkinitcpio.conf:|<nowiki>MODULES="dm_mod ..."</nowiki>}}<br />
<br />
変更を適用するには initramfs を[[Mkinitcpio (日本語)#イメージ作成とアクティベーション|再生成]]する必要があります。<br />
<br />
* ''lvm'' コマンドを次のように試してみて下さい:<br />
# lvm pvdisplay<br />
<br />
=== 論理ボリュームが表示されない ===<br />
<br />
既存の論理ボリュームをマウントしようとしても、{{ic|lvscan}} に表示されない場合、以下のコマンドによってボリュームを有効にすることができます:<br />
<br />
# vgscan<br />
# vgchange -ay<br />
<br />
=== リムーバルメディア上の LVM ===<br />
<br />
症状:<br />
# vgscan<br />
Reading all physical volumes. This may take a while...<br />
/dev/backupdrive1/backup: read failed after 0 of 4096 at 319836585984: Input/output error<br />
/dev/backupdrive1/backup: read failed after 0 of 4096 at 319836643328: Input/output error<br />
/dev/backupdrive1/backup: read failed after 0 of 4096 at 0: Input/output error<br />
/dev/backupdrive1/backup: read failed after 0 of 4096 at 4096: Input/output error<br />
Found volume group "backupdrive1" using metadata type lvm2<br />
Found volume group "networkdrive" using metadata type lvm2<br />
<br />
病因:<br />
:最初にボリュームグループを無効にしないで外付けの LVM ドライブを取り外したこと。切断する前に、次を実行するようにしましょう:<br />
# vgchange -an ''volume group name''<br />
<br />
治療:<br />
:外部ドライブのプラグを抜いて数分待って下さい:<br />
# vgscan<br />
# vgchange -ay ''volume group name''<br />
<br />
=== カーネルオプション ===<br />
<br />
カーネルオプションに、{{ic|dolvm}} が必要かもしれません。{{ic|<nowiki>root=</nowiki>}} は論理ボリュームに設定してください (例: {{ic|/dev/mapper/''vg-name''-''lv-name''}})。<br />
<br />
== 参照 ==<br />
<br />
* [http://sourceware.org/lvm2/ LVM2 Resource Page] on SourceWare.org<br />
* [http://tldp.org/HOWTO/LVM-HOWTO/ LVM HOWTO] article at The Linux Documentation project<br />
* [http://www.gentoo.org/doc/en/lvm2.xml Gentoo LVM2 installation] guide at Gentoo documentation<br />
* [http://wiki.gentoo.org/wiki/LVM LVM] article at Gentoo wiki<br />
* [http://www.joshbryan.com/blog/2008/01/02/lvm2-mirrors-vs-md-raid-1/ LVM2 Mirrors vs. MD Raid 1] post by Josh Bryan<br />
* [http://www.tutonics.com/2012/11/ubuntu-lvm-guide-part-1.html Ubuntu LVM Guide Part 1][http://www.tutonics.com/2012/12/lvm-guide-part-2-snapshots.html Part 2 detals snapshots]</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=LVM_(Italiano)&diff=301044LVM (Italiano)2014-02-24T03:46:24Z<p>Mistofvongola: /* Altre risorse */ Fix Gentoo Wiki link</p>
<hr />
<div>[[Category:Getting and installing Arch (Italiano)]]<br />
[[Category:File systems (Italiano)]]<br />
[[cs:LVM]]<br />
[[de:LVM]]<br />
[[en:LVM]]<br />
[[es:LVM]]<br />
[[fr:LVM]]<br />
[[ja:LVM]]<br />
[[ru:LVM]]<br />
[[tr:LVM]]<br />
[[zh-CN:LVM]]<br />
{{Out of date|Questo articolo non è stato aggiornato secondo la nuova procedure di installazione fornita dai nuovi script di installazione di Arch. I riferimenti ad /arch/setup e all'installer non sono applicabili ai nuovi media di installazione.}}<br />
{{Related articles start (Italiano)}}<br />
{{Related|Software RAID and LVM}}<br />
{{Related|System Encryption with LUKS}}<br />
{{Related articles end}}<br />
Questo articolo fornirà un esempio su come installare e configurare Arch Linux utilizzando il Logical Volume Manager (LVM).<br />
<br />
==Introduzione==<br />
{{Wikipedia|Logical Volume Manager (Linux)}}<br />
<br />
'''LVM''' (Logical Volume Management) utilizza la funzione di [http://sources.redhat.com/dm/ device-mapper] del kernel Linux per fornire un sistema di partizioni che sia indipendente dalla sottostante struttura del disco fisico. Con LVM è possibile crere uno spazio di archiviazione astratto ed avere "partizioni virtuali" il che rende più facile ingrandirene o ridurne la dimensione (sempre che il filesystem che vi risede lo permetta) permette inoltre di aggiungere/rimuovere partizioni senza preoccuparsi di avere spazio contiguo a disposizione su uno specifico disco, senza incorrere nel problema di effettuare un fdisk su un disco in uso (senza preoccuparsi se il kernel stia usando la vecchia o la nuova tavola delle partizioni) e senza aver bisogno di spostare altre partizioni dal loro posto. Questo è una semplificazione nella gestione: non fornisce nessuna sicurezza per i dati. Comunque, si integra bene con le altre due tecnologie che vengono utilizzate.<br />
<br />
Nota che LVM non è utilizzato per la partizione {{ic|/boot}}, a causa di problemi con il bootloader.<br />
{{Tip|/boot non può risiedere su di una partizione LVM se viene utilizzato [[GRUB Legacy (Italiano)|GRUB Legacy]], il quale non supporta LVM. Se si vuole utilizzare LVM anche per la partizione di /boot sarà necessario utilizzare [[GRUB2 (Italiano)|GRUB2]]. }}<br />
<br />
Le componenti base di LVM sono:<br />
<br />
* '''Volume Fisico(Physical volume (PV))''': Partizione del disco(oppure anche l'intero disco o un file di loopback) sul quale è possibile creare un gruppo di volumi. Ha un header speciale ed è diviso in estensioni fisiche. Si pensi al volume fisico come grandi blocchi che possono essere usati per costruire il nostro hard drive.<br />
* '''Gruppo di Volumi(Volume group (VG))''': Un insieme di volumi fisici usati come un unico volume di archiviazione(come un disco). Essi contengono i volumi logici.Si pensi ai gruppi di volumi come agli hard drive.<br />
* '''Volume Logico(Logical volume (LV))''': Una "partizione virtuale/logica" che risiede in un volume logico ed è composta da estensioni fisiche. Si pensi ai volumi logici come una normale partizione.<br />
* '''Estensione Fisica(Physical extent (PE))''': Una piccola porzione di un disco (solitamente 4MB) che può assegnata ad un volume logico. Si pensi alle estensioni fisiche come porzioni di dischi che posso essere allocate ad una qualsiasi partizione.<br />
<br />
Con LVM sarà più facile gestire le proprie partizioni (volumi logici) rispetto ad un disco partizionato normalmente. Ad esempio, sarà possibile:<br />
<br />
* Usare ''un qualsiasi numero'' di dischi come un grande disco(VG)<br />
* Avere partizioni(LV) sparse ''sopra'' a diversi dischi (possono essere grandi quanto la capacità di archiviazione di tutti i dischi insieme)<br />
* Ridimensionare/creare/eliminare partizioni(LV) e dischi(VG) ''come si vuole'' (non esiste il vincolo della posizione dei volumi logici nel gruppo di volumi come invece per le normali partizioni)<br />
* Ridimensionare/creare/cancellare partizioni(LV) e dischi(VG) ''online'' (i filesystem che risiedono su di essi dovranno essere ridimensionati, ma solo alcuni supportano il ridimensionamento online)<br />
* ''Chiamare'' i propri dischi(VG) e le proprie partizioni(LV) come si desidera<br />
* Creare piccole partizioni(LV) e ridimensionarle "''dinamicamente''" appena esse si riempono (l'allargamento del filesystem dovrà essere eseguito a mano, ma può essere effettuato online con alcuni filesystem)<br />
* ...<br />
<br />
Esempio: <br />
'''Dischi fisici'''<br />
<br />
Disco1 (/dev/sda):<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br />
|Partizione1 50GB (Volume fisico) |Partizione2 80GB (Volume fisico) |<br />
|/dev/sda1 |/dev/sda2 |<br />
|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |<br />
<br />
Disco2 (/dev/sdb):<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br />
|Partizione1 120GB (Volume fisico) |<br />
|/dev/sdb1 |<br />
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ _|<br />
<br />
'''Volumi logici LVM'''<br />
<br />
Gruppo di volumi1 (/dev/MyStorage/ = /dev/sda1 + /dev/sda2 + /dev/sdb1):<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ <br />
|Volume logico1 15GB |volume logico2 35GB |Volume logico3 200GB |<br />
|/dev/MyStorage/rootvol|/dev/MyStorage/homevol |/dev/MyStorage/mediavol |<br />
|_ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |<br />
<br />
Per riassumere: con LVM si può utilizzare tutto il proprio spazio di archiviazione come un unico grande disco (gruppo di volumi) ed avere una maggiore flessibilità nella gestione delle partizioni (volumi logici).<br />
<br />
==Vantaggi==<br />
Qui sono elencate alcune cose che è possibile realizzare con LVM che non possono (oppure non sono facilmente realizzabili) con il semplice uso di mdadm, partizioni MBR, partizioni GPT, parted/gparted e strumenti a livello file come rsync.<br />
# Ridimensionamento online/live.<br />
# Non sono più necessarie partizioni estese (non lo sono nemmeno per i partizionamenti GPT)<br />
# Ridimensionare le partizioni senza il problema del loro ordine sul disco (non è necessario preoccuparsi dello spazio contiguo disponibile)<br />
# Migrazione online/live delle partizioni usate da servizi senza dover riavviare i servizi.<br />
<br />
Questo può essere molto utile su di un server, senza interfaccia grafica quindi, ma sarà necessario decidere se le sue caratteristiche valgono l'astrazione.<br />
<br />
==Installazione==<br />
Prima poter procedere sarà necessario caricare il modulo appropriato:<br />
# modprobe dm-mod<br />
Se Arch Linux è già installata e si vuole solamente provare/aggiungere una partizione usando LVM, saltare al paragrafo [[#Partizionare i dischi|Partizionare i dischi]].<br />
<br />
===Installare Arch Linux su LVM===<br />
Prima di eseguire gli script di installazione di Arch Linux ({{ic|/arch/setup}}), sarà necessario partizionare il disco con {{ic|cfdisk}} (oppure un altro strumento a piacimento). Dato che grub legacy (GRUB avente un numero versione minore di 1.0) non può effettuare il boot da volumi logici LVM non sarà possibile avere la partizione {{ic|/boot}} su LVM, creare quindi una partizione dedicata. 100 MB dovrebbero bastare. Una alternativa consiste nell'utilizzare LILO oppure GRUB versione 1.95 o maggiore. <br />
<br />
===Partizionare i dischi===<br />
Successivamente sarà necessario creare una partizione per LVM. Il suo filesystem dovrebbe essere 'Linux LVM', usare quindi l'identificazione di partizione 0x8e (tipo di filesystem: 8e). Sarà necessario creare solo una partizione LVM su ogni disco che si intende utilizzare con LVM. I dischi logici risiederanno all'interno di queste partizioni quindi scegliere le dimensioni in modo adeguato. Se si intende utilizzare solo LVM e nessuna partizione esterna, usare tutto lo spazio libero su ogni disco.<br />
<br />
{{attenzione|/boot non può risiedere su LVM se viene utilizzato [[GRUB Legacy (Italiano)|GRUB Legacy]], il quale non supporta LVM. Se si vuole utilizzare LVM anche per la partizione di /boot sarà necessario utilizzare [[GRUB2 (Italiano)|GRUB2]]. }}<br />
<br />
{{Tip|Tutte le partizioni LVM su tutti i dischi possono essere configurate per apparire come un unico grande disco.}}<br />
<br />
===Creare i volumi fisici(Physical volumes)===<br />
Adesso sarà necessario inizializzare le partizioni così che possano essere utilizzate da LVM. Usare {{ic|fdisk -l}} per determinare quali partizioni hanno come tipo di filesystem 'Linux LVM' e creare il volume fisico su di esse:<br />
# pvcreate /dev/sda2<br />
Sostituire {{ic|/dev/sda2}} con le partizioni su cui si vuole creare il volume fisico. Questo comando crea un intestazione su tutte le partizioni così che possano essere usate per LVM.<br />
Si possono monitorare i volumi fisici creati con il comando:<br />
# pvdisplay<br />
<br />
{{Nota|Se si utilizza un disco SSD utilizzare {{ic|pvcreate --dataalignment 1m /dev/sda2}} (per cancellare block size < 1MiB), consultare ad esempio [http://serverfault.com/questions/356534/ssd-erase-block-size-lvm-pv-on-raw-device-alignment questa discussione]}}<br />
<br />
===Creare gruppi di volumi (Volume group)===<br />
Il prossimo passo consiste nel creare un gruppo di volumi su questo volume fisico. Prima si dovrà creare un gruppo di volumi su una delle nuove partizioni e successivamente aggiungere gli altri volumi fisici che lo comporranno:<br />
# vgcreate VolGroup00 /dev/sda2<br />
# vgextend VolGroup00 /dev/sdb1<br />
Sarà possibile utilizzare un qualsiasi altro nome invece di VolGroup00 per il gruppo di volumi durante la sua creazione. Sarà possibile controllare come si stanno espandendo i gruppi di volumi con il comando:<br />
# vgdisplay<br />
<br />
{{Nota|Sarà possibile creare più di un gruppo di volumi se necessario, ma così il nostro storage non sarà più rappresentato come un solo dico..}}<br />
<br />
===Creare i volumi logici (Logical Volumes)===<br />
Adesso verranno creati i volumi logici su questo gruppo di volumi. Creare il volume logico con il seguente comando specificando il nome del volume logico, la sua dimensione, ed il gruppo di volumi dove risiederà:<br />
# lvcreate -L 10G VolGroup00 -n lvolhome<br />
Questo comando creerà un volume logico al quale sarà possibile accedere con {{ic|/dev/mapper/VolGroup00-lvolhome}} o {{ic|/dev/VolGroup00/lvolhome}}. Come per il gruppo di volumi, sarà possibile utilizzare qualsiasi nome per il volume logico durante la sua creazione.<br />
<br />
Per creare una partizione di swap su di un volume logico, sarà necessario un argomento aggiuntivo:<br />
# lvcreate -C y -L 10G VolGroup00 -n lvolswap<br />
L'opzione {{ic|-C y}} è usata per creare una partizione contigua, cioè la partizione di swap non sarà allocata su più di un disco oppure su estensioni fisiche (PE) non contigue.<br />
<br />
Se si vuole riempire tutto lo spazio libero rimasto in un gruppo di volumi, utilizzare il seguente comando:<br />
# lvcreate -l +100%FREE VolGroup00 -n lvolmedia<br />
<br />
Si può controllare i volumi logici creati con:<br />
# lvdisplay<br />
<br />
{{Nota|Potrebbe essere necessario caricare il modulo ''device-mapper'' del kernel ('''modprobe dm-mod''') affinché il comando sopra citato abbia successo.}}<br />
<br />
{{Tip|Sarà possibile iniziare con relativamente piccole dimensioni per i volumi logici ed espanderli successivamente se necessario. Per semplicità lasciare dello spazio libero nel gruppo di volumi così da avere spazio per le espansioni dei volumi logici.}}<br />
<br />
===Creare i filesystem ed effettuare il mount dei volumi logici===<br />
Adesso i volumi logici dovrebbero essere situati in {{ic|/dev/mapper/}} e {{ic|/dev/NomeGruppoDiVolumi}}. Se non fosse possibile trovarli, usare il prossimo comando per caricare il modulo per la creazione dei nodi dei device e per rendere accessibili i gruppi di volumi:<br />
# modprobe dm-mod<br />
# vgscan<br />
# vgchange -ay<br />
Adesso sarà possibile creare i filesystem sui volumi logici ed effettuarne il mount come per le normali partizioni (se si sta installando Arch Linux, fare riferimento al paragrafo [[Beginners' Guide (Italiano)#Montare le partizioni|montare le partizioni]] per maggiori dettagli):<br />
# mkfs.ext3 /dev/mapper/VolGroup00-lvolhome<br />
# mount /dev/mapper/VolGroup00-lvolhome /home<br />
<s>Se si sta installando Arch Linux, avviare {{ic|/arch/setup}}, selezionare ''Prepare Hard Drive'' direttamente al passaggio 3 ''Set Filesystem Mountpoints'' e '''''leggere le seguenti [[# Impostare i filesystem ed i punti di mount|sezioni]] prima di procedere con l'installazione!'''''</s><br />
<br />
=== Impostare i filesystem ed i punti di mount ===<br />
* Quando si sceglie il punto di mount, selezionare il volume logico appena creato (utilizzare: {{ic|/dev/mapper/Volgroup00-lvolhome}}).<br>NON selezionare le partizioni usate per creare il volume logico (non utilizzare: {{ic|/dev/sda2}}).<br />
<br />
=== Configurare il sistema ===<br />
L'opzione {{ic|1=use_lvmetad = 1}} deve essere impostata nel file {{ic|/etc/lvm/lvm.conf}}. Come di default nelle nuove configurazioni fornite dal pacchetto {{pkg|lvm2}} - nel caso sia presente il file {{ic|lvm.conf.pacnew}}, sarà necessario confrontare i cambiamenti dei file.<br />
<br />
In caso si abbia necessità del monitoraggio dei volumi(necessario per l'uso degli snapshots):<br />
<br />
# systemctl enable lvm-monitoring.service<br />
<br />
Se si utilizza LVM su un device criptato, sarà necessario utilizzare invece:<br />
<br />
# systemctl enable lvm-on-crypt.service<br />
<br />
Oppure, se si utilizza sysvinit, modificare il valore di {{ic|USELVM}} in modo appropriato:<br />
<br />
{{hc|# vim /etc/rc.conf|<nowiki>USELVM="yes"</nowiki>}}<br />
<br />
A partire dal 02.12.2013 saranno necessarie le segueti modifiche. Sarà necessario assicurarsi che gli hook {{ic|lvm2}} ed {{ic|udev}} in [[mkinitcpio (Italiano)|mkinitcpio]] siano abilitati.<br />
<br />
{{hc|/etc/mkinitcpio.conf|<nowiki>HOOKS="base udev ... lvm2 filesystems"</nowiki>}}<br />
<br />
Assicurarsi anche che sia abilitato il modulo {{ic|dm_mod}}.<br />
<br />
{{hc|/etc/mkinitcpio.conf:|<nowiki>MODULES="dm_mod ..."</nowiki>}}<br />
<br />
In caso siano state effettuate delle modifiche al file, sarà necessario [[Mkinitcpio (Italiano)#Creazione dell'immagine ed attivazione|ricreare]] l'initramfs, in modo da renderle effetive.<br />
<br />
Può essere necessario aggiongere alle opzioni del kernel, {{ic|dolvm}}. {{ic|<nowiki>root=</nowiki>}} dovrebbe essere impostato sul volume logico, ad esempio {{ic|<nowiki>/dev/mapper/{vg-name}-{lv-name}</nowiki>}}<br />
<br />
== Configurazione ==<br />
=== Ingrandire un volume logico ===<br />
Per ingrandire un volume logico prima sarà necessario ingrandire il volume logico e poi il filesystem per poter usare il nuovo spazio libero. Ipotizzando di avere un volume logico di 15GB con un filesystem ext3 e si vuole ingrandirlo a 20GB. Saranno necessario seguire i seguenti passaggi:<br />
# lvextend -L 20G VolGroup00/lvolhome (oppure lvresize -L +5G VolGroup00/lvolhome)<br />
# resize2fs /dev/VolGroup00/lvolhome<br />
Sarà possibile usare {{ic|lvresize}} invece di {{ic|lvextend}}.<br />
<br />
Se si vuole utilizzare tutto lo spazio libero in un gruppo di volumi, usare il seguente comando:<br />
# lvextend -l +100%FREE VolGroup00/lvolhome<br />
<br />
{{attenzione|Non tutti i filesystem supportano l'ingrandimento senza perdite di dati e/o il ridimensionamento online.}}<br />
<br />
{{Nota|Se non si ridimensiona il filesystem, si avrà un volume della solita dimensione precedente al ridimensionamento (il volume sarà più grande ma parzialmente inutilizzato).}}<br />
<br />
=== Ridurre un volume logico ===<br />
Dato che probabilmente il filesystem sarà grande quanto il volume logico su cui risiede, sarà necessario prima ridurre il filesystem e dopo il volume logico. A seconda del filesystem utilizzato, potrebbe essere necessario effettuare l'umount prima. Ipotizzando di avere un volume logico di 15GB avente un filesystem ext3 e si desidera ridurlo a 10GB. Sarà necessario seguire i seguenti passaggi:<br />
# resize2fs /dev/VolGroup00/lvolhome 9G<br />
# lvreduce -L 10G VolGroup00/lvolhome (oppure lvresize -L -5G VolGroup00/lvolhome)<br />
# resize2fs /dev/VolGroup00/lvolhome<br />
In questo caso il filesystem viene ridotto in maniera maggiore di quanto viene ridotto il volume logico così non verrà accidentalmente tagliata fuori la fine del filesystem. Dopo sarà possibile espandere il filesystem fino a riempire lo spazio libero rimasto sul volume logico. Può essere utilizzato {{ic|lvresize}} invece di {{ic|lvreduce}}.<br />
<br />
{{attenzione|<br />
*Non ridurre la dimensione del filesystem fino ad essere minore del volume dei dati in esso contenuti altrimenti si rischia una perdita di dati.<br />
*Non tutti i filesystem supportano la riduzione senza perdita di dati e/o la riduzione online.}}<br />
<br />
{{Nota|E' meglio ridurre il filesystem ad una dimensione minore rispetto al volume logico, così riducendo successivamente il volume logico, non verranno tagliati fuori alcuni dei dati alla fine del filesystem.}}<br />
<br />
=== Rimuovere volumi logici ===<br />
{{attenzione|Prima di rimuovere un volume logico, assicurarsi di trasferire altrove tutti i dati che si desidera mantenere, altrimenti andranno persi!}}<br />
<br />
Prima, identificare il nome del volume logico che si desidera rimuovere. Si può ottenere una lista di tutti i volumi logici presenti nel sistema con:<br />
<br />
{{bc|# lvs}}<br />
<br />
Poi, controllare il punto di mount per il volume logico scelto...:<br />
<br />
{{bc|$ df -h}}<br />
<br />
... ed effettuare l'umount:<br />
<br />
{{bc|# umount /punto_di_mount}}<br />
<br />
Infine, rimuovere il volume logico:<br />
<br />
{{bc|# lvremove /dev/yourVG/yourLV}}<br />
<br />
Confermare premendo {{ic|y}} e sarà rimosso.<br />
<br />
Non dimenticare di aggiornare il file {{ic|/etc/fstab}}!<br />
<br />
Sarà possibile verificare la rimozione del volume logico utilizzando nuovamente come utente root il comando "lvs" (vedere il primo passaggio di questa sezione).<br />
<br />
=== Aggiungere un volume fisico ad un gruppo di volumi ===<br />
Per prima cosa creare un volume fisico sulla periferica a blocchi che verrà utilizzata, successivamente estendere il gruppo di volumi:<br />
<br />
{{bc|1=<br />
# pvcreate /dev/sdb1<br />
# vgextend VolGroup00 /dev/sdb1}}<br />
Questo aumenterà il numero totale di estensioni fisiche(Piscal Extens) del gruppo di volumi, che potranno essere allocate dai volumi logici.<br />
{{Nota|E' considerata buona norma utilizzare il corretto codice partizione per la propria tavola delle partizioni: {{ic|8e}} per il partizionamento MBR, e {{ic|8e00}} per il partizionamento GPT.}}<br />
<br />
=== Rimuovere una partizione da un gruppo di volumi ===<br />
Tutti i dati su questa partizione devono essere spostati su di una altra partizione. Fortunatamente, LVM rende questo più facile:<br />
<br />
# pvmove /dev/sdb1<br />
Se si desidera che i dati risiedano su di un determinato volume fisico, specificarlo come secondo argomento al comando {{ic|pvmove}}:<br />
# pvmove /dev/sdb1 /dev/sdf1<br />
Poi il volume fisico che deve essere rimosso dal gruppo di volumi:<br />
# vgreduce myVg /dev/sdb1<br />
Oppure rimuovere tutti i volumi fisici vuoti:<br />
# vgreduce --all vg0<br />
<br />
Ed infine, se si desidera utilizzare le partizioni in altro modo, per evitare che LVM veda la partizione come un volume fisico:<br />
# pvremove /dev/sdb1<br />
<br />
=== Snapshots ===<br />
====Introduzione====<br />
LVM permette di creare uno snapshot del sistema in maniera molto più efficiente dei tradizionali metodi di backup. Questa efficenza è data dall'utilizzo della policy COW (copy-no-write). Lo snapshot iniziale conterrà hard-link agli inode dei dati attuali. Fino a che i dati restano invariati, lo snapshot conterrà solo i link agli inode e non i dati stessi. Quando verrà modificato un file o una cartella ai quali lo snapshot punta, LVM automaticamente clonerà i dati, la vecchia copia referenziata dallo snapshot, e la nuova copia referenziata dall'attuale sistema. In questo modo, è possibile effettuare uno snapshot di un sistema di 35GB di dati usando solamente 2GB di spazio libero fino a che le modifiche effettuate saranno inferiori ai 2 GB (in entrambi l'originale e lo snapshot).<br />
<br />
====Configurazione====<br />
Creare uno volume logico snapshot come i normali volumi logici.<br />
<br />
# lvcreate --size 100M --snapshot --name snap01 /dev/mapper/vg0-pv<br />
Con questo volume, si potranno modificare meno di 100 M di dati, prima che il volume si riempa.<br />
<br />
E’ importante inserire il modulo ''dm-snapshot'' nell’array MODULES nel file {{ic|/etc/mkinitcpio.conf}}, altrimenti il sistema non si avvierà. Se si effettua la modifica ad un sistema già installato ricostruire l’immagine con il comando:<br />
# mkinitcpio -g /boot/initramfs-linux.img<br />
<br />
Todo: script per automatizzare lo snapshot della partizione di root prima degli aggiornamenti, per tornare allo stato precedente... aggiornare il file {{ic|menu.lst}} per effettuare il boot dagli snapshot (articolo separato?)<br />
<br />
gli snapshot sono principalmente usati per fornire una copia congelata del filesystem per effetuare i backup; un backup impiega due ore e fornisce un immagine più consistente del filesystem piuttosto che effettuare il backup diretto della partizione.<br />
<br />
== Risoluzione di problemi ==<br />
===I comandi LVM commands non funzionano===<br />
*Caricare il modulo appropriato:<br />
# modprobe dm_mod<br />
*Provare ad anteporre ''lvm'' ai comandi in questo modo:<br />
# lvm pvdisplay<br />
<br />
=== Nela pagina Set Filesystem Mountpoints i volumi logici non sono mostrati ===<br />
Se si sta installando un sistema dove è già presente un gruppo di volumi, potrebbe non essere accessibile anche dopo il comando "modprobe dm-mod" ed i volumi logici non vengono rilevati.<br />
<br />
In questo caso, potrebbe essere necessario eseguire:<br />
# vgscan<br />
oppure:<br />
# vgchange -ay <volgroup><br />
<br />
in modo da attivare il gruppo di volumi e rendere i volumi logici accessibili.<br />
<br />
===LVM su periferiche rimovibili===<br />
Sintomi:<br />
~$ sudo vgscan<br />
Reading all physical volumes. This may take a while...<br />
/dev/backupdrive1/backup: read failed after 0 of 4096 at 319836585984: Input/output error<br />
/dev/backupdrive1/backup: read failed after 0 of 4096 at 319836643328: Input/output error<br />
/dev/backupdrive1/backup: read failed after 0 of 4096 at 0: Input/output error<br />
/dev/backupdrive1/backup: read failed after 0 of 4096 at 4096: Input/output error<br />
Found volume group "backupdrive1" using metadata type lvm2<br />
Found volume group "networkdrive" using metadata type lvm2<br />
<br />
Cause:<br />
:Rimuovendo un disco esterno con LVM senza disattivare il gruppo(i) di volumi prima. Prima di disconnettere, assicurarsi di:<br />
# vgchange -an <volume group name><br />
<br />
Soluzione: (ipotizzando che sia già stato provato ad attivare il gruppo di volumi con il comando vgchange -ay <vg>, e siano stati restituiti degli errori di Input/output<br />
# vgchange -an <volume group name><br />
:Scollegare il disco esterno ed aspettare alcuni minuti<br />
# vgscan<br />
# vgchange -ay <volume group name><br />
<br />
== Altre risorse ==<br />
* [http://sourceware.org/lvm2/ LVM2 Resource Page] su SourceWare.org<br />
* [http://tldp.org/HOWTO/LVM-HOWTO/ LVM HOWTO] articolo del Linux Documentation Project<br />
* [http://www.gentoo.org/doc/en/lvm2.xml Installazione di Gentoo su LVM2] guida della documentazione di Gentoo<br />
* [http://wiki.gentoo.org/wiki/LVM LVM] articolo del Wiki di Gentoo<br />
* [http://www.joshbryan.com/blog/2008/01/02/lvm2-mirrors-vs-md-raid-1LVM2 Mirrors vs. MD Raid 1] post by Josh Bryan</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=LVM_(%C4%8Ce%C5%A1tina)&diff=301043LVM (Čeština)2014-02-24T03:43:53Z<p>Mistofvongola: /* Další zdroje */ Fix Gentoo Wiki link</p>
<hr />
<div>[[Category:Getting and installing Arch (Česky)]]<br />
[[Category:File systems (Česky)]]<br />
[[de:LVM]]<br />
[[en:LVM]]<br />
[[es:LVM]]<br />
[[fr:LVM]]<br />
[[it:LVM]]<br />
[[ja:LVM]]<br />
[[ru:LVM]]<br />
[[tr:LVM]]<br />
[[zh-CN:LVM]]<br />
=Úvod=<br />
<br />
LVM je správce logických svazků pro Linux. LVM vytváří abstrakci nad fyzickým úložištěm dat v podobě virtuálních oddílů, které lze snadněji upravovat. Základní termíny při práci s LVM jsou:<br />
<br />
* '''Fyzické zařízení (PV)''': je diskový oddíl (celý pevný disk či loopback soubor), na kterém lze vytvářet skupiny svazků. Fyzické zařízení má speciální hlavičku a je dále rozděleno do fyzických bloků. Fyzické oddíly lze chápat jako obdobu fyzických bloků disku.<br />
* '''Skupina svazků (VG)''': je skupina fyzických zařízení použitých jako úložiště, tedy jeden disk. Skupiny svazků obsahují logické svazky. Skupinu svazků lze chápat jako obdobu pevného disku.<br />
* '''Logické svazky (LV)''': jsou logické či virtuální diskové oddíly, ze kterých se skládá skupina svazků. Tyto logické svazky jsou dále tvořeny fyzickými bloky. Logické svazky lze chápat jako běžné diskové oddíly.<br />
* '''Fyzický blok (PE)''': je malá část disku (obvykle 4 MB), kterou lze přidělit logickému svazku. Fyzické bloky lze chápat jako části disku, které lze přidělit libovolnému diskovému oddílu.<br />
<br />
Správa logických svazků LVM je snazší, než správa běžných diskových oddílů:<br />
<br />
* ''Libovolný počet'' pevných disků lze použit jako jeden velký disk (VG).<br />
* Diskové oddíly (LV) mohou ''přesahovat'' na několik pevných disků. Logický svazek může mít velikost celého diskového úložiště (tj. všech pevných disků v něm).<br />
* Je možné ''libovolně'' vytářet, rušit a měnit velikost diskových oddílů (LV) a disků (VG). Na umístění logického svazku ve skupině svazků nezáleží tak, jako je tomu s běžnými diskovými oddíly.<br />
* Lze měnit vělikost, vytvářet a rušit diskové oddíly (LV) a disky (VG) ''za běhu'' systému. Systémy souborů je pak stále nutné zvětšit či zmenšit. Některé z nich toto za běhu také umožňují.<br />
* Disky (VG) a diskové oddíly (LV) lze libovolně ''pojmenovat''.<br />
* Je možné vytvořit malé diskové oddíly (LV) a ty zvětšovat ''dynamicky'' podle míry zaplnění daty. Zvětšení systému souborů musí být stále provedeno ručně. Některé systéstémy souborů toto umožňují za běhu.<br />
* ...<br />
<br />
Příklad: <br />
'''Fyzické disky'''<br />
<br />
Disk1 (/dev/sda):<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ <br />
|Oddíl1 50 GB (Fyzické zařízení)|Oddíl2 80 GB (Fyzické zařízení) |<br />
|/dev/sda1 |/dev/sda2 |<br />
|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|<br />
<br />
Disk2 (/dev/sdb):<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ <br />
|Partition1 120 GB (Fyzické zařízení) |<br />
|/dev/sdb1 |<br />
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|<br />
<br />
'''LVM logické svazky'''<br />
<br />
Skupina svazků 1 (/dev/MeUloziste/ = /dev/sda1 + /dev/sda2 + /dev/sdb1):<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ <br />
|Logický svazek1 15 GB |Logický svazek2 35 GB |Logický svazek3 200 GB |<br />
|/dev/MeUloziste/root |/dev/MeUloziste/home |/dev/MeUloziste/media |<br />
|_ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _|<br />
<br />
Shrnutí: LVM umožňuje použít veškerou kapacitu disků jako jeden velký disk (skupinu svazků) a tuto pak flexibilněji rozdělit mezi oddíly (logické svazky).<br />
<br />
=Instalace=<br />
<br />
Nejprve je potřeba načíst příslušný jaderný modul:<br />
# modprobe dm-mod<br />
Pokud už máte Arch Linux nainstalovaný a pouze chcete přidat či vyzkoušet LVM, přeskočte na<br />
[[LVM_(Česky)#Rozdělení_disků|rozdělení disků]].<br />
<br />
====Instalace Arch Linuxu na LVM====<br />
Před spuštěním instalačních skritpů Arch Linuxu (/arch/setup), je potřeba rozdělit disk(y) nástrojem {{ic|cfdisk}} (či jiným Vámi oblíbeným). Protože grub legacy (tj. s verzí menší než 1.0) neumí bootovat z logického svazku LVM, nemůžete vytvořit oddíl {{ic|/boot}} na LVM. Vytvořte tedy samostatný bootovací oddíl. Za dostatečnou velikost se považuje 100MB. Alternativně můžete použít zavaděč lilo nebo grub 2 (od verze 1.95).<br />
<br />
====Rozdělení disků====<br />
Dalším krokem je vytvoření diskového oddílu pro LVM. Pro tento oddíl použijte systém souborů typu ''Linux LVM'', tedy id oddílu 0x8e (typ systému souborů: 8e). Na každém disku, kde chcete použít LVM, stačí vytvořit jeden diskový oddíl typu LVM. Ten bude využit pro logické svazky, volte tedy vhodnou velikost. Pokud chcete používat pouze LVM, využijte pro diskový oddíl LVM veškeré volné místo na každém disku.<br />
<br />
{{Tip|Lze nastavit, aby se všechny LVM oddíly na všech discích tvářily jako jeden velký disk.}}<br />
<br />
====Vytvoření fyzických zařízení====<br />
<br />
Nyní je třeba inicializovat vytvořené LVM diskové oddíly. Příkazem {{ic|fdisk -l}} zjistěte, které diskové oddíly mají typ systému souborů ''Linux LVM'' a vytvořte z nich fyzické zařízení LVM:<br />
# pvcreate /dev/sda2<br />
Nahraďte {{ic|/dev/sda2}} všemi oddíly, ze kterých chcete vytvořit fyzické zařízení LVM. Tento příkaz vytvoří LVM hlavičku na daných diskových oddílech.<br />
Vytvořená fyzická zařízení můžete sledovat příkazem:<br />
# pvdisplay<br />
<br />
====Vytvoření skupin(y) svazků====<br />
V dalším kroku vytvoříte na fyzickém zařízení skupinu svazků. Nejprve vytvořte skupinu svazků na jednom z nových fyzických zařízení. Poté můžete přidat všechna ostatní fyzická zařízení, která chcete do skupiny svazků zahrnout:<br />
# vgcreate VolGroup00 /dev/sda2<br />
# vgextend VolGroup00 /dev/sdb1<br />
Namísto VolGroup00 můžete použít libovolné jméno skupiny svazků, kterou chcete vytvořit. Růst skupiny svazků můžete sledovat příkazem:<br />
# vgdisplay<br />
<br />
{{Note|Pokud chcete, můžete vytvořit více skupin svazků. Celé Vaše datové úložiště se pak však nebude tvářit jako jeden disk.}}<br />
<br />
====Vytvoření logických svazků====<br />
Nyní nastal čas vytvořit ve skupině svazků logické svazky. Toho dosáhnete spuštěním následujícího příkazu, ve kterém určujete jméno nového logického svazku, jeho velikost a skupinu svazků, ve které má být vytvořen:<br />
# lvcreate -L 10G VolGroup00 -n lvolhome<br />
Dojde k vytvoření logického svazku, ke kterému můžete přistupovat jako k {{ic|/dev/mapper/Volgroup00-lvolhome}} nebo {{ic|/dev/VolGroup00/lvolhome}}. Stejně jako při vytváření skupiny svazků i pro logický svazek můžete použít libovolné jméno.<br />
<br />
Při vytváření oddílu swap na logickém svazku použijte následující příkaz:<br />
# lvcreate -C y -L 10G VolGroup00 -n lvolswap<br />
Parametr {{ic|-C y}} určuje, že má být vytvořen souvislý oddíl. To znamená, že se swap oddíl nerozdrobí mezi více disků, či několik nesouvislých fyzických bloků.<br />
<br />
Pokud chcete vyplnit vytvářeným logickým svazkem zbytek místa ve skupině svazků, použijte následující příkaz:<br />
# lvcreate -l +100%FREE VolGroup00 -n lvolmedia<br />
<br />
Logické svazky můžete sledovat příkazem:<br />
# lvdisplay<br />
<br />
{{Note|Pro funkčnost předchozích příkazů může být pořeba načíst modul ''device-mapper''. Toho docílíte příkazem '''modprobe dm-mod'''.}}<br />
<br />
{{Tip|Pro začátek můžete vytvořit relativně malé logické svazky a ty rozšiřovat až podle potřeby. Jednoduše nechte ve skupině svazků volné místo.}}<br />
<br />
====Vytvoření systému souborů a připojení logického svazku====<br />
Vytvořené logické svazky najdete ve složce {{ic|/dev/mapper/}} a {{ic|/dev/YourVolumeGroupName}}. Pokud je nemůžete najít, použijte následující příkazy pro zavedení modulu vytváření uzlů zařízení a pro aktivaci skupin svazků:<br />
# modprobe dm-mod<br />
# vgchange -ay<br />
Nyní můžete na logických svazcích vytvořit systémy souborů. Poté už jen připojíte logické svazky jako běžné diskové oddíly. (Pokud právě instalujete Arch linux, tento krok přeskočte. K připojení logických svazků využijte instalátor, ve kterém vyberte vytvořené LVM oddíly.):<br />
# mkfs.ext3 /dev/mapper/VolGroup00-lvolhome<br />
# mount /dev/mapper/VolGroup00-lvolhome /home<br />
Pokud instalujete Arch Linux, spusťte /arch/setup, vyberte volbu ''Prepare Hard Drive'' a pak přímo krok 3 ''Set Filesystem Mountpoints'' a '''''přečtěte si sekci [[LVM_(Česky)#Důležité_informace|Důležité informace]] před tím, než budete s instalací systému pokračovat!'''''<br />
<br />
===Důležité informace===<br />
Při používání Arch Linuxu s LVM, či instalaci na LVM dbejte na následující (v závorkách jsou uvedena odpovídající menu instalátoru):<br />
* Při výběru přípojných bodů vybírejte pouze nově vytvořené logické svazky (použijte: {{ic|/dev/mapper/Volgroup00-lvolhome}}).<br>NEVYBÍREJTE skutečné oddíly, na kterých jsou logické svazky vytvořeny. Tedy nepoužívejte: {{ic|/dev/sda2}}. (''Set Filesystem Mountpoints'')<br />
* Změňte volbu ''USELVM="no"'' na ''USELVM="yes"'' v souboru {{ic|/etc/rc.conf}}. (''Configure System'')<br />
* Přidejte ''lvm2'' do sekce HOOKS v souboru {{ic|/etc/mkinitcpio.conf}} těsně před ''filesystems'', aby kernel dokázal najít LVM oddíly při bootu. Pokud chcete využívat LVM snímky, přidejte ''dm-snapshot'' do proměnné MODULES. (''Configure System'')<br />
* Pokud jste na logický svazek umístili i systém souborů kořenového adresáře ( "/" ), znovu sestavte obraz kernelu (''/boot/kernel26.img'') s využitím upraveného souboru {{ic|/etc/mkinitcpio.conf}}. Tím umožníte zavaděči nalezení oddílu root při bootu. Využijte k tomu níže uvedený příkaz: (''Configure System'') <br />
mkinitcpio -g /boot/kernel26.img <br />
* V konfiguračním systému zavaděče grub: {{ic|/boot/grub/menu.lst}} použijte správný oddíl pro root, například: (''Install Bootloader'')<br />
...<br />
(0) Arch Linux<br />
title Arch Linux<br />
root (hd0,0)<br />
kernel /vmlinuz26 '''root=/dev/mapper/VolGroup00-lvolroot''' resume=/dev/mapper/VolGroup00-lvolswap ro<br />
initrd /kernel26.img<br />
...<br />
* Pokud používáte LILO nastavte ho obdobně: {{ic|/etc/lilo.conf}}:<br />
image=/boot/vmlinuz26<br />
label=arch<br />
append="'''root=/dev/mapper/VolGroup00-lvolroot''' resume=/dev/mapper/VolGroup00-lvolswap ro"<br />
initrd=/boot/kernel26.img<br />
<br />
= Nastavení =<br />
<br />
== Rozšíření logického svazku ==<br />
Nejprve je třeba zvětšit logický svazek a pak ještě zbývá zvětšit systém souborů, aby využil nově vytvořené místo. Řekněme, že máme logický svazek o velikosti 15 GB, na kterém je systém souborů ext3. Tento chceme zvětšit na 20 GB. Musíme tedy udělat následující: <br />
# lvextend -L 20G VolGroup00/lvolhome<br />
# resize2fs /dev/VolGroup00/lvolhome<br />
Lze také využít příkaz {{ic|lvresize}} namísto {{ic|lvextend}}:<br />
# lvresize -L +5G VolGroup00/lvolhome<br />
<br />
Pokud chcete vyplnit veškeré zbývající volné místo ve skupině svazků, použijte následující příkaz:<br />
# lvextend -l +100%FREE VolGroup00/lvolhome<br />
<br />
{{Warning|Ne všechny souborové systémy podporují zvětšení beze ztráty dat, či zvětšení za běhu.}}<br />
<br />
{{Note|Pokud nezvětšíte systém souborů, bude jemu odpovídající oddíl stále stejně velký. Logický svazek pak bude mít novou velikost a bude částečně nevyužitý.}}<br />
<br />
== Zmenšení logického svazku ==<br />
Protože nejspíše máte systém souborů tak velký jako logický svazek, na kterém je umístěn, je nejprve nutné zmenšit systém souborů. Podle toho, jaký systém souborů používáte, může být nejprve nutné systém souborů odpojit. Řekněme, že máme logický svazek o velikosti 15 GB, na kterém je systém souborů ext3. Tento svazek chceme zmenšit na 10 GB. Musíme tedy udělat následující:<br />
# resize2fs /dev/VolGroup00/lvolhome 9G<br />
# lvreduce -L 10G VolGroup00/lvolhome<br />
# resize2fs /dev/VolGroup00/lvolhome<br />
Lze také využít příkaz {{ic|lvresize}} namísto {{ic|lvreduce}}:<br />
# lvresize -L -5G VolGroup00/lvolhome<br />
V příkladě jsme zmenšili systém souborů více, než bylo potřeba. Učinili jsme tak proto, abychom náhodně nesmazali některé z posledních bloků systému souborů. Zbývá tedy ještě zvětšit systém souborů tak, aby vyplnil zbývající místo na logickém svazku. <br />
<br />
{{Warning|Zmenšujte systém souborů pouze o tolik, aby zbylo dost místa pro uložená data.}}<br />
<br />
{{Warning|Ne všechny systémy souborů umožňují zmenšení beze ztráty dat, či zmenšení za běhu.}}<br />
<br />
== Přidání diskového oddílu do skupiny svazků ==<br />
Aby bylo možné přidat oddíl do skupiny svazků, musíte nejprve změnit jeho typ na ''Linux LVM'' (například nástrojem {{ic|cfdisk}}). Poté zbývá ještě vytvořit z oddílu fyzické zařízení a rozšířit o něj skupinu svazků:<br />
# pvcreate /dev/sdb1<br />
# vgextend VolGroup00 /dev/sdb1<br />
Tím jste získali volné místo ve skupině svazků, které může být využito logickými svazky.<br />
<br />
{{Tip|Přidané diskové oddíly se mohou nacházet na libovolných discích.}}<br />
<br />
== Odebrání diskového oddílu ze skupiny svazků ==<br />
Při odebírání diskového oddílu ze skupiny svazků je potřeba přesunout všechna data, která se na něm nachází, na jiný diskový oddíl. LVM toto umožňuje následovně:<br />
# pvmove /dev/sdb1<br />
Pokud chete přesunout data na určité fyzické zařízení, použijte následující příkaz:<br />
# pvmove /dev/sdb1 /dev/sdf1<br />
Poté můžete odebrat fyzické zařízení ze skupiny oddílů:<br />
# vgreduce myVg /dev/sdb1<br />
Nebo také můžete odstranit všechna prázdná fyzická zařízení:<br />
# vgreduce --all vg0<br />
<br />
Konečně, pokud chcete využívat diskový oddíl pro jiné učely, a zabránit tomu, aby byl chápán jako fyzické zařízení LVM, použijte následující příkaz:<br />
# pvremove /dev/sdb1<br />
<br />
== Snímky ==<br />
<br />
====Úvod====<br />
LVM umožuje efektivnější vytvářní snímků systému, než klasické metody zálohování. Pro tento účel používá techniku kopírování při zápisu. Na počátku obsahuje snímek pouze pevné odkazy na inody skutečných dat. Dokud zůstávají data nezměněna, snímek tedy pouze obsahuje odkazy inodů a nikoliv samotná data. V okamžiku, kdy změníte soubor (či adresář), na který snímek odkazuje, LVM automaticky naklonuje data tak, že snímek odkazuje na starou kopii a aktivní systém souborů odkazuje na novou. Takto je možné vytvořit snímek 35 GB dat, který využije jen 2 GB prostoru navíc, pokud tedy nezměníte více jak 2 GB původních dat (či dat ve snímku).<br />
<br />
====Nastavení====<br />
Snímek logického svazku vytvoříte obdobně jako samotný logický svazek:<br />
# lvcreate --size 100M --snapshot --name snap01 /dev/mapper/vg0-pv<br />
Takto můžete změnit méně než 100 MB dat, než se svazek snímku zaplní.<br />
<br />
Aby systém nabootoval, je potřeba mít v proměnné MODULES souboru {{ic|/etc/mkinitcpio.conf}} uveden modul ''dm-snapshot''. Pokud toto provedete na již používaném systému, nezapomeňte přegenerovat obraz jádra:<br />
# mkinitcpio -g /boot/kernel26.img<br />
<br />
TODO: Skripty automatizující snímky kořenového systému souborů před updatováním systému, což umožní pozdější návrat k předchozímu stavu. Úprava {{ic|menu.lst}}, aby šlo bootovat snímky (samostatný článek?).<br />
<br />
Primárním účelem snímku je poskytnout zmraženou kopii systému souborů pro účel zálohování. Obzvláště pro dlouhoběžící zálohovací úlohy tak lze dosáhnout mnohem konzistentnějšího obrazu systému souborů, než při přímém zálohování diskového oddílu.<br />
<br />
= Řešení problémů =<br />
====LVM příkazy nefungují====<br />
*Načtěte správný jaderný modul:<br />
# modprobe dm-mod<br />
*Zkuste předcházet příkazy slovem ''lvm'' následovně:<br />
# lvm pvdisplay<br />
<br />
==== Výpis nastavení přípojných bodů systému souborů nezobrazuje logické svazky ====<br />
Pokud instalujete systém někam, kde už existuje LVM skupina svazků, může se stát, že i po vykonání příkazu {{ic|modprobe dm-mod}} nepůjde zobrazit seznam logických svazků.<br />
<br />
V takovém případě musíte ještě spustit příkaz:<br />
# vgchange -ay <skupina svazků><br />
<br />
Takto aktivujete skupinu svazků a zpřístupníte logické svazky.<br />
<br />
= Tipy a triky =<br />
TODO:<br />
<br />
= Další zdroje =<br />
Další články týkající se LVM na Archwiki:<br />
* [[Installing_with_Software_RAID_or_LVM|Installing with software RAID or LVM]]<br />
* [[RAID_Encryption_LVM|RAID encryption LVM]]<br />
Externí zdroje:<br />
* [http://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux) LVM na Wikipedii (anglicky)]<br />
* [http://tldp.org/HOWTO/LVM-HOWTO/ LVM HOWTO na tldp.org (anglicky)]<br />
* [http://www.gentoo.org/doc/en/lvm2.xml Instalace LVM2 v systému Gentoo na gentoo.org (anglicky)]<br />
* [http://wiki.gentoo.org/wiki/LVM LVM na wiki.gentoo.org (anglicky)]<br />
* [http://www.joshbryan.com/blog/2008/01/02/lvm2-mirrors-vs-md-raid-1 LVM2 zrcadlení vs. MD raid 1 (anglicky)]</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=LVM_(Espa%C3%B1ol)&diff=301042LVM (Español)2014-02-24T03:43:09Z<p>Mistofvongola: /* Mas recursos ( en ingles) */ Fix Gentoo wiki link</p>
<hr />
<div>[[Category:Getting and installing Arch (Español) ]]<br />
<br />
[[Category:File systems (Español)]]<br />
[[cs:LVM]]<br />
[[de:LVM]]<br />
[[en:LVM]]<br />
[[fr:LVM]]<br />
[[it:LVM]]<br />
[[ja:LVM]]<br />
[[ru:LVM]]<br />
[[tr:LVM]]<br />
[[zh-CN:LVM]]<br />
== Introduccion ==<br />
<br />
LVM es un Administrador de Volúmenes Lógicos para el kernel Linux. Con LVM se puede abstraer el espacio de almacenamiento y tener “particiones virtuales” para facilitar su modificación. Los bloques básicos que construyen LVM son:<br />
<br />
<br />
<br />
* '''Physical volume/Volúmenes físicos (PV)''': Particiones en el disco rígido ( puede ser sobre tanto sobre un disco o sobre un archivo de loopback) donde se tener un grupo de volúmenes Posee una cabecera especial y esta dividida en extensiones físicas Piense en los volúmenes físicos como un gran edificio de bloques que pueden ser usados para armar tus discos rígidos<br />
<br />
* '''Volume group/Grupo de volúmenes (VG)''': Son grupos de volúmenes físicos que son usados como volúmenes de almacenamiento ( como si fueran un solo disco). Contienen volúmenes lógicos Piense en los grupos de volúmenes como discos rígidos<br />
<br />
<br />
<br />
* '''Logical volume/Volúmenes lógicos (LV)''': Una "partición virtual/lógica" que reside en un grupo de volúmenes y esta compuesta por extensiones físicas Piense en volúmenes lógicos como particiones normales.<br />
<br />
* '''Physical extenúe/Extensiones físicas (PE)''': Una pequeña parte de un disco (usualmente 4MB) que puede ser asignada a un volumen lógico Piense en las Extensiones físicas como partes de los discos que pueden ser asignadas a cualquier partición<br />
<br />
<br />
<br />
Con LVM usted puede manejar particiones (volúmenes lógicos) mas fácilmente que con las particiones comunes. Por ejemplo usted puede:<br />
<br />
<br />
<br />
* Usar '' cualquier cantidad '' de discos como un gran disco(VG).<br />
<br />
* Tenes particiones(LV) del tamaño de varios discos ( pueden ser del tamaño del total de todos tus discos juntos)<br />
<br />
* Redimencionar/crear/borrar particiones(LV) y discos(VG) ''como quieras'' ( no depende de la posición del volumen lógico dentro del grupo de volúmenes, como pasa con las particiones normales)<br />
<br />
* Redimencionar/crear/borrar particiones(LV) y discos(VG) ''en linea'' (los sistemas de archivo aun necesitan ser mencionados, pero algunos soportan dimensionamiento en linea)<br />
<br />
* Puede ''nombrar'' a sus discos(VG) y particiones(LV) como quiera.<br />
<br />
* Cree pequeñas particiones(LV) y dimencionelas "''dinamicamente''" mientras se van llenando ( agrandarlas se debe hacer a mano, pero algunos sistemas de archivos soportan hacerlo en linea)<br />
<br />
* ...<br />
<br />
<br />
<br />
Ejemplo:<br />
<br />
''' Disco físico'''<br />
<br />
Disco1 (/dev/sda):<br />
<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br />
<br />
|Particion1 50GB (Volumen físico) |Particion2 80GB (Volumen físico) |<br />
<br />
|/dev/sda1 |/dev/sda2 |<br />
<br />
|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |<br />
<br />
<br />
<br />
<br />
<br />
Disco2 (/dev/sdb):<br />
<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br />
<br />
|Particion1 120GB (Volumen físico) |<br />
<br />
|/dev/sdb1 |<br />
<br />
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ _|<br />
<br />
<br />
<br />
'''Volúmenes lógicos LVM'''<br />
<br />
<br />
<br />
Grupo de volumenes1 (/dev/MiAlmacenamiento/ = /dev/sda1 + /dev/sda2 + /dev/sdb1):<br />
<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br />
<br />
|Volumen Logico2 15GB |Volumen Logico2 35GB |Volumen Logico2 200GB |<br />
<br />
|/dev/MiAlmacenamiento/volroot |/dev/MiAlmacenamiento/volhome |/dev/MiAlmacenamiento/volmedia |<br />
<br />
|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |<br />
<br />
<br />
<br />
Para sumar todo: con LVM puede usar todo tu espacio de almacenamiento como un gran disco (Grupo de Volúmenes) y tener mas flexibilidad sobre sus particiones (Volúmenes lógicos).<br />
<br />
<br />
<br />
<br />
<br />
=Instalación=<br />
<br />
<br />
<br />
Antes de hacer cualquier cosa, necesitamos cargar los módulos apropiados:<br />
<br />
#modprobe dm-mod<br />
<br />
Si ya tiene instalado Arch Linux y solo quiere agregar/probar particiones con LVM, valla a [[Lvm#Particionando_discos|Particionando discos]].<br />
<br />
<br />
<br />
====Instalando Arch linux en LVM====<br />
<br />
Antes de correr el script de instalación de Arch Linux (/arch/setup), necesitamos particionar el disco con {{ic|cfdisk}} (o la herramienta que mas le guste). Porque Grub legacy ( versiones de Grub anteriores a la 1.0) no pueden iniciar desde volúmenes lógicos LVM, no se puede tener {{ic|/boot}} en un LVM, por eso debe crear una partición /boot separada. 100MB deberían ser suficientes. La otra solución podría ser usar lilo o una versión de Grub desde 1.95 en adelante.<br />
<br />
<br />
<br />
====Particionando discos====<br />
<br />
Ahora debemos crear una partición para LVM. El sistema de archivos debe ser 'Linux LVM', use el id de partición 0x8e ( tipo de sistema de archivos: 8e). Se debe crear solo una partición LVM en cada disco que se desee usar con LVM. Sus volúmenes lógicos residirán dentro de esas particiones, entonces dele un tamaño acorde. Si solo va a usar LVM y ninguna partición externa, use el total de espacio libre de cada disco.<br />
<br />
<br />
<br />
<br />
<br />
{{Warning|/boot no puede estar en una partición LVM por que Grub (versión<1.95) no lo soporta.}}<br />
<br />
<br />
<br />
{{Tip|Las particiones LVM de los discos puede configurarse para aparecer como un gran disco único}}<br />
<br />
<br />
<br />
====Creando Volúmenes físicos====<br />
<br />
<br />
<br />
Es momento de inicializar esas particiones para que puedan ser usadas por LVM. Use {{ic|fdisk -l}} para encontrar aquellas particiones que tengan como sistema de archivos el tipo 'Linux LVM' y cree un volumen físico en ellas:<br />
<br />
# pvcreate /dev/sda2<br />
<br />
Debe substituir {{ic|/dev/sda2}} con todas las particiones para crear los volumenes fisicos en todas ellas. Este comando creara una cabecera en cada particion para que pueda ser usada por LVM.<br />
<br />
Puede ver los volumenes fisicos creados con:<br />
<br />
# pvdisplay<br />
<br />
<br />
<br />
====Creando grupo(s) de volumenes====<br />
<br />
El siguiente paso, es crear un grupo de volumenes en este volumen fisico. Primero debe crear un grupo de volumenes en una de las nuevas particiones y luego agregarle todos los volumenes fisicos que desee:<br />
<br />
# vgcreate VolGroup00 /dev/sda2<br />
<br />
# vgextend VolGroup00 /dev/sdb1<br />
<br />
Puede usar cualquier otro nombre en vez de VolGroup00, puede fijasre como el grupo de volumenes va aumentando con:<br />
<br />
# vgdisplay<br />
<br />
<br />
<br />
{{Note|Puede crear mas de un grupo de volumenes si lo necesita, pero no tendra todo su almacenamiento en un solo disco.}}<br />
<br />
<br />
<br />
====Crendo volumenes logicos====<br />
<br />
Necesitaremos crear volumenes logicos en este grupo de volumenes. Para ello debe utilizar el siguiente comando, dandole como parametros el nombre del nuevo volumen logico, su tamaño, y el grupo de volumenes al que pertenecera:<br />
<br />
# lvcreate -L 10G VolGroup00 -n lVolHome<br />
<br />
Luego prodra acceder con {{ic|/dev/mapper/Volgroup00-lvolhome}} o {{ic|/dev/VolGroup00/lvolhome}}. Se puede usar el nombre que desee para los volumenes logicos.<br />
<br />
<br />
<br />
Para crear una swap en un volumen logico, se necesita un parametro adicional:<br />
<br />
<br />
<br />
# lvcreate -C y -L 10G VolGroup00 -n lvolswap<br />
<br />
El parametro {{ic|-C y}} es usado para crear particiones contiguas, significa que el espacio swap no podra ser particionado entre varios discos.<br />
<br />
<br />
<br />
Si quiere llenar todo el espacio libre restante en un grupo de volumenes, use el siguiente comando:<br />
<br />
# lvcreate -l +100%FREE VolGroup00 -n lvolmedia<br />
<br />
<br />
<br />
Verifique los volumenes logicos creados con:<br />
<br />
# lvdisplay<br />
<br />
<br />
<br />
{{Note|Debe cargar el modulo ''device-mapper'' al kernel, de esta manera ('''modprobe dm-mod''')}}<br />
<br />
<br />
<br />
{{Tip|Puede empezar con una cantidad relativamente pequeña de volumenes logicos y expandirlos luego si lo necesita. Para facilitarlo, deje algo de espacio libre in el grupo de volumenes.}}<br />
<br />
<br />
<br />
====Creando el sistema de archivos y montando los volumenes logicos====<br />
<br />
Sus volumenes logicos deberian encontrarse en {{ic|/dev/mapper/}} and {{ic|/dev/NombredelGrupodeV}}. De no encontrarse, use el siguiente comando para cargar el modulo que crea nodos de dispositivos y hacer que los grupos de volumenes esten disponibles:<br />
<br />
# modprobe dm-mod<br />
<br />
# vgchange -ay<br />
<br />
Ahora puede crear el sistema de archivos en los volumenes logicos, y montarlos como particiones normales ( si esta instalando arch, saltee este paso. Use el instalador de Arch para seleccinar las particiones LVM que creo):<br />
<br />
# mkfs.ext3 /dev/mapper/VolGroup00-lvolhome<br />
<br />
# mount /dev/mapper/VolGroup00-lvolhome /home<br />
<br />
Si estas instalando Arch Linux, ejecute /arch/setup, calla a ''Prepare Hard Drive'' y luego al paso 3 ''Set Filesystem Mountpoints'' y '''''lea la seccion [[Lvm#Importante|Improtante]] antes de proceder con la instalacion!'''''<br />
<br />
<br />
<br />
===Importante===<br />
<br />
Hay un par de cosas con las que se debe tener cuidado cuando se instala/usa Arch en una LVM ( use los menues correspondientes durante la instalacion):<br />
<br />
# Cuando eleja los puntos de montaje, solo seleccione los volumenes logicos creados (use: {{ic|/dev/mapper/Volgroup00-lvolhome}}).<br>NO seleccione la particion donde el volumen logico fue creado (no use: {{ic|/dev/sda2}}). (''Set Filesystem Mountpoints'')<br />
<br />
# Asegurese que cambio ''USELVM="no"'' a ''USELVM="yes"'' en {{ic|/etc/rc.conf}} (''Configure System'')<br />
<br />
# Asegurese que ''lvm2'' esta en la seccion de HOOKS del archivo {{ic|/etc/mkinitcpio.conf}}, justo antes de ''filesystems'' para que el kernel encuentre los volumenes LVM cuando intente iniciar (boot). Si quiere usar los Snapshots/instantaneas de LVM, agregue ''dm-snapshot'' a la variable MODULES. (''Configure System'') <br />
<br />
# Asegurese que el archivo {{ic|/boot/grub/menu.lst}} use los volumenes correctos para root. Deberia quedar algo como esto: (''Install Bootloader'')<br />
<br />
<br />
<br />
...<br />
# (0) Arch Linux<br />
title Arch Linux<br />
root (hd0,0)<br />
kernel /vmlinuz26 '''root=/dev/mapper/VolGroup00-lvolroot''' resume=/dev/mapper/VolGroup00-lvolswap ro<br />
initrd /kernel26.img<br />
...<br />
<br />
Si usa LILO verifique {{ic|/etc/lilo.conf}}:<br />
<br />
image=/boot/vmlinuz26<br />
label=arch<br />
append="'''root=/dev/mapper/VolGroup00-lvolroot''' resume=/dev/mapper/VolGroup00-lvolswap ro"<br />
initrd=/boot/kernel26.img<br />
<br />
<br />
= Configuracion =<br />
<br />
<br />
<br />
== Agrandando volumenes logicos ==<br />
<br />
Para agrandar un volumen logico, se debe agrandar el volumen logico y luego el sistema de archivos para poder usar el nuevo espacio libre creado. Digamos que tenemos un volumen logico de 15GB con ext3, y queremos agrandarlo a 20GB. Debe seguir los siguientes pasos: <br />
<br />
# lvextend -L 20G VolGroup00/lvolhome (o lvresize -L +5G VolGroup00/lvolhome)<br />
<br />
# resize2fs /dev/VolGroup00/lvolhome<br />
<br />
Puede usar {{ic|lvresize}} en vez de {{ic|lvextend}}.<br />
<br />
<br />
<br />
Si quiere llenar todo el espacio lobre de un grupo de volumenes, use el siguiente comando:<br />
<br />
# lvextend -l +100%FREE VolGroup00/lvolhome<br />
<br />
<br />
<br />
{{Warning|No todos los sistemas de archivos soportan ser agrandados sin perder datos, o ser agrandados en linea.}}<br />
<br />
<br />
<br />
{{Note|Si no le cambia el tamaño al sistema de archivos, este mantendra el tamaño que tenia antes ( El volumen sera mas grande, pero usado en parte)<br />
<br />
<br />
<br />
== Partir volumenes logicos ==<br />
<br />
Probablemente el sistema de archivos sea tan grande como el volumen logico en el que reside, para partirlo, se debe partir primero el sistema de archivos, y luego el volumen logico. Dependiendo del sistema de arhcivos, puede que lo deba desmontar antes. Digamos que tenemos un volumen logico de 15GB con ext3 y lo queremos dejar de 10GB. Seguiremos los siguientes pasos:<br />
<br />
# resize2fs /dev/VolGroup00/lvolhome 9G<br />
<br />
# lvreduce -L 10G VolGroup00/lvolhome (o lvresize -L -5G VolGroup00/lvolhome)<br />
<br />
# resize2fs /dev/VolGroup00/lvolhome<br />
<br />
Ya hemos partido el sistema de archivos, mas de lo que debiamos para que cuando sea partido el volumen logico, no cortemos accidentalmente el final del sistema de archivos. Luego agrandaremos normalmente el sistema de archivos para llenar todo el espacio libre del volumen logico.You may use {{ic|lvresize}} instead of {{ic|lvreduce}}.<br />
<br />
<br />
<br />
{{Warning|No reduzca el sistema de archivos a un tamaño menor al ocupado por los datos, por que se arriesga a perderlos.}}<br />
<br />
<br />
<br />
{{Warning|No todos los sistemas de archivos soportan ser partidos sin perder datos, o ser partidos en linea.}}<br />
<br />
<br />
<br />
{{Note|Es mejor reducir el sistema de archivos a un tamaño menor que el volumen logico, para que accidentalmente no cortemos el final del sistema de archivos.}}<br />
<br />
<br />
<br />
== Agregar una particion al grupo de volumenes ==<br />
<br />
Para agregar una particion al grupo de volumenes primero debe darle a la particion el tipo 'Linux LVM' (por ejemplo con {{ic|cfdisk}}). Luego necesitara crear un volumen fisico dentro y estender el grupo de volumenes sobre la particion:<br />
<br />
# pvcreate /dev/sdb1<br />
<br />
# vgextend VolGroup00 /dev/sdb1<br />
<br />
Ahora tendras el espacio libre en tu grupo de volumenes, que puede ser usado por los volumenes logicos del grupo.<br />
<br />
<br />
<br />
{{Tip|Se puede agregar una particion desde cualquier disco, al grupo de volumenes.}}<br />
<br />
<br />
<br />
== Remover una particion de un grupo de volumenes ==<br />
<br />
Todos los datos de la particion debe ser movida a otra particion. Afortunadamente, LVM lo hace sencillo:<br />
<br />
# pvmove /dev/sdb1<br />
<br />
Si quiere tener los datos en un volumen fisico especifico, agreguelo como segundo argumento a {{ic|pvmove}}:<br />
<br />
# pvmove /dev/sdb1 /dev/sdf1<br />
<br />
Luego removemos los volumenes fisicos del grupo de volumenes:<br />
<br />
# vgreduce myVg /dev/sdb1<br />
<br />
O removemos todos los volumenes vacios:<br />
<br />
# vgreduce --all vg0<br />
<br />
<br />
<br />
Por ultimo, si quiere usar la particion para algo mas, y quiere evitar a LVM, piense que esa particion es un volumen fisico mas:<br />
<br />
# pvremove /dev/sdb1<br />
<br />
<br />
<br />
== Instantáneas/Snapshots ==<br />
<br />
====Introducción====<br />
<br />
LVM permite tomar instantaneas/snapshots de su sitema lo que es mucho mas eficiente que el tradicional backup. Podemos hacer esto usano una politica COW (copy-on-write)/(copia-cuando-escribe).La instantanea inicial simplemente contiene enlaces fuertes a los inodos de tus datos actuales. Mientras los datos esten descargados, la instantanea simplemente contara con punteros a sus respectivos inodos y no a los datos en si mismos. Cada vez que se modifica un archivo o un directorio a la que apunte la isntantanea, LVM automaticamente colonara los datos. Por lo tanto puede tener instantaneas de un sistema de 35GB de datos usando solo 2GB de espacio libre, mientras sean modificadas menos de 2GB de datos ( en el original y en la instantanea).<br />
<br />
<br />
<br />
====Configuracion====<br />
<br />
Los volumenes logicos para las instantaneas se crean igual que los normales:<br />
<br />
<br />
<br />
# lvcreate --size 100M --snapshot --name snap01 /dev/mapper/vg0-pv<br />
<br />
Con dicho volumen, podra modificar menos de 100MB de datos, antes de que el volumen para las instantaneas se llene.<br />
<br />
<br />
<br />
Es importante tener el modulo ''dm-snapshot'' agregado en la cariable MODULOS de {{ic|/etc/mkinitcpio.conf}}, de otra manera el sistema no iniciara. Si hizo esto en un sistema ya instalado, asegurese de reconstruir la imagen del kernel con:<br />
<br />
# mkinitcpio -g /boot/kernel26.img<br />
<br />
<br />
<br />
{{Tip|Hay scripts que automatizan la inclusion de las instantaneas en el archivo {{ic|menu.lst}} para poder iniciar en ellas.}}<br />
<br />
<br />
<br />
<br />
<br />
= Solucionando problemas =<br />
<br />
====Los comandos LVM no funcionan====<br />
<br />
*Cargue los modulos apropiados:<br />
<br />
# modprobe dm-mod<br />
<br />
*Anteponga ''lvm'' al comando:<br />
<br />
# lvm pvdisplay<br />
<br />
<br />
<br />
==== No se ven los volumenes logicos ====<br />
<br />
Si esta instalando en un sistema donde hay un grupo de volumenes existentes, es posible que luego de hacer "modprobe dm-mod" siga sin ver los volumenes logicos.<br />
<br />
<br />
<br />
En este caso, debe hacer lo siguiente:<br />
<br />
# vgchange -ay <volgroup><br />
<br />
<br />
<br />
Ordenadamente para activar el grupo de volumenes y hacer accesible los volumenes logicos.<br />
<br />
<br />
<br />
<br />
<br />
= Mas recursos ( en ingles) =<br />
<br />
Otros articulos sobre LVM en Archwiki:<br />
<br />
* [[Installing_with_Software_RAID_or_LVM|Instalando con softwared de RAID o LVM]]<br />
<br />
* [[RAID_Encryption_LVM|Encriptacion de RAID en LVM]]<br />
<br />
Recursos externos:<br />
<br />
* [http://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux) LVM en wikipedia]<br />
<br />
* [http://tldp.org/HOWTO/LVM-HOWTO/ LVM CÓMO en tldp.org ]<br />
<br />
* [http://www.gentoo.org/doc/en/lvm2.xml Instalando LVM2 en Gentoo, gentoo.org ]<br />
<br />
* [http://wiki.gentoo.org/wiki/LVM LVM en wiki.gentoo.org]<br />
<br />
* [http://www.joshbryan.com/blog/2008/01/02/lvm2-mirrors-vs-md-raid-1 Espejos LVM2 vs MD raid 1]</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=LVM_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)&diff=301041LVM (Русский)2014-02-24T03:42:01Z<p>Mistofvongola: /* Ещё по теме */ Fix Gentoo Wiki link</p>
<hr />
<div>[[Category:Русский]]<br />
[[cs:LVM]]<br />
[[de:LVM]]<br />
[[en:LVM]]<br />
[[es:LVM]]<br />
[[fr:LVM]]<br />
[[it:LVM]]<br />
[[ja:LVM]]<br />
[[tr:LVM]]<br />
[[zh-CN:LVM]]<br />
{{translateme}}<br />
=Введение=<br />
<br />
Менеджер логических томов (англ. Logical Volume Manager) — менеджер логических томов. В отличие от разделов жёсткого диска, размеры логических томов можно легко менять.<br />
<br />
Устройство LVM:<br />
<br />
<br />
* '''Физический том(англ. physical volume)''': Раздел на жёстком диске или жёсткий диск на котором создаются логические тома.<br />
* '''Группа томов (англ. volume group)''': Набор физических томов в один объект. Содержат логические тома.Группу томов можно представить как жёсткие диски.<br />
* '''Логический том (англ. logical volume)''': аналогичен разделу (hda1, sdа1) на не-LVM системах. Так же, как и на них, представляется как блочное устройство и может нести файловую систему.<br />
* '''Физический диапазон (англ. physical extent) ''': Небольшая часть диска(обычно имеет размер 4MB), которая может быть добавлена к логическому тому. Может быть добавлен к любому разделу.<br />
* '''Логические диапазоны (англ. logical extent)''': диапазоны, на которые разбивается логический том. Их объём одинаков по всей группе томов.<br />
<br />
<br />
<br />
Некоторые возможности LVM:<br />
<br />
* использование любого количества жёстких дисков или их разделов как один большой раздел.<br />
* логические тома могут быть "размазаны" на несколько жёстких дисков. Максимальный размер равен объёму всех жёстких дисков.<br />
* изменение/создание/удаление логических томов в любом виде. То есть не зависит от физического расположения тома.<br />
* изменение/создание/удаление логических томов и групп томов в режиме "online"(Внимание: не все файловые системы, поддерживают изменение размере в режиме "online")<br />
* динамическое увеличение размера логических томов по мере их наполнения. Увеличение размера производится пользователем, некоторые файловые системы поддерживают изменение размера в режиме "online".<br />
<br />
<br />
<br />
Пример:<br />
'''Жёсткий диск'''<br />
<br />
Disk1 (/dev/sda):<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br />
|Partition1 50GB (Physical volume) |Partition2 80GB (Physical volume) |<br />
|/dev/sda1 |/dev/sda2 |<br />
|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |<br />
<br />
Disk2 (/dev/sdb):<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br />
|Partition1 120GB (Physical volume) |<br />
|/dev/sdb1 |<br />
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ _|<br />
<br />
'''Логические тома'''<br />
<br />
Volume Group1 (/dev/MyStorage/ = /dev/sda1 + /dev/sda2 + /dev/sdb1):<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ <br />
|Logical volume1 15GB |Logical volume2 35GB |Logical volume3 200GB |<br />
|/dev/MyStorage/rootvol|/dev/MyStorage/homevol |/dev/MyStorage/mediavol |<br />
|_ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |<br />
<br />
В сумме получается: объединение всего доступного места в одну группу томов(LV) и более гибкий контроль над разделами(логическими томами)<br />
<br />
=Установка=<br />
<br />
Перед началом установки нужно загрузить модуль ядра:<br />
# modprobe dm-mod<br />
Если вы уже установили Arch Linux и хотите попробовать LVM в действии, перейдите сразу к [[Lvm#Partition_disks|partition disks]].<br />
<br />
====Установка Arch Linux на LVM====<br />
Перед запуском /arch/setup нужно разметить жёсткий диск. Например с помощью {{ic|cfdisk}}. Загрузчик grub версии ниже 1.0 не поддерживает загрузку с томов LVM, поэтому раздел {{ic|/boot}} должен быть расположен на загрузочном разделе(100МБ должно хватить) либо используйте lilo или grub версии 1.95 и выше. <br />
<br />
====Разметка дисков====<br />
<br />
Для начала нужно создать раздел для LVM. Тип файловой системы должен быть 'Linux LVM' поэтому при разметке используйте id 0x8e (тип файловой системы: 8e).<br />
Для работы LVM требует наличие одного раздела типа 'Linux LVM' на каждом жёстком диске, который вы хотите использовать с LVM. Логические тома находятся внутри этих разделов, поэтому задайте им соответствующий размер. Если вы предполагаете не создавать других разделов на этих дисках - используйте всё доступное место на каждом диске.<br />
<br />
<br />
{{Warning|/boot не может находиться внутри LVM раздела т.к. grub (версии<1.95) не имеет поддержки загрузки с LVM.}}<br />
<br />
{{Tip|Все разделы LVM на всех дисках могут быть представлены в виде одного большого диска.}}<br />
<br />
====Создание физических томов(PV)====<br />
Произведите инициализацию разделов чтобы LVM мог использовать их. Используйте {{ic|fdisk -l}} чтобы найти разделы с файловой системой 'Linux LVM' и создайте в них физические тома:<br />
# pvcreate /dev/sda2<br />
Замените {{ic|/dev/sda2}} на имена разделов на вашей системе. Эта команда поместит заголовок на каждый раздел. Теперь он может быть использован LVM.<br />
Отобразить все разделы, которые LVM может использовать, можно с помощью:<br />
# pvdisplay<br />
<br />
====Создание группы логических томов====<br />
Следующий шаг - это создание логических томов внутри физических томов. <br />
Выполните следующую команду на каждом физическом томе:<br />
# vgcreate VolGroup00 /dev/sda2<br />
# vgextend VolGroup00 /dev/sdb1<br />
Метку "VolGroup00" можно заменить на любую другую.<br />
Отобразить все доступные логические тома можно с помощью:<br />
# vgdisplay<br />
<br />
{{Note|Можно создать несколько логических групп, но тогда они будут видны в системе в виде нескольких дисков.}}<br />
<br />
====Создание логических томов====<br />
Теперь нужно создать логические тома внутри группы томов. Следующая команда создаст логический том внутри "VolGroup00" с размером 10GB и меткой "lvolhome" <br />
# lvcreate -L 10G VolGroup00 -n lvolhome<br />
Этот том будет доступен позже как устойство {{ic|/dev/mapper/Volgroup00-lvolhome}} или {{ic|/dev/VolGroup00/lvolhome}}.<br />
Как и в случае в логическими томами, метка логического тома может быть выбрана на ваше усмотрение.<br />
<br />
Чтобы создать раздел swap внутри тома, нужен дополнительный параметр: <br />
# lvcreate -C y -L 10G VolGroup00 -n lvolswap<br />
{{ic|-C y}} создаст монолитный раздел, то есть раздел swap будет создан на одном диске и не будет "размазан" на несколько устройств или физических расширений. <br />
<br />
Если вы хотите использовать всё оставшееся свободное место внутри группы томов, выполните:<br />
# lvcreate -l +100%FREE VolGroup00 -n lvolmedia<br />
<br />
Логические тома можно отобразить командой:<br />
# lvdisplay<br />
<br />
{{Note|возможно потребуется загрузка модуля ядра ('''modprobe dm-mod''')}}<br />
<br />
{{Tip|Для начала можно создать относительно небольшие тома и позже по мере надобности их расширить. Оставьте свободное место внутри группы томов, чтобы было место для последующего увеличения разделов.}}<br />
<br />
====Создание файловых систем и их монтирование====<br />
Ваши логические тома должны быть доступны по следующему пути: {{ic|/dev/mapper/}} и {{ic|/dev/YourVolumeGroupName}}. Если их там нет, загрузите модуль ядра и сделайте группы доступными:<br />
# modprobe dm-mod<br />
# vgchange -ay<br />
Теперь можно создать файловые системы внутри логических томов и смонтировать их как обычные разделы.Если вы устанавливаете Arch Linux, пропустите этот шаг и используйте программу установки для выбора LVM разделов, которые вы создали.<br />
# mkfs.ext3 /dev/mapper/VolGroup00-lvolhome<br />
# mount /dev/mapper/VolGroup00-lvolhome /home<br />
Если вы устанавливаете Arch Linux, выполните /arch/setup, перейдите к ''Prepare Hard Drive'' далее сразу выберите ''Set Filesystem Mountpoints'' и '''''прочтите абзац [[Lvm#Важно|Важно]] перед тем как продолжить!'''''<br />
<br />
===Важно===<br />
Осталось всего несколько шагов, будьте внимательны при использовании/установке Arch Linux на LVM(в скобках указаны соответствующие меню во время установки):<br />
#Во время выбора точек монтирования выберете только что созданные логические тома(используйте: {{ic|/dev/mapper/Volgroup00-lvolhome}}).<br> НЕ выбирайте физические разделы на которых были созданы логические тома(не используйте: {{ic|/dev/sda2}}). (''Set Filesystem Mountpoints'')<br />
#Убедитесь, что вы заменили ''USELVM="no"'' на ''USELVM="yes"''в ''USELVM="no"'' to ''USELVM="yes"''<br />
#Убедитесь, что ''lvm2'' находится в секции HOOKS в {{ic|/etc/mkinitcpio.conf}} непосредственно перед ''filesystems'', для того чтобы ядро смогло найти LVM во <br />
время загрузки. Если вы хотите использовать LVM образы(англ. snapshots) добавьте ''dm-snapshot'' к переменной MODULES (''Configure System'')<br />
#Убедитесь, что в {{ic|/boot/grub/menu.lst}} указаны правильные тома для раздела /root.(''Install Bootloader'')<br />
Пример {{ic|/boot/grub/menu.lst}}<br />
...<br />
# (0) Arch Linux<br />
title Arch Linux<br />
root (hd0,0)<br />
kernel /vmlinuz26 '''root=/dev/mapper/VolGroup00-lvolroot''' resume=/dev/mapper/VolGroup00-lvolswap ro<br />
initrd /kernel26.img<br />
...<br />
If you are using LILO check {{ic|/etc/lilo.conf}}:<br />
image=/boot/vmlinuz26<br />
label=arch<br />
append="'''root=/dev/mapper/VolGroup00-lvolroot''' resume=/dev/mapper/VolGroup00-lvolswap ro"<br />
initrd=/boot/kernel26.img<br />
<br />
= Настройка =<br />
<br />
== Увеличение размера логического тома ==<br />
Для этого нужно увеличить сам том и затем размер файловой системы на нём. Представим, что у нас есть логический том размером 15Гб с ext3 на нём. Увеличим его размер до 20Гб:<br />
# lvextend -L 20G VolGroup00/lvolhome (или lvresize -L +5G VolGroup00/lvolhome)<br />
# resize2fs /dev/VolGroup00/lvolhome<br />
Вы можете использовать {{ic|lvresize}} вместо {{ic|lvextend}}.<br />
<br />
Если вы хотите заполнить всё свободное место в группе томов:<br />
# lvextend -l +100%FREE VolGroup00/lvolhome<br />
<br />
{{Warning|Не все файловые системы поддерживают изменение раздела в режиме "online" без потери данных.}}<br />
<br />
{{Note|Если вы не увеличите размер файловой системы, вы не сможете использовать свободное место добавленное к логическому тому.}}<br />
<br />
== Уменьшение размера логического тома==<br />
Скорее всего размер файловой системы такой-же как и логического тома, поэтому сначала нужно уменьшить её размет и только потом уменьшать размер тома.<br />
Дальнейшие действия зависят от типа файловой системы, возможно вам нужно отмонтировать её. Для логического тома размером 15ГБ и ext3 уменьшение размера до 10ГБ<br />
выглядит следующим образом: <br />
# resize2fs /dev/VolGroup00/lvolhome 9G<br />
# lvreduce -L 10G VolGroup00/lvolhome (или lvresize -L -5G VolGroup00/lvolhome)<br />
# resize2fs /dev/VolGroup00/lvolhome<br />
В данном случае мы уменьшили размер файловой системы до 9Гб чтобы при уменьшении размера логического тома, случайно, не потерять данные в конце файловой системы. После этого размер файловой системы можно увеличить.<br />
Вы можете использовать {{ic|lvresize}} вместо {{ic|lvreduce}}.<br />
<br />
{{Warning|Не уменьшайте размер файловой системы, до размера меньшего чем объём данных на ней, иначе вы рискуете потерять данные.}}<br />
<br />
{{Warning|Не все файловые системы поддерживают изменение раздела в режиме "online" без потери данных.}}<br />
<br />
{{Note|Рекомендуется задать размер файловой системы меньше чем логического тома чтобы при уменьшении размера логического тома, случайно, не потерять данные в конце файловой системы.}}<br />
<br />
== Добавить раздел к логической группе ==<br />
Тип раздела должен быть 'Linux LVM'. Используйте, например, {{ic|cfdisk}}. После этого нужно создать физический том на этом разделе и затем добавить его к логической группе:<br />
# pvcreate /dev/sdb1<br />
# vgextend VolGroup00 /dev/sdb1<br />
<br />
{{Tip|К логической группе могут быть добавлены разделы с любого диска в вашей системе.}}<br />
<br />
== Удаление раздела из логической группы ==<br />
Перед удаление нужно переместить данные на другой раздел. LVM легко с этим справится:<br />
# pvmove /dev/sdb1<br />
Если вы хотите чтобы данные были перемещены на определённый физический том, передайте его в качестве второго аргумента командной строки:<br />
# pvmove /dev/sdb1 /dev/sdf1<br />
Если физический том должен быть удалён из группы томов:<br />
# vgreduce myVg /dev/sdb1<br />
Или удалите все пустые физические тома:<br />
# vgreduce --all vg0<br />
И наконец если вы хотите использовать раздел для чего-то другого и отвязать его от LVM совсем:<br />
# pvremove /dev/sdb1<br />
<br />
== Клонирование ==<br />
====Введение====<br />
<br />
LVM может создавать образ вашей системы по эффективно чем традиционные способы резервного копирования. Достигается это тем, что пока идёт создание клона при изменении исходного тома сначала начальная версия копируется в образ (англ. snapshot) и только потом изменяется. Начальный образ содержит только жёсткие ссылки(hard-links) к индексным дескриптором(inodes) ваших данных и использует их всё время пока данные не были изменены. Так система с размером в 35Гб может использовать только 2ГБ свободного места если в сумме в образе и в оригинале было изменено меньше 2ГБ.<br />
<br />
====Настрйка====<br />
Клон логического тома создаётся так-же как обычный том:<br />
<br />
# lvcreate --size 100M --snapshot --name snap01 /dev/mapper/vg0-pv<br />
На этом томе можно изменять менее 100Мб данных, после этого образ(snapshot) будет заполнен полностью)<br />
<br />
<br />
''dm-snapshot'' должен быть в переменной MODULES в {{ic|/etc/mkinitcpio.conf}}, иначе система не загрузится<br />
# mkinitcpio -g /boot/kernel26.img<br />
<br />
Образы используются в первую очередь для создания замороженной копии файловой системы чтобы уже с неё делать резервную копию.<br />
<br />
= Решение проблем =<br />
====LVM команды не работают ====<br />
*Загрузите модуль ядра:<br />
# modprobe dm-mod<br />
* Попробуйте использовать префикс ''lvm'':<br />
# lvm pvdisplay<br />
<br />
==== Не видно логические тома ====<br />
При установке на систему с уже существующей группой томов, вы можете не увидеть логические тома даже после "modprobe dm-mod".<br />
<br />
В этом случае вам возможно прийдётся выполнить:<br />
# vgchange -ay <volgroup><br />
<br />
<br />
= Ещё по теме =<br />
Другие статьи на Arch Wiki:<br />
* [[Installing_with_Software_RAID_or_LVM|Installing with software RAID or LVM]]<br />
* [[RAID_Encryption_LVM|RAID encryption LVM]]<br />
Внешние ссылки:<br />
* [http://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux) LVM on wikipedia]<br />
* [http://tldp.org/HOWTO/LVM-HOWTO/ LVM HOWTO on tldp.org ]<br />
* [http://www.gentoo.org/doc/en/lvm2.xml Gentoo LVM2 installation at gentoo.org ]<br />
* [http://wiki.gentoo.org/wiki/LVM LVM at en.gentoo-wiki.com]</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=LVM_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=301040LVM (简体中文)2014-02-24T03:41:41Z<p>Mistofvongola: /* 更多资源 */ Fix Gentoo Wiki link</p>
<hr />
<div>[[Category:Getting and installing Arch (简体中文)]]<br />
[[Category:File systems (简体中文)]]<br />
[[Category:简体中文]]<br />
[[cs:LVM]]<br />
[[de:LVM]]<br />
[[en:LVM]]<br />
[[es:LVM]]<br />
[[fr:LVM]]<br />
[[it:LVM]]<br />
[[ja:LVM]]<br />
[[ru:LVM]]<br />
[[tr:LVM]]<br />
{{TranslationStatus (简体中文)|LVM|2013-08-12|266713}}<br />
<br />
<br />
{{Article summary start|摘要}}<br />
{{Article summary text|本文提供如何在 Arch Linux 中配置和使用 Logical Volume Manager (LVM) 的例子。}}<br />
<!--{{Article summary heading|需要的软件}}<br />
{{Article summary link|Software|}}--><br />
{{Article summary heading|相关页面}}<br />
{{Article summary wiki|Software RAID and LVM}}<br />
{{Article summary wiki|System Encryption with LUKS}}<br />
{{Article summary end}}<br />
<br />
== 介绍 ==<br />
<br />
{{Wikipedia|Logical Volume Manager (Linux)}}<br />
<br />
=== LVM基本组成块(building blocks) ===<br />
<br />
LVM利用Linux内核的[http://sources.redhat.com/dm/ device-mapper]来实现存储系统的虚拟化(系统分区独立于底层硬件)。<br />
通过LVM,你可以实现存储空间的抽象化并在上面建立虚拟分区(virtual partitions),可以更简便地扩大和缩小分区,可以增删分区时无需担心某个硬盘上没有足够的连续空间,<br />
without getting caught up in the problems of fdisking a disk that is in use (and wondering whether the kernel is using the old or new partition table) and without having to move other partition out of the way.<br />
LVM是用来方便管理的,不会提供额外的安全保证。<br />
However, it sits nicely with the other two technologies we are using.<br />
<br />
LVM的基本组成块(building blocks)如下:<br />
<br />
* '''物理卷Physical volume (PV)''':可以在上面建立卷组的媒介,可以是硬盘分区,也可以是硬盘本身或者回环文件(loopback file)。物理卷包括一个特殊的header,其余部分被切割为一块块物理区域(physical extents)。 Think of physical volumes as big building blocks which can be used to build your hard drive.<br />
* '''卷组Volume group (VG)''':将一组物理卷收集为一个管理单元。Group of physical volumes that are used as storage volume (as one disk). They contain logical volumes. Think of volume groups as hard drives.<br />
* '''逻辑卷Logical volume (LV)''':虚拟分区,由物理区域(physical extents)组成。A "virtual/logical partition" that resides in a volume group and is composed of physical extents. Think of logical volumes as normal partitions.<br />
* '''物理区域Physical extent (PE)''':硬盘可供指派给逻辑卷的最小单位(通常为4MB)。A small part of a disk (usually 4MB) that can be assigned to a logical Volume. Think of physical extents as parts of disks that can be allocated to any partition.<br />
<br />
示例: <br />
'''两块物理硬盘'''<br />
<br />
硬盘1 (/dev/sda):<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ <br />
|分区1 50GB (物理卷) |分区2 80GB (物理卷) |<br />
|/dev/sda1 |/dev/sda2 |<br />
|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ __|<br />
<br />
硬盘2 (/dev/sdb):<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br />
|分区1 120GB (物理卷) |<br />
|/dev/sdb1 |<br />
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|<br />
<br />
'''LVM方式'''<br />
<br />
卷组VG1 (/dev/MyStorage/ = /dev/sda1 + /dev/sda2 + /dev/sdb1):<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ <br />
|逻辑卷1 15GB |逻辑卷2 35GB |逻辑卷3 200GB |<br />
|/dev/MyStorage/rootvol |/dev/MyStorage/homevol |/dev/MyStorage/mediavol |<br />
|_ _ _ _ _ _ _ _ _ _ _ _ _ _ __|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|<br />
<br />
=== 优点 ===<br />
<br />
比起正常的硬盘分区管理,LVM更富于弹性:<br />
* 使用卷组(VG),使众多硬盘空间看起来像一个大硬盘。<br />
* 使用逻辑卷(LV),可以创建跨越众多硬盘空间的分区。<br />
* 可以创建小的逻辑卷(LV),在空间不足时再动态调整它的大小。<br />
* 在调整逻辑卷(LV)大小时可以不用考虑逻辑卷在硬盘上的位置,不用担心没有可用的连续空间。It does not depend on the position of the LV within VG, there is no need to ensure surrounding available space.<br />
* 可以在线(online)对逻辑卷(LV)和卷组(VG)进行创建、删除、调整大小等操作。LVM上的文件系统也需要重新调整大小,某些文件系统也支持这样的在线操作。<br />
* 无需重新启动服务,就可以将服务中用到的逻辑卷(LV)在线(online)/动态(live)迁移至别的硬盘上。<br />
* 允许创建快照,可以保存文件系统的备份,同时使服务的下线时间(downtime)降低到最小。<br />
<br />
这些优点使得LVM对服务器的管理非常有用,对于桌面系统管理的帮助则没有那么显著,你需要根据实际情况进行取舍。<br />
<br />
=== 缺点 ===<br />
<br />
* 只能在Linux上使用。对于其他操作系统(如FreeBSD, Windows等),尚未有官方支持。<br />
* 在系统设置时需要更复杂的额外步骤。<br />
* 假如你使用的是[[btrfs]]文件系统,那么它所提供的子卷(subvolume)实际上已经时一层可动态调整的存储层,此时再用LVM就显得多余了。<br />
<br />
==在LVM上安装Arch Linux==<br />
<br />
你应该在安装过程的[[Partitioning (简体中文)|Partitioning]]和[[File Systems (简体中文)#Step_2:_create_the_new_file_system|mkfs]]步骤中间创建LVM卷,<br />
而且根(root)分区不再通过直接格式化硬盘来创建,而是创建在LVM逻辑卷(LV)上。<br />
<br />
快速导览:<br />
* 创建物理卷(PV)所在的分区,设置分区格式为'Linux LVM',对应的十六进制码为8e(MBR)或8e00(GPT)。<br />
* 创建物理卷(PV)。如果你只有一个硬盘,那么你最好只创建一个分区一个物理卷;如果你有多个硬盘,你可以创建多个分区,在每个分区上分别创建一个物理卷。<br />
* 创建卷组(VG),并把所有物理卷加进卷组。<br />
* 在卷组上创建逻辑卷(LV)。<br />
* 继续Beginners' Guide中的格式化分区步骤。<br />
* 当你做到Beginners' Guide中的[[Beginners' Guide (简体中文)#创建初始 ramdisk 环境|创建初始 ramdisk 环境]]时,把lvm加入到mkinitcpio.conf文件中(请参考下文)。<br />
<br />
{{警告|如果你的启动引导程序使用的是[[GRUB Legacy (简体中文)|GRUB Legacy]],那么由于GRUB Legacy不支持LVM,因而你将无法在LVM上创建{{ic|/boot}}分区。[[GRUB (简体中文)|GRUB]]用户则不会有这个限制。如果你必须使用GRUB Legacy,那么请单独创建并在硬盘上直接格式化/boot分区。}}<br />
<br />
===创建物理卷(PV)===<br />
<br />
请确认你对正确的分区进行操作!你可以通过以下方式找到类型为'Linux LVM'的分区:<br />
* MBR格式: {{Ic|fdisk -l}}<br />
* GPT格式: 先用命令{{Ic|lsblk}},再用命令{{Ic|gdisk -l ''disk-device''}}<br />
<br />
在该分区下创建一个物理卷pv(假设是/dev/sda2):<br />
# pvcreate /dev/sda2<br />
This command creates a header on each partition so it can be used for LVM.<br />
你可以用以下命令查看已创建好的物理卷:<br />
# pvdisplay<br />
<br />
{{注意|如果你用的是擦除块(erase block)大小小于1M的SSD,请采用以下命令{{ic|pvcreate --dataalignment 1m /dev/sda2}}来设置对齐(alignment),可以参考[http://serverfault.com/questions/356534/ssd-erase-block-size-lvm-pv-on-raw-device-alignment 链接(英文)]}}<br />
<br />
=== 创建卷组(VG)===<br />
<br />
创建完成物理卷(PV)之后,下一步就是在该物理卷创建卷组(VG)了。 如果有两个以上的物理卷(例如以下的/dev/sda2和/dev/sdb1),首先必须先在其中一个物理卷(PV)创建一个卷组,然后让该卷组扩大到其他所有的物理卷(这里假设你只使用一个卷组来管理其他所有的物理卷):<br />
# vgcreate VolGroup00 /dev/sda2<br />
# vgextend VolGroup00 /dev/sdb1<br />
其中,“VolGroup00”名字换成你自己起的名字即可。接下来可以用以下命令查看卷组:<br />
# vgdisplay<br />
<br />
{{注意|你可以创建多个的卷组,但这将因此让你的硬盘空间看起来不像一块硬盘。}}<br />
<br />
===创建逻辑卷(LV)===<br />
<br />
创建完卷组(VG)之后,就可以开始创建逻辑卷(LV)了。输入下面命令: <br />
# lvcreate -L 10G VolGroup00 -n lvolhome<br />
其中10G是大小,VolGroup00是卷组名称,lvolhome是逻辑卷名称,这些都可以根据你自己喜欢设定。<br />
该逻辑卷创建完后,你就可以通过{{ic|/dev/mapper/Volgroup00-lvolhome}}或{{ic|/dev/VolGroup00/lvolhome}}来访问它。<br />
<br />
如果你要创建的是swap,那么你需要加上{{Ic|-C y}}参数:<br />
# lvcreate -C y -L 10G VolGroup00 -n lvolswap<br />
{{Ic|-C y}}参数用来指定逻辑卷的空间分配是连续的,这保证了你所创建的swap空间不会被分散在不连续的物理空间甚至不同的硬盘中。<br />
<br />
如果你想让要创建的逻辑卷拥有卷组(VG)的所有未使用空间,请使用以下命令:<br />
# lvcreate -l +100%FREE VolGroup00 -n lvolmedia<br />
<br />
你可以通过以下命令来查看逻辑卷:<br />
# lvdisplay<br />
<br />
{{注意|为了使上述命令能正常运行,你可能需要加载''device-mapper''内核模块(请使用命令'''modprobe dm-mod''')。}}<br />
<br />
{{小贴士|一开始可以创建小一点的逻辑卷,在卷组里留下一部分未使用空间,以后就可以根据需要再作扩展了。}}<br />
<br />
===建立文件系统与挂载逻辑卷===<br />
<br />
现在你的逻辑卷应该已经在{{ic|/dev/mapper/}}和{{ic|/dev/''YourVolumeGroupName''}}中了。如果你无法在以上位置找到它,请使用以下命令来加载模块、并扫描与激活卷组:<br />
# modprobe dm-mod<br />
# vgscan<br />
# vgchange -ay<br />
现在你可以在逻辑卷上创建文件系统并像普通分区一样挂载它了(如果你正在安装Arch linux,需要更详细的信息,请参考[[Beginners' Guide (简体中文)#挂载分区|挂载分区]]):<br />
# mkfs.ext4 /dev/mapper/VolGroup00-lvolhome<br />
# mount /dev/mapper/VolGroup00-lvolhome /home<br />
<br />
{{警告|挂载点请选择你所新建的逻辑卷(例如:{{ic|/dev/mapper/Volgroup00-lvolhome}}),'''不要'''使用逻辑卷所在的实际分区设备(例如:{{ic|/dev/sda2}})。}}<br />
<br />
=== 在mkinitcpio.conf中加入lvm的钩子扩展(hook) ===<br />
<br />
你需要保证{{Ic|udev}}和{{Ic|lvm2}}这两个[[mkinitcpio]]的钩子扩展被启用。<br />
<br />
{{Ic|udev}}已经预设好,不必手动启用了。你只需要编辑{{Ic|/etc/mkinitcpio.conf}}文件,在{{Ic|block}}与{{Ic|filesystem}}这两项中间插入{{Ic|lvm2}}:<br />
<br />
{{hc|/etc/mkinitcpio.conf:|<nowiki>HOOKS="base udev ... block lvm2 filesystems"</nowiki>}}<br />
<br />
之后你就可以继续下一步的[[mkinitcpio (简体中文)#创建和启用镜像|创建和启用镜像]]操作了。<br />
<br />
== 配置 ==<br />
<br />
=== 高级选项 ===<br />
<br />
如果你需要监控功能(这对快照是必须的),那么你需要启用lvmetad。<br />
这只需要在{{ic|/etc/lvm/lvm.conf}}文件中设置{{ic|1=use_lvmetad = 1}}选项即可。<br />
目前这个选项已经成为预设选项,不需要手动设置。<br />
<br />
=== 扩大逻辑卷 ===<br />
<br />
如果你想扩大逻辑卷的文件系统大小,你需要先扩充该逻辑卷,再让文件系统也扩充到新增加的空余空间中。<br />
<br />
假设我们有一个15GB的逻辑卷,该逻辑卷被格式化为ext3文件系统。现在我们想让它变为20G,那么我们需要执行以下命令:<br />
# lvextend -L 20G VolGroup00/lvolhome (或 lvresize -L +5G VolGroup00/lvolhome)<br />
# resize2fs /dev/VolGroup00/lvolhome<br />
如上所示,你可以使用{{Ic|lvresize}}命令来替代{{Ic|lvextend}}命令。<br />
<br />
如果你想把逻辑卷(LV)扩大到整个卷组(VG)的所有空余空间中,那么你可以执行以下命令:<br />
# lvextend -l +100%FREE VolGroup00/lvolhome<br />
<br />
{{警告|并非所有的文件系统都支持无损或在线(online)扩大逻辑卷(在已挂载的文件系统上扩大逻辑卷很可能会造成数据损失)。}}<br />
<br />
{{注意|如果你没有执行{{ic|resize2fs}}命令来调整文件系统的大小,那么你实际可用的逻辑卷空间不会得到扩充。}}<br />
<br />
=== 缩小逻辑卷 ===<br />
<br />
由于你逻辑卷上的文件系统很可能已经占满了逻辑卷的空间,因此在缩小逻辑卷时,你可能需要先缩小文件系统的大小,再缩小逻辑卷本身。对于不支持在线调整大小的文件系统,你还需要先卸载它再执行上述操作。<br />
假设我们有一个15GB的逻辑卷,该逻辑卷被格式化为ext3文件系统。现在我们想让它缩小到10G,那么我们需要执行以下命令:<br />
# resize2fs /dev/VolGroup00/lvolhome 9G<br />
# lvreduce -L 10G VolGroup00/lvolhome (或 lvresize -L -5G VolGroup00/lvolhome)<br />
# resize2fs /dev/VolGroup00/lvolhome<br />
在这里我们先把文件系统缩小到不足15G的大小(上例为9G),之所以不把它调整到刚好15G大小是为了防止在缩小逻辑卷时对文件系统数据可能造成的损害。之后我们再用{{Ic|resize2fs}}命令把文件系统调整到正常大小(上例为15G),以让它可以使用逻辑卷另外的(上例为6G)空余空间。与扩大逻辑卷类似,你可以使用{{Ic|lvresize}}命令来替代{{Ic|lvreduce}}命令。<br />
<br />
{{警告|<br />
*为了避免数据丢失,在缩小文件系统时请不要让文件系统的大小比它的已使用空间还小。<br />
*并非所有的文件系统都支持无损或在线(online)缩小逻辑卷(在已挂载的文件系统上缩小逻辑卷很可能会造成数据损失)。}}<br />
<br />
{{注意|建议一开始缩小文件系统时,使文件系统大小比缩小后的逻辑卷大小还小,这样可以保证在缩小逻辑卷时,不会造成文件系统末端被切断的意外。}}<br />
<br />
=== 移除逻辑卷 ===<br />
<br />
{{警告|在移除逻辑卷之前,请先备份好数据以免丢失!}}<br />
<br />
首先,找到你所要移除的逻辑卷的名称。你可以使用以下命令来查看系统的所有逻辑卷:<br />
<br />
# lvs<br />
<br />
接下来,找到你所要移除的逻辑卷的挂载点<br />
$ df -h<br />
并卸载它:<br />
# umount /your_mountpoint<br />
<br />
最后,使用以下命令来移除逻辑卷:<br />
<br />
# lvremove /dev/yourVG/yourLV<br />
<br />
请输入{{ic|y}}来确定你要执行移除逻辑卷操作。<br />
<br />
此外,请不要忘了更新{{ic|/etc/fstab}}!<br />
<br />
你可以再次使用{{ic|lvs}}命令来确认你的逻辑卷已被移除。<br />
<br />
=== 添加物理卷(PV)到卷组(VG)中 ===<br />
<br />
首先创建一个新的物理卷(PV),再把卷组(VG)扩充到该物理卷上:<br />
<br />
{{bc|1=<br />
# pvcreate /dev/sdb1<br />
# vgextend VolGroup00 /dev/sdb1<br />
}}<br />
<br />
This of course will increase the total number of physical extents on your volume group, which can be allocated by logical volumes as you see fit.<br />
<br />
{{Note|It is considered good form to have a [[Partitioning|partition table]] on your storage medium below LVM. Use the appropriate type code: {{ic|8e}} for MBR, and {{ic|8e00}} for GPT partitions.}}<br />
<br />
=== 从卷组(VG)中移除分区 ===<br />
<br />
首先,分区中的所有数据需要被转移到别的分区,幸而LVM提供了以下的简便方式:<br />
# pvmove /dev/sdb1<br />
如果你想指定所要转移的目标分区,那么可以把该分区作为{{Ic|pvmove}}的第二个参数:<br />
# pvmove /dev/sdb1 /dev/sdf1<br />
接着,从卷组(VG)中移除物理卷(PV):<br />
# vgreduce myVg /dev/sdb1<br />
或者把所有的空物理卷(PV)都移除掉:<br />
# vgreduce --all vg0<br />
<br />
最后,如果你仍然想要使用该分区,而且不想让LVM以为它是一个物理卷,那么你可以执行以下命令:<br />
# pvremove /dev/sdb1<br />
<br />
===快照功能 ===<br />
====介绍====<br />
LVM可以给系统创建一个快照,由于使用了写入时复制(copy-on-write) 策略,相比传统的备份更有效率。 初始的快照只有关联到实际数据的inode的实体链接(hark-link)而已。只要实际的数据没有改变,快照就只会包含指向数据的inode的指针,而非数据本身。一旦你更改了快照对应的文件或目录,LVM就会自动拷贝相应的数据,包括快照所对应的旧数据的拷贝和你当前系统所对应的新数据的拷贝。这样的话,只要你修改的数据(包括原始的和快照的)不超过2G,你就可以只使用2G的空间对一个有35G数据的系统创建快照。<br />
<br />
====配置====<br />
你可以像创建普通逻辑卷一样创建快照逻辑卷。<br />
<br />
# lvcreate --size 100M --snapshot --name snap01 /dev/mapper/vg0-pv<br />
你可以修改少于100M的数据直到该快照逻辑卷空间不足为止。<br />
<br />
Todo: scripts to automate snapshots of root before updates, to rollback... updating menu.lst to boot snapshots (separate article?)<br />
<br />
快照可以提供文件系统的冻结副本,主要被用来做备份;一份需要两小时才能完成的(快照)备份比直接备份分区更能保证文件系统映像的一致性。<br />
<br />
== 常见问题 ==<br />
=== Arch Linux默认设定所必须的设定值(Changes that could be required due to changes in the Arch-Linux defaults) ===<br />
在{{ic|/etc/lvm/lvm.conf}}文件中必须设定{{ic|1=use_lvmetad = 1}}。现在这个选项已经成为预设值——你可以通过合并{{ic|lvm.conf.pacnew}}文件来更新你过时的{{ic|/etc/lvm/lvm.conf}}文件。<br />
<br />
===LVM 命令不起作用===<br />
<br />
*加载以下模块:<br />
# modprobe dm_mod<br />
<br />
正常情况下,{{ic|dm_mod}}模块应当被自动加载。假如该模块无法被自动加载,你可以试着修改{{ic|/etc/mkinitcpio.conf}}:<br />
<br />
{{hc|/etc/mkinitcpio.conf:|<nowiki>MODULES="dm_mod ..."</nowiki>}}<br />
<br />
你需要[[mkinitcpio (简体中文)#创建和启用镜像|重建initramfs]]来提交你对{{ic|/etc/mkinitcpio.conf}}的更改。<br />
<br />
*测试以''lvm''开头的命令是否可以被正确执行,例如:<br />
# lvm pvdisplay<br />
<br />
=== 逻辑卷无法显示 ===<br />
<br />
如果你在挂载某个已创建好的逻辑卷时,发现它没有出现在{{ic|lvscan}}命令的结果列表里,那么你可以用以下命令去激活它:<br />
<br />
# vgscan<br />
# vgchange -ay<br />
<br />
===在可移除设备上的LVM问题===<br />
<br />
症状:<br />
# vgscan<br />
Reading all physical volumes. This may take a while...<br />
/dev/backupdrive1/backup: read failed after 0 of 4096 at 319836585984: Input/output error<br />
/dev/backupdrive1/backup: read failed after 0 of 4096 at 319836643328: Input/output error<br />
/dev/backupdrive1/backup: read failed after 0 of 4096 at 0: Input/output error<br />
/dev/backupdrive1/backup: read failed after 0 of 4096 at 4096: Input/output error<br />
Found volume group "backupdrive1" using metadata type lvm2<br />
Found volume group "networkdrive" using metadata type lvm2<br />
<br />
产生原因:<br />
:在卷组(VG)失活(deactivate)之前就移除掉外部的LVM设备。在你断开连接之前,需要保证以下命令被执行:<br />
# vgchange -an ''volume group name''<br />
<br />
<br />
解决方案:(假设你已经用{{ic|# vgchange -ay ''vg''}}命令来激活卷组,但仍有''Input/output error''的错误信息。)执行以下命令:<br />
# vgchange -an ''volume group name''<br />
移除外部设备,稍候几分钟后再执行以下命令:<br />
# vgscan<br />
# vgchange -ay ''volume group name''<br />
<br />
=== 内核(kernel)选项 ===<br />
<br />
在grub的kernel选项中,你可能需要{{ic|dolvm}}。{{ic|<nowiki>root=</nowiki>}}需要被设置成相应的逻辑卷,例如{{ic|/dev/mapper/''vg-name''-''lv-name''}}。<br />
<br />
== 更多资源 ==<br />
archwiki的其他关于LVM的文章:<br />
* [[Installing_with_Software_RAID_or_LVM|Installing with software RAID or LVM]]<br />
* [[RAID_Encryption_LVM|RAID encryption LVM]]<br />
外部资源:<br />
* [http://sourceware.org/lvm2/ LVM2 Resource Page] on SourceWare.org<br />
* [http://tldp.org/HOWTO/LVM-HOWTO/ LVM HOWTO] article at The Linux Documentation project<br />
* [http://www.gentoo.org/doc/en/lvm2.xml Gentoo LVM2 installation] guide at Gentoo documentation<br />
* [http://wiki.gentoo.org/wiki/LVM LVM] article at Gentoo wiki<br />
* [http://www.joshbryan.com/blog/2008/01/02/lvm2-mirrors-vs-md-raid-1/ LVM2 Mirrors vs. MD Raid 1] post by Josh Bryan</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=LVM&diff=301039LVM2014-02-24T03:41:09Z<p>Mistofvongola: /* See also */ Fix Gentoo wiki link</p>
<hr />
<div>[[Category:Getting and installing Arch]]<br />
[[Category:File systems]]<br />
[[cs:LVM]]<br />
[[de:LVM]]<br />
[[es:LVM]]<br />
[[fr:LVM]]<br />
[[it:LVM]]<br />
[[ja:LVM]]<br />
[[ru:LVM]]<br />
[[tr:LVM]]<br />
[[zh-CN:LVM]]<br />
{{Related articles start}}<br />
{{Related|Software RAID and LVM}}<br />
{{Related|System Encryption with LUKS}}<br />
{{Related|dm-crypt/Encrypting an Entire System#LVM on LUKS}}<br />
{{Related|dm-crypt/Encrypting an Entire System#LUKS on LVM}}<br />
{{Related articles end}}<br />
From [[Wikipedia:Logical Volume Manager (Linux)]]:<br />
:LVM is a [[Wikipedia:logical volume management|logical volume manager]] for the [[Wikipedia:Linux kernel|Linux kernel]]; it manages disk drives and similar mass-storage devices.<br />
<br />
=== LVM Building Blocks ===<br />
<br />
Logical Volume Management makes use of the [http://sources.redhat.com/dm/ device-mapper] feature of the Linux kernel to provide a system of partitions independent of the underlying disk's layout. With LVM you abstract your storage and have "virtual partitions", making it easier to extend and shrink partitions (subject to potential limitations of your file system) and add/remove partitions without worrying about whether you have enough contiguous space on a particular disk, getting caught up in fdisking a disk in use (and wondering whether the kernel is using the old or new partition table), or, having to move other partitions out of the way. This is strictly an ease-of-management issue: it does not provide any security. However, it sits nicely with the other two technologies we are using.<br />
<br />
The basic building blocks of LVM are:<br />
<br />
* '''Physical volume (PV)''': Partition on hard disk (or even hard disk itself or loopback file) on which you can have volume groups. It has a special header and is divided into physical extents. Think of physical volumes as big building blocks which can be used to build your hard drive.<br />
* '''Volume group (VG)''': Group of physical volumes that are used as storage volume (as one disk). They contain logical volumes. Think of volume groups as hard drives.<br />
* '''Logical volume (LV)''': A "virtual/logical partition" that resides in a volume group and is composed of physical extents. Think of logical volumes as normal partitions.<br />
* '''Physical extent (PE)''': A small part of a disk (usually 4MiB) that can be assigned to a logical Volume. Think of physical extents as parts of disks that can be allocated to any partition.<br />
<br />
Example:<br />
'''Physical disks'''<br />
<br />
Disk1 (/dev/sda):<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br />
|Partition1 50GB (Physical volume) |Partition2 80GB (Physical volume) |<br />
|/dev/sda1 |/dev/sda2 |<br />
|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |<br />
<br />
Disk2 (/dev/sdb):<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br />
|Partition1 120GB (Physical volume) |<br />
|/dev/sdb1 |<br />
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ _|<br />
<br />
'''LVM logical volumes'''<br />
<br />
Volume Group1 (/dev/MyStorage/ = /dev/sda1 + /dev/sda2 + /dev/sdb1):<br />
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ <br />
|Logical volume1 15GB |Logical volume2 35GB |Logical volume3 200GB |<br />
|/dev/MyStorage/rootvol|/dev/MyStorage/homevol |/dev/MyStorage/mediavol |<br />
|_ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |<br />
<br />
=== Advantages ===<br />
<br />
LVM gives you more flexibility than just using normal hard drive partitions:<br />
* Use any number of disks as one big disk.<br />
* Have logical volumes stretched over several disks.<br />
* Create small logical volumes and resize them "dynamically" as they get more filled.<br />
* Resize logical volumes regardless of their order on disk. It does not depend on the position of the LV within VG, there is no need to ensure surrounding available space.<br />
* Resize/create/delete logical and physical volumes online. File systems on them still need to be resized, but some support online resizing.<br />
* Online/live migration of LV being used by services to different disks without having to restart services.<br />
* Snapshots allow you to backup a frozen copy of the file system, while keeping service downtime to a minimum.<br />
<br />
These can be very helpful in a server situation, desktop less so, but you must decide if the features are worth the abstraction.<br />
<br />
=== Disadvantages ===<br />
<br />
* Linux exclusive (almost). There is no official support in most other OS (FreeBSD, Windows..).<br />
* Additional steps in setting up the system, more complicated.<br />
* If you use the [[Btrfs]] file system, its Subvolume feature will also give you the benefit of having a flexible layout. In that case, using the additional Abstraction layer of LVM may be unnecessary.<br />
<br />
== Installing Arch Linux on LVM ==<br />
<br />
You should create your LVM Volumes between the [[Partitioning]] and [[File Systems#Format a device|formatting]] steps of the Installation Procedure. Instead of directly formatting a partition to be your root file system, it will be created inside a logical volume (LV). <br />
<br />
Make sure the {{pkg|lvm2}} package is [[pacman|installed]].<br />
<br />
Quick overview: <br />
* Create partition(s) where your PV will reside. Set the partition type to 'Linux LVM', which is 8e if you use MBR, 8e00 for GPT.<br />
* Create your physical volumes (PV). If you have one disk it is best to just create one PV in one large partition. If you have multiple disks you can create partitions on each of them and create a PV on each partition.<br />
* Create your volume group (VG) and add all the PV to it.<br />
* Create logical volumes (LV) inside your VG.<br />
* Continue with “Format the partitions” step of [[Beginners' guide]].<br />
* When you reach the “Create initial ramdisk environment” step in the Beginners Guide, add the {{ic|lvm}} hook to {{ic|/etc/mkinitcpio.conf}} (see below for details).<br />
<br />
{{Warning|{{ic|/boot}} cannot reside in LVM when using [[GRUB Legacy]], which does not support LVM. [[GRUB]] users do not have this limitation. If you need to use GRUB Legacy, you must create a separate {{ic|/boot}} partition and format it directly. }}<br />
<br />
=== Create physical volumes ===<br />
<br />
Make sure you target the right partitions! To find the partitions with type 'Linux LVM':<br />
* MBR system: {{Ic|fdisk -l}}<br />
* GPT system: {{Ic|lsblk}} and then {{Ic|gdisk -l ''disk-device''}}<br />
<br />
Create a physical volume on them:<br />
# pvcreate ''disk-device''<br />
''disk-device'' may be e.g. {{ic|/dev/sda2}}.<br />
This command creates a header on each partition so it can be used for LVM.<br />
You can track created physical volumes with:<br />
# pvdisplay<br />
<br />
{{Note|If using a SSD, use {{ic|pvcreate --dataalignment 1m /dev/sda2}} (for erase block size < 1MiB), see e.g. [http://serverfault.com/questions/356534/ssd-erase-block-size-lvm-pv-on-raw-device-alignment here]}}<br />
<br />
=== Create volume group ===<br />
<br />
Next step is to create a volume group on this physical volume. First you need to create a volume group on one of the new partitions and then add to it all other physical volumes you want to have in it:<br />
# vgcreate VolGroup00 /dev/sda2<br />
# vgextend VolGroup00 /dev/sdb1<br />
Also you can use any other name you like instead of VolGroup00 for a volume group when creating it. You can track how your volume group grows with:<br />
# vgdisplay<br />
<br />
{{Note|You can create more than one volume group if you need to, but then you will not have all your storage presented as one disk.}}<br />
<br />
=== Create logical volumes ===<br />
<br />
Now we need to create logical volumes on this volume group. You create a logical volume with the next command by giving the name of a new logical volume, its size, and the volume group it will live on:<br />
# lvcreate -L 10G VolGroup00 -n lvolhome<br />
This will create a logical volume that you can access later with {{ic|/dev/mapper/Volgroup00-lvolhome}} or {{ic|/dev/VolGroup00/lvolhome}}. Same as with the volume groups, you can use any name you want for your logical volume when creating it.<br />
<br />
To create swap on a logical volume, an additional argument is needed:<br />
# lvcreate -C y -L 10G VolGroup00 -n lvolswap<br />
The {{Ic|-C y}} is used to create a contiguous partition, which means that your swap space does not get partitioned over one or more disks nor over non-contiguous physical extents.<br />
<br />
If you want to fill all the free space left on a volume group, use the next command:<br />
# lvcreate -l +100%FREE VolGroup00 -n lvolmedia<br />
<br />
You can track created logical volumes with:<br />
# lvdisplay<br />
<br />
{{Note|You may need to load the ''device-mapper'' kernel module ('''modprobe dm-mod''') for the above commands to succeed:}}<br />
<br />
{{Tip|You can start out with relatively small logical volumes and expand them later if needed. For simplicity, leave some free space in the volume group so there is room for expansion.}}<br />
<br />
=== Create file systems and mount logical volumes ===<br />
<br />
Your logical volumes should now be located in {{ic|/dev/mapper/}} and {{ic|/dev/''YourVolumeGroupName''}}. If you cannot find them, use the next commands to bring up the module for creating device nodes and to make volume groups available:<br />
# modprobe dm-mod<br />
# vgscan<br />
# vgchange -ay<br />
Now you can create file systems on logical volumes and mount them as normal partitions (if you are installing Arch linux, refer to [[Beginners' guide#Mount the partitions|mounting the partitions]] for additional details):<br />
# mkfs.ext4 /dev/mapper/VolGroup00-lvolhome<br />
# mount /dev/mapper/VolGroup00-lvolhome /home<br />
<br />
{{Warning|When choosing mountpoints, just select your newly created logical volumes (use: {{ic|/dev/mapper/Volgroup00-lvolhome}}). Do '''not''' select the actual partitions on which logical volumes were created (do not use: {{ic|/dev/sda2}}).}}<br />
<br />
=== Add lvm hook to mkinitcpio.conf ===<br />
<br />
You will need to make sure the {{Ic|udev}} and {{Ic|lvm2}} [[mkinitcpio]] hooks are enabled.<br />
<br />
{{Ic|udev}} is there by default. Edit the file and insert {{Ic|lvm2}} between {{Ic|block}} and {{Ic|filesystem}} like so:<br />
<br />
{{hc|/etc/mkinitcpio.conf:|<nowiki>HOOKS="base udev ... block lvm2 filesystems"</nowiki>}}<br />
<br />
Afterwards, you can continue in normal installation instructions with the [[Mkinitcpio#Image_creation_and_activation|create an initial ramdisk]] step.<br />
<br />
== Configuration ==<br />
<br />
=== Advanced options ===<br />
<br />
If you need monitoring (needed for snapshots) you can enable lvmetad. <br />
For this set {{ic|1=use_lvmetad = 1}} in {{ic|/etc/lvm/lvm.conf}}.<br />
This is the default by now. <br />
<br />
You can restrict the volumes that are activated automatically by setting the {{Ic|auto_activation_volume_list}} in {{Ic|/etc/lvm/lvm.conf}}. If in doubt, leave this option commented out.<br />
<br />
=== Grow logical volume ===<br />
<br />
To grow a logical volume you first need to grow the logical volume and then the file system to use the newly created free space. Let us say we have a logical volume of 15 GB with ext3 on it, and we want to grow it to 20 GB. We need to do the following steps: <br />
# lvextend -L 20G VolGroup00/lvolhome (or lvresize -L +5G VolGroup00/lvolhome)<br />
# resize2fs /dev/VolGroup00/lvolhome<br />
You may use {{Ic|lvresize}} instead of {{Ic|lvextend}}.<br />
<br />
If you want to fill all the free space on a volume group, use the next commands:<br />
# lvextend -l +100%FREE VolGroup00/lvolhome<br />
# resize2fs /dev/VolGroup00/lvolhome<br />
<br />
{{Warning|Not all file systems support growing without loss of data and/or growing online.}}<br />
<br />
{{Note|If you do not resize your file system, you will still have a volume with the same size as before (volume will be bigger but partly unused).}}<br />
<br />
=== Shrink logical volume ===<br />
<br />
Because your file system is probably as big as the logical volume it resides on, you need to shrink the file system first and then shrink the logical volume. Depending on your file system, you may need to unmount it first. Let us say we have a logical volume of 15 GB with ext3 on it and we want to shrink it to 10 GB. We need to do the following steps: <br />
# resize2fs /dev/VolGroup00/lvolhome 9G<br />
# lvreduce -L 10G VolGroup00/lvolhome<br />
<br />
Here we shrunk the file system more than needed so that when we shrunk the logical volume we did not accidentally cut off the end of the file system. After that, we normally grow the file system to fill all free space left on logical volume. You may use {{Ic|lvresize}} instead of {{Ic|lvreduce}}.<br />
# lvresize -L -5G VolGroup00/lvolhome<br />
# resize2fs /dev/VolGroup00/lvolhome<br />
<br />
{{Warning|<br />
* Do not reduce the file system size to less than the amount of space occupied by data or you risk data loss.<br />
* Not all file systems support shrinking without loss of data and/or shrinking online.<br />
}}<br />
<br />
{{Note|It is better to reduce the file system to a smaller size than the logical volume, so that after resizing the logical volume, we do not accidentally cut off some data from the end of the file system.}}<br />
<br />
=== Remove logical volume ===<br />
<br />
{{Warning|Before you remove a logical volume, make sure to move all data that you want to keep somewhere else; otherwise, it will be lost!}}<br />
<br />
First, find out the name of the logical volume you want to remove. You can get a list of all logical volumes installed on the system with:<br />
<br />
# lvs<br />
<br />
Next, look up the mountpoint for your chosen logical volume...:<br />
<br />
$ df -h<br />
<br />
... and unmount it:<br />
<br />
# umount /your_mountpoint<br />
<br />
Finally, remove the logical volume:<br />
<br />
# lvremove /dev/yourVG/yourLV<br />
<br />
Confirm by typing {{ic|y}} and you are done.<br />
<br />
Do not forget, to update {{ic|/etc/fstab}}!<br />
<br />
You can verify the removal of your logical volume by typing {{ic|lvs}} as root again (see first step of this section).<br />
<br />
=== Add physical volume to a volume group ===<br />
<br />
You first create a new physical volume on the block device you wish to use, then extend your volume group<br />
<br />
{{bc|1=<br />
# pvcreate /dev/sdb1<br />
# vgextend VolGroup00 /dev/sdb1<br />
}}<br />
<br />
This of course will increase the total number of physical extents on your volume group, which can be allocated by logical volumes as you see fit.<br />
<br />
{{Note|It is considered good form to have a [[Partitioning|partition table]] on your storage medium below LVM. Use the appropriate type code: {{ic|8e}} for MBR, and {{ic|8e00}} for GPT partitions.}}<br />
<br />
=== Remove partition from a volume group ===<br />
<br />
All of the data on that partition needs to be moved to another partition. Fortunately, LVM makes this easy:<br />
# pvmove /dev/sdb1<br />
If you want to have the data on a specific physical volume, specify that as the second argument to {{Ic|pvmove}}:<br />
# pvmove /dev/sdb1 /dev/sdf1<br />
Then the physical volume needs to be removed from the volume group:<br />
# vgreduce myVg /dev/sdb1<br />
Or remove all empty physical volumes:<br />
# vgreduce --all vg0<br />
<br />
And lastly, if you want to use the partition for something else, and want to avoid LVM thinking that the partition is a physical volume:<br />
# pvremove /dev/sdb1<br />
<br />
<br />
=== Deactivate volume group ===<br />
<br />
Just invoke <br />
# vgchange -a n my_volume_group<br />
<br />
This will deactivate the volume group and allow you to unmount the container it is stored in.<br />
<br />
=== Snapshots ===<br />
<br />
==== Introduction ====<br />
<br />
LVM allows you to take a snapshot of your system in a much more efficient way than a traditional backup. It does this efficiently by using a COW (copy-on-write) policy. The initial snapshot you take simply contains hard-links to the inodes of your actual data. So long as your data remains unchanged, the snapshot merely contains its inode pointers and not the data itself. Whenever you modify a file or directory that the snapshot points to, LVM automatically clones the data, the old copy referenced by the snapshot, and the new copy referenced by your active system. Thus, you can snapshot a system with 35GB of data using just 2GB of free space so long as you modify less than 2GB (on both the original and snapshot).<br />
<br />
==== Configuration ====<br />
<br />
You create snapshot logical volumes just like normal ones.<br />
<br />
# lvcreate --size 100M --snapshot --name snap01 /dev/mapper/vg0-pv<br />
With that volume, you may modify less than 100M of data, before the snapshot volume fills up.<br />
<br />
Reverting the modified 'pv' logical volume to the state when the 'snap01' snapshot was taken can be done with<br />
<br />
{{ic|# lvconvert --merge /dev/vg0/snap01}}<br />
<br />
In case the origin logical volume is active, merging will occur on the next reboot.(Merging can be done even from a LiveCD)<br />
<br />
The snapshot will no longer exist after merging.<br />
<br />
Also multiple snapshots can be taken and each one can be merged with the origin logical volume at will.<br />
<br />
The snapshot can be mounted and backed up with '''dd''' or '''tar'''. The size of the backup file done with '''dd''' will be the size of the files residing on the snapshot volume. <br />
To restore just create a snapshot, mount it, and write or extract the backup to it. And then merge it with the origin.<br />
<br />
It is important to have the ''dm_snapshot'' module listed in the MODULES variable of {{ic|/etc/mkinitcpio.conf}}, otherwise the system will not boot. If you do this on an already installed system, make sure to rebuild the image with<br />
# mkinitcpio -g /boot/initramfs-linux.img<br />
<br />
Todo: scripts to automate snapshots of root before updates, to rollback... updating {{ic|menu.lst}} to boot snapshots (separate article?)<br />
<br />
snapshots are primarily used to provide a frozen copy of a file system to make backups; a backup taking two hours provides a more consistent image of the file system than directly backing up the partition.<br />
<br />
See [[Create root filesystem snapshots with LVM]] for automating the creation of clean root file system snapshots during system startup for backup and rollback.<br />
<br />
[[Dm-crypt/Encrypting an Entire System#LVM on LUKS]] and [[Dm-crypt/Encrypting an Entire System#LUKS on LVM]].<br />
<br />
If you have LVM volumes not activated via the [[Mkinitcpio|initramfs]], [[#Using units|enable]] the '''lvm-monitoring''' service, which is provided by the {{pkg|lvm2}} package.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Changes that could be required due to changes in the Arch-Linux defaults ===<br />
<br />
The {{ic|1=use_lvmetad = 1}} must be set in {{ic|/etc/lvm/lvm.conf}}. This is the default now - if you have a {{ic|lvm.conf.pacnew}} file, you must merge this change.<br />
<br />
=== LVM commands do not work ===<br />
<br />
* Load proper module:<br />
# modprobe dm_mod<br />
<br />
The {{ic|dm_mod}} module should be automatically loaded. In case it does not, you can try:<br />
<br />
{{hc|/etc/mkinitcpio.conf:|<nowiki>MODULES="dm_mod ..."</nowiki>}}<br />
<br />
You will need to [[Mkinitcpio#Image_creation_and_activation|rebuild]] the initramfs to commit any changes you made.<br />
<br />
* Try preceding commands with ''lvm'' like this:<br />
# lvm pvdisplay<br />
<br />
=== Logical Volumes do not show up ===<br />
<br />
If you are trying to mount existing logical volumes, but they do not show up in {{ic|lvscan}}, you can use the following commands to activate them:<br />
<br />
# vgscan<br />
# vgchange -ay<br />
<br />
=== LVM on removable media ===<br />
<br />
Symptoms:<br />
# vgscan<br />
Reading all physical volumes. This may take a while...<br />
/dev/backupdrive1/backup: read failed after 0 of 4096 at 319836585984: Input/output error<br />
/dev/backupdrive1/backup: read failed after 0 of 4096 at 319836643328: Input/output error<br />
/dev/backupdrive1/backup: read failed after 0 of 4096 at 0: Input/output error<br />
/dev/backupdrive1/backup: read failed after 0 of 4096 at 4096: Input/output error<br />
Found volume group "backupdrive1" using metadata type lvm2<br />
Found volume group "networkdrive" using metadata type lvm2<br />
<br />
Cause:<br />
:Removing an external LVM drive without deactivating the volume group(s) first. Before you disconnect, make sure to:<br />
# vgchange -an ''volume group name''<br />
<br />
Fix: (assuming you already tried to activate the volume group with {{ic|# vgchange -ay ''vg''}}, and are receiving the Input/output errors:<br />
# vgchange -an ''volume group name''<br />
Unplug the external drive and wait a few minutes:<br />
# vgscan<br />
# vgchange -ay ''volume group name''<br />
<br />
=== Kernel options ===<br />
<br />
In kernel options, you may need {{ic|dolvm}}. {{ic|<nowiki>root=</nowiki>}} should be set to the logical volume, e.g {{ic|/dev/mapper/''vg-name''-''lv-name''}}.<br />
<br />
== See also ==<br />
<br />
* [http://sourceware.org/lvm2/ LVM2 Resource Page] on SourceWare.org<br />
* [http://tldp.org/HOWTO/LVM-HOWTO/ LVM HOWTO] article at The Linux Documentation project<br />
* [http://www.gentoo.org/doc/en/lvm2.xml Gentoo LVM2 installation] guide at Gentoo documentation<br />
* [http://wiki.gentoo.org/wiki/LVM LVM] article at Gentoo wiki<br />
* [http://www.joshbryan.com/blog/2008/01/02/lvm2-mirrors-vs-md-raid-1/ LVM2 Mirrors vs. MD Raid 1] post by Josh Bryan<br />
* [http://www.tutonics.com/2012/11/ubuntu-lvm-guide-part-1.html Ubuntu LVM Guide Part 1][http://www.tutonics.com/2012/12/lvm-guide-part-2-snapshots.html Part 2 detals snapshots]</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=Fluxbox_(%ED%95%9C%EA%B5%AD%EC%96%B4)&diff=301038Fluxbox (한국어)2014-02-24T03:38:48Z<p>Mistofvongola: Fix Gentoo wiki link</p>
<hr />
<div>[[Category:Stacking WMs (한국어)]]<br />
[[cs:Fluxbox]]<br />
[[de:Fluxbox]]<br />
[[en:Fluxbox]]<br />
[[es:Fluxbox]]<br />
[[fr:Fluxbox]]<br />
[[it:Fluxbox]]<br />
[[pl:Fluxbox]]<br />
[[pt:Fluxbox]]<br />
[[ru:Fluxbox]]<br />
[[sr:Fluxbox]]<br />
[[zh-TW:Fluxbox]]<br />
플럭스박스는 X11용 창 관리자 가운데 하나이다. Blackbox 0.61.1 코드에 기초하여 기능을 개선하고 계속 개발하고 있다. 플럭스박스는 시스템 자원을 덜 소모하고 빠르며 탭과 그룹화 같은 흥미있는 창 관리 도구를 제공한다. 설정 파일은 이해하고 수정하기 쉬우며 데스크톱을 멋지게 변경할 수 있는 수백 개의 “스타일”이 있다. 아치 리눅스에 플럭스박스를 설치하면 메모리 256MB의 구형 펜티엄 800 시스템을 매우 쓸만한 컴퓨터로 만들 수 있다. <br />
<br />
==설치==<br />
<br />
팩맨으로 설치하기.<br />
# pacman -S fluxbox<br />
<br />
[[Xorg]]가 설치되지 않았다면 물론 설치해야 한다.<br />
<br />
== 플럭스박스 시작하기 ==<br />
=== 방법 1: KDM/GDM/LightDM 로그인 관리자 ===<br />
[[KDM]], [[GDM]], [[Lightdm]] 로그인 관리자를 사용한다면 세션 목록에 플럭스박스가 자동으로 추가된다. 로그인할 때 세션 목록에서 플럭스박스를 선택하라. <br />
<br />
=== 방법 2: ~/.xinitrc ===<br />
<br />
{{ic|~/.xinitrc}}를 수정해 다음을 추가하라. <br />
<br />
exec startfluxbox<br />
<br />
logind, consolekit 세션과 같은 자세한 내용은 [[xinitrc]]를 보라.<br />
<br />
== 설정하기 ==<br />
<br />
시스템 설정 파일은 {{ic|/usr/share/fluxbox}}에 있으며 사용자 설정 파일은 {{ic|~/.fluxbox}}에 있다. 사용자 설정 파일은 다음과 같다.<br />
<ul><br />
<li>init: 플럭스박스 주 설정 파일.[http://fluxbox-wiki.org/index.php?title=Editing_the_init_file init 파일 수정하기]를 보라.<br />
<li>menu: 플럭스박스 메뉴 설정. 아래와 [http://fluxbox-wiki.org/index.php?title=Editing_the_menu menu 파일 수정하기]를 보라.<br />
<li>keys: 플럭스박스 키보드 단축키 설정. 아래와 [http://fluxbox-wiki.org/index.php?title=Keyboard_shortcuts 여기]를 보라.<br />
<li>startup: 시작 프로그램을 설정. 아래 .xinitrc와 [http://fluxbox-wiki.org/index.php?title=Editing_the_startup_file 여기]를 보라.<br />
<li>overlay: 스타일 요소 설정 파일. [http://fluxbox-wiki.org/index.php?title=Style_overlay 여기]를 보라.<br />
<li>apps: 특정 프로그램 창 설정을 저장하는 파일. [http://fluxbox-wiki.org/index.php?title=Editing_the_apps_file 여기]를 보라.<br />
<li>windowmenu: 창 메뉴 자체를 변경하는 설정 파일. [http://fluxbox-wiki.org/index.php?title=Editing_the_windowmenu 여기]를 보라.<br />
</ul><br />
그 디렉토리에 많은 설정 파일이 있지만 주로 init, menu, keys, startup 파일이 관심의 대상이다.<br />
<br />
=== 메뉴 관리 ===<br />
<br />
When you first install fluxbox a very basic applications menu will be created at ~/.fluxbox/menu. You access the menu via a right mouse button click on the desktop. As with other lightweight window managers Fluxbox does not automatically update its menu when you install new applications. It is therefore recommended that you install most of the apps you want on your system first and then re-generate or edit the menu. To enhance the menu and add/edit items there are basically four ways to do it:<br />
<br />
==== fluxbox-generate_menu ====<br />
There is a built-in command provided with fluxbox:<br />
$ fluxbox-generate_menu<br />
This command will auto-generate a {{ic|~/.fluxbox/menu/}} file based on your installed programs. However, the menu it generates will not be as comprehensive as that generated by "menumaker" (see immediately below).<br />
<br />
====MenuMaker====<br />
[http://menumaker.sourceforge.net MenuMaker] is a powerful tool that creates XML-based menus for a variety of Window Managers, including Fluxbox. MenuMaker will search your computer for executable programs and create a menu based on the results. It can be configured to exclude Legacy X, GNOME, KDE, or Xfce applications if desired.<br />
<br />
To install MenuMaker:<br />
# pacman -S menumaker<br />
<br />
Once installed, you can generate a complete menu and overwrite the default one by running:<br />
$ mmaker -f FluxBox<br />
<br />
To see MenuMaker options:<br />
$ mmaker --help<br />
<br />
==== 아치 리눅스 Xdg menu ====<br />
Requires [[XdgMenu]] which is available via pacman:<br />
# pacman -S archlinux-xdg-menu<br />
<br />
To then create a fluxbox menu:<br />
$ xdg_menu --fullmenu --format fluxbox --root-menu /etc/xdg/menus/arch-applications.menu >~/.fluxbox/menu<br />
<br />
More info:<br />
$ xdg_menu --help<br />
<br />
==== 수동으로 메뉴 편집하기 ====<br />
Use your favourite text editor and edit the file: "~/.fluxbox/menu" .<br />
The basic syntax for a menu item to appear is:<br />
[exec] (name) {command} <path to icon><br />
<br />
...where "name" is the text you wish to appear for that menu item and "command" is the location of the binary, e.g.:<br />
[exec] (Firefox Browser) {/usr/bin/firefox} <path to firefox icon><br />
<br />
Note that the "<path to icon>" is optional. If you want to create a submenu the syntax is:<br />
[submenu] (Name)<br />
...<br />
...<br />
[end]<br />
When done editing save the file and exit. There is no need to restart fluxbox. For more info read [http://fluxbox-wiki.org/index.php?title=Editing_the_menu editing the fluxbox menu].<br />
<br />
===Init===<br />
The ~/.fluxbox/init file is FluxBox's primary configuration resource file. You can change the basic functionality of fluxbox, windows, toolbar, focus, etc. Some of these options are also available from the Fluxbox, Configuration Menu. For more detail read [http://fluxbox-wiki.org/index.php?title=Editing_the_init_file Editing the init file].<br />
<br />
===단축키===<br />
Fluxbox offers basic hotkeys functionality. The fluxbox hotkey file is located at {{ic|~/.fluxbox/keys}}.<br />
The Control key is represented by "Control". Mod1 corresponds to the Alt key and Mod4 corresponds to Meta (not a standard key but most users map Meta to the "Win" key). When installed and first run Fluxbox will provide you with a very usable, almost complete set of hotkeys. You should peruse and learn the ~/.fluxbox/keys file to enhance your FluxBox experience.<br />
<br />
Example: here is a quick way to control the Master volume:<br />
Control Mod1 Up :Exec amixer set Master,0 5%+ <br />
Control Mod1 Down :Exec amixer set Master,0 5%-<br />
<br />
===작업공간===<br />
Fluxbox defaults to having four workspaces. These are accessible using Ctrl+F1-F4 shortcuts, or by using the left mouse button to click the arrows on the toolbar. You can also access workspaces via a middle mouse button click on desktop which pops up the Workspaces Menu.<br />
<br />
===탭과 그룹화===<br />
<br />
적어도 창 두 개가 열려 있을 때 하나의 창 제목 줄에 ctrl + 왼쪽 클릭하여 다른 창으로 끌고 가면 두 창은 상단 탭바로 그룹화된다. 이 그룹화된 창을 하나의 창처럼 사용할 수 있다. 탭 그룹화를 해제하려면 상단 탭바를 ctrl + 왼쪽 클릭하여 데스크톱 빈 공간으로 끌어 놓아라.<br />
<br />
===바탕화면===<br />
Setting the background in Fluxbox has historically been convoluted, especially where transparency was required. The fluxbox-wiki now has an entry for [http://fluxbox-wiki.org/index.php?title=Howto_set_the_background background setting], so please refer to that. <br />
<br />
The easiest way to do it with ArchLinux is to first of all check that you have a background setting application available:<br />
$ fbsetbg -i<br />
<br />
If not, install either feh, esetroot or wmsetbg using pacman. Then add this "fbsetbg" line to your ~/.xinitrc file, before the "exec" line, e.g.:<br />
fbsetbg /path/to/my/image.image<br />
<br />
====여러 바탕화면을 전환하기====<br />
<br />
Place the following submenu in your fluxbox menu:<br />
[submenu] (Backgrounds)<br />
[wallpapers] (~/.fluxbox/backgrounds) {feh --bg-scale}<br />
[wallpapers] (/usr/share/fluxbox/backgrounds) {feh --bg-scale}<br />
[end]<br />
Then put your background images into {{ic|~/.fluxbox/backgrounds}} or any other folder you specify, they will then appear in the same fashion as your styles.<br />
<br />
The same applies to a dual screen wallpaper on a system without 'xinerama' (NVidia TwinView for example) :<br />
[submenu] (Backgrounds)<br />
[wallpapers] (/path/to/your/backgrounds) {feh --bg-scale --no-xinerama }<br />
[end]<br />
<br />
====Feh 사용====<br />
Install feh with:<br />
# pacman -S feh<br />
<br />
To make sure fluxbox will load feh background next time start:<br />
<br />
'''1.''' Make {{ic|.fehbg}} executable:<br />
$ chmod 770 ~/.fehbg<br />
<br />
'''2.''' Then add (or modify) the following line to the file {{ic|~/.fluxbox/init}}:<br />
session.screen0.rootCommand: ~/.fehbg<br />
<br />
'''3.''' or add (or modify) the following line to the file {{ic|~/.fluxbox/startup}}:<br />
~/.fehbg<br />
<br />
===테마===<br />
To install a fluxbox theme extract the theme archive file to a styles directory. The default directories are:<br />
*global - {{ic|/usr/share/fluxbox/styles}}<br />
*user only - {{ic|~/.fluxbox/styles}}<br />
<br />
The ArchLinux [[AUR]] currently contains a compilation of good looking fluxbox themes called "fluxbox-styles". Get it [https://aur.archlinux.org/packages.php?ID=28743 here] and install this package for more themes than you could possibly use. When installed correctly they will appear in the Fluxbox, Styles section of your Fluxbox menu.<br />
<br />
To create your own Fluxbox styles read [[Fluxbox_Style_Guide]] and this [http://tenr.de/howto/style_fluxbox/style_fluxbox.html style guide].<br />
<br />
===슬릿===<br />
Fluxbox, WindowMaker and a couple of other lightweight window managers have a "Slit". This is a dock for any application that can be 'dockable'. A docked application is anchored and appears on every workspace. It cannot be moved freely and is not influenced by any manipulation to windows. It is basically a small widget. Dock apps that are useful in such a situation tend to be clocks, system monitors, weather, etc. Visit [http://dockapps.windowmaker.org/ dockapps.windowmaker.org]<br />
<br />
===자동 시작 프로그램===<br />
The ArchLinux way to autostart apps is to put all code into {{ic|~/.xinitrc}}. Please read [[Xinitrc]]. However, fluxbox provides functionality to autostart applications on its own. The {{ic|~/.fluxbox/startup}} file is a script for autostarting applications as well as starting fluxbox itself. The # symbol denotes a comment.<br />
<br />
A sample file:<br />
fbsetbg -l <nowiki>#</nowiki> sets the last background set, very useful and recommended.<br />
<nowiki>#</nowiki> In the below commands the ampersand symbol (&) is required on all applications that do not terminate immediately. <br />
<nowiki>#</nowiki> failure to provide them will cause fluxbox not to start.<br />
idesk & <br />
xterm &<br />
<nowiki>#</nowiki> exec is for starting fluxbox itself, do not put an ampersand (&) after this or fluxbox will exit immediately<br />
exec /usr/bin/fluxbox<br />
<nowiki>#</nowiki> or if you want to keep a log, uncomment the below command and comment out the above command:<br />
<nowiki>#</nowiki> exec /usr/bin/fluxbox -log ~/.fluxbox/log<br />
<br />
===기타 메뉴===<br />
<br />
In the "Menu Management" section (above) we were discussing the main "Applications" Menu, called the "Root" menu in fluxbox lingo. FluxBox also has other menus available to the user:<br />
<ul><br />
<li>Workspaces Menu: middle click on desktop.<br />
<li>Configuration Menu: located within the "Fluxbox" section of the "Root" menu.<br />
<li>Window menu: right click on the titlebar of any window, or its bar if minimized. Can be edited. See fluxbox-menu man page.<br />
<li>Toolbar menu: right click on empty part of toolbar. Also found as a sub-menu within the Configuration Menu.<br />
<li>Slit Menu: found as a sub-menu within the configuration menu.<br />
</ul><br />
<br />
===투명 효과===<br />
To enable true transparency in fluxbox you need an X compositor such as [[Xcompmgr]].<br />
<br />
===알림 표시===<br />
To enable connection notifications on-screen for fluxbox read [https://bbs.archlinux.org/viewtopic.php?id=138616 this Arch forum thread].<br />
<br />
===xorg.conf를 사용하지 않고 설정하기===<br />
Xorg no longer requires an xorg.conf file. Traditionally this is where you would change your keyboard settings and powersave settings. Luckily there are elegant solutions not using xorg.conf. <br />
<br />
====키보드 설정====<br />
Just add the following line to {{ic|~/.fluxbox/startup}}:<br />
setxkbmap us -variant intl & # to have a us keyboard with special characters enabled (like éóíáú)<br />
<br />
Instead of 'us' you can also pass your language code and remove the variant option (ex.: 'us_intl', which works like the command above in some setups). See man setxkbmap for more options.<br />
<br />
To make a help function in your menu, just add in {{ic|~/.fluxbox/menu}}:<br />
[submenu] (Keyboard)<br />
[exec] (normal) {setxkbmap us}<br />
[exec] (international) {setxkbmap us -variant intl}<br />
[end]<br />
<br />
==같이 보기==<br />
* [http://fluxbox.org/ 플럭스박스 홈페이지]<br />
* [http://fluxbox-wiki.org/ 플럭스박스 위키]<br />
* [http://wiki.gentoo.org/wiki/Fluxbox 젠투 위키 플럭스박스]<br />
* [http://www.gentoo.org/doc/en/fluxbox-config.xml 젠투 플럭스박스 문서]<br />
* [http://box-look.org/ 플럭스박스 테마]<br />
* [[Fluxbox_Style_Guide|플럭스박스 스타일 안내]]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=77729 Narada 플럭스박스 안내]<br />
* 플럭스박스 man 문서: fluxbox, fluxbox-menu, fluxbox-style, fluxbox-keys, fluxbox-apps, fluxbox-remote, fbsetroot, fbsetbg, fbrun, startfluxbox.<br />
* [https://bbs.archlinux.org/viewtopic.php?id=90260 아치 리눅스 플럭스박스 스크린샷]</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=Fluxbox_(Portugu%C3%AAs)&diff=301037Fluxbox (Português)2014-02-24T03:38:30Z<p>Mistofvongola: Fix Gentoo Wiki Link</p>
<hr />
<div>[[Category:Stacking WMs (Portuguese)]]<br />
[[cs:Fluxbox]]<br />
[[de:Fluxbox]]<br />
[[en:Fluxbox]]<br />
[[es:Fluxbox]]<br />
[[fr:Fluxbox]]<br />
[[it:Fluxbox]]<br />
[[ko:Fluxbox]]<br />
[[pl:Fluxbox]]<br />
[[ru:Fluxbox]]<br />
[[sr:Fluxbox]]<br />
[[zh-TW:Fluxbox]]<br />
Flubox é um gerenciador de janelas para X11. É baseado no código do(agora descontinuado) Blackbox 0.61.1, porém com significantes melhoras e desenvolvimento contínuo. Fluxbox é bastante leve a nível de recursos e rápido, e ainda provê ferramentas interesantes para gerenciamento de janelas como abas e agrupamentos. Seus arquivos de configuração são fáceis de entender e editar e existem centenas de "estilos" de fluxbox para tornar a aparencia do seu desktop legal. ArchLinux com FluxBox pode tornar um velho Pentium 800 com apenas 256MB de RAM em um computador bastante usável.<br />
<br />
==Instalação==<br />
<br />
A instalação é tão fácil quanto:<br />
<br />
# pacman -S fluxbox fluxconf<br />
<br />
==Iniciando o Fluxbox==<br />
=== Método 1: Gerenciadores de Login KDM/GDM/LightDM ===<br />
Usuários do [[KDM (Português)|KDM]], [[GDM (Português)|GDM]] e [[LightDM (Português)|LightDM]] deverão encontrar uma nova entrada referente ao fluxbox de forma automática na lista de sessões disponíveis. Apenas selecione o fluxbox quando logando.<br />
<br />
=== Método 2: ~/.xinitrc ===<br />
<br />
{{Out of date|ConsoleKit is deprecated, see [https://www.archlinux.org/news/consolekit-replaced-by-logind/] and [[General Troubleshooting#Session permissions]].}}<br />
<br />
Edite {{ic|~/.xinitrc}} e adicione o seguinte código:<br />
<br />
exec fluxbox<br />
<br />
Se você prefere ter os dispositivos montados automaticamente(ex: no Thunar ou outros gerenciadores de arquivo), use o seguinte código:<br />
<br />
exec ck-launch-session dbus-launch startfluxbox<br />
<br />
Veja [[Xinitrc (Português)|Xinitrc]] para maiores detalhes. Utilize o comando "startx" de um terminal para lançar o X com o seu gerenciador de janelas.<br />
<br />
=== Método 3: Gerenciador de login SLiM ===<br />
<br />
SLiM, the Simple Login Manager(o gerenciado de login simples) é o favorito para muitos usuários do Arch por conta de sua eficiência. O SLiM lê o arquivo ~/.xinitrc, portanto, se você tiver o .xinitrc configurado como o acima irá funcionar. Contudo, se você quer habilitar o SLiM para escolher entre diversos gerenciadores de janelas então edite a variavel de sessões no arquivo {{ic|/etc/slim.conf}} para que os nomes sejam comparados com a declaração "case" no arquivo {{ic|~/.xinitrc}} Veja [[SLiM (Português)|SLiM]] e [[Xinitrc (Português)|Xinitrc]].<br />
<br />
== Configuração ==<br />
<br />
O arquivo de configuração global do Fluxbox reside em {{ic|/usr/share/fluxbox}, enquanto o arquivo de configuração específico do usuário em {{ic|~/.fluxbox}}. Os arquivos de usuário são:<br />
<ul><br />
<li>init: arquivo principal de configuração de recursos. Ver [http://fluxbox-wiki.org/index.php?title=Editing_the_init_file Editando o arquivo init]<br />
<li>menu: configuração de menu do fluxbox. Ver abaixo e em [http://fluxbox-wiki.org/index.php?title=Editing_the_menu Editando o arquivo menu]<br />
<li>keys: arquivo de atalhos de teclado(hotkeys) do fluxbox. Ver abaixo e [http://fluxbox-wiki.org/index.php?title=Keyboard_shortcuts aqui]<br />
<li>startup: aplicações lançadas no iniciar, porém veja o .xinitrc e [http://fluxbox-wiki.org/index.php?title=Editing_the_startup_file aqui]<br />
<li>overlay: arqivo de configuração para sobrescreves elementos de estilos. Ver [http://fluxbox-wiki.org/index.php?title=Style_overlay aqui]<br />
<li>apps: arquivo de configuração para guardar configuração de janelas de aplicações especificas. Ver [http://fluxbox-wiki.org/index.php?title=Editing_the_apps_file aqui]<br />
<li>windowmenu: arquivo de configuração para alterar o próprio Window Menu: [http://fluxbox-wiki.org/index.php?title=Editing_the_windowmenu Leia-me]<br />
</ul><br />
Alguns arquivos de menor importancia existem neste diretório. Porém os principais são init, menu, keys e talvez o startup.<br />
<br />
=== Gerenciamento do menu ===<br />
Na primeira instalação do fluxbox, uma lista básica de aplicativos será criado em ~/.fluxbox/menu. Você acessa o menu através do clique com o botão direito do mouse no desktop. Como qualquer outro gerenciador de janelas leve, o Fluxbox não atualiza o seu menu automaticamente ao instalar cada aplicativo novo. É recomendado que você instale a maioria dos aplicativos que deseja primeiro e então gere novamente ou edite o menu. Para aprimorar o menu e adicionar/editar itens, as quatro coisas básicas a se fazer são: <br />
<br />
==== fluxbox-generate_menu ====<br />
Existe um comando built-in com o fluxbox:<br />
$ fluxbox-generate_menu<br />
Este comando irá gerar automaticamente o {{ic|~/.fluxbox/menu/}}, baseado em seus programas instalados. Porém, o menu gerado não será tão detalhado quanto um gerado pelo "menumaker" (imediatamente abaixo).<br />
<br />
==== MenuMaker ====<br />
[http://menumaker.sourceforge.net MenuMaker] é uma ferramenta poderosa que cria menus baseados em XML para uma variedade de gerenciadores de janela, incluindo o Fluxbox. O MenuMaker irá buscar em seu computador por programas executáveis e criará um menu baseado nos resultados. Pode ser configurado para excluir aplicações do X(legadas), GNOME, KDE ou Xfce se desejado.<br />
<br />
Para instalar o MenuMaker:<br />
# pacman -S menumaker<br />
<br />
Uma vez instalado, um novo e completo menu pode ser gerado sobrescrevendo o padrão apenas executando:<br />
$ mmaker -f FluxBox<br />
<br />
Para verificar as opções do MenuMaker:<br />
$ mmaker --help<br />
<br />
==== Arch Linux Xdg menu ====<br />
Requisito - [[XdgMenu (Português)|XdgMenu]] disponível via pacman:<br />
# pacman -S archlinux-xdg-menu<br />
<br />
Para criar o menu do Fluxbox:<br />
$ xdg_menu --fullmenu --format fluxbox --root-menu /etc/xdg/menus/arch-applications.menu >~/.fluxbox/menu<br />
<br />
Informações adicionais:<br />
$ xdg_menu --help<br />
<br />
==== Editar/Criar manualmente o menu ====<br />
Use seu editor de texto favorito e edite o arquivo: "~/.fluxbox/menu" .<br />
A sintaxe básica para um item de menu é:<br />
[exec] (nome) {comando} <caminho para o ícone><br />
<br />
...onde "nome" é o texto que aparecerá no item do menu e "comando" é a localização do binário. ex:<br />
[exec] (Navegador Firefox) {/usr/bin/firefox} <caminho para o ícone do Firefox><br />
<br />
Se você deseja um submenu:<br />
[submenu] (Nome)<br />
...<br />
...<br />
[end]<br />
<br />
Quando terminado de editar o arqivo, salve. Não há necessidade de reiniciar o fluxbox. Para maiores informações, ver [http://fluxbox-wiki.org/index.php?title=Editing_the_menu editando o menu do fluxbox].<br />
<br />
===Init===<br />
O arquivo ~/.fluxbox/init é o recurso primário de configuração do Fluxbox. Você pode alterar o funcionamento básico, janelas, toolbar, foco, etc. Algumas destas opções estão também disponíveis no menu de configuração do Fluxbox. Para maiores detalhes leia [http://fluxbox-wiki.org/index.php?title=Editing_the_init_file editando o arquivo init].<br />
<br />
===Teclas de atalho(Hotkeys)===<br />
O Fluxbox oferece uma funcionalidade básica de teclas de atalho. O arquivo que define tais hotkeys é o {{ic|~/.fluxbox/keys}}.<br />
A tecla Control é representada por "COntrol". Mod1 corresponde a tecla Alt e Mod4 corresponte a Meta (não é uma tecla padrão, porém muitos usuários mapeiam-a como tecla "Win"). Logo após instalado, uma série de teclas de atalho já padronizadas lhe darão um ambiente confortável no Fluxbox. Você deve aprender a manipular o arquivo ~/.fluxbox/keys, para melhorar sua produtividade e experiência com o Fluxbox.<br />
<br />
Exemplo: Forma rápida de controlar o volume principal(Master):<br />
Control Mod1 Up :Exec amixer set Master,0 5%+<br />
Control Mod1 Down :Exec amixer set Master,0 5%-<br />
<br />
===Workspaces===<br />
O Fluxbox por padrão trabalha com quatro workspaces. Eles estão acessíveis através dos atalhos Ctrl+F1-F4, ou usando o clique esquerdo do mouse nas setas que residem na toolbar. Você pode também acessar uma workspace através de um clique com o botão do meio no desktop, que lhe tratá o menu dos Workspaces disponíveis.<br />
<br />
===Abas e Agrupamento===<br />
Com no mínimo duas janelas visíveis no seu desktop, clique com o botão do meio do mouse na aba superior de uma das janelas e solte-a em outra janela aberta. As duas janelas serão agrupadas através de abas na barra superior da janela. Agora você pode executar operações na janela, e o grupo inteiro será afetado.<br />
<br />
===Fundo (Wallpaper)===<br />
<br />
{{Out of date|ConsoleKit is deprecated, see [https://www.archlinux.org/news/consolekit-replaced-by-logind/] and [[General Troubleshooting#Session permissions]].}}<br />
<br />
Configurar um plano de fundo(wallpaper) no Fluxbox é historicamente perturbador, especialmente quando transparência é um requisito. A Wiki do Fluxbox agora possui um artigo para [http://fluxbox-wiki.org/index.php?title=Howto_set_the_background configuração de background] então, use com sabedoria.<br />
<br />
A forma mais fácil de fazer isto no ArchLinux é primeiro verificar se você possui disponível uma configuração correta para a aplicação do fundo:<br />
$ fbsetbg -i<br />
<br />
Se não, instale feh, esetroot ou wmsetbg utilizando o pacman. Então adicione esta linha do "fbsetbg" no seu arquivo ~/.xinitrc antes da entrada "exec". Exemplo:<br />
fbsetbg /path/to/my/image.image<br />
exec ck-launch-session dbus-launch startfluxbox<br />
<br />
====Alterando diversos fundos facilmente====<br />
Adicione o seguinte submenu no seu menu do Fluxbox:<br />
[submenu] (Backgrounds)<br />
[wallpapers] (~/.fluxbox/backgrounds)<br />
[wallpapers] (/usr/share/fluxbox/backgrounds)<br />
[end]<br />
<br />
Então, adicione suas imagens que serão utilizadas como plano de fundo em {{ic|~/.fluxbox/backgrounds}} ou algum outro diretório de sua preferência(e altere acima obviamente), que eles aparecerão em uma seleção da mesma forma que os estilos do Fluxbox.<br />
<br />
====Utilizando o Feh com FluxBox====<br />
Instalando o feh:<br />
# pacman -S feh<br />
Você pode adicionar um submenu rapidamente no arquivo {{ic|~/.fluxbox/menu}}, que lhe permitirá a troca de fundos "on-the-fly"<br />
[submenu] (Backgrounds)<br />
[backgrounds] (/path/to/your/backgrounds) {feh --bg-scale}<br />
[end]<br />
<br />
Para ter certeza que o fluxbox irá carregar o feh em background no momento do início:<br />
<br />
'''1.''' Faça o arquivo {{ic|.fehbg}} executável:<br />
$ chmod 770 ~/.fehbg<br />
<br />
'''2.''' Adicione(ou modifique) a seguinte linha em {{ic|~/.fluxbox/init}}:<br />
session.screen0.rootCommand: ~/.fehbg<br />
<br />
'''3.''' Adicione(ou modifique) a seguinte linha em {{ic|~/.fluxbox/startup}}:<br />
~/.fehbg<br />
<br />
===Temas===<br />
Para instalar um novo tema no fluxbox basta extrair o arquivo de tema ao diretório de estilos. Os diretórios padrões são:<br />
*global - {{ic|/usr/share/fluxbox/styles}}<br />
*user only - {{ic|~/.fluxbox/styles}}<br />
<br />
O [[Arch User Repository (Português)|AUR]] atualmente contém uma compilação de temas de fluxbox bastante bonitos, chamados de "fluxbox-stiles". Adquira-os [https://aur.archlinux.org/packages.php?ID=28743 aqui] e instale este pacote para uma maior gama de temas disponíveis. QUando instalado corretamente, eles aparecerão no Fluxbox, na sessão "Styles" do menu do Fluxbox.<br />
<br />
Para criar seus próprios estilos no fluxbox, leia o artigo [[Fluxbox_Style_Guide]] e este [http://tenr.de/howto/style_fluxbox/style_fluxbox.html guia de estilos].<br />
<br />
===Iniciando automaticamente aplicativos===<br />
O modo ArchLinux de iniciar aplicativos automaticamente é colocar todo o código dentro do {{ic|~/.xinitrc}}. Veja [[Xinitrc (Português)|Xinitrc]] para maiores detalhes. Contudo, fluxbox provê funcionalidades de iniciar automaticamente aplicativos de sua própria forma. O arquivo {{ic|~/.fluxbox/startup}} é um script de "autostart" de programas, e de início do fluxbox mesmo. O símbolo # denota um comentário<br />
<br />
Arquivo de exemplo:<br />
fbsetbg -l <nowiki>#</nowiki> sets the last background set, very useful and recommended.<br />
<nowiki>#</nowiki> In the below commands the ampersand symbol (&) is required on all applications that do not terminate immediately. <br />
<nowiki>#</nowiki> failure to provide them will cause fluxbox not to start.<br />
idesk & <br />
xterm &<br />
<nowiki>#</nowiki> exec is for starting fluxbox itself, do not put an ampersand (&) after this or fluxbox will exit immediately<br />
exec /usr/bin/fluxbox<br />
<nowiki>#</nowiki> or if you want to keep a log, uncomment the below command and comment out the above command:<br />
<nowiki>#</nowiki> exec /usr/bin/fluxbox -log ~/.fluxbox/log<br />
<br />
===Outros menus===<br />
<br />
Na seção "Gerenciamento do menu"(acima) nos discutimos sobre o menu de aplicações, chamdo de "Root" menu no fluxbox. O FluxBox também possui outros menus disponíveis para o usuário:<br />
<ul><br />
<li>Workspaces Menu: Clique com o botão do meio no desktop.<br />
<li>Configuration Menu: Localizado na seção Fluxbox do "Root menu".<br />
<li>Window menu: Clique direito na barra de título de qualquer janela, ou se na barra de minimizada. Pode ser editado. Veja a página de manuais do fluxbox-menu(man fluxbox-menu).<br />
<li>Toolbar menu: Clique direito em uma toolbar vazia. Também pode ser encontrada como um submenu do menu de configurações(Configuration Menu).<br />
<li>Slit Menu: Sub-menu do menu de configurações.<br />
</ul><br />
<br />
=== Terminais transparentes rxvt-unicode ===<br />
Instale urxvt:<br />
# pacman -S rxvt-unicode<br />
<br />
Execute o urxvt com os seguintes parametros:<br />
$ urxvt -depth 32 -bg rgba:0000/0000/0000/bbbb -tint grey<br />
<br />
Ou você pode editar o arquivo ~/.Xdefaults e adicionar um equivalente do comando urxvt. Veja [[Xdefaults]] para maiores informações.<br />
<br />
===Vida após "xorg.conf"===<br />
O Xorg não requer mais o arquivo de configuração xorg.conf. Tradicionalmente este é o arquivo onde você deveria alterar layout de teclado e opções de gerenciamento de energia. Com sorte, existem soluções elegantes que não usam o xorg.conf.<br />
<br />
====Configurando o seu layout de teclado====<br />
Apenas adicione a seguinte linha ao arquivo {{ic|~/.fluxbox/startup}}:<br />
setxkbmap us -variant intl & # Para teclados de layout americano(us), mas que tem acesso a acentuação(como éóíáú). <br />
<br />
Ao invés de 'us" você pode passar diretamente a linguagem e sua variação(como por exemplo 'us_intl'). Veja os manuais de setxkbmap para mais opções.<br />
<br />
Para ficar mais fácil, adicione no seu menu editando o arquivo {{ic|~/.fluxbox/menu}}:<br />
[submenu] (Keyboard)<br />
[exec] (normal) {setxkbmap us}<br />
[exec] (international) {setxkbmap us -variant intl}<br />
[end]<br />
<br />
====Desabilitando economia de energia====<br />
Você sabe bem a raiva que dá quando a tela fica branca enquanto você assiste um filme? Pois é, o Xorg detectou que você não estava fazendo nada :). Se você não necessita tal funcionalidade, ela pode ser desativada. Basta que você lembre de desligar seu monitor na mão quando não estiver utilizando ele.<br />
<br />
Apenas adicione a seguinte linha ao arquivo {{ic|~/.fluxbox/startup}}:<br />
xset s off -dpms &<br />
<br />
== Recursos Adicionais ==<br />
<br />
* [http://fluxbox.org/ Fluxbox Homepage]<br />
* [http://fluxbox-wiki.org/ Fluxbox Wiki]<br />
* [http://wiki.gentoo.org/wiki/Fluxbox Wiki do Gentoo sobre o Fluxbox]<br />
* [http://www.gentoo.org/doc/en/fluxbox-config.xml Documentação do Gentoo sobre o Fluxbox]<br />
* [http://box-look.org/ Temas para Fluxbox]<br />
* [[Fluxbox_Style_Guide|Guia de estilo para o Fluxbox]]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=77729 Guia do Narada - Fluxbox ]<br />
* Páginas de manual do fluxbox: fluxbox, fluxbox-menu, fluxbox-style, fluxbox-keys, fluxbox-apps, fluxbox-remote, fbsetroot, fbsetbg, fbrun, startfluxbox.<br />
* [https://bbs.archlinux.org/viewtopic.php?id=90260 Screenshots do Fluxbox no ArchLinux]</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=Fluxbox_(Espa%C3%B1ol)&diff=301036Fluxbox (Español)2014-02-24T03:38:07Z<p>Mistofvongola: Fix Gentoo Wiki link</p>
<hr />
<div>[[Category:Stacking WMs (Español)]]<br />
[[cs:Fluxbox]]<br />
[[de:Fluxbox]]<br />
[[en:Fluxbox]]<br />
[[fr:Fluxbox]]<br />
[[it:Fluxbox]]<br />
[[ko:Fluxbox]]<br />
[[pl:Fluxbox]]<br />
[[pt:Fluxbox]]<br />
[[ru:Fluxbox]]<br />
[[sr:Fluxbox]]<br />
[[zh-TW:Fluxbox]]<br />
Fluxbox es un gestor de ventanas para X. Esta basado en el código del abandonado Blackbox 0.61.1, pero con continuas mejoras y desarrollo. Fluxbox es muy ligero, consume pocos recursos y rápido, provee de varias herramientas útiles como tabulación y agrupación, ademas es fácil de configurar.<br />
<br />
Para instalar Fluxbox ejecuta:<br />
<br />
# pacman -S fluxbox<br />
<br />
== Comenzando con Fluxbox ==<br />
=== Método 1: KDM/GDM Login/Session Managers ===<br />
Si usas [[KDM]] o [[GDM]] se añadirá automáticamente una entrada para Fluxbox. Simplemente escoge Fluxbox en el menú de sesiones antes de iniciar sesión.<br />
<br />
=== Metodo 2: ~/.xinitrc ===<br />
<br />
{{Out of date|ConsoleKit is deprecated, see [https://www.archlinux.org/news/consolekit-replaced-by-logind/] and [[General Troubleshooting#Session permissions]].}}<br />
<br />
Abre el fichero {{ic|~/.xinitrc}} y añade el siguiente código:<br />
<br />
exec startfluxbox <br />
<br />
Si quieres habilitar el auto montado de dispositivos (p.e. en Thunar y otros gestores de archivos), usa el siguiente código:<br />
<br />
exec ck-launch-session dbus-launch startfluxbox<br />
<br />
{{Nota | Solo se puede tener una linea {{ic|exec}} en tu fichero {{ic|~/.xinitrc}}.}}<br />
<br />
== Configuración ==<br />
<br />
Los archivos de configuración de Fluxbox del sistema se encuentran en la carpeta {{ic|/usr/share/fluxbox}} y los del usuario en {{ic|~/.fluxbox}}. Los archivos de configuración del usuario son:<br />
<ul><br />
<li>init: El archivo principal de configuración. Mira [http://fluxbox-wiki.org/index.php?title=Editing_the_init_file Editing the init file]<br />
<li>menu: la configuración del menú. Mira mas abajo y en [http://fluxbox-wiki.org/index.php?title=Editing_the_menu Editing the menu file]<br />
<li>keys: los atajos de teclado de fluxbox (hotkeys). Mira mas abajo y [http://fluxbox-wiki.org/index.php?title=Keyboard_shortcuts aquí]<br />
<li>startup: las aplicaciones que se iniciaran al arrancar fluxbox. Mira abajo para .xinitrc y/o [http://fluxbox-wiki.org/index.php?title=Editing_the_startup_file aquí]<br />
<li>overlay: un archivo de configuración para anular los elementos de los estilos. Mirar [http://fluxbox-wiki.org/index.php?title=Style_overlay aquí].<br />
<li>apps: guarda configuraciones especificas para las aplicaciones (posición en la pantalla, tamaño de la venta, etc). Mira [http://fluxbox-wiki.org/index.php?title=Editing_the_apps_file aquí]<br />
<li>windowmenu: fichero de configuración para cambiar el menú de las ventanas. Mira en [http://fluxbox-wiki.org/index.php?title=Editing_the_windowmenu]<br />
</ul><br />
En el directorio hay otros archivos de configuración menos importantes. Los archivos mas importantes son init, menu, keys y tal vez startup.<br />
<br />
=== Mantenimiento del menú ===<br />
<br />
Cuando instalas por primera vez Fluxbox este genera una configuración básica para el menú en ~/.fluxbox/menu. Para acceder a el pulsa con el botón derecho del ratón en una zona libre del escritorio. Para mejorar el menú y editar/añadir entradas existen cuatro formas de hacerlo:<br />
<br />
==== fluxbox-generate_menu ====<br />
Este comando viene de serie con Fluxbox:<br />
$ fluxbox-generate_menu<br />
Este comando auto-genera el archivo {{ic|~/.fluxbox/menu/}} basándose en los programas que tengas instalados. Sin embargo, no es tan exhaustivo como el generador por "menumaker" (ver debajo).<br />
<br />
====MenuMaker====<br />
[http://menumaker.sourceforge.net MenuMaker] es una poderosa herramienta que genera menús basados en XML para una variedad de gestores de ventanas, Fluxbox incluido. MenuMaker busca ejecutables en el sistema y genera el menú basándose en los resultados. Puede configurarse para excluir aplicaciones de Legacy X, GNOME, KDE o Xfce.<br />
<br />
Para instalar MenuMaker:<br />
# pacman -S menumaker<br />
<br />
Una vez instalado, para generar el menú o sobrescribir el existente:<br />
$ mmaker -f FluxBox<br />
<br />
Para ver las opciones de MenuMaker:<br />
$ mmaker --help<br />
<br />
==== Arch Linux Xdg menu ====<br />
Para instalar [[XdgMenu]]:<br />
# pacman -S archlinux-xdg-menu<br />
Para generar el menú para Fluxbox:<br />
$ xdg_menu --fullmenu --format fluxbox --root-menu /etc/xdg/menus/arch-applications.menu >~/.fluxbox/menu<br />
<br />
Mas información:<br />
$ xdg_menu --help<br />
<br />
==== Crear/editar manualmente el menú ====<br />
Usa tu editor de texto favorito para modificar: "~/.fluxbox/menu" .<br />
La sintaxis básica para añadir una entrada en el menú es:<br />
[exec] (nombre) {comando}<br />
<br />
...donde "nombre" es el titulo que aparecera en la entrada y "comando" es el ejecutable, p.e.:<br />
[exec] (Firefox) {/usr/bin/firefox}<br />
<br />
Si quieres crear un submenú escribe:<br />
[submenu] (Nombre)<br />
...<br />
...<br />
[end]<br />
Guarda el archivo, cierra el editor y ya tienes el nuevo menú. No es necesario reiniciar Fluxbox para ver los cambios. Para mas información lee [http://fluxbox-wiki.org/index.php?title=Editing_the_menu editing the fluxbox menu].<br />
<br />
===Teclas de acceso rápido===<br />
Fluxbox ofrece funciones básicas de atajos de teclado. El archivo con la configuración esta en {{ic|~/.fluxbox/keys}}.<br />
La tecla Control esta representada con al palabra "Control". Mod1 corresponda a la tecla Alt y Mod4 corresponde a Meta (no es una tecla estándar pero muchos usuarios mapean Meta con la tecla "Win"). Cuando se instala y ejecuta Fluxbox por primera vez provee una muy útil y casi completa configuración de teclas de acceso rápido. Debería de leer y aprende r del archivo ~/.fluxbox/keys para mejorar su experiencia con Fluxbox.<br />
<br />
Ejemplo: una manera rápida de controlar el volumen principal:<br />
Control Mod1 Up :Exec amixer set Master,0 5%+ <br />
Control Mod1 Down :Exec amixer set Master,0 5%-<br />
<br />
===Espacios de trabajo===<br />
Fluxbox tiene por defecto con 4 escritorios. Puedes cambiar entre ellos usando la combinación de teclas Ctrl+F1-F4, pulsando sobre las flechas en la barra de tareas o con la rueda del ratón. Si pulsa con el botón central se abrirá un menú con los escritorios, una lista de los programas que se están ejecutando en el y unas pocas opciones.<br />
<br />
===Tabulación y agrupación===<br />
Si tienes 2 ventanas abiertas pulsa sobre una de ellas con el botón central del ratón ya arrástrala a la otra. Las dos ventanas han sido agrupadas y puedes cambiar entre ellas pulsando en las pestañas situadas arriba de la ventana. Las operaciones sobre la ventana afectaran a todo el "grupo".<br />
<br />
===Fondos de pantalla===<br />
Históricamente configurar el fondo de pantalla en Fluxbox a sido complicado, especialmente si se trabajaba con transparencias. En la Wiki de Fluxbox hay una entrada al respecto [http://fluxbox-wiki.org/index.php?title=Poner_un_fondo Poner un fondo]. <br />
<br />
La via mas rápida para saber si en Arch tenemos instalado algún programa para configurar el fondo de pantalla:<br />
$ fbsetbg -i<br />
<br />
Si no es así, instala feh, esetroot o wmsetbg con pacman. Luego añade lo siguiente en ~/.xinitrc o en ~/.fluxbox/startup , p.e.:<br />
fbsetbg /ruta/a/mi/imagen.imagen<br />
<br />
<br />
====Cambiar fondos de pantalla fácilmente====<br />
<br />
Añade lo siguiente en tu menú de Fluxbox:<br />
[submenu] (Backgrounds)<br />
[wallpapers] (~/.fluxbox/backgrounds)<br />
[wallpapers] (/usr/share/fluxbox/backgrounds)<br />
[end]<br />
Mete las imágenes que usaras de fondo en {{ic|~/.fluxbox/backgrounds}} u otra carpeta que especifiques, Estos saldrán como en el menú de Estilos.\<br />
<br />
====Usando Feh en FluxBox====<br />
Instala feh usando:<br />
# pacman -S feh<br />
Puedes añadir un submenu en {{ic|~/.fluxbox/menu}} para cambiar el fondo de pantalla:<br />
[submenu] (Fondos)<br />
[wallpapers] (/ruta/a/tus/fondos) {feh --bg-scale}<br />
[end]<br />
<br />
Para estar seguro de que Fluxbox cargara el fondo de pantalls:<br />
<br />
'''1.''' Añade permisos de ejecución a {{ic|.fehbg}}:<br />
$ chmod 770 ~/.fehbg<br />
<br />
'''2.''' Añade o modifica la siguiente linea en {{ic|~/.fluxbox/init}}:<br />
session.screen0.rootCommand: ~/.fehbg<br />
<br />
'''3.''' o añade o modifica la siguiente linea en {{ic|~/.fluxbox/startup}}:<br />
~/.fehbg<br />
<br />
===Temas===<br />
Para instalar temas en Fluxbox, descomprime los archivos en la carpeta styles. Los directorios por defecto son:<br />
*global - {{ic|/usr/share/fluxbox/styles}}<br />
*usuario - {{ic|~/.fluxbox/styles}}<br />
<br />
Actualmente en [[AUR]] hay varias compilaciones de buenos temas para Fluxbox llamados "fluxbox-styles". Descarga uno desde [https://aur.archlinux.org/packages.php?ID=28743 aquí] e instala el paquete para obtener varios temas. Una vez instalados correctamente aparecerán en la sección Styles dentro de Fluxbox en el menú .<br />
<br />
Para crear tus temas de Fluxbox lee [[Fluxbox_Style_Guide]] y esto [http://tenr.de/howto/style_fluxbox/style_fluxbox.html guía de estilo].<br />
<br />
===La Slit===<br />
Fluxbox, WindowMaker y algunos gestores de ventanas ligeros tienen un "Slit". En ella se acoplan pequeños programas llamados "docks" que se verán en todos los espacios de trabajo. Estos no se pueden mover libremente y no les afecta el manipula miento de las ventanas. Son básicamente pequeñas aplicaciones. Una dock son utiles en varias situaciones como relojes, monitores de sistema, etc. Visita [http://dockapps.org Dockapps.org] para ver varias de estas pequeñas aplicaciones<br />
<br />
===Auto arrancar aplicaciones===<br />
La manera de Archlinux de auto arrancar es poner el código en el archivo {{ic|~/.xinitrc}}. Por favor, mire [[Xinitrc]]. Sin embargo, fluxbox provee un metodo para hacerlo al arrancar. El archivo {{ic|~/.fluxbox/startup}} es un script para auto arrancar programas cuando lo hace el. tambien se puede usar para editar variables del sistema, etc. El símbolo # sirve para escribir un comentario.<br />
<br />
Un ejemplo:<br />
fbsetbg -l <nowiki>#</nowiki> establece el ultimo fondo de pantalla definido, muy útil y recomendable.<br />
<nowiki>#</nowiki> In the below commands the ampersand symbol (&) is required on all applications that do not terminate immediately. <br />
<nowiki>#</nowiki> failure to provide them will cause fluxbox not to start.<br />
idesk & <br />
xterm &<br />
<nowiki>#</nowiki> exec is for starting fluxbox itself, don't put an ampersand (&) after this or fluxbox will exit immediately<br />
exec /usr/bin/fluxbox<br />
<nowiki>#</nowiki> or if you want to keep a log, uncomment the below command and comment out the above command:<br />
<nowiki>#</nowiki> exec /usr/bin/fluxbox -log ~/.fluxbox/log<br />
<br />
'''Nota:''' Cada linea debe de acabar con el símbolo &, de lo contrario los programas no terminaran correctamente y provocar que Fluxbox no arranque.<br />
<br />
===Terminales rxvt-unicode transparente===<br />
Instalar urxvt:<br />
# pacman -S rxvt-unicode<br />
<br />
Lanza urxvtcon estas opciones:<br />
$ urxvt -depth 32 -bg rgba:0000/0000/0000/bbbb -tint grey<br />
<br />
O edita el archivo ~/.Xdefaults y escribe los comandos equivalentes de urxvt en el archivo. Mira [[Xdefaults]] para infotmación.<br />
<br />
===La vida después de xorg.conf===<br />
Xorg ya no requiere del archivo xorg.conf. Tradicionalmente se usaba para configurar el teclado y el ahorro de energía. Por suerte hay maneras elegantes de hacerlo sin el archivo xorg.conf. <br />
<br />
====Configurar el teclado correctamente====<br />
Añade esto en el archivo {{ic|~/.fluxbox/startup}}:<br />
setxkbmap es -variant intl& # para habilitar el teclado español y poder usar la tecla Ñ y los caracteres especiales del idioma.<br />
<br />
Después de 'es' también puede pasar el código del lenguaje y quitar la opción de la variante (ej.: 'es_intl', hace lo mismo que el comando anterior). Mira man setxkbmap para ver mas opciones.<br />
<br />
Para poder cambiar el teclado, añade lo siguiente en {{ic|~/.fluxbox/menu}}:<br />
[submenu] (Teclado)<br />
[exec] (Por defecto) {setxkbmap us}<br />
[exec] (Español) {setxkbmap es}<br />
[end]<br />
<br />
====Deshabilitar ahorro de energia====<br />
¿Reconoce ese problema cuando estas jugando o viendo algún vídeo y se pone la pantalla en negro? Felicidades, justo Xorg a detectado que no estas haciendo nada :). Si no necesitas los ejercicios de movimiento, puedes deshabilitarlo. Recuerda apagar el monitor si no vas a usarlo durante un tiempo.<br />
<br />
Añade esto al principio de {{ic|~/.fluxbox/startup}}:<br />
xset s off -dpms &<br />
<br />
==Recursos adicionales==<br />
<br />
* [http://fluxbox.org/ Pagina de Fluxbox]<br />
* [http://fluxbox-wiki.org/ Fluxbox Wiki]<br />
* [http://fluxbox-wiki.org/index.php?title=Category:Espa%C3%83%C2%B1ol_/_Spanish_howtos Howtos de Fluxbox en español]<br />
* [http://wiki.gentoo.org/wiki/Fluxbox Manual de Fluxbox en la Wiki de Gentoo]<br />
* [http://www.gentoo.org/doc/en/fluxbox-config.xml Documentación de Fluxbox en Gentoo]<br />
* [http://box-look.org/ Temas para Fluxbox]<br />
* [[Fluxbox_Style_Guide|Guía de estilo para Fluxbox (ingles)]]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=77729 Guía de Fluxbox por Narada]</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=Fluxbox_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)&diff=301035Fluxbox (Русский)2014-02-24T03:37:43Z<p>Mistofvongola: Fix Gentoo wiki link</p>
<hr />
<div>[[Category:Desktop environments (Русский)]]<br />
[[Category:Tutorials (Русский)]]<br />
[[Category:Русский]]<br />
[[cs:Fluxbox]]<br />
[[de:Fluxbox]]<br />
[[en:Fluxbox]]<br />
[[es:Fluxbox]]<br />
[[fr:Fluxbox]]<br />
[[it:Fluxbox]]<br />
[[ko:Fluxbox]]<br />
[[pl:Fluxbox]]<br />
[[pt:Fluxbox]]<br />
[[sr:Fluxbox]]<br />
[[zh-TW:Fluxbox]]<br />
Fluxbox - это еще один оконный менеджер для X-ов. Он основан на кодовой базе Blackbox 0.61.1. Fluxbox выглядит как blackbox и управляет стилями, цветами, расположением окон и прочими подобными вещами аналогично blackbox (100% совместимость тем/стилей). <br />
==Установка Fluxbox==<br />
Для установки {{pkg|fluxbox}} и {{pkg|fluxconf}} (графический конфигуратор) выполните:<br />
# pacman -S fluxbox fluxconf<br />
<br />
==Полное руководство==<br />
Спасибо narada - автору этого руководства.<br />
Найти его можно здесь:<br />
[https://bbs.archlinux.org/viewtopic.php?id=77729]<br />
<br />
==Запуск Fluxbox==<br />
===Способ № 1: Логин менеджеры KDM/GDM/LightDM===<br />
Если у вас установлен экранный менеджер [[KDM]], [[GDM]] или [[LightDM]], то fluxbox будет автоматически добавлен в его меню. Далее, для запуска fluxbox, будет достаточно просто выбрать соответствующий пункт в меню.<br />
Инструкции по настройке менеджеров можно найти [[Добавление экранного менеджера входа в систему (KDM, GDM или XDM) в автозагрузку|здесь]].<br />
<br />
===Способ № 2: ~/.xinitrc===<br />
Отредактируйте {{ic|~/.xinitrc}}, добавив в него следующий код:<br />
exec fluxbox <br />
Или, если вы захотите использовать файл ''startfluxbox'', замените код на следующий:<br />
exec startfluxbox <br />
Запуск с помощью {{ic|startfluxbox}} является более предпочтительным, так как при использовании этой команды будет прочитан и выполнен файл {{ic|~/.fluxbox/startup}} (список команд автозагрузки).<br />
<br />
{{Note | в файле {{ic|~/.xinitrc}} команда {{ic|exec}} может встречаться только один раз!}}<br />
<br />
''Примечание'' : если fluxbox "падает" при запуске, то это может быть связано с локалью. Установив переменную LC_ALL в значение по умолчанию, "C", можно избежать "падений"[https://bbs.archlinux.org/viewtopic.php?t=25797 1].<br />
<br />
После добавления нужной строки в {{ic|~/.xinitrc}}, fluxbox можно запустить командой startx.<br />
<br />
==Настройка==<br />
Общесистемные конфигурационные файлы fluxbox расположены в {{ic|/usr/share/fluxbox}}, а пользовательские в {{ic|~/.fluxbox}}. К пользовательским конфигурационным файлам относятся:<br />
<ul><br />
<li>{{ic|init}}: основной конфигурационный файл fluxbox. Подробнее [http://fluxbox-wiki.org/index.php?title=Editing_the_init_file Editing the init file]<br />
<li>{{ic|menu}}: файл настройки меню fluxbox. См. ниже и [http://fluxbox-wiki.org/index.php?title=Editing_the_menu Editing the menu file]<br />
<li>{{ic|keys}}: файл настройки клавиатурных сочетаний fluxbox (hotkeys). См. ниже и [http://fluxbox-wiki.org/index.php?title=Keyboard_shortcuts здесь]<br />
<li>{{ic|startup}}: файл предназначенный для запуска приложений. Читать далее о [[xinitrc]] и [http://fluxbox-wiki.org/index.php?title=Editing_the_startup_file здесь]<br />
<li>{{ic|overlay}}: конфигурационный файл переопределения элементов стиля. Подробнее [http://fluxbox-wiki.org/index.php?title=Style_overlay здесь].<br />
<li>{{ic|apps}}: конфигурационный файл для настройки отображения конкретных приложений. Подробнее [http://fluxbox-wiki.org/index.php?title=Editing_the_apps_file здесь]<br />
<li>{{ic|windowmenu}}: конфигурационный файл самого Window Menu: [http://fluxbox-wiki.org/index.php?title=Editing_the_windowmenu читать здесь]<br />
</ul><br />
В этой директории имеются и другие, менее важные, конфигурационные файлы. Основными же являются файлы init, menu, keys и, возможно, startup.<br />
<br />
===Меню===<br />
====Встроенный метод====<br />
Встроенная команда<br />
$ fluxbox-generate_menu<br />
данная команда, исходя из установленных у вас программ, автоматически сгенерирует файл меню {{ic|~/.fluxbox/menu}}. Эту команду можно выполнить выбрав в меню fluxbox пункт "helper / regenerate menu".<br />
<br />
====MenuMaker====<br />
Программа [http://menumaker.sourceforge.net/ MenuMaker] является мощными инструментом по созданию меню для различных менеджеров окон, в том числе и для Fluxbox, из файлов основывающихся на XML. MenuMaker просканирует систему на наличие исполняемых программ, и, по результатам сканирования, создаст файл меню. Ее можно настроить таким образом, чтоб из результатов были исключены приложения для Legacy X, GNOME, KDE, или Xfce.<br />
<br />
MenuMaker расположен в [community] и устанавливается при помощи [[pacman]]:<br />
# pacman -S menumaker<br />
<br />
После установки, вы можете создать полное меню, выполнив:<br />
$ mmaker -v Fluxbox<br />
<br />
Для получения полного списка опций, запустите '''mmaker --help'''.<br />
<br />
====Arch Linux xdg menu====<br />
Установить [[XdgMenu]] можно с помощью pacman:<br />
# pacman -S archlinux-xdg-menu<br />
<br />
Создать файл меню fluxbox следующей командой:<br />
$ xdg_menu --fullmenu --format fluxbox --root-menu /etc/xdg/menus/arch-applications.menu >~/.fluxbox/menu<br />
<br />
'''Совет:''' замена по умолчанию xterm/urxvt:<br />
$ sed -i 's/xterm/urxvt/g' ~/.fluxbox/menu<br />
<br />
Дополнительная информация о программе:<br />
$ xdg_menu --help<br />
<br />
====Создание меню вручную с помощью fluxconf====<br />
Чтобы запустить редактор меню, входящий в состав программы fluxconf, наберите:<br />
$ fluxmenu<br />
Окно редактора разбито на три колонки: Type, Title и Command/Comment.<br><br />
Для редактирования полей нужно кликнуть по нужным.<br><br />
Кнопка "Add sub" позволяет добавить подменю.<br><br />
Кнопка "Add exec" откроет поле для добавления команды.<br><br />
<br />
Колонка Type может принимать следующие значения:<br />
#begin, необходимо для открытия и загрузки, собственно, файла меню. Поле Title в этом случае - заголовок меню.<br><br />
#submenu, подменю в составе меню. Title - отображаемое название данного подменю.<br><br />
#exec, строка команды. Title - название пункта меню, Command/Comment - команда для запуска.<br />
#separator, разделитель пунктов меню, без дополнительных аргументов.<br />
#workspaces, список рабочих столов и приложений, которые на них запущены. Title - название пункта меню.<br />
#stylesdir, отображает список стилей fluxbox. Title должен принимать значение пути к директории со стилями (например - {{ic|/usr/share/fluxbox/styles}}, {{ic|~/.fluxbox/styles}}).<br />
#config, меню с настройками для конфигурации fluxbox. В поле Title помещается название данного меню.<br />
#reconfig, повторная загрузка файла конфигурации. Title - название данного пункта меню.<br />
#restart, перезапустить fluxbox. Поле Title аналогично предыдущему.<br />
#exit, выход из fluxbox к окну логина экранного менеджера или к консоли, в зависимости от способа настройки . Title - аналогично предыдущему.<br />
<br />
Не забудьте нажать кнопку Save перед выходом из редактора.<br />
<br />
====Создание/Редактирование файла меню вручную====<br />
Воспользуйтесь командой:<br />
$ nano ~/.fluxbox/menu<br />
Приступайте к редактированию, добавьте новые строки в меню:<br />
[exec] (name) {command} <path to icon><br />
... где "name" это название, которое будет отображаться в данном пункте меню, "command" - путь к исполняемому файлу, а "<path to icon>" - путь к файлу с иконкой, например:<br />
[exec] (Firefox Browser) {/usr/bin/firefox} <path to firefox icon><br />
Обратите внимание, что "<path to icon>" не является обязательным параметром.<br />
<br />
Для создания подменю:<br />
[submenu] (Name)<br />
...<br />
...<br />
[end]<br />
Когда закончите редактирование, сохраните файл и выйдите из редактора. Перезапускать fluxbox нет необходимости. Для получения дополнительной информации обратитесь к [http://fluxbox-wiki.org/index.php?title=Editing_the_menu руководству по настройке меню fluxbox].<br />
<br />
===Init===<br />
Файл {{ic|~/.fluxbox/init}} - основной конфигурационный файл FluxBox. В нем можно настроить основную функциональность fluxbox, окон, панели инструментов, фокусировку, и т.д. Некоторые из этих настроек доступны через Configuration Menu Fluxbox. Для получения дополнительной информации почитайте о [http://fluxbox-wiki.org/index.php?title=Editing_the_init_file Редактировании файла init].<br />
<br />
===Горячие клавиши===<br />
Горячие клавиши во fluxbox описываются в файле {{ic|~/.fluxbox/keys}}.<br />
Клавиша Control задается текстом "Control", Alt - "Mod1", а Meta - "Mod4". Meta - это не стандартная клавиша, но многие привязывают ее к клавише win key.<br><br />
<br />
Например, вот быстрый способ контроля уровня звука с помощью комбинации CTRL-ALT+ Стрелка вниз или вверх:<br />
Control Mod1 Up :Exec amixer sset Master,0 5%+ <br />
Control Mod1 Down :Exec amixer sset Master,0 5%- <br />
<br />
Если у вас установлен fluxconf, то вы можете настроить горячие клавиши через графический интерфейс, для этого выполните команду:<br />
$ fluxkeys<br />
<br />
Первое текстовое поле - для названия клавиши, второе - для действия, совершаемого по нажатию на эту клавишу. Выберите execCommand и впишите название команды в третье поле. Во втором текстовом поле доступны различные функции (выбирать в выпадающем меню).<br />
<br />
===Рабочие столы===<br />
По умолчанию во fluxbox используются четыре рабочих стола, по которым можно переключаться при помощи Alt+F1-4 или с помощью стрелок на панели.<br><br />
Вызвав меню, кликнув правой кнопкой мыши, можно выбрать пункт Workspaces и увидеть в нем список рабочих столов.<br />
<br />
===Вкладки и Группировка===<br />
Когда на вашем рабочем столе открыто по крайней мере два окна - зажмите ctrl + левую кнопку мыши на верхней вкладке одного из окон и перетащите его на второе окно. Окна будут сгруппированы, и переключаться между ними можно будет через верхнюю панель вкладок. Теперь любое изменение активного окна будет применяться ко всем окнам входящим в "группу". Для отмены группировки - зажмите ctrl + левую кнопку мыши на нужной вкладке и перетащите ее на свободное пространство рабочего стола.<br />
<br />
===Фон рабочего стола===<br />
Для установки фона необходима специальная программа, например:<br />
*{{AUR|eterm}} <br />
*{{pkg|feh}} (не поддерживает прозрачность меню)<br />
<br />
Есть и другие, но эти - самые часто-используемые. Список других программ можно получить в документации к fbsetbg в секции "Дополнительных ссылок".<br />
Для установки фона выполните:<br />
$ fbsetbg /путь/к/изображению<br />
<br />
Также, для автоматической установки фона при логине, можно добавить или изменить нижеследующую строчку в файле {{ic|~/.fluxbox/init}}:<br />
session.screen0.rootCommand: fbsetbg /путь/к/изображению<br />
<br />
Или:<br />
session.screen0.rootCommand: fbsetbg -l<br />
<br />
Теперь в качестве фона будет использовано последнее, заданное с помощью fbsetbg, изображение.<br />
<br />
====Тем, кто любит часто менять фоновое изображение====<br />
Можно добавить следующее подменю в файл меню {{ic|~/.fluxbox/menu}}:<br />
<br />
[submenu] (Backgrounds)<br />
[wallpapers] (~/.fluxbox/backgrounds)<br />
[wallpapers] (/usr/share/fluxbox/backgrounds)<br />
[end]<br />
Затем разместите нужные обои в {{ic|~/.fluxbox/backgrounds}} или в том каталоге, который был указан в файле меню.<br />
<br />
====Feh====<br />
Установите {{pkg|feh}}:<br />
# pacman -S feh<br />
Также можно добавить подменю в файл {{ic|~/.fluxbox/menu}} для быстрой смены фона:<br />
[submenu] (Wallpaper)<br />
[wallpapers] (/path/to/your/wallpapers) {feh --bg-scale}<br />
[end]<br />
<br />
Теперь нужно убедится в том, что fluxbox при следующем запуске загрузит feh в фоновом режиме:<br />
<br />
'''1.''' Сделайте {{ic|~/.fehbg}} исполняемым:<br />
$ chmod 770 ~/.fehbg<br />
<br />
'''2.''' Добавьте (или измените) следующую строчку в файле {{ic|~/.fluxbox/init}}:<br />
session.screen0.rootCommand: ~/.fehbg<br />
<br />
'''3.''' Добавьте (или измените) следующую строчку в файле {{ic|~/.fluxbox/startup}}:<br />
~/.fehbg<br />
<br />
===Темы оформления===<br />
Чтобы установить тему, нужно распаковать архив с ней в одну из следующих директорий:<br />
*глобальная установка (для всех пользователей) - {{ic|/usr/share/fluxbox/styles}} <br />
*только для вашего пользователя - {{ic|~/.fluxbox/styles}}<br />
На данный момент в [[AUR]] по запросу "fluxbox-styles" можно найти множество красивых тем оформления. Расположены он здесь [https://aur.archlinux.org/packages.php?ID=28743]. Просто установите этот пакет. При правильной установке новые темы появятся в разделе Styles меню Fluxbox.<br />
<br />
Для создания собственных тем оформления ознакомьтесь с [[Fluxbox_Style_Guide]] и с этим руководством [http://tenr.de/howto/style_fluxbox/style_fluxbox.html].<br />
<br />
===Автозапуск программ===<br />
Существуют два способа автозапуска: помещение названий соответствующих команд в системный файл {{ic|~/.xinitrc}} (выполняется при запуске X.Org) или в специальный файл fluxbox - {{ic|~/.fluxbox/startup}}.<br />
<br />
{{ic|~/.fluxbox/startup}} это сценарий для автозапуска приложений и самого fluxbox-а. Строки комментируются символом #.<br />
<br />
Например:<br />
fbsetbg -l <nowiki>#</nowiki> устанавливает последнее заданное фоновое изображение;<br />
<nowiki>#</nowiki> данная команда очень часто используется пользователями fluxbox<br />
<nowiki>#</nowiki> важно помнить, что для запуска тех программ, которые не завершаются сразу (менеджер рабочего стола и т.п.),<br />
<nowiki>#</nowiki> следует указывать амперсанд (&) в конце строки. <br />
idesk & <br />
xterm &<br />
<nowiki>#</nowiki> для запуска, собственно, самого fluxbox используется следующая команда (без амперсанда)<br />
exec /usr/bin/fluxbox<br />
<nowiki>#</nowiki> также можно сохранять лог работы fluxbox следующей командой вместо предыдущей:<br />
exec /usr/bin/fluxbox -log ~/.fluxbox/log<br />
<br />
<br />
====Настройка клавиатуры====<br />
Просто добавьте следующую строку в файл {{ic|~/.fluxbox/startup}}:<br />
setxkbmap us -variant intl & # включение специальных символов клавиатуры (подобно éóíáú)<br />
<br />
Вместо 'us' можно использовать свой вариант языка. Для получения дополнительной информации обратитесь к man setxkbmap.<br />
<br />
Для добавления в меню возможности включения дополнительных символов - добавьте в файл {{ic|~/.fluxbox/menu}} следующий код:<br />
[submenu] (Keyboard)<br />
[exec] (normal) {setxkbmap us}<br />
[exec] (international) {setxkbmap us -variant intl}<br />
[end]<br />
<br />
====Отключение энергосбережения====<br />
У вас имеется проблема с отключением экрана при просмотре фильмов? Поздравляем, Xorg обнаружил ваше бездействие :). Если вам не нужен режим энергосбережения, его можно полностью отключить. Но, когда вы не будете пользоваться монитором, - вам придется отключать его самостоятельно, вручную.<br />
<br />
Просто добавьте эту строку в начало файла {{ic|~/.fluxbox/startup}}:<br />
xset s off -dpms &<br />
<br />
=== Поддержка русского языка ===<br />
Для отображения русского языка в окнах и меню стоит установить подходящий шрифт в выбранной вами теме. Например (если установлен пакет {{pkg|ttf-dejavu}}):<br />
*Font: -*-dejavu sans-*<br />
Теперь fluxbox поддерживает русские названия, даже если вы используете локаль en_US.UTF-8.<br />
<br />
=См. также=<br />
<br />
* [http://fluxbox.org/ Официальный сайт fluxbox]<br />
* [http://wiki.gentoo.org/wiki/Fluxbox настройка fluxbox в gentoo-wiki]<br />
* [http://www.gentoo.org/doc/en/fluxbox-config.xml документация fluxbox в gentoo]<br />
* [http://box-look.org/ темы для fluxbox]<br />
* [http://fluxbox-wiki.org/ Fluxbox Wiki]<br />
* [[Fluxbox_Style_Guide|Fluxbox Style Guide]]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=77729 Narada's Fluxbox Guide]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=90260 Archlinux-FluxBox screenshots]<br />
* The fluxbox man pages: fluxbox, fluxbox-menu, fluxbox-style, fluxbox-keys, fluxbox-apps, fluxbox-remote, fbsetroot, fbsetbg, fbrun, startfluxbox.</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=Fluxbox_(Italiano)&diff=301034Fluxbox (Italiano)2014-02-24T03:37:15Z<p>Mistofvongola: Fix gentoo wiki link</p>
<hr />
<div>[[Category:Stacking WMs (Italiano)]]<br />
[[cs:Fluxbox]]<br />
[[de:Fluxbox]]<br />
[[en:Fluxbox]]<br />
[[es:Fluxbox]]<br />
[[fr:Fluxbox]]<br />
[[ko:Fluxbox]]<br />
[[pl:Fluxbox]]<br />
[[pt:Fluxbox]]<br />
[[ru:Fluxbox]]<br />
[[sr:Fluxbox]]<br />
[[zh-TW:Fluxbox]]<br />
{{Related articles start (Italiano)}}<br />
{{Related2|Fluxbox Style Guide (Italiano) | Fluxbox Style Guide}}<br />
{{Related2|Cwm (Italiano) | CWM}}<br />
{{Related2|Evilwm (Italiano) | Evilwm}}<br />
{{Related2|FVWM (Italiano) | FVWM}}<br />
{{Related2|IceWM (Italiano) | IceWM}}<br />
{{Related2|JWM (Italiano) | JWM}}<br />
{{Related2|Openbox (Italiano) | Openbox}}<br />
{{Related2|Pawm (Italiano) | Pawm}}<br />
{{Related2|Twm (Italiano) | Twm}}<br />
{{Related2|PekWM (Italiano) | PekWM}}<br />
{{Related2|Window Maker (Italiano) | Window Maker}}<br />
{{Related2|Awesome3 (Italiano) | Awesome3}}<br />
{{Related articles end}}<br />
Fluxbox è un gestore di finestre per X. È basato sul codice di Blackbox 0.61.1. Fluxbox assomiglia a blackbox e gestisce elementi come lo stile, i colori, il posizionamento delle finestre e altre cose simili, esattamente come blackbox (la compatibilità dei temi/stile è del 100%). Fluxbox ha una sintassi facile da imparare ed è estremamente leggero. Arch + Fluxbox infatti può infatti rendere molto usabile un vecchio pentium con 256 MB di ram. <br />
<br />
==Installazione==<br />
Il pacchetto {{pkg|fluxbox}} è presente nei [[Official Repositories (Italiano)|repositories ufficiali]]. Installarlo quindi con [[pacman (Italiano)|pacman]]. <br />
<br />
Se non si ha ancora installaro [[Xorg (Italiano)|xorg]], farlo ora.<br />
<br />
== Avviare Fluxbox ==<br />
<br />
=== Metodo 1: KDM/GDM ===<br />
Gli utenti di [[KDM (Italiano)|KDM]], [[GDM]] o [[Lightdm]] troveranno una nuova voce di fluxbox aggiunta automaticamente al loro menù di sessione. Si scelga semplicemente l'opzione fluxbox durante la fase del login. <br />
=== Metodo 2: ~/.xinitrc ===<br />
Si modifichi il file {{ic|~/.xinitrc}} e si aggiunga la seguente riga:<br />
<br />
exec startfluxbox<br />
<br />
Vedere [[Xinitrc (Italiano)|xinitrc]] per i dettagli su come preservare la sessione logind (utile ad esempio per l'automount dei dispositivi usb).<br />
<br />
== Configurazione ==<br />
<br />
I file di configurazione generali di fluxbox (quindi validi per tutti gli utenti del sistema) sono contenuti in {{ic|/usr/share/fluxbox}}, mentre quelli vlidi a livello del solo utente sono contenuti in {{ic|~/.fluxbox}}.<br />
<br />
Quindi dare da user:<br />
$ mkdir ~/.fluxbox<br />
$ cp /usr/share/fluxbox/* ~/.fluxbox/<br />
<br />
per copiare tutti i file nella directory dell'utente.<br />
<br />
Nello specifico, i file sono:<br />
<ul><br />
<li>init: il file principale di fluxbox. Vedere [http://fluxbox-wiki.org/index.php?title=Editing_the_init_file Editare il file ''init'']<br />
<li>menu: file di configurazione del menu di fluxbox. Vedere sotto e [http://fluxbox-wiki.org/index.php?title=Editing_the_menu Editare il file ''menu'']<br />
<li>keys: file di configurazione delle scorciatoie da tastiera di fluxbox (hotkeys). Vedere sotto e [http://fluxbox-wiki.org/index.php?title=Keyboard_shortcuts qui]<br />
<li>startup: file nel quale è possibile decidere quali programmi si vogliono avviare all'inizio della sessione. Vedere anche [[Xinitrc (Italiano)|xinitrc]] e [http://fluxbox-wiki.org/index.php?title=Editing_the_startup_file questo articolo] <br />
<li>overlay: file di configurazione per gli ''elementi di stile''. Vedere anche [http://fluxbox-wiki.org/index.php?title=Style_overlay qui].<br />
<li>apps: file che permette a fluxbox di ricordare le impostazioni delle singole finestre. Vedere [http://fluxbox-wiki.org/index.php?title=Editing_the_apps_file qui]<br />
<li>windowmenu: file per modificare la finestra del menu: per maggiori informazioni leggere [http://fluxbox-wiki.org/index.php?title=Editing_the_windowmenu leggere questo articolo]<br />
</ul><br />
<br />
=== Gestione del Menu ===<br />
<br />
Quando si installa fluxbox la prima volta, il menù sarà davvero minimale. Inoltre essendo un WM non ha nessuno strumento per aggiornare il menu ogni qual volta si installa o disintalla qualcosa. Il menu, raggiungibile con il click destro del mouse sul desktop, va quindi creato o modificato a mano ~/.fluxbox/menu. Esistono comunque dei metodi automatici per la sua creazione.<br />
<br />
==== Metodo incorporato ====<br />
<br />
Comando incorporato:<br />
$ fluxbox-generate_menu<br />
Questo comando genera un file ~/.fluxbox/menu/ basato sui propri programmi installati. C'è anche un "aiuto / rigenerazione menu" nel menu di fluxbox.<br />
<br />
====MenuMaker====<br />
<br />
[http://menumaker.sourceforge.net/ MenuMaker] è un potento strumento che crea menu basati su codice XML per vari gestori di finestre, Fluxbox incluso. MenuMaker eseguirà una ricerca di programmi avviabili sul sistema ed in base al risultato creerà il menu. Può anche essere configurato per escludere applicazioni basate su Legacy X, GNOME, KDE, o Xfce, se desiderato.<br />
<br />
MenuMaker è presente nel repository [community] di pacman:<br />
# pacman -S menumaker<br />
<br />
Una volta installato, si può generare un menu completo eseguendo:<br />
$ mmaker -f Fluxbox<br />
<br />
Per una lista completa di tutte le opzioni possibili si digiti da terminale: $ mmaker --help<br />
<br />
==== Arch Linux Xdg menu ====<br />
<br />
Richiede {{pkg|archlinux-xdg-menu}}, installabile con pacman: <br />
# pacman -S archlinux-xdg-menu<br />
<br />
Per creare il menu lanciare in un terminale (da utente):<br />
$ xdg_menu --fullmenu --format fluxbox --root-menu /etc/xdg/menus/arch-applications.menu >~/.fluxbox/menu<br />
<br />
Per maggiori informazioni:<br />
$ xdg_menu --help<br />
<br />
''Si veda anche: [[XdgMenu]]''<br />
<br />
==== Creare e modificare manualmente il menu ====<br />
Si usi il comando:<br />
$ nano ~/.fluxbox/menu<br />
{{Nota| non è fondamentale usare ''nano'', va bene un qualunque editor.}}<br />
La sintassi base del file è:<br />
[exec] (name) {command} <percorso icona><br />
dove ''name'' è il testo che apparirà sul menu e ''command'' è il percorso dei binari, ad esempio:<br />
[exec] (Firefox Browser) {/usr/bin/firefox} <percorso esatto all'icona di firefox><br />
{{Nota|per determinare il percorso dei binari usare ''pacman -Ql| grep bin''.}}<br />
Notare che "<percorso all'icona>" non è fondamentale. Se si desidera creare un sottomenù usare la seguente sintassi:<br />
[submenu] (Name)<br />
...<br />
...<br />
[end]<br />
Una volta finito, salvare ed uscire. Non è necessario riavviare fluxbox. Per maggiori informazioni leggere [http://fluxbox-wiki.org/index.php?title=Editing_the_menu editare il menu di fluxbox].<br />
<br />
===Init===<br />
Il file {{ic|~/.fluxbox/init}} è la ''base'' di Fluxbox. Da qui si possono cambiare tutte le funzionalità di base come finestre, toolbar, focus ecc... Alcuni di questi parametri sono modificabili anche tramite il ''Configuration Menu''. Per maggiori informazioni leggere [http://fluxbox-wiki.org/index.php?title=Editing_the_init_file editare il file ''init''].<br />
<br />
===Scorciatoie da tastiera===<br />
Fluxbox offre funzionalità base di scorciatoie da tastiera. Il file dei tasti di fluxbox è situato in:<br />
~/.fluxbox/keys<br />
La chiave Control è rappresentata da "Control". Mod1 corrisponde ad Alt e Mod4 corrisponde a Meta (non è una chiave standard ma molti stabiliscono una corrispondenza tra meta e il tasto di windows)<br />
<br />
Qui c'è un metodo veloce per controllare il volume del canale ''master'' utilizzando i tastiCTRL-ALT+ Freccia su e giù: <br />
Control Mod1 Up :Exec amixer set Master,0 5%+ <br />
Control Mod1 Down :Exec amixer set Master,0 5%- <br />
<br />
===Aree di lavoro===<br />
Di base fluxbox dispone di quattro aree di lavoro. Queste sono accessibili usando la scorciatoia Ctrl+F1-F4, o con la freccia sulla toolbar vicino alla scritta che dice '''uno'''.<br />
<br />
Cliccando con il destro sul desktop e andando nel proprio menù Workspace (gli utenti di menumaker: FluxBox>Workspaces, gli utenti di fluxconf: il titolo aree di lavoro) sarà possibile interagire con le aree di lavoro.<br />
<br />
Menù delle aree di lavoro:<br />
Icons – mostra le applicazioni minimizzate<br />
--separator--<br />
Workspaces names (default: one,two,three,four) – Mostra tutte le applicazioni su quel desktop<br />
--separator--<br />
New Workspace – Aggiunge un'area di lavoro<br />
Edit Current workspace name – permette di impostare il nome che si desidera per le aree di lavoro. Sarà mostrato sul lato sinistro della toolbar<br />
Remove Last - Rimuove l'ultima area di lavoro della lista, sposta tutte le applicazioni di quel desktop su quello precedente<br />
<br />
<br />
===Schede e gruppi===<br />
Con almeno due finestre aperte sullo spazio di lavoro è possibile tramite {{ic|Ctrl + Click destro}} unire le due finestre in una sola. In questo modo, un operazione sulla finestra agirà su entramenbe le schede raggruppate.<br />
Per effettuare l'operazione inversa usare sempre {{ic|Ctrl + Click Destro}} su una scheda e trascinarsa su una parte libera del desktop.<br />
<br />
===Background===<br />
Per impostare lo sfondo è necessario usare un programma dedicato che si può installare con uno di questi pacchetti:<br />
*eterm<br />
*feh<br />
<br />
Ce ne sono anche altri, ma questi sono i due raccomandati, per gli altri è possibile consultare la documentazione di fbsetbg nella sezione "Additional Links section"<br />
Per impostare lo sfondo:<br />
$ fbsetbg /percorso/all'/immagine.di.sfondo<br />
<br />
Si può anche aggiungere (o modificare) la linea seguente nel file ~/.fluxbox/init in modo da risultare:<br />
session.screen0.rootCommand: fbsetbg /percorso/al/wallpaper<br />
<br />
O semplicemente:<br />
session.screen0.rootCommand: fbsetbg -l<br />
<br />
====Note per chi ama cambiare spesso sfondo====<br />
<br />
Posizionare questo sottomenù nel proprio menù di fluxbox<br />
[submenu] (Backgrounds)<br />
[wallpapers] (~/.fluxbox/backgrounds) {feh --bg-scale}<br />
[wallpapers] (/usr/share/fluxbox/backgrounds) {feh --bg-scale}<br />
[end]<br />
Ora mettere le proprie immagini di sfondo in {{ic|~/.fluxbox/backgrounds}} o in una qualsiasi altra cartella si abbia specificato, ora appariranno allo stesso modo degli stili.<br />
<br />
Si proceda in maniera analoga per i sistemi a doppio schermo senza 'xinerama' (ad esempio NVidio TwinView):<br />
[submenu] (Backgrounds)<br />
[wallpapers] (/path/to/your/backgrounds) {feh --bg-scale --no-xinerama }<br />
[end]<br />
<br />
====Feh====<br />
Installare {{pkg|feh}} con [[pacman (Italiano)|pacman]]. <br />
<br />
Per assicurarsi che fluxbox carichi lo sfondo di feh al prossimo avvio:<br />
<br />
'''1.''' Rendere {{ic|.fehbg}} eseguibile:<br />
$ chmod 770 ~/.fehbg<br />
<br />
'''2.''' Aggiungere poi (o modificare) la seguente linea al file {{ic|~/.fluxbox/init}}:<br />
session.screen0.rootCommand: ~/.fehbg<br />
<br />
'''3.''' o aggiungere (o modificare) la seguente linea al file {{ic|~/.fluxbox/startup}}:<br />
~/.fehbg<br />
<br />
=== Temi ===<br />
Per installare un tema si estragga l'archivio in una cartella di stile, quelle di default sono:<br />
*globale - /usr/share/fluxbox/styles <br />
*solo dell'utente - ~/.fluxbox/styles<br />
<br />
Su [[Arch User Repository (Italiano)|AUR]] è presente il pacchetto {{AUR|fluxbox-styles}} che include parecchi temi. Una volta installato comparirà in Fluxbox -> Styles nel menu.<br />
<br />
Per creare un proprio tema, seguire le pagine [[Fluxbox Style Guide (Italiano)|Fluxbox Style Guide]] e [http://tenr.de/howto/style_fluxbox/style_fluxbox.html Style Guide].<br />
<br />
Se si usa {{ic|mmaker -f FluxBox}} per creare il proprio menu non si troverà poi la sezione per il cambio di tema. Aggiungere quindi a {{ic|~/.fluxbox/menu}}:<br />
[submenu] (System Styles) {Choose a style...}<br />
[stylesdir] (/usr/share/fluxbox/styles)<br />
[end]<br />
[submenu] (User Styles) {Choose a style...}<br />
[stylesdir] (~/.fluxbox/styles)<br />
[end]<br />
<br />
===Slit===<br />
<br />
Fluxbox, WindowMaker, Openbox e pochi altri window managers hanno "Slit". In pratica una parte della dock, visibile su ogni spazio di lavoro in cui le applicazioni sono ancorate. Visitare: [http://dockapps.windowmaker.org/ dockapps.windowmaker.org].<br />
<br />
===Avvio automatico delle applicazioni===<br />
Gli utenti di [[Xinitrc (Italiano)|Xinitrc]] dovrebbero inserire tutto il codice in {{ic|~/.xinitrc}}. Ad ogni modo, fluxbox offre la possibilità di avviare automaticamente le applicazioni da solo.<br />
<br />
Il file {{ic|~/.fluxbox/startup}} è uno script per l'avvio delle applicazioni contemporaneamente all'avvio stesso di fluxbox. Il simbolo # denota un commento. (il cancelletto denota un commento)<br />
<br />
Un file d'esempio:<br />
fbsetbg -l <nowiki>#</nowiki> imposta lo sfondo.<br />
<nowiki>#</nowiki> il simbolo (&) nei comandi sottostanti permette ai programmi avviati di non stopparsi subito e a fluxbox di avviarsi in modo corretto<br />
idesk & <br />
xterm &<br />
exec /usr/bin/startfluxbox<br />
<nowiki>#</nowiki> o se si vuole un log:<br />
<nowiki>#</nowiki> exec /usr/bin/fluxbox -log ~/.fluxbox/log<br />
<br />
===Altri menu===<br />
<br />
In the "Menu Management" section (above) we were discussing the main "Applications" Menu, called the "Root" menu in fluxbox lingo. FluxBox also has other menus available to the user:<br />
<ul><br />
<li>Workspaces Menu: click tasto centrale mouse sul desktop.<br />
<li>Configuration Menu: located within the "Fluxbox" section of the "Root" menu.<br />
<li>Window menu: click destro sul bordo di una finestra. Può essere modificato. Vedere la pagina ''man'' di fluxbox-menu.<br />
<li>Toolbar menu: click destro su una parte vuota della toolbar. Modificabile attraverso un sotto-menu in Configuration Menu.<br />
<li>Slit Menu: si trova in una sotto sezione di Configuration Menu.<br />
</ul><br />
<br />
===Vera trasparenza===<br />
Per abilitare la vera trasparenza in fluxbox è necessario un compositor per X come [[Xcompmgr]] disponibile nei [[Official Repositories (Italiano)|repository ufficiali]].<br />
<br />
===Notifiche===<br />
Per abilitare le notifiche a schermo per fluxbox leggere [https://bbs.archlinux.org/viewtopic.php?id=138616 questo topic del forum internazionale di Arch].<br />
<br />
===Una vita dopo xorg.conf===<br />
Xorg non richiede più il file xorg.conf. Tradizionalmente è qui che si configurerebbero le impostazioni della tastiera e quelle per il risparmio energetico. Fortunatamente esistono altre soluzioni efficaci senza xorg.conf. <br />
<br />
====Impostare correttamente la propria tastiera====<br />
Si aggiunga semplicemente la linea seguente in {{ic|~/.fluxbox/startup}}:<br />
setxkbmap us -variant intl & # to have a us keyboard with special characters enabled (like éóíáú)<br />
<br />
Al posto di 'us' si può inserire il codice della propria lingua e rimuovere le opzioni diverse (ad esempio: 'us_intl', che funziona come il comando precedente in alcuni setup). Si veda il man di setxkbmap per maggiori informazioni.<br />
<br />
Per creare una funzione d'aiuto nel proprio menù, si aggiunga in {{ic|~/.fluxbox/menu}}:<br />
[submenu] (Keyboard)<br />
[exec] (normal) {setxkbmap us}<br />
[exec] (international) {setxkbmap us -variant intl}<br />
[end]<br />
<br />
==Altre risorse==<br />
<br />
* [http://fluxbox.org/ Fluxbox Homepage]<br />
* [http://wiki.gentoo.org/wiki/Fluxbox Gentoo Wiki about Fluxbox]<br />
* [http://www.gentoo.org/doc/en/fluxbox-config.xml Gentoo Fluxbox Documentation]<br />
* [http://box-look.org/ Themes for Fluxbox]<br />
* [http://fluxbox-wiki.org/ Fluxbox Wiki]<br />
* [http://www.xs4all.nl/~hanb/software/fbsetbg/fbsetbg.html fbsetbg documentation]<br />
* [http://archux.com/page/application-recommendations Application recommendations]<br />
* [[Fluxbox Style Guide_(Italiano)|Fluxbox Style Guide]]</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=Fluxbox_(%D0%A1%D1%80%D0%BF%D1%81%D0%BA%D0%B8)&diff=301033Fluxbox (Српски)2014-02-24T03:36:56Z<p>Mistofvongola: Fix gentoo wiki link</p>
<hr />
<div>[[Category:Samostalni menadžeri prozora (Српски)]]<br />
[[Category:Uputstva (Српски)]]<br />
[[cs:Fluxbox]]<br />
[[de:Fluxbox]]<br />
[[en:Fluxbox]]<br />
[[es:Fluxbox]]<br />
[[fr:Fluxbox]]<br />
[[it:Fluxbox]]<br />
[[ko:Fluxbox]]<br />
[[pl:Fluxbox]]<br />
[[pt:Fluxbox]]<br />
[[ru:Fluxbox]]<br />
[[zh-TW:Fluxbox]]<br />
= Početak =<br />
<br />
==Kompletno uputstvo==<br />
Hvala narada-i; on je autor ovog uputstva.<br />
Možete ga pronaći na:<br />
[https://bbs.archlinux.org/viewtopic.php?id=77729]<br />
<br />
== Startovanje Fluxbox-a ==<br />
=== Metoda 1: KDM/GDM ===<br />
Korisnici [[KDM]] ili [[GDM]] će naći novi fluxbox unos automatski dodat u njihov meni sesije.will find a new fluxbox entry added to their session menu automatically. Jednostavno izaberite fluxbox opciju kada se prijavljujete na sistem.<br />
<br />
=== Metod 2: ~/.xinitrc ===<br />
Izmenite {{ic|~/.xinitrc}} i dodajte sledeći kod:<br />
exec fluxbox<br />
ili ako bi ste želeli da koristite 'startfluxbox' fajl, dodajte ovu liniju umesto:<br />
exec startfluxbox <br />
<tt>startfluxbox</tt> je metoda koja se preporučuje, jer ona će takođe izvršiti sve programe definisane u {{ic|~/.fluxbox/startup}}.<br />
<br />
Ako takođe koristite '''polkit''' i '''D-Bus''' (npr. za drajvere za automatsko nasađivanje), upotrebite ovaj kod umesto:<br />
exec startfluxbox<br />
<br />
{{Note | Može biti samo jedna <tt>exec</tt> linija u Vašem {{ic|~/.xinitrc}} fajlu.}}<br />
<br />
Ako dođe do pada sistema prilikom startovanja, moguće je da je problem u lokalizaciji. Podešavanjem LC_ALL na početnu "C" lokalizaciju, možete izbeći ovaj problem. [https://bbs.archlinux.org/viewtopic.php?t=25797 1].<br />
<br />
= Podešavanje =<br />
== Upravljanje menijem ==<br />
=== Built-in metoda ===<br />
Built-in command:<br />
$ fluxbox-generate_menu<br />
Ova komanda će napraviti ~/.fluxbox/menu/ fajl baziran na Vašim instaliranim programima. Takođe postoji "helper / regenerate menu" u fluxbox meniju.<br />
<br />
=== MenuMaker ===<br />
[http://menumaker.sourceforge.net/ MenuMaker] je moćna alatka za kreiranje XML-baziranih menija za razne menadžere prozora, uključujući i Fluxbox. MenuMaker će pretražiti Vaš kompjuter za izvršne programe i napraviti meni baziran na rezultatima. Može biti konfigurisan za izuzme Legacy X, GNOM, KDE, ili Xfce aplikacije ako tako želite.<br />
<br />
MenuMaker je dostupan u [community] preko pakmena:<br />
# pacman -S menumaker<br />
<br />
Nakon što je instaliran, možete generisati kompletan meni izvršavanjem:<br />
$ mmaker -v Fluxbox<br />
<br />
Da vidite celu listu opticija, izvršite '''mmaker --help'''<br />
<br />
=== Arch Linux Xdg meni ===<br />
Zahteva [https://aur.archlinux.org/packages.php?ID=10535 Arch Linux xdg meni] <br><br />
$ xdg_menu --fullmenu --format fluxbox --root-menu /etc/xdg/menus/arch-applications.menu >~/.fluxbox/menu<br />
'''Savet:''' zamenite početni xterm/urxvt:<br />
$ sed -i 's/xterm/urxvt/g' ~/.fluxbox/menu<br />
Više informacija:<br />
$ xdg_menu --help<br />
<br />
''Takođe pogledajte: [[XdgMenu]]''<br />
<br />
=== Kreiranje prilagođenog menija sa fluxconf-om ===<br />
Da startujete meni sekciju fluxconf-a izvršite:<br />
$ fluxmenu<br />
U prozoru ćete videti tri kolone: Type, Title, & Command/Comment.<br><br />
Klikom na jedan od unosa će Vam dozvoliti da ga editujete.<br><br />
Klikom na "Add sub" ćete dodati podmeni.<br><br />
Klikom na "Add exec" ćete dodati komandu.<br><br />
<br />
Kolona za tip ima nekoliko validnih opcija:<br />
#begin, neophodna za startovanje meni fajla. Title opcija je meni zaglavlje.<br><br />
#submenu, "folder" u okviru menija. Title je ime submenu-ja.<br><br />
#exec, komandna linija. Title je ono što je prikazano i Command/Comment je komanda koja će biti izvršena.<br />
#separator, razdvajač u meniju. Nema argumenata za njega.<br />
#workspaces, lista radnih površina i koje aplikacije se izvršavaju na svakoj. Title je ono što će biti prikazano korisniku.<br />
#stylesdir, direktorijum koji sadrži stilove. Title je staza ka direktorijumu. Preporučuje se da stavite ovo u svoj zasebni poddirektoirjum jer može postati prilično velik. Direktorijumi koji su pogodni: /usr/share/fluxbox/styles ~/.fluxbox/stylesRecommended that you put this into its own subdirectory as it can get quite large. directories to use: /usr/share/fluxbox/styles ~/.fluxbox/styles .<br />
#config, meni sa mnogo opcija za konfigurisanje ponašanja fluxbox-a. Title je ime menija prikazanog korisniku.<br />
#reconfig, ponovo učitava konfig fajl. Title je naslov prikazan korisniku.<br />
#restart, restartuje fluxbox. Title je naslov prikazan korisniku.<br />
#exit, izlazi iz fluxbox-a, iskočiće u upravljač desktop-a ili izaći iz X-a sve u zavisnosti od metode za startovanje koju ste upotrebili. Title je naslov prikazan korisniku.<br />
<br />
Zapamtite da stisnete save pre zatvaranja<br />
<br />
=== Ručno kreirajte/editujte meni ===<br />
Upotrebite komandu:<br />
$ nano ~/.fluxbox/menu<br />
Zatim napišite linije u ovom stilu:<br />
[exec] (name) {command}<br />
Ako želite da napravite podmeni napišite:<br />
[submenu] (Name)<br />
...<br />
...<br />
[end]<br />
Kada ste završili sačuvajte i izađite. Nije neophodno da restartujete fluxbox.<br />
<br />
== Prečice ==<br />
Fluxbox pruža funkcionalnost osnovnih prečica. Fluxbox fajl sa prečicama se nalazi u:<br />
~/.fluxbox/keys<br />
Control je predstavljen sa "Control". Mod1 odgovara Alt-u i Mod4 odgovara Meta tasteru (nestandardan stater ali mnogi mapiraju meta na win taster).<br />
<br />
Evo ga brzi način za kontrolisanje Vašeg Master glasnoće zvuka, upotrebom CTRL-ALT+ strelica na gore ili dole:<br />
Control Mod1 Up :Exec amixer set Master,0 5%+ <br />
Control Mod1 Down :Exec amixer set Master,0 5%- <br />
<br />
Ako ste instalirali fluxconf, možete upotrebiti njegov metod editovanja ovoga u GUI-ju sa sledećom komandom:<br />
$ fluxkeys<br />
<br />
Prvi tekstualni boks je za dugme, a drugi je za akciju. Izaberite execCommand da podesite komandu i stavite ime komande u 3. tekst boks.<br />
<br />
Više funkcija ovog tipa možete upotrebiti iz 2. tekstualnog boksa (Padajući meni je dostupan)<br />
<br />
== Radne površine ==<br />
Fluxbox početna podešavanja imaju četiri radne površine. Ona su dostupna upotrebom Alt+F1-F4 skraćenica, ili strelica na liniji sa alatkama pored mesta gde piše '''one'''.<br />
<br />
Desnim klikom na desktop i ulaskom u Workspaces meni (menumaker koristi: FluxBox>Workspaces, fluxconf korisnici: the workspaces title) će Vam omogućiti interakciju sa radnim površinama.<br />
<br />
Meni radnih površina:<br />
Icons - prikazuje umanjene aplikacije<br />
--razdvajač--<br />
Workspace names (početna: jedan,dva,tri,četiri) - Prikazuje sve aplikacije na tom desktopu<br />
--razdvajač--<br />
New Workspace - Dodaje radnu površinu<br />
Editu Current workspace name - omogućava Vam da date naziv Vašoj radnoj površini onako kako želite. Prikazaće se na levoj strani linije sa alatkama. <br />
Remove Last - Uklanja poslednju radnu površinu u listi, izbacuje sve aplikacije koje se nalaze na toj površini na jednu pre nje.<br />
<br />
== Pozadina ==<br />
Podešavanje pozadine zahteva program koji to omogućava. Moraćete da instalirate jedan od ovih paketa:<br />
*eterm <br />
*feh (nedostaje mu meni transparentnost). <br />
<br />
Postoje i drugi ali ovo su dva najpreporučljivija, da vidite ostale proverite fbsetbg dokumentaciju u "Sekciji za dodatne linkove"<br />
Da podesite pozadinu:<br />
$ fbsetbg /path/to/background.image<br />
<br />
Takođe možete dodati (ili izmeniti) sledeće linije u fajlu ~/.fluxbox/init u nešto poput ovog:<br />
session.screen0.rootCommand: fbsetbg /path/to/wallpaper<br />
<br />
Ili jednostavno:<br />
session.screen0.rootCommand: fbsetbg -l<br />
<br />
====Dodatne beleške za ljude koji vole da često menjaju pozadine====<br />
<br />
Dodajte sledeći podmeni u fluxbox meni<br />
[submenu] (Pozadine)<br />
[wallpapers] (~/.fluxbox/pozadine)<br />
[wallpapers] (/usr/share/fluxbox/pozadine)<br />
[end]<br />
Zatim stavite Vaše slike pozadina u ~/.fluxbox/pozadine ili neki drugi direktorijum koji sami odredite, oni će se zatim pojaviti na isti način kao i Vaši stilovi.<br />
<br />
=== Feh ===<br />
Instalirajte feh sa:<br />
# pacman -S feh<br />
Možete dodati brzi podmeni u Vaš {{ic|~/.fluxbox/menu}} fajl koji će Vam omogućiti da menjate pozadine u letu:<br />
[submenu] (Wallpaper)<br />
[wallpapers] (/staza/ka/Vašim/pozadinama) {feh --bg-scale}<br />
[end]<br />
<br />
Da bi ste bili sigurni da će fluxbox učitati feh pozadine prilikom sledećeg startovanja:<br />
<br />
'''1.''' Napravite {{ic|.fehbg}} izvršni fajl:<br />
$ chmod 770 ~/.fehbg<br />
<br />
'''2.''' Zatim dodajte (ili izmenite) sledeće linije u fajlu {{ic|~/.fluxbox/init}}:<br />
session.screen0.rootCommand: ~/.fehbg<br />
<br />
'''3.''' ili dodajte (ili izmenite) sledeće linije u fajlu {{ic|~/.fluxbox/startup}}:<br />
~/.fehbg<br />
<br />
== Teme ==<br />
Da bi ste instalirali teme, odpakujte arhivu u direktorijum za stilove. Uobičajeni direktorijumi su:<br />
*globalni - /usr/share/fluxbox/styles<br />
*samo korisnik - ~/.fluxbox/styles<br />
Linkovi ka nekim sajtovima sa temama su obezbeđeni ispod.<br />
<br />
== GTK2 Themes ==<br />
''Pogledajte: [[GTK+]]''<br />
<br />
== Automatsko startovanje aplikacija ==<br />
xinitrc korisnici bi trebali da stave sav kod u {{ic|~/.xinitrc}}. Međutim, fluxbox pruža funkcionalnost za automatsko startovanje programa sam za sebe.<br />
<br />
{{ic|~/.fluxbox/startup}} fajl je skripta za automatsko startovanje aplikacija kao i za startovanje samog fluxbox-a. # simbol označava komentar.<br />
<br />
Primerak fajla:<br />
fbsetbg -l <nowiki>#</nowiki> podešava poslednju pozadinu, vrlo korisno i preporučljivo.<br />
<nowiki>#</nowiki> U donjim komandama znak (&) je neophodan za sve aplikacije koje se ne gase istog momenta. <br />
<nowiki>#</nowiki> neuspeh u njihovom obezbeđivanju će uzrokovati time da fluxbox ne startuje.<br />
idesk & <br />
xterm &<br />
<nowiki>#</nowiki> exec je za startovanje samog fluxboxa, ne stavljajte (&) nakon ovoga ili će fluxbox izaći istog momenta<br />
exec /usr/bin/fluxbox<br />
<nowiki>#</nowiki> ili ako želite da zadržite log, odkomentirajte komandu ispod i stavite pod komentare gornju komandu:<br />
<nowiki>#</nowiki> exec /usr/bin/fluxbox -log ~/.fluxbox/log<br />
<br />
== Život nakon xorg.conf-a ==<br />
Xorg više ne zahteva xorg.conf fajl. Tradicionalno ovo je mesto gde bi ste menjali Vaša podešavanja za tastaturu i podešavanja za čuvanje energije. Srećom postoje elegantna rešenja bez upotrebe xorg.conf-a.<br />
<br />
=== Podešavanje Vaše tastature na pravi način ===<br />
Dodajte sledeću liniju u {{ic|~/.fluxbox/startup}}:<br />
setxkbmap us & # za tastaturu SAD - Sjedinjene Američke Države<br />
ili za srpsku latinicu dodajte:<br />
setxkbmap rs latin &<br />
za srpsku ćirilicu:<br />
setxkbmap rs &<br />
<br />
Umesto 'us', 'rs latin' ili 'rs' možete dodati kod za neki drugi jezik i ukloniti prethodnu opciju. Pogledajte man setxkbmap za više opcija.<br />
<br />
Da napravite help funkciju u Vašem meniju, jednostavno dodajte {{ic|~/.fluxbox/menu}}:<br />
[submenu] (Tastatura)<br />
[exec] (srpski latinica) {setxkbmap rs latin}<br />
[exec] (srpski ćirilica) {setxkbmap rs}<br />
[exec] (internacionalna) {setxkbmap us}<br />
[end]<br />
<br />
=== Onemogući uštedu energije ===<br />
Da li prepoznajete problem dok gledate film, a ekran postane crn? Čestitamo, Xorg je upravo primetio da ništa niste radili :). Ako Vam ne trebaju ovakva vežbanja sa pokretima, možete da onemogućite ovu opciju u potpunosti. Samo treba da zapamtite da ručno ugasite Vaš monitor ako ga ne koristite.<br />
<br />
Dodajte sledeću liniju na početak {{ic|~/.fluxbox/startup}}:<br />
xset s off -dpms &<br />
<br />
= Dodatni izbori =<br />
<br />
* [http://fluxbox.org/ Fluxbox Homepage]<br />
* [http://wiki.gentoo.org/wiki/Fluxbox Gentoo Wiki about Fluxbox]<br />
* [http://www.gentoo.org/doc/en/fluxbox-config.xml Gentoo Fluxbox Documentation]<br />
* [http://box-look.org/ Themes for Fluxbox]<br />
* [http://fluxbox-wiki.org/ Fluxbox Wiki]<br />
* [http://www.xs4all.nl/~hanb/software/fbsetbg/fbsetbg.html fbsetbg documentation]<br />
* [http://archux.com/page/application-recommendations Application recommendations]<br />
* [[Fluxbox_Style_Guide|Fluxbox Style Guide]]</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=Fluxbox_(%C4%8Ce%C5%A1tina)&diff=301032Fluxbox (Čeština)2014-02-24T03:36:35Z<p>Mistofvongola: /* Další zdroje */ Fix Gentoo wiki link</p>
<hr />
<div>[[Category:Desktop environments (Česky)]]<br />
[[de:Fluxbox]]<br />
[[en:Fluxbox]]<br />
[[es:Fluxbox]]<br />
[[fr:Fluxbox]]<br />
[[it:Fluxbox]]<br />
[[ko:Fluxbox]]<br />
[[pl:Fluxbox]]<br />
[[pt:Fluxbox]]<br />
[[ru:Fluxbox]]<br />
[[sr:Fluxbox]]<br />
[[zh-TW:Fluxbox]]<br />
= Úvod =<br />
<br />
==Úplný návod==<br />
Autorem úplného návodu je narada.<br />
Nalézt jej můžete zde:<br />
[https://bbs.archlinux.org/viewtopic.php?id=77729]<br />
<br />
== Jak nainstalovat Fluxbox ==<br />
Instalace je poměrně jednoduchá, vše je v repozitářích. Začínajícím uživatelům doporučuji nainstalovat také menumaker a fluxconf.<br />
pacman -S fluxbox fluxconf menumaker<br />
<br />
== Spuštění Fluxboxu ==<br />
=== Metoda 1: KDM/GDM ===<br />
O přidání nabídky do správce přihlášení [[KDM]] nebo [[GDM]] se automaticky postará instalátor. Při přihlašování vyberte fluxbox.<br />
<br />
=== Metoda 2: ~/.xinitrc ===<br />
Ve svém domovském adresáři přijdete do souboru {{ic|~/.xinitrc}} následující řádek:<br />
exec fluxbox<br />
pokud chcete fluxbox spustit souborem 'startfluxbox', vložte:<br />
exec startfluxbox<br />
Je doporučeno spouštět fluxbox souborem <tt>startfluxbox</tt>, protože při startu spustí programy, definované v souboru {{ic|~/.fluxbox/startup}}.<br />
<br />
{{Note | V souboru {{ic|~/.xinitrc}} může být pouze jeden řádek <tt>exec</tt>.}}<br />
<br />
Pokud se při startu vyskytnou problémy, může být problém v locale. Nastavením LC_ALL na předvolenou hodnotu "C" může pomoci. Viz [https://bbs.archlinux.org/viewtopic.php?t=25797 1].<br />
<br />
= Konfigurace =<br />
<br />
Za nastavením Fluxboxu stojí tři soubory, které se nachází v domovském adresáři uživatele v adresáři /.fluxbox -> menu, keys, init. V těchto souborech je možné nastavit úplně vše, od základního fungovaní (init), klavesových zkratek (keys), až po jeho menu (menu). Tyto soubory lze editovat ručně, nebo pomocí utility zvané FluxConf.<br />
<br />
== Úprava menu ==<br />
=== Rychlá metoda: ===<br />
pomocí příkazu:<br />
$ fluxbox-generate_menu<br />
se vygeneruje soubor ~/.fluxbox/menu v závislosti na programech, které máte nainstalované. V menu fluxboxu je položka "helper / regenerate menu", která vykoná totéž.<br><br />
Základní struktura menu:<br />
[begin] (Nadpis menu)<br />
[submenu] (Nadpis submenu)<br />
[exec] (Název aplikace) {/cesta/k/programu}<br />
[include] (/cesta/k_souboru/s_menu)<br />
[end]<br />
[nop] (--------)<br />
[separator]<br />
[workspaces] (Název submenu s pracovními plochami)<br />
[stylesdir] (/cesta/k_adresari/se_styly)<br />
[config] (Název submenu s konfigurací fluxboxu)<br />
[restart] (Restart Fluxboxu)<br />
[exit] (Konec sezení ve Fluxboxu) <br />
<br />
* [nop] - Slouží jako oddělovač, do závorek je možné uvést libovolný text. Tento bude uveden v menu, nespouští však žádný příkaz.<br />
* [separator] - Oddělovač v podobě horizontální linky.<br />
<br />
Ukázka souboru .fluxbox/menu:<br />
# Generated by fluxbox-generate_menu<br />
#<br />
# If you read this it means you want to edit this file manually, so here<br />
# are some useful tips:<br />
#<br />
# - You can add your own menu-entries to ~/.fluxbox/usermenu<br />
#<br />
# - If you miss apps please let me know and I will add them for the next<br />
# release.<br />
#<br />
# - The -r option prevents removing of empty menu entries and lines which<br />
# makes things much more readable.<br />
#<br />
# - To prevent any other app from overwriting your menu<br />
# you can change the menu name in .fluxbox/init to:<br />
# session.menuFile: /home/you/.fluxbox/my-menu<br />
[begin] (Fluxbox-1.0rc3)<br />
[exec] (urxvt) {urxvt}<br />
[exec] (opera) {env QT_XFT=true opera}<br />
[submenu] (Terminals)<br />
[exec] (xterm) {xterm}<br />
[exec] (urxvt) {urxvt}<br />
[exec] (urxvtc) {urxvtc}<br />
[exec] (mlterm) {mlterm}<br />
[end]<br />
[submenu] (Net)<br />
[submenu] (Browsers)<br />
[exec] (dillo) {dillo}<br />
[exec] (vncviewer) {vncviewer}<br />
[exec] (links-graphic) {links -driver x fluxbox.org}<br />
[exec] (opera) {env QT_XFT=true opera}<br />
[exec] (links) {urxvt -e links fluxbox.org}<br />
[end]<br />
[submenu] (IM)<br />
[exec] (gaim) {gaim}<br />
[end]<br />
[submenu] (Mail)<br />
[exec] (sylpheed-claws) {sylpheed-claws}<br />
[exec] (mutt) {urxvt -e mutt}<br />
[end]<br />
[submenu] (IRC)<br />
[exec] (irssi) {urxvt -e irssi}<br />
[end]<br />
[submenu] (ftp)<br />
[exec] (gftp) {gftp}<br />
[exec] (ftp) {urxvt -e ftp}<br />
[end]<br />
[exec] (xnmap) {xnmap}<br />
[exec] (skype) {skype}<br />
[end]<br />
[submenu] (Editors)<br />
[exec] (gvim) {gvim}<br />
[exec] (xedit) {xedit}<br />
[exec] (evim) {evim}<br />
[exec] (scite) {scite}<br />
[exec] (nano) {urxvt -e nano}<br />
[exec] (vim) {urxvt -e vim}<br />
[exec] (vi) {urxvt -e vi}<br />
[end]<br />
[submenu] (File utils)<br />
[exec] (rox) {rox}<br />
[exec] (mc) {urxvt -e mc}<br />
[end]<br />
[submenu] (Multimedia)<br />
[submenu] (Graphics)<br />
[exec] (inkscape) {inkscape}<br />
[exec] (gqview) {gqview}<br />
[exec] (blender) {blender -w}<br />
[end]<br />
[submenu] (Audio)<br />
[exec] (xmms) {xmms}<br />
[exec] (alsaplayer) {alsaplayer}<br />
[exec] (easytag) {easytag}<br />
[exec] (audacity) {audacity}<br />
[exec] (beep-media-player) {beep-media-player}<br />
[exec] (alsamixer) {urxvt -e alsamixer}<br />
[end]<br />
[submenu] (Video)<br />
[exec] (xine) {xine}<br />
[exec] (aviplay) {aviplay}<br />
[exec] (gmplayer) {gmplayer}<br />
[exec] (vlc) {vlc}<br />
[exec] (dvdrip) {nohup dvdrip}<br />
[end]<br />
[submenu] (X-utils)<br />
[exec] (xfontsel) {xfontsel}<br />
[exec] (xman) {xman}<br />
[exec] (xload) {xload}<br />
[exec] (xbiff) {xbiff}<br />
[exec] (editres) {editres}<br />
[exec] (viewres) {viewres}<br />
[exec] (xclock) {xclock}<br />
[exec] (xmag) {xmag}<br />
[exec] (gkrellm) {gkrellm}<br />
[exec] (vmware) {vmware}<br />
[exec] (Reload .Xdefaults) {xrdb -load /home/tobias/.Xdefaults}<br />
[end]<br />
[end]<br />
[submenu] (Office)<br />
[exec] (xclock) {xclock}<br />
[exec] (xcalc) {xcalc}<br />
[exec] (Open Office) {soffice}<br />
[exec] (abiword) {abiword}<br />
[exec] (acroread) {acroread}<br />
[exec] (xpdf) {xpdf}<br />
[exec] (gv) {gv}<br />
[end]<br />
[submenu] (Games)<br />
[exec] (bzflag) {bzflag}<br />
[exec] (xeyes) {xeyes}<br />
[end]<br />
[submenu] (System Tools)<br />
[exec] (top) {urxvt -e top}<br />
[end]<br />
[submenu] (fluxbox menu)<br />
[config] (Configure)<br />
[submenu] (System Styles) {Choose a style...}<br />
[stylesdir] (/usr/share/fluxbox/styles)<br />
[end]<br />
[submenu] (User Styles) {Choose a style...}<br />
[stylesdir] (~/.fluxbox/styles)<br />
[end]<br />
[workspaces] (Workspace List)<br />
[submenu] (Tools)<br />
[exec] (Window name) {xprop WM_CLASS|cut -d \" -f 2|xmessage -file - -center}<br />
[exec] (Screenshot - JPG) {import screenshot.jpg && display -resize 50% screenshot.jpg}<br />
[exec] (Screenshot - PNG) {import screenshot.png && display -resize 50% screenshot.png}<br />
[exec] (gtk-theme-switch) {switch}<br />
[exec] (gtk2-theme-switch) {switch2}<br />
[exec] (Regen Menu) {fluxbox-generate_menu}<br />
[end]<br />
[submenu] (Window)<br />
[restart] (openbox) {openbox}<br />
[end]<br />
[commanddialog] (Fluxbox Command)<br />
[reconfig] (Reload config)<br />
[restart] (Restart)<br />
[exec] (About) {(fluxbox -v; fluxbox -info | sed 1d) 2> /dev/null | xmessage -file - -center}<br />
[separator]<br />
[exit] (Exit)<br />
[end]<br />
[end]<br />
<br />
=== Doporučená metoda: MenuMaker ===<br />
[http://menumaker.sourceforge.net/ MenuMaker] je kvalitní nástroj, který vytvoří menu v XML, které lze použít v různých okenních správcích, včetně Fluxboxu. MenuMaker prohledá váš počítač a vygeneruje menu podle programů, které najde. Může být nastaven tak, aby vynechal programy z X, GNOME, KDE nebo Xfce.<br />
<br />
MenuMaker je dostupný v repozitáři [community]:<br />
# pacman -S menumaker<br />
<br />
Po nainstalování lze menu vygenerovat příkazem:<br />
$ mmaker -v Fluxbox<br />
<br />
Kompletní nápovědu lze zobrazit příkazem '''mmaker --help'''<br />
<br />
=== Menu Arch Linux programem Xdg ===<br />
Vyžaduje nainstalovat balíček [https://aur.archlinux.org/packages.php?ID=10535 Arch Linux xdg menu] <br><br />
$ xdg_menu --fullmenu --format fluxbox --root-menu /etc/xdg/menus/arch-applications.menu >~/.fluxbox/menu<br />
'''Tip:''' náhrada předvoleného xterm/urxvt:<br />
$ sed -i 's/xterm/urxvt/g' ~/.fluxbox/menu<br />
Další info:<br />
$ xdg_menu --help<br />
<br />
''Viz také: [[XdgMenu]]''<br />
<br />
=== Vytvoření uživatelského menu pomocí programu fluxconf ===<br />
Tvorba menu se spustí příkazem:<br />
$ fluxmenu<br />
V okně vidíte tři sloupce: Type, Title, & Command/Comment.<br><br />
Kliknutím na položku ji můžete editovat.<br><br />
Kliknutím na "Add sub" přidáte submenu.<br><br />
Kliknutím na "Add exec" přidáte program.<br><br />
<br />
Sloupec type má několik platných možností:<br />
#begin, požadovaný pro začátek souboru menu. Title je název hlavičky menu.<br><br />
#submenu, "adresář" uvnitř menu. Title je název submenu.<br><br />
#exec, příkazový řádek. Title je co se zobrazí a Command/Comment je program, který bude spuštěn.<br />
#separator, oddělovač menu. Bez parametrů.<br />
#workspaces, seznam pracovních ploch a které programy běží na které. Title je název, zobrazený uživateli.<br />
#stylesdir, adresář, obsahující styly. Title je cesta k adresáři. Doporučuje se styly ukládat do vlastních podadresářů, aby se jich více vešlo. Adresáře jsou: /usr/share/fluxbox/styles ~/.fluxbox/styles .<br />
#config, menu s mnoha volbami konfigurace chování fluxboxu. Title je název, zobrazený uživateli.<br />
#reconfig, znovu nahraje konfigurační soubor. Title je název, zobrazený uživateli.<br />
#restart, restartuje fluxbox. Title je název, zobrazený uživateli.<br />
#exit, ukončí fluxbox, vrátí se do přihlašovacího manažeru nebo ukončí X podle metody, použité při spuštění. Title je název, zobrazený uživateli.<br />
<br />
Před ukončením nezapomeňte soubor uložit kliknutím na save<br />
<br />
=== Manuální tvorba/editace menu ===<br />
Použijte příkaz:<br />
$ nano ~/.fluxbox/menu<br />
Pak vkládejte řádky tímto způsobem:<br />
[exec] (name) {command}<br />
Pokud chcete vložit submenu:<br />
[submenu] (Name)<br />
...<br />
...<br />
[end]<br />
Nakonec klikněte na save a exit. Není třeba restartovat fluxbox.<br />
<br />
== Klávesové zkratky ==<br />
Nastavení klávesových zkratek se nachází v souboru:<br />
~/.fluxbox/keys<br />
Klávesa Control je reprezentována příkazem "Control". Mod1 odpovídá klávese Alt a Mod4 klávese Meta (není standardní klávesa, většinou je mapována na klávesu win).<br />
<br />
Např. úroveň hlasitosti pomocí kláves CTRL-ALT + šipka nahoru nebo dolů lze nastavit takto:<br />
Control Mod1 Up :Exec amixer sset Master,0 5%+ <br />
Control Mod1 Down :Exec amixer sset Master,0 5%- <br />
<br />
Pokud máte nainstalovaný program fluxconf, můžete použít grafickou konfiguraci příkazem:<br />
$ fluxkeys<br />
<br />
První textové pole je pro klávesu a druhé pro akci. Pro nastavení příkazu zvolte execCommand a vložte jméno příkazu do třetího textového pole.<br />
<br />
Další funkce lze použít z druhého textového pole (je dostupné drop down menu)<br />
<br />
== Pracovní plochy (workspaces) ==<br />
Fluxbox poskytuje ve výchozím nastavení uživateli čtyři pracovní plochy, dostupné použitím kláves Alt+F1 až F4 nebo šipkami na toolbaru vedle místa, kde je vypsán název současné pracovní plochy.<br />
<br />
Kliknutím pravého tlačítka na ploše a vstupem do Workspaces menu (uživatelé menumakeru: FluxBox>Workspaces, uživatelé fluxconf: položka workspaces) můžete pracovní plochy upravovat.<br />
<br />
Menu Workspaces:<br />
Icons - zobrazí minimalizované aplikace<br />
--separator--<br />
Workspaces names (default: one,two,three,four) - zobrazí všechny aplikace na této ploše<br />
--separator--<br />
New Workspace - přidá pracovní plochu<br />
Edit Current workspace name - dovolí vám změnit popisek pracovní plochy na cokoliv budete chtít. Ten se ukáže na levé straně toolbaru.<br />
Remove Last - odstraní poslední pracovní plochu v seznamu a přesune všechny aplikace běžící na dané ploše na plochu předcházející<br />
<br />
== Pozadí ==<br />
Nastavení pozadí se provádí dalším softwarem. Lze nainstalovat např. následující balíčky:<br />
*eterm <br />
*feh (postrádající průhlednost menu).<br />
<br />
Existují další, ale tyto dva jsou doporučené. Další programy jsou uvedené v dokumentaci k fbsetbg v kapitole "Additional Links section"<br />
Pozadí se nastavuje příkazem:<br />
$ fbsetbg /path/to/background.image<br />
<br />
Můžete přidat nebo modifikovat tento řádek v souboru ~/.fluxbox/init:<br />
session.screen0.rootCommand: fbsetbg /path/to/wallpaper<br />
<br />
nebo jednoduše:<br />
session.screen0.rootCommand: fbsetbg -l<br />
<br />
====Další poznámky pro uživatele, kteří chtějí často měnit pozadí plochy====<br />
<br />
Přidejte do svého fluxbox menu toto submenu:<br />
[submenu] (Backgrounds)<br />
[wallpapers] (~/.fluxbox/backgrounds)<br />
[wallpapers] (/usr/share/fluxbox/backgrounds)<br />
[end]<br />
Přidejte svoje obrázky pozadí plochy do adresáře ~/.fluxbox/backgrounds nebo jiného specifikovaného, budou se nastavovat podobně, jako styly.<br />
<br />
=== Feh ===<br />
Instalace feh:<br />
# pacman -S feh<br />
Můžete si do souboru {{ic|~/.fluxbox/menu}} přidat submenu, které umožní měnit plochu za běhu:<br />
[submenu] (Wallpaper)<br />
[wallpapers] (/path/to/your/wallpapers) {feh --bg-scale}<br />
[end]<br />
<br />
Aby mohl být feh spuštěn při příštím startu fluxboxu, proveďte následující:<br />
<br />
'''1.''' Nastavte soubor {{ic|.fehbg}} jako spustitelný:<br />
$ chmod 770 ~/.fehbg<br />
<br />
'''2.''' Přidejte (nebo modifikujte) následující řádek do souboru {{ic|~/.fluxbox/init}}:<br />
session.screen0.rootCommand: ~/.fehbg<br />
<br />
'''3.''' nebo přidejte (či modifikujte) tento řádek v souboru {{ic|~/.fluxbox/startup}}:<br />
~/.fehbg<br />
<br />
== Témata ==<br />
Téma se instaluje rozbalením archivu s tématem do jednoho z adresářů:<br />
*globálně dostupné - /usr/share/fluxbox/styles<br />
*pouze pro daného uživatele - ~/.fluxbox/styles<br />
Odkazy na některé servery s tématy jsou uvedené níže.<br />
<br />
== Témata GTK2 ==<br />
''Viz: [[GTK+]]''<br />
<br />
== Spouštění aplikací při startu ==<br />
Uživatelé xinitrc by měli veškerý kód vložit do souboru {{ic|~/.xinitrc}}. Ovšem fluxbox nabízí vlastní možnost spouštění aplikací:<br />
<br />
soubor {{ic|~/.fluxbox/startup}} je skript, ve kterém je nastaveno, které programy fluxbox při startu spustí. Znak # označuje komentáře.<br />
<br />
Příklad:<br />
fbsetbg -l <nowiki>#</nowiki> nastavuje poslední pozadí plochy, velice praktické a doporučené.<br />
<nowiki>#</nowiki> Znak (&), uvedený u příkazů níže, je vyžadován pro spouštění programů, které se po spuštění okamžitě neukončí.<br />
<nowiki>#</nowiki> Pokud se vynechá, fluxbox se nespustí.<br />
idesk & <br />
xterm &<br />
<nowiki>#</nowiki> exec je pro samotné spuštění fluxboxu, nezadávejte za něj znak (&), nebo se fluxbox ihned ukončí<br />
exec /usr/bin/fluxbox<br />
<nowiki>#</nowiki> pokud chcete výpis do logu, odkomentujte spodní řádek a zakomentujte horní:<br />
<nowiki>#</nowiki> exec /usr/bin/fluxbox -log ~/.fluxbox/log<br />
<br />
== Nepoužití souboru xorg.conf ==<br />
Xorg již nepotřebuje konfigurační soubor xorg.conf. Tradičně se v něm mění nastavení klávesnice a úspora energie. Naštěstí existují elegantnější řešení bez použití souboru xorg.conf. <br />
<br />
=== Nastavení klávesnice ===<br />
Přidejte následující řádek do souboru {{ic|~/.fluxbox/startup}}:<br />
setxkbmap us -variant intl & # umožní použít us klávesnici se speciálními znaky (např. éóíáú)<br />
<br />
Místo 'us' můžete zadat svůj kód jazykové sady a odstranit parametr variant. Další možnosti viz man setxkbmap.<br />
<br />
Přepínač klávesnice lze do menu v souboru {{ic|~/.fluxbox/menu}} přidat takto:<br />
[submenu] (Keyboard)<br />
[exec] (normální) {setxkbmap us}<br />
[exec] (mezinárodní) {setxkbmap us -variant intl}<br />
[end]<br />
<br />
=== Vypnutí šetření energie ===<br />
Znáte situaci, kdy vám šetřič energie vypne monitor během sledování filmu? Gratulujeme, Xorg zrovna detekoval, že nic neděláte :). Toto lze softwarově vypnout, ovšem když budete potom chtít vypnout monitor, musíte to udělat ručně.<br />
<br />
Přidejte následující řádek na začátek souboru {{ic|~/.fluxbox/startup}}:<br />
xset s off -dpms &<br />
<br />
= Další zdroje =<br />
<br />
* [http://fluxbox.sourceforge.net/ Fluxbox Homepage]<br />
* [http://wiki.gentoo.org/wiki/Fluxbox Gentoo Wiki about Fluxbox]<br />
* [http://www.gentoo.org/doc/en/fluxbox-config.xml Gentoo Fluxbox Documentation]<br />
* [http://box-look.org/ Themes for Fluxbox]<br />
* [http://fluxbox-wiki.org/ Fluxbox Wiki]<br />
* [http://www.xs4all.nl/~hanb/software/fbsetbg/fbsetbg.html fbsetbg documentation]<br />
* [http://archux.com/page/application-recommendations Application recommendations]<br />
* [[Fluxbox_Style_Guide|Fluxbox Style Guide]]</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=Fluxbox_(%E6%AD%A3%E9%AB%94%E4%B8%AD%E6%96%87)&diff=301031Fluxbox (正體中文)2014-02-24T03:36:02Z<p>Mistofvongola: /* 額外資源 */</p>
<hr />
<div>[[Category:正體中文]]<br />
[[Category:Stacking WMs (正體中文)]]<br />
[[cs:Fluxbox]]<br />
[[de:Fluxbox]]<br />
[[en:Fluxbox]]<br />
[[es:Fluxbox]]<br />
[[fr:Fluxbox]]<br />
[[it:Fluxbox]]<br />
[[ko:Fluxbox]]<br />
[[pl:Fluxbox]]<br />
[[pt:Fluxbox]]<br />
[[ru:Fluxbox]]<br />
[[sr:Fluxbox]]<br />
= 安裝及執行 =<br />
<br />
== 安裝 ==<br />
<br />
在 extra 套件庫中可以找到fluxbox。<br />
<br />
# pacman -S fluxbox<br />
<br />
== 執行 ==<br />
<br />
=== 透過 startx ===<br />
編輯 {{ic|~/.xinitrc}} 加入<br />
exec startfluxbox <br />
或者<br />
exec fluxbox<br />
<br />
建議使用 <tt>startfluxbox</tt> ,因為這將會同時執行所有定義在 {{ic|~/.fluxbox/startup}} 當中的程式。<br />
<br />
{{Note | 在 {{ic|~/.xinitrc}} 當中只能有一行 <tt>exec</tt> 。}}<br />
<br />
如果無法順利啟動,透過設定 LC_ALL 為預設的 "C" ,也許能夠避免這個情形。 [https://bbs.archlinux.org/viewtopic.php?t=25797 1].<br />
<br />
=== 透過 KDM/GDM ===<br />
<br />
安裝 fluxbox之後,[[KDM]] 或 [[GDM]] 將會在 session 選單當中自動增加 fluxbox 的選項。在登入時選取 fluxbox就行了。<br />
<br />
= 設定 =<br />
<br />
== 選單管理 ==<br />
<br />
=== 透過 fluxbox-generate_menu ===<br />
<br />
使用 fluxbox 的指令:<br />
<br />
$ fluxbox-generate_menu<br />
<br />
這個指令將會根據所安裝的軟體來產生 {{ic|~/.fluxbox/menu/}}。在 Fluxbox 選單中的 Fluxbox menu / Tools / Regen Menu 也是執行相同的動作。<br />
<br />
=== 手動修改 ===<br />
<br />
編輯{{ic|~/.fluxbox/menu}}:<br />
<br />
$ nano ~/.fluxbox/menu<br />
<br />
根據以下的格式編寫:<br />
<br />
[exec] (name) {command}<br />
<br />
如果你想新增子選單:<br />
<br />
[submenu] (Name)<br />
...<br />
...<br />
[end]<br />
<br />
編輯完成之後儲存即可,修改選單並不需要重新啟動 fluxbox 。<br />
<br />
== 快捷鍵 ==<br />
透過編輯 {{ic|~/.fluxbox/keys}} 能夠改變以及增加快捷鍵的組合。<br />
<br />
*Control: Control<br />
*Mod1: Alt<br />
*Mod4: Meta (大多數是 windows 鍵)<br />
<br />
使用 CTRL,ALT以及上下箭頭調整音量的範例:<br />
Control Mod1 Up :Exec amixer sset Master,0 5%+ <br />
Control Mod1 Down :Exec amixer sset Master,0 5%-<br />
<br />
== 工作桌面 ==<br />
<br />
Fluxbox 預設提供四個工作桌面,可以透過底部左方的箭頭或是使用鍵盤組合 Ctrl+F1-F4來更換桌面。透過Fluxbox選單中的 Fluxbox Menu/ Workspace List 可以對工作桌面做設定。<br />
<br />
== 設定背景圖片 ==<br />
<br />
設定背景圖片需要透過額外的軟體來進行設定,使用下列指令來檢查是否已經有安裝這類型的軟體:<br />
<br />
$ fbsetbg -i<br />
<br />
如果回應的訊息不是 ''hsetroot is a nice wallpapersetter. You won't have any problems.''或類似的話,你需要安裝背景圖片的管理程式來設定背景圖片。你可以使用下列幾個軟體其中一個或是使用其他習慣的軟體。<br />
<br />
*hsetroot<br />
*eterm <br />
*feh (lacks menu transparency). <br />
<br />
有了必須的軟體之後,就能夠使用fbsetbg來設定背景圖片了<br />
<br />
$ fbsetbg /path/to/background.image<br />
$ fbsetbg -f /path/to/background.image #全螢幕<br />
$ fbsetbg -c /path/to/background.image #置中<br />
$ fbsetbg -t /path/to/background.image #磁磚填滿<br />
$ fbsetbg -r /path/to/ #從目錄中隨機選取<br />
<br />
更換佈景主題時,背景圖片會消失,使用下列指令能夠快速將背景圖片設定回復。<br />
<br />
$ fbsetbg -l<br />
<br />
== 佈景主題 ==<br />
將所下載的壓縮檔解壓縮到下列的兩個預設路徑之一,就完成安裝:<br />
*全域 - /usr/share/fluxbox/styles<br />
*特定使用者 - ~/.fluxbox/styles<br />
<br />
== 自動執行特定軟體 ==<br />
startx 的使用者應該將想執行的程式碼放入 {{ic|~/.xinitrc}} 當中。然而 fluxbox 額外提供了自身的啟動方式。<br />
<br />
在 fluxbox 啟動的時候會自動執行 {{ic|~/.fluxbox/startup}} 。需要依照軟體執行的類型來決定是否增加 & 符號。<br />
<br />
範例檔案 ( # 代表註解 ):<br />
fbsetbg -l # 設定背景圖片<br />
idesk & # 使用 & 符號使得執行不會馬上結束<br />
xterm & # 使用 & 符號使得執行不會馬上結束<br />
# exec /usr/bin/fluxbox -log ~/.fluxbox/log #fluxbox紀錄檔<br />
<br />
== 沒有 xorg.conf 之後 ==<br />
<br />
因為在多數的情形下,新版的 Xorg 不再需要 xorg.conf。以前在 xorg.conf 當中所做關於鍵盤以及省電模式的設定可以透過下列方式進行調整。<br />
<br />
=== 正確設定鍵盤排列 ===<br />
在 {{ic|~/.fluxbox/startup}} 當中加入以下指令藉以啟動特殊字元 (例如:éóíáú) 支援:<br />
<br />
setxkbmap us -variant intl &<br />
<br />
詳細語法,請閱讀 man setxkbmap。<br />
<br />
修改 {{ic|~/.fluxbox/menu}},在選單中加入鍵盤變更的選項:<br />
<br />
[submenu] (Keyboard)<br />
[exec] (normal) {setxkbmap us}<br />
[exec] (international) {setxkbmap us -variant intl}<br />
[end]<br />
<br />
=== 停用省電模式 ===<br />
<br />
直接將下列指令加入 {{ic|~/.fluxbox/startup}} 當中:<br />
<br />
xset s off -dpms &<br />
<br />
= 視窗標題亂碼 =<br />
<br />
修改佈景主題中的 {{ic|theme.cfg}}:<br />
<br />
menu.title.font: AR PL NewSung-9:bold #字型-大小:特效<br />
toolbar.workspace.font: AR PL NewSung-10:bold<br />
toolbar.iconbar.focused.font: AR PL NewSung-8:bold<br />
toolbar.iconbar.unfocused.font: AR PL NewSung-8<br />
window.font: AR PL NewSung-8<br />
<br />
<br />
= 額外資源 =<br />
<br />
* [http://fluxbox.sourceforge.net/ Fluxbox Homepage]<br />
* [http://wiki.gentoo.org/wiki/Fluxbox Gentoo Wiki about Fluxbox]<br />
* [http://www.gentoo.org/doc/en/fluxbox-config.xml Gentoo Fluxbox Documentation]<br />
* [http://box-look.org/ Themes for Fluxbox]<br />
* [http://fluxbox-wiki.org/ Fluxbox Wiki]<br />
* [http://www.xs4all.nl/~hanb/software/fbsetbg/fbsetbg.html fbsetbg documentation]<br />
* [http://archux.com/page/application-recommendations Application recommendations]<br />
* [https://wiki.archlinux.org/index.php/Fluxbox_Style_Guide Fluxbox Style Guide]</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=Fluxbox&diff=301028Fluxbox2014-02-24T03:20:35Z<p>Mistofvongola: /* See also */ Fix Gentoo Wiki link in references</p>
<hr />
<div>[[Category:Stacking WMs]]<br />
[[cs:Fluxbox]]<br />
[[de:Fluxbox]]<br />
[[es:Fluxbox]]<br />
[[fr:Fluxbox]]<br />
[[it:Fluxbox]]<br />
[[ko:Fluxbox]]<br />
[[pl:Fluxbox]]<br />
[[pt:Fluxbox]]<br />
[[ru:Fluxbox]]<br />
[[sr:Fluxbox]]<br />
[[zh-TW:Fluxbox]]<br />
Fluxbox is yet another window manager for X11. It is based on the (now abandoned) Blackbox 0.61.1 code, but with significant enhancements and continued development. Fluxbox is very light on resources and fast, yet provides interesting window management tools such as tabbing and grouping. Its configuration files are easy to understand and edit and there are hundreds of Fluxbox "styles" to make your desktop look great. Arch Linux with Fluxbox can turn an old Pentium 800 box with just 256MB of RAM into a very usable computer.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|fluxbox}} from the [[official repositories]].<br />
You must have [[Xorg]] as well.<br />
<br />
== Starting Fluxbox ==<br />
<br />
=== Method 1: KDM/GDM/LightDM login managers ===<br />
<br />
Users of [[KDM]], [[GDM]] or [[Lightdm]] should find a new Fluxbox entry added to their session menu automatically. Simply choose the Fluxbox option from the session menu when logging in.<br />
<br />
=== Method 2: ~/.xinitrc ===<br />
<br />
Edit {{ic|~/.xinitrc}} and add the following code:<br />
<br />
exec startfluxbox<br />
<br />
See [[xinitrc]] for details, such as preserving the logind session.<br />
<br />
== Configuration ==<br />
<br />
System-wide Fluxbox configuration files are in {{ic|/usr/share/fluxbox}} while user configuration files are in {{ic|~/.fluxbox}}. The user config files are:<br />
<br />
* ''init'' - the main Fluxbox resource configuration file. See [http://fluxbox-wiki.org/index.php?title=Editing_the_init_file Editing the init file]<br />
* ''menu'' - the Fluxbox menu config. See below and [http://fluxbox-wiki.org/index.php?title=Editing_the_menu Editing the menu file]<br />
* ''keys'' - the Fluxbox keyboard shortcuts (hotkeys) file. See below and [http://fluxbox-wiki.org/index.php?title=Keyboard_shortcuts here]<br />
* ''startup'' - where to launch startup apps but see below for .xinitrc and also [http://fluxbox-wiki.org/index.php?title=Editing_the_startup_file here]<br />
* ''overlay'' - a config file to override elements of styles. See [http://fluxbox-wiki.org/index.php?title=Style_overlay here].<br />
* ''apps'' - a config file for remembering the window configuration of specific apps. See [http://fluxbox-wiki.org/index.php?title=Editing_the_apps_file here]<br />
* ''windowmenu'' - a config file for altering the Window Menu itself: [http://fluxbox-wiki.org/index.php?title=Editing_the_windowmenu read this]<br />
<br />
There are a couple of other less important config files in the directory. But the main ones to be concerned with are init, menu, keys and perhaps startup.<br />
<br />
=== Menu management ===<br />
<br />
When you first install Fluxbox a very basic applications menu will be created at {{ic|~/.fluxbox/menu}}. You access the menu via a right mouse button click on the desktop. As with other lightweight window managers Fluxbox does not automatically update its menu when you install new applications. It is therefore recommended that you install most of the apps you want on your system first and then re-generate or edit the menu. To enhance the menu and add/edit items there are basically four ways to do it:<br />
<br />
==== fluxbox-generate_menu ====<br />
<br />
There is a built-in command provided with Fluxbox:<br />
$ fluxbox-generate_menu<br />
This command will auto-generate a {{ic|~/.fluxbox/menu}} file based on your installed programs. However, the menu it generates will not be as comprehensive as that generated by [[#MenuMaker|MenuMaker]].<br />
<br />
==== MenuMaker ====<br />
<br />
[http://menumaker.sourceforge.net MenuMaker] is a powerful tool that creates XML-based menus for a variety of Window Managers, including Fluxbox. MenuMaker will search your computer for executable programs and create a menu based on the results. It can be configured to exclude Legacy X, GNOME, KDE, or Xfce applications if desired.<br />
<br />
Install {{Pkg|menumaker}}, then you can generate a complete menu and overwrite the default one by running:<br />
$ mmaker -f FluxBox<br />
<br />
To see MenuMaker options:<br />
$ mmaker --help<br />
<br />
==== Arch Linux Xdg menu ====<br />
<br />
Requires [[XdgMenu]]. Install {{Pkg|archlinux-xdg-menu}}.<br />
<br />
Then, to create a Fluxbox menu:<br />
$ xdg_menu --fullmenu --format fluxbox --root-menu /etc/xdg/menus/arch-applications.menu > ~/.fluxbox/menu<br />
<br />
==== Manually create/edit the menu ====<br />
<br />
Use your favourite text editor and edit the file: {{ic|~/.fluxbox/menu}}.<br />
The basic syntax for a menu item to appear is:<br />
[exec] (name) {command} <path to icon><br />
<br />
...where "name" is the text you wish to appear for that menu item and "command" is the location of the binary, e.g.:<br />
[exec] (Firefox Browser) {/usr/bin/firefox} <path to firefox icon><br />
<br />
Note that the "<path to icon>" is optional. If you want to create a submenu the syntax is:<br />
[submenu] (Name)<br />
...<br />
...<br />
[end]<br />
When done editing save the file and exit. There is no need to restart Fluxbox. For more info read [http://fluxbox-wiki.org/index.php?title=Editing_the_menu editing the Fluxbox menu].<br />
<br />
=== Init ===<br />
<br />
The {{ic|~/.fluxbox/init}} file is Fluxbox's primary configuration resource file. You can change the basic functionality of Fluxbox, windows, toolbar, focus, etc. Some of these options are also available from the Fluxbox, Configuration Menu. For more detail read [http://fluxbox-wiki.org/index.php?title=Editing_the_init_file Editing the init file].<br />
<br />
=== Hotkeys ===<br />
<br />
Fluxbox offers basic hotkeys functionality. The Fluxbox hotkey file is located at {{ic|~/.fluxbox/keys}}.<br />
The Control key is represented by "Control". Mod1 corresponds to the Alt key and Mod4 corresponds to Meta (not a standard key but most users map Meta to the "Win" key). When installed and first run Fluxbox will provide you with a very usable, almost complete set of hotkeys. You should peruse and learn the {{ic|~/.fluxbox/keys}} file to enhance your Fluxbox experience.<br />
<br />
Example: here is a quick way to control the Master volume:<br />
Control Mod1 Up :Exec amixer set Master,0 5%+<br />
Control Mod1 Down :Exec amixer set Master,0 5%-<br />
<br />
=== Workspaces ===<br />
<br />
Fluxbox defaults to having four workspaces. These are accessible using Ctrl+F1-F4 shortcuts, or by using the left mouse button to click the arrows on the toolbar. You can also access workspaces via a middle mouse button click on desktop which pops up the Workspaces Menu.<br />
<br />
=== Tabbing and grouping ===<br />
<br />
With at least two windows visible on your desktop use ctrl +left click on the upper window tab of one window and drag it into the other open window. The two windows will now be grouped together with window tabs in the upper window tab bar. You may now perform a window operation that will affect the entire window "group". To reverse the tabbing use {{ic|Ctrl+left click}} on a tab and drag it to an empty space on the desktop.<br />
<br />
=== Wallpaper ===<br />
<br />
Setting the background in Fluxbox has historically been convoluted, especially where transparency was required. The Fluxbox wiki now has an entry for [http://fluxbox-wiki.org/index.php?title=Howto_set_the_background background setting], so please refer to that.<br />
<br />
The easiest way to do it with ArchLinux is to first of all check that you have a background setting application available:<br />
$ fbsetbg -i<br />
<br />
If not, install either feh, esetroot or wmsetbg using pacman. Then add this "fbsetbg" line to your {{ic|~/.xinitrc}} file, before the "exec" line, e.g.:<br />
fbsetbg /path/to/my/image.image<br />
<br />
==== Swapping multiple backgrounds easily ====<br />
<br />
Place the following submenu in your Fluxbox menu:<br />
[submenu] (Backgrounds)<br />
[wallpapers] (~/.fluxbox/backgrounds) {feh --bg-scale}<br />
[wallpapers] (/usr/share/fluxbox/backgrounds) {feh --bg-scale}<br />
[end]<br />
Then put your background images into {{ic|~/.fluxbox/backgrounds}} or any other folder you specify, they will then appear in the same fashion as your styles.<br />
<br />
The same applies to a dual screen wallpaper on a system without 'xinerama' (NVidia TwinView for example):<br />
[submenu] (Backgrounds)<br />
[wallpapers] (/path/to/your/backgrounds) {feh --bg-scale --no-xinerama }<br />
[end]<br />
<br />
==== Using feh with Fluxbox ====<br />
<br />
Install {{Pkg|feh}}.<br />
<br />
To make sure Fluxbox will load feh background next time start:<br />
<br />
'''1.''' Make {{ic|.fehbg}} executable:<br />
$ chmod 770 ~/.fehbg<br />
<br />
'''2.''' Then add (or modify) the following line to the file {{ic|~/.fluxbox/init}}:<br />
session.screen0.rootCommand: ~/.fehbg<br />
<br />
'''3.''' or add (or modify) the following line to the file {{ic|~/.fluxbox/startup}}:<br />
~/.fehbg<br />
<br />
=== Theming ===<br />
<br />
To install a Fluxbox theme extract the theme archive file to a styles directory. The default directories are:<br />
* Global - {{ic|/usr/share/fluxbox/styles}}<br />
* User only - {{ic|~/.fluxbox/styles}}<br />
<br />
The ArchLinux [[AUR]] currently contains a compilation of good looking Fluxbox themes called "fluxbox-styles". Get it [https://aur.archlinux.org/packages.php?ID=28743 here] and install this package for more themes than you could possibly use. When installed correctly they will appear in the Fluxbox, Styles section of your Fluxbox menu.<br />
<br />
To create your own Fluxbox styles read [[Fluxbox_Style_Guide]] and this [http://tenr.de/howto/style_fluxbox/style_fluxbox.html style guide].<br />
<br />
If you use mmaker -f FluxBox to create your menus, you will not see the styles menu selection after you install the styles. To correct this add the following to {{ic|~/.fluxbox/menu}} after the restart menu item:<br />
[submenu] (System Styles) {Choose a style...}<br />
[stylesdir] (/usr/share/fluxbox/styles)<br />
[end]<br />
[submenu] (User Styles) {Choose a style...}<br />
[stylesdir] (~/.fluxbox/styles)<br />
[end]<br />
<br />
=== The Slit ===<br />
<br />
Fluxbox, WindowMaker and a couple of other lightweight window managers have a "Slit". This is a dock for any application that can be 'dockable'. A docked application is anchored and appears on every workspace. It cannot be moved freely and is not influenced by any manipulation to windows. It is basically a small widget. Dock apps that are useful in such a situation tend to be clocks, system monitors, weather, etc. Visit [http://dockapps.windowmaker.org/ dockapps.windowmaker.org]<br />
<br />
=== Autostart programs ===<br />
<br />
Fluxbox provides functionality to autostart applications on its own. The {{ic|~/.fluxbox/startup}} file is a script for autostarting applications as well as starting Fluxbox itself. The {{ic|#}} symbol denotes a comment.<br />
<br />
A sample file:<br />
fbsetbg -l # sets the last background set, very useful and recommended.<br />
# In the below commands the ampersand symbol (&) is required on all applications that do not terminate immediately.<br />
# Failure to provide them will cause Fluxbox not to start.<br />
idesk &<br />
xterm &<br />
# exec is for starting Fluxbox itself, do not put an ampersand (&) after this or Fluxbox will exit immediately.<br />
exec /usr/bin/fluxbox<br />
# or if you want to keep a log, uncomment the below command and comment out the above command:<br />
# exec /usr/bin/fluxbox -log ~/.fluxbox/log<br />
<br />
=== Other menus ===<br />
<br />
In the "Menu Management" section (above) we were discussing the main "Applications" Menu, called the "Root" menu in Fluxbox lingo. Fluxbox also has other menus available to the user:<br />
<br />
* Workspaces Menu: middle click on desktop.<br />
* Configuration Menu: located within the "Fluxbox" section of the "Root" menu.<br />
* Window menu: right click on the titlebar of any window, or its bar if minimized. Can be edited. See fluxbox-menu man page.<br />
* Toolbar menu: right click on empty part of toolbar. Also found as a sub-menu within the Configuration Menu.<br />
* Slit Menu: found as a sub-menu within the configuration menu.<br />
<br />
=== True transparency ===<br />
<br />
To enable true transparency in Fluxbox you need an X compositor such as [[Xcompmgr]].<br />
<br />
=== Notifications ===<br />
<br />
To enable connection notifications on-screen for Fluxbox read [https://bbs.archlinux.org/viewtopic.php?id=138616 this Arch forum thread].<br />
<br />
=== After xorg.conf ===<br />
<br />
Xorg no longer requires an ''xorg.conf'' file. Traditionally this is where you would change your keyboard settings and powersave settings. Luckily there are elegant solutions not using ''xorg.conf''.<br />
<br />
==== Setting your keyboard right ====<br />
<br />
Just add the following line to {{ic|~/.fluxbox/startup}}:<br />
setxkbmap us -variant intl & # to have a us keyboard with special characters enabled (like éóíáú)<br />
<br />
Instead of 'us' you can also pass your language code and remove the variant option (ex.: 'us_intl', which works like the command above in some setups). See ''setxkbmap'' manual page for more options.<br />
<br />
To make a help function in your menu, just add in {{ic|~/.fluxbox/menu}}:<br />
[submenu] (Keyboard)<br />
[exec] (normal) {setxkbmap us}<br />
[exec] (international) {setxkbmap us -variant intl}<br />
[end]<br />
<br />
== See also ==<br />
<br />
* [http://fluxbox.org/ Fluxbox Homepage]<br />
* [http://fluxbox-wiki.org/ Fluxbox wiki]<br />
* [http://wiki.gentoo.org/wiki/Fluxbox Gentoo Wiki about Fluxbox]<br />
* [http://www.gentoo.org/doc/en/fluxbox-config.xml Gentoo Fluxbox documentation]<br />
* [http://box-look.org/ Themes for Fluxbox]<br />
* [[Fluxbox_Style_Guide|Fluxbox Style Guide]]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=77729 Narada's Fluxbox Guide]<br />
* The Fluxbox man pages: fluxbox, fluxbox-menu, fluxbox-style, fluxbox-keys, fluxbox-apps, fluxbox-remote, fbsetroot, fbsetbg, fbrun, startfluxbox.<br />
* [https://bbs.archlinux.org/viewtopic.php?id=90260 Arch Linux Fluxbox screenshots]</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=User:Mistofvongola&diff=301027User:Mistofvongola2014-02-24T02:56:52Z<p>Mistofvongola: </p>
<hr />
<div>* [[Special:Contributions/mistofvongola|Wiki Contributions]]<br />
* [http://davidpalma.me Blog]<br />
<br />
== Notes ==<br />
<br />
* '''[[:Template:hc|hc]]''' - <code><nowiki>{{hc|/boot/grub/menu.lst|<nowiki># (0) Arch Linux...</nowiki>}}</nowiki></code><br />
<div style="border-left:3em solid #FFF"><br />
{{hc|/boot/grub/menu.lst|<nowiki>kernel /vmlinuz26 root=/dev/disk/by-label/ROOT ro console=tty1 splash=silent,fadein,fadeout,theme:arch-black logo.nologo quiet<br />
initrd /kernel26.img</nowiki>}}</div><br />
<br />
* '''[[:Template:bc|bc]]''' - <code><nowiki>{{bc|&lt;nowiki>for _a in {A..Z}...&lt;/nowiki>|&lt;nowiki>BASH: /bin/bash...&lt;/nowiki>}}</nowiki></code><br />
<div style="border-left:3em solid #FFF"><br />
{{bc|<nowiki>for _a in {A..Z} {a..z};do _z=\${!${_a}*};for _i in `eval echo "${_z}"`;do echo -e "$_i: ${!_i}";done;done|cat -Tsv</nowiki>|2=<nowiki>BASH: /bin/bash<br />
BASH_COMMAND: echo -e "$_i: ${!_i}"</nowiki>}}</div><br />
<br />
* '''[[:Template:Note|Note]]''' - <code><nowiki>{{Note|Note should be noted.}}</nowiki></code><br />
<div style="border-left:3em solid #FFF"><br />
{{Note|Note should be noted.}}</div><br />
<br />
* '''[[:Template:Tip|Tip]]''' - <code><nowiki>{{Tip|Tip should be considered.}}</nowiki></code><br />
<div style="border-left:3em solid #FFF"><br />
{{Tip|Tip should be considered.}}</div><br />
<br />
* '''[[:Template:Warning|Warning]]''' - <code><nowiki>{{Warning|Warning should be heeded.}}</nowiki></code><br />
<div style="border-left:3em solid #FFF"><br />
{{Warning|Warning should be heeded.}}</div><br />
<br />
== About ==<br />
<br />
Linux sysadmin, hacker, anime nerd, and tea drinker. Formerly computational high energy physics (ATLAS/CERN). I hang out in #tor, #virt (OFTC) and #archlinux, #reddit-sysadmin (Freenode).<br />
<br />
* Linux/FOSS<br />
* Hacking/DIY<br />
* Physics<br />
* Cryptography</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=User:Mistofvongola&diff=301026User:Mistofvongola2014-02-24T02:55:03Z<p>Mistofvongola: Created page with "* Wiki Contributions * [http://davidpalma.me Blog] == Notes == * '''hc''' - <code><nowiki>{{hc|/boot/grub/menu.lst|<..."</p>
<hr />
<div>* [[Special:Contributions/mistofvongola|Wiki Contributions]]<br />
* [http://davidpalma.me Blog]<br />
<br />
== Notes ==<br />
<br />
* '''[[:Template:hc|hc]]''' - <code><nowiki>{{hc|/boot/grub/menu.lst|<nowiki># (0) Arch Linux...</nowiki>}}</nowiki></code><br />
<div style="border-left:3em solid #FFF"><br />
{{hc|/boot/grub/menu.lst|<nowiki>kernel /vmlinuz26 root=/dev/disk/by-label/ROOT ro console=tty1 splash=silent,fadein,fadeout,theme:arch-black logo.nologo quiet<br />
initrd /kernel26.img</nowiki>}}</div><br />
<br />
* '''[[:Template:bc|bc]]''' - <code><nowiki>{{bc|&lt;nowiki>for _a in {A..Z}...&lt;/nowiki>|&lt;nowiki>BASH: /bin/bash...&lt;/nowiki>}}</nowiki></code><br />
<div style="border-left:3em solid #FFF"><br />
{{bc|<nowiki>for _a in {A..Z} {a..z};do _z=\${!${_a}*};for _i in `eval echo "${_z}"`;do echo -e "$_i: ${!_i}";done;done|cat -Tsv</nowiki>|2=<nowiki>BASH: /bin/bash<br />
BASH_COMMAND: echo -e "$_i: ${!_i}"</nowiki>}}</div><br />
<br />
* '''[[:Template:Note|Note]]''' - <code><nowiki>{{Note|Note should be noted.}}</nowiki></code><br />
<div style="border-left:3em solid #FFF"><br />
{{Note|Note should be noted.}}</div><br />
<br />
* '''[[:Template:Tip|Tip]]''' - <code><nowiki>{{Tip|Tip should be considered.}}</nowiki></code><br />
<div style="border-left:3em solid #FFF"><br />
{{Tip|Tip should be considered.}}</div><br />
<br />
* '''[[:Template:Warning|Warning]]''' - <code><nowiki>{{Warning|Warning should be heeded.}}</nowiki></code><br />
<div style="border-left:3em solid #FFF"><br />
{{Warning|Warning should be heeded.}}</div><br />
<br />
== About ==<br />
<br />
Linux sysadmin, hacker, anime nerd, and tea drinker. Formerly computational high energy physics (ATLAS/CERN).<br />
<br />
* Linux/FOSS<br />
* Hacking/DIY<br />
* Physics<br />
* Cryptography</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=Input_Leap&diff=301025Input Leap2014-02-24T02:41:17Z<p>Mistofvongola: /* Clients configuration */ Update the client autostart section. Replace the rc.d script with a systemd compatible one.</p>
<hr />
<div>[[Category:Input devices]]<br />
[[fr:Synergy]]<br />
[[it:Synergy]]<br />
[http://synergy-foss.org/ Synergy] lets you easily share a single mouse and keyboard between multiple computers (even with different operating systems) without the need for special hardware. It is intended for users with multiple computers on their desk since each system uses its own monitor(s).<br />
<br />
Redirecting the mouse and keyboard is as simple as moving the mouse off the edge of your screen. Synergy also merges the clipboards of all the systems into one, allowing cut-and-paste between systems. Furthermore, it synchronizes screen savers so they all start and stop together and, if screen locking is enabled, only one screen requires a password to unlock them all. <br />
<br />
==Installation==<br />
<br />
===Arch Linux===<br />
You can [[pacman|install]] the {{pkg|synergy}} package from the [[Official Repositories|official repositories]].<br />
<br />
===Windows and Mac OS X===<br />
Download and run [http://synergy-foss.org/download the newest installer] from the official website.<br />
<br />
{{Tip|You can also try the BETA versions of Synergy.}}<br />
<br />
*Read [http://synergy-foss.org/pm/projects/synergy/wiki/Compiling the official compiling help].<br />
<br />
==Pre-configuration==<br />
First determine the IP addresses and [[Configuring_Network#Set_the_host_name|host names]] for each machine and make sure each has a correct hosts file.<br />
<br />
* Arch Linux - {{ic|/etc/hosts}}<br />
* Windows - {{ic|C:\WINDOWS\system32\drivers\etc\hosts}}<br />
* Mac OS X - [http://support.apple.com/kb/TA27291?viewlocale=en_US How to Add Hosts to Local Hosts File].<br />
<br />
{{hc|/etc/hosts|<br />
10.10.66.1 archserver.localdomain archserver<br />
10.10.66.100 archleft.localdomain archleft<br />
10.10.66.105 archright.localdomain archright}}<br />
<br />
{{Note|Check that the clients can reach the server.}}<br />
<br />
==Server configuration==<br />
In synergy, the computer with keyboard and mouse you want to share is called server.<br />
See [http://synergy2.sourceforge.net/configuration.html Synergy Configuration File Format] for a detailed description of all available sections and options.<br />
<br />
===Arch Linux===<br />
<br />
The configuration file for Arch Linux is {{ic|/etc/synergy.conf}}. If it does not exist, create it using {{ic|/etc/synergy.conf.example}}, whose comments should give you enough information for a basic configuration; if you need further reference, read the guide mentioned above.<br />
{{Tip|1=You may also use either {{Pkg|qsynergy}} from the [[official repositories]] or {{AUR|quicksynergy}} from the [[AUR]] which provide a GUI to simplify the configuration process.}}<br />
{{Tip|1=Need to open tcp port 24800}}<br />
<br />
If you experience problems and you wish to run the server in the foreground, you can run the following command instead:<br />
# synergys -f<br />
<br />
The synergy server process needs to attach to your user's X session, which means it needs to run as your user otherwise you will see errors like this in your logs:<br />
<br />
Synergy 1.4.12: 2013-06-18T18:45:45 DEBUG: XOpenDisplay(":0.0")<br />
Synergy 1.4.12: 2013-06-18T18:45:45 WARNING: primary screen unavailable: unable to open screen<br />
Synergy 1.4.12: 2013-06-18T18:45:45 DEBUG: retry in 60 seconds<br />
<br />
To get around this, you can create a custom systemd service file to start the daemon as your user. Create the file '''/etc/systemd/system/synergys@.service'''<br />
<br />
[Unit]<br />
Description=Synergy Server Daemon<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
ExecStart=/usr/bin/synergys --config /etc/synergy.conf<br />
User=%i<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
Then enable it as the appropriate user (replacing 'mary' with your username):<br />
<br />
# systemctl enable synergys@mary<br />
# systemctl start synergys@mary<br />
<br />
===Windows===<br />
<br />
# Open the Synergy program<br />
# Select the option ''Server (share this computer's mouse and keyboard)''<br />
# Select ''Configure interactively''<br />
# Click the ''Configure Server...'' button<br />
# This opens a window in which you can add screens depending on how many computers/screens you have: just drag the screen icon in the top-right corner to the screens area, and double-click it to edit its settings<br />
# Click ''OK'' to close the screens window when you are ready, then click on ''Start'' to start the server<br />
<br />
On Windows, configuration is saved by default in a {{ic|synergy.sgc}} file, but its name and location can of course be changed at pleasure.<br />
<br />
If you want to start the Synergy server everytime Windows starts, you have to launch the program '''as administrator''', then go to ''Edit -> Services'' and select ''Install'' in the ''Server'' section; note that at the following reboot Synergy will indeed automatically start, but the tray icon will not display automatically (at least for version 1.4.2 beta on Windows 7). To uninstall the service, do the same thing but obviously select ''Uninstall''.<br />
<br />
If you want to start the server from the command-line, here is a Windows command you can place in a {{ic|.bat}} file or just run from {{ic|cmd.exe}}:<br />
<br />
{{bc|C:\Program Files\Synergy+\bin\synergys.exe -f --debug ERROR --name left --log c:\windows\synergy.log -c C:/windows/synergy.sgc --address 10.66.66.2:24800}}<br />
<br />
===Mac OS X===<br />
<br />
Mac OS X has a similar configuration as Unix: check [http://synergy-foss.org/docs the official documentation] for more information.<br />
<br />
===Configuration examples===<br />
<br />
This is an example for a basic 3-computers setup:<br />
<br />
{{hc|/etc/synergy.conf|<nowiki><br />
section: screens<br />
server-fire:<br />
archright-fire:<br />
archleft-fire:<br />
end<br />
<br />
section: links<br />
archleft-fire:<br />
right = server-fire<br />
server-fire:<br />
right = archright-fire<br />
left = archleft-fire<br />
archright-fire:<br />
left = server-fire<br />
end<br />
</nowiki>}}<br />
<br />
This should be the example bundled with the Arch Linux package:<br />
<br />
{{hc|/etc/synergy.conf|2=<br />
section: screens<br />
# three hosts named: moe, larry, and curly<br />
moe:<br />
larry:<br />
curly:<br />
end<br />
<br />
section: links<br />
# larry is to the right of moe and curly is above moe<br />
moe:<br />
right = larry<br />
up = curly<br />
<br />
# moe is to the left of larry and curly is above larry.<br />
# note that curly is above both moe and larry and moe<br />
# and larry have a symmetric connection (they're in<br />
# opposite directions of each other).<br />
larry:<br />
left = moe<br />
up = curly<br />
<br />
# larry is below curly. if you move up from moe and then<br />
# down, you'll end up on larry.<br />
curly:<br />
down = larry<br />
end<br />
<br />
section: aliases<br />
# curly is also known as shemp<br />
curly:<br />
shemp<br />
end<br />
<br />
}}<br />
<br />
The following is a more customized example:<br />
<br />
{{hc|synergy.sgc|2=<br />
section: screens<br />
leftpc:<br />
halfDuplexCapsLock = false<br />
halfDuplexNumLock = false<br />
halfDuplexScrollLock = false<br />
xtestIsXineramaUnaware = false<br />
switchCorners = none +top-left +top-right +bottom-left +bottom-right <br />
switchCornerSize = 0<br />
rightpc:<br />
halfDuplexCapsLock = false<br />
halfDuplexNumLock = false<br />
halfDuplexScrollLock = false<br />
xtestIsXineramaUnaware = false<br />
switchCorners = none +top-left +top-right +bottom-left +bottom-right <br />
switchCornerSize = 0<br />
end<br />
<br />
section: aliases<br />
leftpc:<br />
10.66.66.2<br />
rightpc:<br />
10.66.66.1<br />
end<br />
<br />
section: links<br />
leftpc:<br />
right = rightpc<br />
rightpc:<br />
left = leftpc<br />
end<br />
<br />
section: options<br />
heartbeat = 1000<br />
relativeMouseMoves = false<br />
screenSaverSync = false<br />
win32KeepForeground = false<br />
switchCorners = none +top-left +top-right +bottom-left +bottom-right <br />
switchCornerSize = 4<br />
end<br />
}}<br />
<br />
==Clients configuration==<br />
<br />
{{Note|This assumes a server has been set up and configured '''properly'''. Make sure the server is already configured to accept the client(s) before continuing.}}<br />
<br />
===Arch Linux===<br />
In a console window, type:<br />
$ synergyc server-host-name<br />
<br />
Or, to run synergy in the foreground:<br />
$ synergyc -f server-host-name<br />
<br />
Here, {{ic|server-host-name}} is the host name of the server.<br />
<br />
====Use Encryption====<br />
To use the encryption feature type:<br />
$ synergyc --crypto-pass <pass> <server-host-name><br />
<pass> is not the choosen passphrase of the server!<br />
It can be found in the servers log in DEBUG2 mode.<br />
<br />
====Autostart====<br />
<br />
There exist several ways to automatically start the Synergy client, and they are actually the same that can be used for every other application.<br />
<br />
{{Note|In all of the following examples, you always have to substitute {{ic|server-host-name}} with the real server host name.}}<br />
<br />
* You can add the next line to your [[xinitrc|{{ic|~/.xinitrc}}]]:<br />
<br />
{{hc|~/.xinitrc|<br />
...<br />
<br />
#replace server-host-name with the real name<br />
synergyc server-host-name<br />
}}<br />
<br />
The following is an alternative:<br />
<br />
{{hc|~/.xinitrc|<br />
<nowiki>XINIT_CMD='/usr/bin/synergyc -d FATAL -n galileo-fire 10.66.66.2:24800'<br />
/usr/bin/pgrep -lxf "$XINIT_CMD" || ( ( $XINIT_CMD ) & )</nowiki><br />
}}<br />
<br />
* Otherwise, if you are using a [[Display Manager|display manager]] (kdm, gdm, [[SLiM]], ...), or a stand-alone [[Window Manager|window manager]] (Openbox, ...), you could exploit its start-up script and add the following:<br />
synergyc server-host-name<br />
<br />
For example, using ''kdm'' you should edit {{ic|/usr/share/config/kdm/Xsetup}}.<br />
<br />
* To start the Synergy client with systemd, create a service file, '''/etc/systemd/system/synergyc@.service''' and optionally a config file, '''/etc/conf.d/synergyc.conf'''<br />
<br />
{{hc| /etc/systemd/system/synergyc@.service|2=<br />
[Unit]<br />
Description=Synergy Client Daemon<br />
After=network.target<br />
<br />
[Service]<br />
EnvironmentFile=/etc/conf.d/synergyc.conf<br />
ExecStart=/usr/bin/synergyc --no-daemon --debug ${DEBUGLEVEL:-INFO} ${SERVERALIAS}<br />
User=%i<br />
<br />
[Install]<br />
WantedBy=multi-user.target}}<br />
<br />
{{hc|/etc/conf.d/synergyc.conf|2=<br />
DEBUGLEVEL=WARNING<br />
SERVERALIAS=server-name}}<br />
<br />
To start the service for your user,<br />
<br />
# systemctl start synergyc@mary<br />
<br />
Automatically starting Synergy is also documented in its [http://synergy2.sourceforge.net/autostart.html official reference page].<br />
<br />
===Windows===<br />
<br />
After installation, open the Synergy program, select the option ''Client (use another computer's keyboard and mouse)'' and type the host name of the server computer in the text box, then click ''Start'' to start the client.<br />
{{Note|You can use the tray icon to stop the client.}}<br />
<br />
If you want to start the Synergy client every time Windows starts, you have to launch the program '''as an administrator''', then go to ''Edit -> Services'' and select ''Install'' in the ''Client'' section.<br />
<br />
If you want to start the client from the command-line, here is a Windows command you can place in a {{ic|.bat}} file or just run from {{ic|cmd.exe}}. This points to a configuration file in {{ic|C:\synergy.sgc}} and runs in the background like a service.<br />
<br />
{{bc|<nowiki>START /MIN /D"C:\Program Files\Synergy+\bin" synergys.exe -d ERROR -n m6300 -c C:\synergy.sgc -a 10.66.66.2:24800</nowiki>}}<br />
<br />
===Mac OS X===<br />
<br />
Locate the synergyc program in the synergyc folder and drag it onto the terminal window: the full path will appear in the terminal.<br />
Now append the host name of the server, so that the complete command will look like this:<br />
<br />
{{bc|/path/to/synergyc/synergyc server-host-name}}<br />
<br />
Then press {{ic|Enter}}.<br />
<br />
==Known Issues==<br />
If Arch is being used as a client in a Synergy installation, the server may not be able to wake the client monitor. There are some workarounds, such as executing the following via [[Secure Shell|SSH]], if ACPI is enabled (see: [[Display_Power_Management_Signaling#Modifing_DPMS_and_screensaver_settings_using_xset|Modifying DPMS and ScreenSaver settings with xset]]):<br />
{{bc|# xset dpms force on}}<br />
<br />
==Troubleshooting==<br />
The official documentation has a [http://synergy-foss.org/pm/projects/synergy/wiki/UserFAQ FAQ] and also a [http://synergy2.sourceforge.net/trouble.html troubleshooting page].<br />
<br />
===Keyboard repeat===<br />
If you experience problems with your keyboard repeat on the client machine (Linux host), simply type:<br />
{{bc|# /usr/bin/xset r on}}<br />
in any console.<br />
<br />
===Keyboard mapping===<br />
If you experience problems with the keyboard mapping when using the server's keyboard in a client window (e.g a terminal) then re-setting the X key map after starting synergyc may help. The following command sets the keymap to its current value:<br />
<br />
# setxkbmap $(setxkbmap -query | grep "^layout:" | awk -F ": *" '{print $2}')<br />
<br />
===messages.log being spammed with by synergyc===<br />
If you run ''synergyc'' as described above then your {{ic|/var/log/messages.log}} file will get spammed with messages like these:<br />
<br />
May 26 22:30:46 localhost Synergy 1.4.6: 2012-05-26T22:30:46 INFO: entering screen<br />
/build/src/synergy-1.4.6-Source/src/lib/synergy/CScreen.cpp,103<br />
May 26 22:30:47 localhost Synergy 1.4.6: 2012-05-26T22:30:47 INFO: leaving screen<br />
/build/src/synergy-1.4.6-Source/src/lib/synergy/CScreen.cpp,121<br />
<br />
To prevent this run ''synergyc'' with the {{ic|-d WARNING}} option. This ''debug level'' option tells synergy to only log messages if they are level ''WARNING'' or above.<br />
<br />
synergyc -d WARNING server-host-name<br />
<br />
You can also edit the line that calls ''synergyc'' if you use a {{ic|/etc/rc.d/synergyc}} file.<br />
<br />
[ -z "$PID" ] && /usr/bin/synergyc -d WARNING "$SERVERALIAS"<br />
<br />
==External Links==<br />
* Synergy website: http://synergy-foss.org<br />
* Official documentation: http://synergy-foss.org/docs<br />
* Gentoo Wiki Synergy Setup: http://en.gentoo-wiki.com/wiki/Synergy</div>Mistofvongolahttps://wiki.archlinux.org/index.php?title=Linux_conferences&diff=301023Linux conferences2014-02-24T01:59:10Z<p>Mistofvongola: /* SCaLE */ Fix conference URL. Old url redirects to http.com...</p>
<hr />
<div>[[Category:Events]]<br />
The idea behind this page is to make a list of big Linux conferences at which we'd like to have Arch Linux represented. The idea is that we can all contribute to it and coordinate on the dates, details, and who's going.<br />
<br />
== FOSDEM ==<br />
<br />
{|cellspacing="3"<br />
!align="left"|Quote:<br />
| FOSDEM meetings are recognized as "The best Free Software and Open Source events in Europe"<br />
|-<br />
!align="left"|Site:<br />
| http://www.fosdem.org/<br />
|-<br />
!align="left"|Wikipedia:<br />
| http://en.wikipedia.org/wiki/FOSDEM<br />
|-<br />
!align="left"|Where:<br />
| Brussels, Belgium<br />
|-<br />
!align="left"|When:<br />
| February, 23th-24th (in 2008)<br />
|-<br />
!align="left"|Since:<br />
| 2001<br />
|-<br />
!align="left"|Arch presence:<br />
| no booths, but in 2k10 JGC,Thomas,Roman and Dieter were there. In 2k11 Dieter was there (both times in Arch clothing)<br />
|}<br />
<br />
== FrOSCon ==<br />
<br />
{|cellspacing="3"<br />
!align="left"|Site:<br />
| http://www.froscon.org/<br />
|-<br />
!align="left"|Where:<br />
| Sankt Augustin, Germany<br />
|-<br />
!align="left"|When:<br />
| August, 23th-24th (2008); August, 25th-26th (2007); June, 24th-25th (2006)<br />
|-<br />
!align="left"|Since:<br />
| 2006<br />
|-<br />
!align="left"|Arch presence:<br />
| 2007, 2008, 2009<br />
|}<br />
<br />
== Linux Bier Wanderung ==<br />
<br />
{|cellspacing="3"<br />
!align="left"|Site:<br />
| http://www.linuxbierwanderung.com/<br />http://lbw2008.palfreman.com/<br />http://compsoc.dur.ac.uk/mediawiki/index.php/Mini_LBW_2008<br />
|-<br />
!align="left"|Wikipedia:<br />
| http://en.wikipedia.org/wiki/Linux_Bier_Wanderung<br />
|-<br />
!align="left"|Where:<br />
| different European country each summer,<br />in 2008 - Samnaun-Compatsch, Switzerland,<br />Durham, UK (mini-LBW)<br />
|-<br />
!align="left"|When:<br />
| August, 9th-17th (2008)<br />September, 26th-28th (2008, mini-LBW)<br />
|-<br />
!align="left"|Since:<br />
| 1999<br />
|-<br />
!align="left"|Arch presence:<br />
| not yet :(<br />
|}<br />
<br />
== Linux-Kongress ==<br />
<br />
{|cellspacing="3"<br />
!align="left"|Quote:<br />
| Linux-Kongress is by far one of the most traditional Linux conferences with a focus on development and cutting edge topics<br />
|-<br />
!align="left"|Site:<br />
| http://www.linux-kongress.org/<br />
|-<br />
!align="left"|Wikipedia:<br />
| http://en.wikipedia.org/wiki/Linux_Kongress<br />
|-<br />
!align="left"|Where:<br />
| Hamburg, Germany<br />
|-<br />
!align="left"|When:<br />
| October, 7th-10th (2008)<br />
|-<br />
!align="left"|Since:<br />
| 1997<br />
|-<br />
!align="left"|Arch presence:<br />
| not yet :(<br />
|}<br />
<br />
== LinuxTag ==<br />
<br />
{|cellspacing="3"<br />
!align="left"|Quote:<br />
| Europe's leading exhibition on Linux and Open Source<br />
|-<br />
!align="left"|Site:<br />
| http://www.linuxtag.org/<br />
|-<br />
!align="left"|Wikipedia:<br />
| http://en.wikipedia.org/wiki/LinuxTag<br />
|-<br />
!align="left"|Where:<br />
| Berlin, Germany (since 2007)<br />
|-<br />
!align="left"|When:<br />
| May, 28th-31th (2008)<br />
|-<br />
!align="left"|Since:<br />
| 1996<br />
|-<br />
!align="left"|Arch presence:<br />
| 2007<br />
|}<br />
<br />
== SCaLE ==<br />
<br />
{|cellspacing="3"<br />
!align="left"|Site:<br />
| http://www.socallinuxexpo.org/scale10x/<br />
|-<br />
!align="left"|Where:<br />
| Hilton LAX, Los Angeles, USA<br />
|-<br />
!align="left"|When:<br />
| January 20-22, 2012<br />
|-<br />
!align="left"|Since:<br />
| 2002<br />
|-<br />
!align="left"|Arch user presence:<br />
| Arch Linux Distribution Users, contact Systemservers re booth participation<br />
|}<br />
<br />
==Linux World Expo 2006<br />==<br />
Boston, MA<br /><br />
April 3-5, 2006<br /><br />
[http://www.linuxworldexpo.com/]<br />
<br />
== More ==<br />
*[[Wikipedia:Linux conference]]<br />
<br />
==Notes about conference preparation==<br />
A few notes about conference preparation:<br />
* Make banners. Most likely the information will have changed enough from the last conference to not be able to use the old ones. Banners add a nice look to the drab, boring, grey walls.<br />
* Book hotels '''early'''. If I'm not making myself clear enough, it needs to be as '''early as possible'''. Otherwise you may end up sleeping in a field...<br />
* Try to have at least 2 shifts of people. A booth our size (about 12 square meters) only needed about 4 people at a time. By breaking into two shifts, the booth will be cleaner, have more room in it, and people won't want to all go to lunch at the same time (half went to lunch before they came, the other half go to lunch when they leave).<br />
* Always make sure there's someone in the booth from opening to the end. This means that some people can't party with everyone else the night before. If you rotate the previously mentioned shifts, everyone will have a chance to party with everyone else.<br />
* Have display machines. Nothing is worse than trying to explain how something works to a visitor and not being able to show them.<br />
* Try to have some cool videos running on the display machines. Then they're much less boring when people walk by.<br />
* If you plan on just laying CDs out on the table for anyone to grab, expect to give away a lot of CDs. We ended up having people take about 50 CDs a day, sometimes 2 or 3 at a time. If you plan on giving out CDs like this, look into getting a large bunch pressed: giving away burned CDs marked with a CD pen doesn't exactly look good.<br />
* If you plan on giving away flyers, have them printed before. Also, proof read them to make sure there aren't any silly spelling mistakes. You'll end up giving away more flyers than CDs.<br />
* Don't expect to get a lot of work done while you're in the booth. It's not exactly professional to sit there and force people to approach you because you're deep in some code somewhere.<br />
* Have a donation box. You will get donations.</div>Mistofvongola