<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.lunasys.fr/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Eadam</id>
	<title>LunaSys - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.lunasys.fr/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Eadam"/>
	<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/Special:Contributions/Eadam"/>
	<updated>2026-05-13T20:16:00Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.0</generator>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=System/ArchLinux&amp;diff=322</id>
		<title>System/ArchLinux</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=System/ArchLinux&amp;diff=322"/>
		<updated>2026-02-16T20:08:45Z</updated>

		<summary type="html">&lt;p&gt;Eadam: Created page with &amp;quot; == Troubleshooting ==  === Invalid signature causing update to fail ===  E.g.:   (254/254) checking package integrity  [######################################################...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Invalid signature causing update to fail ===&lt;br /&gt;
&lt;br /&gt;
E.g.:&lt;br /&gt;
&lt;br /&gt;
 (254/254) checking package integrity&lt;br /&gt;
 [####################################################################] 100%&lt;br /&gt;
 error: highway: signature from &amp;quot;Daniel Bermond &amp;lt;dbermond@archlinux.org&amp;gt;&amp;quot; is marginal trust&lt;br /&gt;
 :: File /var/cache/pacman/pkg/highway-1.3.0-2-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).&lt;br /&gt;
 Do you want to delete it? [Y/n] &lt;br /&gt;
&lt;br /&gt;
If `pacman-key --refresh-keys` does not fix the issue, this should be resolved by recreating the entire keyring folder:&lt;br /&gt;
&lt;br /&gt;
 sudo mv /etc/pacman.d/gnupg /root/backup_dir_gnupg&lt;br /&gt;
 sudo pacman-key --init&lt;br /&gt;
 sudo pacman-key --populate archlinux manjaro&lt;br /&gt;
 sudo pacman -Syu&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=Main_Page&amp;diff=321</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=Main_Page&amp;diff=321"/>
		<updated>2026-02-16T20:06:35Z</updated>

		<summary type="html">&lt;p&gt;Eadam: /* System */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Retro ==&lt;br /&gt;
&lt;br /&gt;
* [[Retro/FlashFloppy]]&lt;br /&gt;
&lt;br /&gt;
== System ==&lt;br /&gt;
&lt;br /&gt;
* [[HowTos]]&lt;br /&gt;
* [[System/Apache]]&lt;br /&gt;
* [[System/MySQL]]&lt;br /&gt;
* [[System/PostgreSQL]]&lt;br /&gt;
* [[System/RAID]]&lt;br /&gt;
* [[System/LVM]]&lt;br /&gt;
* [[System/FS/Parted]]&lt;br /&gt;
* [[System/DayToDay]]&lt;br /&gt;
* [[System/OneLiner]]&lt;br /&gt;
* [[System/Backup]]&lt;br /&gt;
* [[System/Performance]]&lt;br /&gt;
* [[System/ArchLinux]]&lt;br /&gt;
&lt;br /&gt;
== Network/Hosting ==&lt;br /&gt;
&lt;br /&gt;
* [[Network/Tools]]&lt;br /&gt;
* [[Network/IPv6]]&lt;br /&gt;
* [[Network/SSH]]&lt;br /&gt;
* [[Network/VPN]]&lt;br /&gt;
* [[Network/Security]]&lt;br /&gt;
* [[Network/Nat]]&lt;br /&gt;
* [[Network/Bridge]]&lt;br /&gt;
* [[Network/iscsi]]&lt;br /&gt;
* [[Network/DNS]]&lt;br /&gt;
* [[Hosting/DNSProviders]]&lt;br /&gt;
&lt;br /&gt;
== Coding ==&lt;br /&gt;
&lt;br /&gt;
* [[Code/Python]]&lt;br /&gt;
* [[Code/PHP/TrojanRemoval]]&lt;br /&gt;
* [[Code/Git]]&lt;br /&gt;
&lt;br /&gt;
== /dev/random ==&lt;br /&gt;
&lt;br /&gt;
* [[DevOps]]&lt;br /&gt;
* [[Divers/Video/Recording]]&lt;br /&gt;
* [[Desktop/i18n]]&lt;br /&gt;
* [[Desktop/i3]]&lt;br /&gt;
* [[Lyrics]]&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Stuff ==&lt;br /&gt;
* [//meta.wikimedia.org/wiki/Help:Contents User's Guide]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/MotionAndRTSP&amp;diff=320</id>
		<title>HowTo/MotionAndRTSP</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/MotionAndRTSP&amp;diff=320"/>
		<updated>2025-05-10T16:03:25Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Download mediammtx here: https://github.com/bluenviron/mediamtx/releases&lt;br /&gt;
&lt;br /&gt;
Configure it:&lt;br /&gt;
&lt;br /&gt;
'''mediamtx.yml'''&lt;br /&gt;
&lt;br /&gt;
 paths:&lt;br /&gt;
   cam:&lt;br /&gt;
     runOnInit: ffmpeg -f v4l2 -i /dev/video0 -c:v libx264 -pix_fmt yuv420p -preset ultrafast -b:v 600k -f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH&lt;br /&gt;
     runOnInitRestart: yes&lt;br /&gt;
&lt;br /&gt;
Install motion (pacman -S motion / apt install motion)&lt;br /&gt;
&lt;br /&gt;
Configure netcam_url param:&lt;br /&gt;
&lt;br /&gt;
'''motion.conf'''&lt;br /&gt;
&lt;br /&gt;
 netcam_url rtsp://192.168.1.25:8554/cam&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/MotionAndRTSP&amp;diff=319</id>
		<title>HowTo/MotionAndRTSP</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/MotionAndRTSP&amp;diff=319"/>
		<updated>2025-05-10T16:02:15Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''mediamtx.yml'''&lt;br /&gt;
&lt;br /&gt;
 paths:&lt;br /&gt;
   cam:&lt;br /&gt;
     runOnInit: ffmpeg -f v4l2 -i /dev/video0 -c:v libx264 -pix_fmt yuv420p -preset ultrafast -b:v 600k -f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH&lt;br /&gt;
     runOnInitRestart: yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''motion.conf'''&lt;br /&gt;
&lt;br /&gt;
 netcam_url rtsp://192.168.1.25:8554/cam&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/MotionAndRTSP&amp;diff=318</id>
		<title>HowTo/MotionAndRTSP</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/MotionAndRTSP&amp;diff=318"/>
		<updated>2025-05-10T16:01:27Z</updated>

		<summary type="html">&lt;p&gt;Eadam: Created page with &amp;quot;`mediamtx.yml`  ``` paths:   cam:     runOnInit: ffmpeg -f v4l2 -i /dev/video0 -c:v libx264 -pix_fmt yuv420p -preset ultrafast -b:v 600k -f rtsp rtsp://localhost:$RTSP_PORT/$M...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;`mediamtx.yml`&lt;br /&gt;
&lt;br /&gt;
```&lt;br /&gt;
paths:&lt;br /&gt;
  cam:&lt;br /&gt;
    runOnInit: ffmpeg -f v4l2 -i /dev/video0 -c:v libx264 -pix_fmt yuv420p -preset ultrafast -b:v 600k -f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH&lt;br /&gt;
    runOnInitRestart: yes&lt;br /&gt;
&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
`motion.conf`&lt;br /&gt;
&lt;br /&gt;
```&lt;br /&gt;
netcam_url rtsp://192.168.1.25:8554/cam&lt;br /&gt;
```&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=Retro/FlashFloppy&amp;diff=317</id>
		<title>Retro/FlashFloppy</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=Retro/FlashFloppy&amp;diff=317"/>
		<updated>2024-04-19T17:16:23Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page explains how to flash and mod a gotek with [https://github.com/keirf/flashfloppy flashfloppy] under linux&lt;br /&gt;
&lt;br /&gt;
== Flash ==&lt;br /&gt;
&lt;br /&gt;
This is only for an &amp;quot;artery&amp;quot; chip gotek&lt;br /&gt;
&lt;br /&gt;
Jump &amp;quot;boot&amp;quot; wires as in the picture below:&lt;br /&gt;
&lt;br /&gt;
[[File:Usb-programming.png]]&lt;br /&gt;
&lt;br /&gt;
Then under linux run:&lt;br /&gt;
&lt;br /&gt;
 dfu-util -D /path/to/flashfloppy/releases/flashfloppy-3.42/dfu/flashfloppy-at415-st105-3.42.dfu -a 0 -s 0x08000000:unprotect:force&lt;br /&gt;
&lt;br /&gt;
And once again:&lt;br /&gt;
&lt;br /&gt;
 dfu-util -D /path/toflashfloppy/releases/flashfloppy-3.42/dfu/flashfloppy-at415-st105-3.42.dfu -a 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/keirf/FlashFloppy/wiki/Firmware-Programming&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=File:Usb-programming.png&amp;diff=316</id>
		<title>File:Usb-programming.png</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=File:Usb-programming.png&amp;diff=316"/>
		<updated>2024-04-19T17:15:59Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=Retro/FlashFloppy&amp;diff=315</id>
		<title>Retro/FlashFloppy</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=Retro/FlashFloppy&amp;diff=315"/>
		<updated>2024-04-19T17:14:21Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page explains how to flash and mod a gotek with [https://github.com/keirf/flashfloppy flashfloppy] under linux&lt;br /&gt;
&lt;br /&gt;
== Flash ==&lt;br /&gt;
&lt;br /&gt;
This is only for an &amp;quot;artery&amp;quot; chip gotek&lt;br /&gt;
&lt;br /&gt;
Jump &amp;quot;boot&amp;quot; wires as in the picture below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then under linux run:&lt;br /&gt;
&lt;br /&gt;
 dfu-util -D /path/to/flashfloppy/releases/flashfloppy-3.42/dfu/flashfloppy-at415-st105-3.42.dfu -a 0 -s 0x08000000:unprotect:force&lt;br /&gt;
&lt;br /&gt;
And once again:&lt;br /&gt;
&lt;br /&gt;
 dfu-util -D /path/toflashfloppy/releases/flashfloppy-3.42/dfu/flashfloppy-at415-st105-3.42.dfu -a 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/keirf/FlashFloppy/wiki/Firmware-Programming&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=Retro/FlashFloppy&amp;diff=314</id>
		<title>Retro/FlashFloppy</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=Retro/FlashFloppy&amp;diff=314"/>
		<updated>2024-04-19T17:13:10Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page explains how to flash and mod a gotek with flashfloppy under linux&lt;br /&gt;
&lt;br /&gt;
== Flash ==&lt;br /&gt;
&lt;br /&gt;
This is only for an &amp;quot;artery&amp;quot; chip gotek&lt;br /&gt;
&lt;br /&gt;
Jump &amp;quot;boot&amp;quot; wires as in the picture below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then under linux run:&lt;br /&gt;
&lt;br /&gt;
 dfu-util -D /path/to/flashfloppy/releases/flashfloppy-3.42/dfu/flashfloppy-at415-st105-3.42.dfu -a 0 -s 0x08000000:unprotect:force&lt;br /&gt;
&lt;br /&gt;
And once again:&lt;br /&gt;
&lt;br /&gt;
 dfu-util -D /path/toflashfloppy/releases/flashfloppy-3.42/dfu/flashfloppy-at415-st105-3.42.dfu -a 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/keirf/FlashFloppy/wiki/Firmware-Programming&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=Retro/FlashFloppy&amp;diff=313</id>
		<title>Retro/FlashFloppy</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=Retro/FlashFloppy&amp;diff=313"/>
		<updated>2024-04-19T17:12:55Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page explains how to flash and mod a gotek with flashfloppy under linux&lt;br /&gt;
&lt;br /&gt;
== Flash ==&lt;br /&gt;
&lt;br /&gt;
This is only for an &amp;quot;artery&amp;quot; chip gotek&lt;br /&gt;
&lt;br /&gt;
Jump &amp;quot;boot&amp;quot; wires as in the picture below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then under linux run:&lt;br /&gt;
&lt;br /&gt;
 dfu-util -D /downloads/build/flashfloppy/releases/flashfloppy-3.42/dfu/flashfloppy-at415-st105-3.42.dfu -a 0 -s 0x08000000:unprotect:force&lt;br /&gt;
&lt;br /&gt;
And once again:&lt;br /&gt;
&lt;br /&gt;
 dfu-util -D /downloads/build/flashfloppy/releases/flashfloppy-3.42/dfu/flashfloppy-at415-st105-3.42.dfu -a 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/keirf/FlashFloppy/wiki/Firmware-Programming&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=Retro/FlashFloppy&amp;diff=312</id>
		<title>Retro/FlashFloppy</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=Retro/FlashFloppy&amp;diff=312"/>
		<updated>2024-04-19T17:12:33Z</updated>

		<summary type="html">&lt;p&gt;Eadam: Created page with &amp;quot;This page explains how to flash and mod a gotek with flashfloppy under linux  == Flash ==  This is only for an &amp;quot;artery&amp;quot; chip gotek  Jump &amp;quot;boot&amp;quot; wires as in the picture below:...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page explains how to flash and mod a gotek with flashfloppy under linux&lt;br /&gt;
&lt;br /&gt;
== Flash ==&lt;br /&gt;
&lt;br /&gt;
This is only for an &amp;quot;artery&amp;quot; chip gotek&lt;br /&gt;
&lt;br /&gt;
Jump &amp;quot;boot&amp;quot; wires as in the picture below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then under linux run:&lt;br /&gt;
&lt;br /&gt;
```dfu-util -D /downloads/build/flashfloppy/releases/flashfloppy-3.42/dfu/flashfloppy-at415-st105-3.42.dfu -a 0 -s 0x08000000:unprotect:force```&lt;br /&gt;
&lt;br /&gt;
And once again:&lt;br /&gt;
&lt;br /&gt;
```dfu-util -D /downloads/build/flashfloppy/releases/flashfloppy-3.42/dfu/flashfloppy-at415-st105-3.42.dfu -a 0```&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/keirf/FlashFloppy/wiki/Firmware-Programming&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=Main_Page&amp;diff=311</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=Main_Page&amp;diff=311"/>
		<updated>2024-04-19T17:09:18Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Retro ==&lt;br /&gt;
&lt;br /&gt;
* [[Retro/FlashFloppy]]&lt;br /&gt;
&lt;br /&gt;
== System ==&lt;br /&gt;
&lt;br /&gt;
* [[HowTos]]&lt;br /&gt;
* [[System/Apache]]&lt;br /&gt;
* [[System/MySQL]]&lt;br /&gt;
* [[System/PostgreSQL]]&lt;br /&gt;
* [[System/RAID]]&lt;br /&gt;
* [[System/LVM]]&lt;br /&gt;
* [[System/FS/Parted]]&lt;br /&gt;
* [[System/DayToDay]]&lt;br /&gt;
* [[System/OneLiner]]&lt;br /&gt;
* [[System/Backup]]&lt;br /&gt;
* [[System/Performance]]&lt;br /&gt;
&lt;br /&gt;
== Network/Hosting ==&lt;br /&gt;
&lt;br /&gt;
* [[Network/Tools]]&lt;br /&gt;
* [[Network/IPv6]]&lt;br /&gt;
* [[Network/SSH]]&lt;br /&gt;
* [[Network/VPN]]&lt;br /&gt;
* [[Network/Security]]&lt;br /&gt;
* [[Network/Nat]]&lt;br /&gt;
* [[Network/Bridge]]&lt;br /&gt;
* [[Network/iscsi]]&lt;br /&gt;
* [[Network/DNS]]&lt;br /&gt;
* [[Hosting/DNSProviders]]&lt;br /&gt;
&lt;br /&gt;
== Coding ==&lt;br /&gt;
&lt;br /&gt;
* [[Code/Python]]&lt;br /&gt;
* [[Code/PHP/TrojanRemoval]]&lt;br /&gt;
* [[Code/Git]]&lt;br /&gt;
&lt;br /&gt;
== /dev/random ==&lt;br /&gt;
&lt;br /&gt;
* [[DevOps]]&lt;br /&gt;
* [[Divers/Video/Recording]]&lt;br /&gt;
* [[Desktop/i18n]]&lt;br /&gt;
* [[Desktop/i3]]&lt;br /&gt;
* [[Lyrics]]&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Stuff ==&lt;br /&gt;
* [//meta.wikimedia.org/wiki/Help:Contents User's Guide]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=Main_Page&amp;diff=310</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=Main_Page&amp;diff=310"/>
		<updated>2024-04-19T17:09:09Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Retro ==&lt;br /&gt;
&lt;br /&gt;
* [[FlashFloppy]]&lt;br /&gt;
&lt;br /&gt;
== System ==&lt;br /&gt;
&lt;br /&gt;
* [[HowTos]]&lt;br /&gt;
* [[System/Apache]]&lt;br /&gt;
* [[System/MySQL]]&lt;br /&gt;
* [[System/PostgreSQL]]&lt;br /&gt;
* [[System/RAID]]&lt;br /&gt;
* [[System/LVM]]&lt;br /&gt;
* [[System/FS/Parted]]&lt;br /&gt;
* [[System/DayToDay]]&lt;br /&gt;
* [[System/OneLiner]]&lt;br /&gt;
* [[System/Backup]]&lt;br /&gt;
* [[System/Performance]]&lt;br /&gt;
&lt;br /&gt;
== Network/Hosting ==&lt;br /&gt;
&lt;br /&gt;
* [[Network/Tools]]&lt;br /&gt;
* [[Network/IPv6]]&lt;br /&gt;
* [[Network/SSH]]&lt;br /&gt;
* [[Network/VPN]]&lt;br /&gt;
* [[Network/Security]]&lt;br /&gt;
* [[Network/Nat]]&lt;br /&gt;
* [[Network/Bridge]]&lt;br /&gt;
* [[Network/iscsi]]&lt;br /&gt;
* [[Network/DNS]]&lt;br /&gt;
* [[Hosting/DNSProviders]]&lt;br /&gt;
&lt;br /&gt;
== Coding ==&lt;br /&gt;
&lt;br /&gt;
* [[Code/Python]]&lt;br /&gt;
* [[Code/PHP/TrojanRemoval]]&lt;br /&gt;
* [[Code/Git]]&lt;br /&gt;
&lt;br /&gt;
== /dev/random ==&lt;br /&gt;
&lt;br /&gt;
* [[DevOps]]&lt;br /&gt;
* [[Divers/Video/Recording]]&lt;br /&gt;
* [[Desktop/i18n]]&lt;br /&gt;
* [[Desktop/i3]]&lt;br /&gt;
* [[Lyrics]]&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Stuff ==&lt;br /&gt;
* [//meta.wikimedia.org/wiki/Help:Contents User's Guide]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=Main_Page&amp;diff=309</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=Main_Page&amp;diff=309"/>
		<updated>2024-04-17T07:36:38Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== System ==&lt;br /&gt;
&lt;br /&gt;
* [[HowTos]]&lt;br /&gt;
* [[System/Apache]]&lt;br /&gt;
* [[System/MySQL]]&lt;br /&gt;
* [[System/PostgreSQL]]&lt;br /&gt;
* [[System/RAID]]&lt;br /&gt;
* [[System/LVM]]&lt;br /&gt;
* [[System/FS/Parted]]&lt;br /&gt;
* [[System/DayToDay]]&lt;br /&gt;
* [[System/OneLiner]]&lt;br /&gt;
* [[System/Backup]]&lt;br /&gt;
* [[System/Performance]]&lt;br /&gt;
&lt;br /&gt;
== Network/Hosting ==&lt;br /&gt;
&lt;br /&gt;
* [[Network/Tools]]&lt;br /&gt;
* [[Network/IPv6]]&lt;br /&gt;
* [[Network/SSH]]&lt;br /&gt;
* [[Network/VPN]]&lt;br /&gt;
* [[Network/Security]]&lt;br /&gt;
* [[Network/Nat]]&lt;br /&gt;
* [[Network/Bridge]]&lt;br /&gt;
* [[Network/iscsi]]&lt;br /&gt;
* [[Network/DNS]]&lt;br /&gt;
* [[Hosting/DNSProviders]]&lt;br /&gt;
&lt;br /&gt;
== Coding ==&lt;br /&gt;
&lt;br /&gt;
* [[Code/Python]]&lt;br /&gt;
* [[Code/PHP/TrojanRemoval]]&lt;br /&gt;
* [[Code/Git]]&lt;br /&gt;
&lt;br /&gt;
== /dev/random ==&lt;br /&gt;
&lt;br /&gt;
* [[DevOps]]&lt;br /&gt;
* [[Divers/Video/Recording]]&lt;br /&gt;
* [[Desktop/i18n]]&lt;br /&gt;
* [[Desktop/i3]]&lt;br /&gt;
* [[Lyrics]]&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Stuff ==&lt;br /&gt;
* [//meta.wikimedia.org/wiki/Help:Contents User's Guide]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=System/FreeBSD&amp;diff=308</id>
		<title>System/FreeBSD</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=System/FreeBSD&amp;diff=308"/>
		<updated>2022-11-14T09:55:39Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== base ==&lt;br /&gt;
&lt;br /&gt;
Base packages&lt;br /&gt;
&lt;br /&gt;
 pkg install sudo bash vim wpa_supplicant screen password-store openvpn rsync geany base64 cups-2.4.2 meld&lt;br /&gt;
&lt;br /&gt;
User setup&lt;br /&gt;
&lt;br /&gt;
 pw groupmod wheel -m eadam&lt;br /&gt;
 chsh -s /usr/local/bin/bash eadam&lt;br /&gt;
 visudo =&amp;gt; uncomment sudo for wheel group&lt;br /&gt;
 chsh -s /usr/local/bin/bash root&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;kern.ipc.shm_allow_removed=1&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
 echo &amp;quot;kern.vt.enable_bell=0&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
'''cat /etc/sysctl.conf'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''cat /boot/loader.conf'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
aesni_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
geom_eli_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
security.bsd.allow_destructive_dtrace=0&lt;br /&gt;
kern.geom.label.disk_ident.enable=&amp;quot;0&amp;quot;&lt;br /&gt;
kern.geom.label.gptid.enable=&amp;quot;0&amp;quot;&lt;br /&gt;
cryptodev_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
zfs_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
kern.vty=vt&lt;br /&gt;
sem_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
linux_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''cat /etc/rc.conf'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
clear_tmp_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
syslogd_flags=&amp;quot;-ss&amp;quot;&lt;br /&gt;
sendmail_enable=&amp;quot;NONE&amp;quot;&lt;br /&gt;
hostname=&amp;quot;eadam-laptop&amp;quot;&lt;br /&gt;
keymap=&amp;quot;us.kbd&amp;quot;&lt;br /&gt;
ifconfig_ue0=&amp;quot;DHCP&amp;quot;&lt;br /&gt;
sshd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
ntpd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
moused_nondefault_enable=&amp;quot;NO&amp;quot;&lt;br /&gt;
# Set dumpdev to &amp;quot;AUTO&amp;quot; to enable crash dumps, &amp;quot;NO&amp;quot; to disable&lt;br /&gt;
dumpdev=&amp;quot;AUTO&amp;quot;&lt;br /&gt;
zfs_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
dbus_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
hald_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
kld_list=&amp;quot;i915kms&amp;quot;&lt;br /&gt;
slim_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
pcscd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== X / i3 ==&lt;br /&gt;
&lt;br /&gt;
 pkg install xorg drm-kmod xf86-input-synaptics-1.9.1_9 autorandr-1.12.1 i3 i3status i3lock mate rofi chromium firefox&lt;br /&gt;
&lt;br /&gt;
edit .xinitrc&lt;br /&gt;
&lt;br /&gt;
== yubikey / u2f ==&lt;br /&gt;
&lt;br /&gt;
=== Yubikey for ssh ===&lt;br /&gt;
&lt;br /&gt;
Install package:&lt;br /&gt;
&lt;br /&gt;
 pkg install py39-yubikey-manager yubico-piv-tool pcsc-lite ccid&lt;br /&gt;
&lt;br /&gt;
Enable and start pcscd daemon:&lt;br /&gt;
&lt;br /&gt;
 sudo service pcscd enable&lt;br /&gt;
 sudo service pcscd start&lt;br /&gt;
&lt;br /&gt;
Set PKCS11 provider for ssh (not required):&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;PKCS11Provider /usr/local/lib/libykcs11.so&amp;quot; &amp;gt;&amp;gt;~/.ssh/config&lt;br /&gt;
&lt;br /&gt;
And/or start your ssh-agent and add the key:&lt;br /&gt;
&lt;br /&gt;
 eval `ssh-agent`&lt;br /&gt;
 ssh-add -s /usr/local/lib/libykcs11.so&lt;br /&gt;
&lt;br /&gt;
=== Yubikey for U2F/FIDO2 ===&lt;br /&gt;
&lt;br /&gt;
 pkg install u2f-devd&lt;br /&gt;
 service devd restart&lt;br /&gt;
 pw group mod u2f -m eadam&lt;br /&gt;
 service devd restart&lt;br /&gt;
&lt;br /&gt;
== suspend ==&lt;br /&gt;
&lt;br /&gt;
 acpiconf -s 3&lt;br /&gt;
&lt;br /&gt;
== backlight ==&lt;br /&gt;
&lt;br /&gt;
 pkg install intel-backlight&lt;br /&gt;
 intel_backlight 30&lt;br /&gt;
 # echo 'acpi_video_load=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /boot/loader.conf&lt;br /&gt;
 # cp /usr/local/share/examples/intel-backlight/acpi-video-intel-backlight.conf /usr/local/etc/devd/&lt;br /&gt;
 sysrc kld_list+=&amp;quot; acpi_video&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== wifi ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig wlan0 create wlandev iwm0&lt;br /&gt;
ifconfig wlan0 up scan&lt;br /&gt;
if [ $1 = &amp;quot;withings&amp;quot; ]; then&lt;br /&gt;
  wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf &amp;amp;&lt;br /&gt;
else&lt;br /&gt;
  wpa_supplicant -i wlan0 -c /etc/wpa_supplicant_home.conf &amp;amp;&lt;br /&gt;
fi&lt;br /&gt;
sleep 3&lt;br /&gt;
dhclient wlan0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== sound ==&lt;br /&gt;
&lt;br /&gt;
 kldload snd_driver&lt;br /&gt;
 echo &amp;quot;hw.snd.default_unit=1&lt;br /&gt;
 hw.snd.default_auto=0&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
== webcam ==&lt;br /&gt;
&lt;br /&gt;
 pkg install webcamd pwcview v4l-utils v4l_compat&lt;br /&gt;
 echo 'webcamd_enable=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
 echo 'cuse_load=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /boot/loader.conf&lt;br /&gt;
 pw groupmod webcamd -m eadam&lt;br /&gt;
&lt;br /&gt;
== todo ==&lt;br /&gt;
&lt;br /&gt;
- home backup&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=System/FreeBSD&amp;diff=307</id>
		<title>System/FreeBSD</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=System/FreeBSD&amp;diff=307"/>
		<updated>2022-11-14T09:53:10Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== base ==&lt;br /&gt;
&lt;br /&gt;
Base packages&lt;br /&gt;
&lt;br /&gt;
 pkg install sudo bash vim wpa_supplicant screen password-store openvpn rsync geany base64 cups-2.4.2 meld&lt;br /&gt;
&lt;br /&gt;
User setup&lt;br /&gt;
&lt;br /&gt;
 pw groupmod wheel -m eadam&lt;br /&gt;
 chsh -s /usr/local/bin/bash eadam&lt;br /&gt;
 visudo =&amp;gt; uncomment sudo for wheel group&lt;br /&gt;
 chsh -s /usr/local/bin/bash root&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;kern.ipc.shm_allow_removed=1&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
 echo &amp;quot;kern.vt.enable_bell=0&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
'''cat /etc/sysctl.conf'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''cat /boot/loader.conf'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
aesni_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
geom_eli_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
security.bsd.allow_destructive_dtrace=0&lt;br /&gt;
kern.geom.label.disk_ident.enable=&amp;quot;0&amp;quot;&lt;br /&gt;
kern.geom.label.gptid.enable=&amp;quot;0&amp;quot;&lt;br /&gt;
cryptodev_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
zfs_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
kern.vty=vt&lt;br /&gt;
sem_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
linux_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''cat /etc/rc.conf'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
clear_tmp_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
syslogd_flags=&amp;quot;-ss&amp;quot;&lt;br /&gt;
sendmail_enable=&amp;quot;NONE&amp;quot;&lt;br /&gt;
hostname=&amp;quot;eadam-laptop&amp;quot;&lt;br /&gt;
keymap=&amp;quot;us.kbd&amp;quot;&lt;br /&gt;
ifconfig_ue0=&amp;quot;DHCP&amp;quot;&lt;br /&gt;
sshd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
ntpd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
moused_nondefault_enable=&amp;quot;NO&amp;quot;&lt;br /&gt;
# Set dumpdev to &amp;quot;AUTO&amp;quot; to enable crash dumps, &amp;quot;NO&amp;quot; to disable&lt;br /&gt;
dumpdev=&amp;quot;AUTO&amp;quot;&lt;br /&gt;
zfs_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
dbus_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
hald_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
kld_list=&amp;quot;i915kms&amp;quot;&lt;br /&gt;
slim_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
pcscd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== X / i3 ==&lt;br /&gt;
&lt;br /&gt;
 pkg install xorg drm-kmod xf86-input-synaptics-1.9.1_9 autorandr-1.12.1 i3 i3status i3lock mate rofi chromium firefox&lt;br /&gt;
&lt;br /&gt;
edit .xinitrc&lt;br /&gt;
&lt;br /&gt;
== u2f ==&lt;br /&gt;
&lt;br /&gt;
 pkg install u2f-devd&lt;br /&gt;
 service devd restart&lt;br /&gt;
 pw group mod u2f -m eadam&lt;br /&gt;
 service devd restart&lt;br /&gt;
&lt;br /&gt;
== suspend ==&lt;br /&gt;
&lt;br /&gt;
 acpiconf -s 3&lt;br /&gt;
&lt;br /&gt;
== backlight ==&lt;br /&gt;
&lt;br /&gt;
 pkg install intel-backlight&lt;br /&gt;
 intel_backlight 30&lt;br /&gt;
 # echo 'acpi_video_load=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /boot/loader.conf&lt;br /&gt;
 # cp /usr/local/share/examples/intel-backlight/acpi-video-intel-backlight.conf /usr/local/etc/devd/&lt;br /&gt;
 sysrc kld_list+=&amp;quot; acpi_video&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== wifi ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig wlan0 create wlandev iwm0&lt;br /&gt;
ifconfig wlan0 up scan&lt;br /&gt;
if [ $1 = &amp;quot;withings&amp;quot; ]; then&lt;br /&gt;
  wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf &amp;amp;&lt;br /&gt;
else&lt;br /&gt;
  wpa_supplicant -i wlan0 -c /etc/wpa_supplicant_home.conf &amp;amp;&lt;br /&gt;
fi&lt;br /&gt;
sleep 3&lt;br /&gt;
dhclient wlan0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== sound ==&lt;br /&gt;
&lt;br /&gt;
 kldload snd_driver&lt;br /&gt;
 echo &amp;quot;hw.snd.default_unit=1&lt;br /&gt;
 hw.snd.default_auto=0&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
== webcam ==&lt;br /&gt;
&lt;br /&gt;
 pkg install webcamd pwcview v4l-utils v4l_compat&lt;br /&gt;
 echo 'webcamd_enable=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
 echo 'cuse_load=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /boot/loader.conf&lt;br /&gt;
 pw groupmod webcamd -m eadam&lt;br /&gt;
&lt;br /&gt;
== todo ==&lt;br /&gt;
&lt;br /&gt;
- home backup&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=System/FreeBSD&amp;diff=306</id>
		<title>System/FreeBSD</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=System/FreeBSD&amp;diff=306"/>
		<updated>2022-11-13T20:36:47Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== base ==&lt;br /&gt;
&lt;br /&gt;
Base packages&lt;br /&gt;
&lt;br /&gt;
 pkg install sudo bash vim wpa_supplicant screen password-store rsync&lt;br /&gt;
&lt;br /&gt;
User setup&lt;br /&gt;
&lt;br /&gt;
 pw groupmod wheel -m eadam&lt;br /&gt;
 chsh -s /usr/local/bin/bash eadam&lt;br /&gt;
 visudo =&amp;gt; uncomment sudo for wheel group&lt;br /&gt;
 chsh -s /usr/local/bin/bash root&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;kern.ipc.shm_allow_removed=1&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
 echo &amp;quot;kern.vt.enable_bell=0&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
'''cat /etc/sysctl.conf'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''cat /boot/loader.conf'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
aesni_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
geom_eli_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
security.bsd.allow_destructive_dtrace=0&lt;br /&gt;
kern.geom.label.disk_ident.enable=&amp;quot;0&amp;quot;&lt;br /&gt;
kern.geom.label.gptid.enable=&amp;quot;0&amp;quot;&lt;br /&gt;
cryptodev_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
zfs_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
kern.vty=vt&lt;br /&gt;
sem_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
linux_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''cat /etc/rc.conf'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
clear_tmp_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
syslogd_flags=&amp;quot;-ss&amp;quot;&lt;br /&gt;
sendmail_enable=&amp;quot;NONE&amp;quot;&lt;br /&gt;
hostname=&amp;quot;eadam-laptop&amp;quot;&lt;br /&gt;
keymap=&amp;quot;us.kbd&amp;quot;&lt;br /&gt;
ifconfig_ue0=&amp;quot;DHCP&amp;quot;&lt;br /&gt;
sshd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
ntpd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
moused_nondefault_enable=&amp;quot;NO&amp;quot;&lt;br /&gt;
# Set dumpdev to &amp;quot;AUTO&amp;quot; to enable crash dumps, &amp;quot;NO&amp;quot; to disable&lt;br /&gt;
dumpdev=&amp;quot;AUTO&amp;quot;&lt;br /&gt;
zfs_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
dbus_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
hald_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
kld_list=&amp;quot;i915kms&amp;quot;&lt;br /&gt;
slim_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
pcscd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== X / i3 ==&lt;br /&gt;
&lt;br /&gt;
 pkg install xorg drm-kmod i3 i3status i3lock mate rofi chromium firefox&lt;br /&gt;
&lt;br /&gt;
edit .xinitrc&lt;br /&gt;
&lt;br /&gt;
== u2f ==&lt;br /&gt;
&lt;br /&gt;
 pkg install u2f-devd&lt;br /&gt;
 service devd restart&lt;br /&gt;
 pw group mod u2f -m eadam&lt;br /&gt;
 service devd restart&lt;br /&gt;
&lt;br /&gt;
== suspend ==&lt;br /&gt;
&lt;br /&gt;
 acpiconf -s 3&lt;br /&gt;
&lt;br /&gt;
== backlight ==&lt;br /&gt;
&lt;br /&gt;
 pkg install intel-backlight&lt;br /&gt;
 intel_backlight 30&lt;br /&gt;
 # echo 'acpi_video_load=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /boot/loader.conf&lt;br /&gt;
 # cp /usr/local/share/examples/intel-backlight/acpi-video-intel-backlight.conf /usr/local/etc/devd/&lt;br /&gt;
 sysrc kld_list+=&amp;quot; acpi_video&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== wifi ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig wlan0 create wlandev iwm0&lt;br /&gt;
ifconfig wlan0 up scan&lt;br /&gt;
if [ $1 = &amp;quot;withings&amp;quot; ]; then&lt;br /&gt;
  wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf &amp;amp;&lt;br /&gt;
else&lt;br /&gt;
  wpa_supplicant -i wlan0 -c /etc/wpa_supplicant_home.conf &amp;amp;&lt;br /&gt;
fi&lt;br /&gt;
sleep 3&lt;br /&gt;
dhclient wlan0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== sound ==&lt;br /&gt;
&lt;br /&gt;
 kldload snd_driver&lt;br /&gt;
 echo &amp;quot;hw.snd.default_unit=1&lt;br /&gt;
 hw.snd.default_auto=0&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
== webcam ==&lt;br /&gt;
&lt;br /&gt;
 pkg install webcamd pwcview v4l-utils v4l_compat&lt;br /&gt;
 echo 'webcamd_enable=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
 echo 'cuse_load=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /boot/loader.conf&lt;br /&gt;
 pw groupmod webcamd -m eadam&lt;br /&gt;
&lt;br /&gt;
== todo ==&lt;br /&gt;
&lt;br /&gt;
- home backup&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=System/i3&amp;diff=305</id>
		<title>System/i3</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=System/i3&amp;diff=305"/>
		<updated>2022-11-13T20:35:11Z</updated>

		<summary type="html">&lt;p&gt;Eadam: Created page with &amp;quot;&amp;lt;pre&amp;gt; # Please see http://i3wm.org/docs/userguide.html for a complete reference!  # This defines which key super maps to on your keyboard.   # Alt key is Mod1, and Windows key...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# Please see http://i3wm.org/docs/userguide.html for a complete reference!&lt;br /&gt;
&lt;br /&gt;
# This defines which key super maps to on your keyboard.  &lt;br /&gt;
# Alt key is Mod1, and Windows key is Mod4&lt;br /&gt;
set $mod Mod4&lt;br /&gt;
set $alt Mod1&lt;br /&gt;
&lt;br /&gt;
# Color values are defined in ~/.Xresources-regolith&lt;br /&gt;
# These are the labels which define each i3 workspace.&lt;br /&gt;
set_from_resource $ws1  i3-wm.workspace.01.name &amp;quot;1&amp;quot;&lt;br /&gt;
set_from_resource $ws2  i3-wm.workspace.02.name &amp;quot;2&amp;quot;&lt;br /&gt;
set_from_resource $ws3  i3-wm.workspace.03.name &amp;quot;3&amp;quot;&lt;br /&gt;
set_from_resource $ws4  i3-wm.workspace.04.name &amp;quot;4&amp;quot;&lt;br /&gt;
set_from_resource $ws5  i3-wm.workspace.05.name &amp;quot;5&amp;quot;&lt;br /&gt;
set_from_resource $ws6  i3-wm.workspace.06.name &amp;quot;6&amp;quot;&lt;br /&gt;
set_from_resource $ws7  i3-wm.workspace.07.name &amp;quot;7&amp;quot;&lt;br /&gt;
set_from_resource $ws8  i3-wm.workspace.08.name &amp;quot;8&amp;quot;&lt;br /&gt;
set_from_resource $ws9  i3-wm.workspace.09.name &amp;quot;9&amp;quot;&lt;br /&gt;
set_from_resource $ws10 i3-wm.workspace.10.name &amp;quot;10&amp;quot;&lt;br /&gt;
set_from_resource $ws11 i3-wm.workspace.11.name &amp;quot;11&amp;quot;&lt;br /&gt;
set_from_resource $ws12 i3-wm.workspace.12.name &amp;quot;12&amp;quot;&lt;br /&gt;
set_from_resource $ws13 i3-wm.workspace.13.name &amp;quot;13&amp;quot;&lt;br /&gt;
set_from_resource $ws14 i3-wm.workspace.14.name &amp;quot;14&amp;quot;&lt;br /&gt;
set_from_resource $ws15 i3-wm.workspace.15.name &amp;quot;15&amp;quot;&lt;br /&gt;
set_from_resource $ws16 i3-wm.workspace.16.name &amp;quot;16&amp;quot;&lt;br /&gt;
set_from_resource $ws17 i3-wm.workspace.17.name &amp;quot;17&amp;quot;&lt;br /&gt;
set_from_resource $ws18 i3-wm.workspace.18.name &amp;quot;18&amp;quot;&lt;br /&gt;
set_from_resource $ws19 i3-wm.workspace.19.name &amp;quot;19&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Use Mouse+$mod to drag floating windows to their wanted position&lt;br /&gt;
floating_modifier $mod&lt;br /&gt;
&lt;br /&gt;
hide_edge_borders smart&lt;br /&gt;
&lt;br /&gt;
# start a terminal&lt;br /&gt;
bindsym $mod+Return exec $terminal_path&lt;br /&gt;
&lt;br /&gt;
# start a web browser&lt;br /&gt;
bindsym $mod+Shift+Return exec firefox&lt;br /&gt;
&lt;br /&gt;
# kill focused window&lt;br /&gt;
bindsym $mod+Shift+q kill&lt;br /&gt;
&lt;br /&gt;
# rofi app and window launchers&lt;br /&gt;
bindsym $mod+space exec rofi -show drun -theme $rofiTheme&lt;br /&gt;
&lt;br /&gt;
# change focus&lt;br /&gt;
bindsym $mod+Left focus left&lt;br /&gt;
bindsym $mod+Down focus down&lt;br /&gt;
bindsym $mod+Up focus up&lt;br /&gt;
bindsym $mod+Right focus right&lt;br /&gt;
&lt;br /&gt;
bindsym $mod+h focus left&lt;br /&gt;
bindsym $mod+j focus down&lt;br /&gt;
bindsym $mod+k focus up&lt;br /&gt;
bindsym $mod+l focus right&lt;br /&gt;
&lt;br /&gt;
# move windows in workspaces&lt;br /&gt;
bindsym $mod+Shift+Left move left&lt;br /&gt;
bindsym $mod+Shift+Down move down&lt;br /&gt;
bindsym $mod+Shift+Up move up&lt;br /&gt;
bindsym $mod+Shift+Right move right&lt;br /&gt;
&lt;br /&gt;
bindsym $mod+Shift+h move left&lt;br /&gt;
bindsym $mod+Shift+j move down&lt;br /&gt;
bindsym $mod+Shift+k move up&lt;br /&gt;
bindsym $mod+Shift+l move right&lt;br /&gt;
&lt;br /&gt;
# toggle split orientation&lt;br /&gt;
bindsym $mod+BackSpace split toggle&lt;br /&gt;
&lt;br /&gt;
# enter fullscreen mode for the focused container&lt;br /&gt;
bindsym $mod+f fullscreen toggle&lt;br /&gt;
&lt;br /&gt;
# change gaps interactively&lt;br /&gt;
bindsym $mod+minus gaps inner current minus 6&lt;br /&gt;
bindsym $mod+plus gaps inner current plus 6&lt;br /&gt;
&lt;br /&gt;
# toggle tiling / floating&lt;br /&gt;
bindsym $mod+Shift+f floating toggle&lt;br /&gt;
&lt;br /&gt;
# change focus between tiling / floating windows&lt;br /&gt;
bindsym $mod+Shift+t focus mode_toggle&lt;br /&gt;
&lt;br /&gt;
# toggle tabbed mode&lt;br /&gt;
bindsym $mod+t layout toggle tabbed splith splitv&lt;br /&gt;
&lt;br /&gt;
# move to workspace&lt;br /&gt;
bindsym $mod+1 workspace $ws1&lt;br /&gt;
bindsym $mod+2 workspace $ws2&lt;br /&gt;
bindsym $mod+3 workspace $ws3&lt;br /&gt;
bindsym $mod+4 workspace $ws4&lt;br /&gt;
bindsym $mod+5 workspace $ws5&lt;br /&gt;
bindsym $mod+6 workspace $ws6&lt;br /&gt;
bindsym $mod+7 workspace $ws7&lt;br /&gt;
bindsym $mod+8 workspace $ws8&lt;br /&gt;
bindsym $mod+9 workspace $ws9&lt;br /&gt;
bindsym $mod+0 workspace $ws10&lt;br /&gt;
bindsym $mod+Ctrl+1 workspace $ws11&lt;br /&gt;
bindsym $mod+Ctrl+2 workspace $ws12&lt;br /&gt;
bindsym $mod+Ctrl+3 workspace $ws13&lt;br /&gt;
bindsym $mod+Ctrl+4 workspace $ws14&lt;br /&gt;
bindsym $mod+Ctrl+5 workspace $ws15&lt;br /&gt;
bindsym $mod+Ctrl+6 workspace $ws16&lt;br /&gt;
bindsym $mod+Ctrl+7 workspace $ws17&lt;br /&gt;
bindsym $mod+Ctrl+8 workspace $ws18&lt;br /&gt;
bindsym $mod+Ctrl+9 workspace $ws19&lt;br /&gt;
&lt;br /&gt;
# cycle across workspaces&lt;br /&gt;
bindsym $mod+Tab workspace next&lt;br /&gt;
bindsym $mod+Shift+Tab workspace prev&lt;br /&gt;
&lt;br /&gt;
# move focused container to workspace&lt;br /&gt;
bindsym $mod+Shift+1 move container to workspace $ws1&lt;br /&gt;
bindsym $mod+Shift+2 move container to workspace $ws2&lt;br /&gt;
bindsym $mod+Shift+3 move container to workspace $ws3&lt;br /&gt;
bindsym $mod+Shift+4 move container to workspace $ws4&lt;br /&gt;
bindsym $mod+Shift+5 move container to workspace $ws5&lt;br /&gt;
bindsym $mod+Shift+6 move container to workspace $ws6&lt;br /&gt;
bindsym $mod+Shift+7 move container to workspace $ws7&lt;br /&gt;
bindsym $mod+Shift+8 move container to workspace $ws8&lt;br /&gt;
bindsym $mod+Shift+9 move container to workspace $ws9&lt;br /&gt;
bindsym $mod+Shift+0 move container to workspace $ws10&lt;br /&gt;
bindsym $mod+Shift+Ctrl+1 move container to workspace $ws11&lt;br /&gt;
bindsym $mod+Shift+Ctrl+2 move container to workspace $ws12&lt;br /&gt;
bindsym $mod+Shift+Ctrl+3 move container to workspace $ws13&lt;br /&gt;
bindsym $mod+Shift+Ctrl+4 move container to workspace $ws14&lt;br /&gt;
bindsym $mod+Shift+Ctrl+5 move container to workspace $ws15&lt;br /&gt;
bindsym $mod+Shift+Ctrl+6 move container to workspace $ws16&lt;br /&gt;
bindsym $mod+Shift+Ctrl+7 move container to workspace $ws17&lt;br /&gt;
bindsym $mod+Shift+Ctrl+8 move container to workspace $ws18&lt;br /&gt;
bindsym $mod+Shift+Ctrl+9 move container to workspace $ws19&lt;br /&gt;
&lt;br /&gt;
# move focused container to workspace, move to workspace&lt;br /&gt;
bindsym $mod+$alt+1 move container to workspace $ws1; workspace $ws1  &lt;br /&gt;
bindsym $mod+$alt+2 move container to workspace $ws2; workspace $ws2&lt;br /&gt;
bindsym $mod+$alt+3 move container to workspace $ws3; workspace $ws3&lt;br /&gt;
bindsym $mod+$alt+4 move container to workspace $ws4; workspace $ws4&lt;br /&gt;
bindsym $mod+$alt+5 move container to workspace $ws5; workspace $ws5&lt;br /&gt;
bindsym $mod+$alt+6 move container to workspace $ws6; workspace $ws6&lt;br /&gt;
bindsym $mod+$alt+7 move container to workspace $ws7; workspace $ws7&lt;br /&gt;
bindsym $mod+$alt+8 move container to workspace $ws8; workspace $ws8&lt;br /&gt;
bindsym $mod+$alt+9 move container to workspace $ws9; workspace $ws9&lt;br /&gt;
bindsym $mod+$alt+0 move container to workspace $ws10; workspace $ws10&lt;br /&gt;
bindsym $mod+$alt+Ctrl+1 move container to workspace $ws11; workspace $ws11&lt;br /&gt;
bindsym $mod+$alt+Ctrl+2 move container to workspace $ws12; workspace $ws12&lt;br /&gt;
bindsym $mod+$alt+Ctrl+3 move container to workspace $ws13; workspace $ws13&lt;br /&gt;
bindsym $mod+$alt+Ctrl+4 move container to workspace $ws14; workspace $ws14&lt;br /&gt;
bindsym $mod+$alt+Ctrl+5 move container to workspace $ws15; workspace $ws15&lt;br /&gt;
bindsym $mod+$alt+Ctrl+6 move container to workspace $ws16; workspace $ws16&lt;br /&gt;
bindsym $mod+$alt+Ctrl+7 move container to workspace $ws17; workspace $ws17&lt;br /&gt;
bindsym $mod+$alt+Ctrl+8 move container to workspace $ws18; workspace $ws18&lt;br /&gt;
bindsym $mod+$alt+Ctrl+9 move container to workspace $ws19; workspace $ws19&lt;br /&gt;
&lt;br /&gt;
# reload the configuration file&lt;br /&gt;
bindsym $mod+Shift+c reload&lt;br /&gt;
&lt;br /&gt;
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)&lt;br /&gt;
bindsym $mod+Shift+r restart&lt;br /&gt;
&lt;br /&gt;
# lock the screen&lt;br /&gt;
bindsym $mod+Mod1+l exec i3lock&lt;br /&gt;
#bindsym $mod+Escape exec gnome-screensaver-command --lock&lt;br /&gt;
&lt;br /&gt;
# shortcuts for common system configuration tasks&lt;br /&gt;
bindsym $mod+c exec mate-control-center&lt;br /&gt;
bindsym $mod+w exec mate-control-center wifi&lt;br /&gt;
bindsym $mod+b exec mate-control-center bluetooth&lt;br /&gt;
bindsym $mod+d exec mate-control-center display&lt;br /&gt;
bindsym $mod+n exec mate-control-center network&lt;br /&gt;
bindsym $mod+p exec mate-control-center power&lt;br /&gt;
bindsym $mod+s exec mate-control-center sound&lt;br /&gt;
&lt;br /&gt;
# resize window (you can also use the mouse for that)&lt;br /&gt;
mode &amp;quot;Resize Mode&amp;quot; {&lt;br /&gt;
        # These bindings trigger as soon as you enter the resize mode&lt;br /&gt;
        bindsym Left resize shrink width 6 px or 6 ppt&lt;br /&gt;
        bindsym Down resize grow height 6 px or 6 ppt&lt;br /&gt;
        bindsym Up resize shrink height 6 px or 6 ppt&lt;br /&gt;
        bindsym Right resize grow width 6 px or 6 ppt&lt;br /&gt;
&lt;br /&gt;
        bindsym Shift+Left resize shrink width 12 px or 12 ppt&lt;br /&gt;
        bindsym Shift+Down resize grow height 12 px or 12 ppt&lt;br /&gt;
        bindsym Shift+Up resize shrink height 12 px or 12 ppt&lt;br /&gt;
        bindsym Shift+Right resize grow width 12 px or 12 ppt&lt;br /&gt;
&lt;br /&gt;
        bindsym h resize shrink width 6 px or 6 ppt&lt;br /&gt;
        bindsym k resize grow height 6 px or 6 ppt&lt;br /&gt;
        bindsym j resize shrink height 6 px or 6 ppt&lt;br /&gt;
        bindsym l resize grow width 6 px or 6 ppt&lt;br /&gt;
&lt;br /&gt;
        bindsym Shift+h resize shrink width 12 px or 12 ppt&lt;br /&gt;
        bindsym Shift+k resize grow height 12 px or 12 ppt&lt;br /&gt;
        bindsym Shift+j resize shrink height 12 px or 12 ppt&lt;br /&gt;
        bindsym Shift+l resize grow width 12 px or 12 ppt&lt;br /&gt;
&lt;br /&gt;
        # back to normal: Enter or Escape&lt;br /&gt;
        bindsym Return mode &amp;quot;default&amp;quot;&lt;br /&gt;
        bindsym Escape mode &amp;quot;default&amp;quot;&lt;br /&gt;
        bindsym $mod+r mode &amp;quot;default&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
bindsym $mod+r mode &amp;quot;Resize Mode&amp;quot;&lt;br /&gt;
&lt;br /&gt;
bindsym XF86MonBrightnessUp exec --no-startup-id intel_backlight incr&lt;br /&gt;
bindsym XF86MonBrightnessDown exec --no-startup-id intel_backlight decr&lt;br /&gt;
&lt;br /&gt;
# Disable titlebar&lt;br /&gt;
#new_window pixel 1&lt;br /&gt;
new_float pixel 1&lt;br /&gt;
&lt;br /&gt;
# window focus follows your mouse movements as the mouse crosses window borders&lt;br /&gt;
focus_follows_mouse yes&lt;br /&gt;
&lt;br /&gt;
# Configure the bar&lt;br /&gt;
bar {&lt;br /&gt;
  font $i3-wm.bar.font&lt;br /&gt;
  separator_symbol &amp;quot; &amp;quot;&lt;br /&gt;
  status_command i3status&lt;br /&gt;
  tray_output none&lt;br /&gt;
  strip_workspace_numbers yes&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
for_window [title=&amp;quot;CSSH&amp;quot;] floating enable&lt;br /&gt;
&lt;br /&gt;
# Run programs when i3 starts&lt;br /&gt;
&lt;br /&gt;
exec xautolock -time 5 -locker '~/xautolock.sh' &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=System/FreeBSD&amp;diff=304</id>
		<title>System/FreeBSD</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=System/FreeBSD&amp;diff=304"/>
		<updated>2022-11-13T20:32:23Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== base &amp;amp; X ==&lt;br /&gt;
&lt;br /&gt;
 pkg install sudo bash vim wpa_supplicant drm-kmod screen password-store rsync&lt;br /&gt;
 pw groupmod wheel -m eadam&lt;br /&gt;
 chsh -s /usr/local/bin/bash eadam&lt;br /&gt;
 visudo =&amp;gt; uncomment sudo for wheel group&lt;br /&gt;
 chsh -s /usr/local/bin/bash root&lt;br /&gt;
&lt;br /&gt;
 pkg install xorg i3 i3status i3lock mate rofi chromium firefox&lt;br /&gt;
&lt;br /&gt;
edit .xinitrc&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;kern.ipc.shm_allow_removed=1&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
 echo &amp;quot;kern.vt.enable_bell=0&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
'''cat /etc/sysctl.conf'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''cat /boot/loader.conf'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
aesni_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
geom_eli_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
security.bsd.allow_destructive_dtrace=0&lt;br /&gt;
kern.geom.label.disk_ident.enable=&amp;quot;0&amp;quot;&lt;br /&gt;
kern.geom.label.gptid.enable=&amp;quot;0&amp;quot;&lt;br /&gt;
cryptodev_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
zfs_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
kern.vty=vt&lt;br /&gt;
sem_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
linux_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''cat /etc/rc.conf'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
clear_tmp_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
syslogd_flags=&amp;quot;-ss&amp;quot;&lt;br /&gt;
sendmail_enable=&amp;quot;NONE&amp;quot;&lt;br /&gt;
hostname=&amp;quot;eadam-laptop&amp;quot;&lt;br /&gt;
keymap=&amp;quot;us.kbd&amp;quot;&lt;br /&gt;
ifconfig_ue0=&amp;quot;DHCP&amp;quot;&lt;br /&gt;
sshd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
ntpd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
moused_nondefault_enable=&amp;quot;NO&amp;quot;&lt;br /&gt;
# Set dumpdev to &amp;quot;AUTO&amp;quot; to enable crash dumps, &amp;quot;NO&amp;quot; to disable&lt;br /&gt;
dumpdev=&amp;quot;AUTO&amp;quot;&lt;br /&gt;
zfs_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
dbus_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
hald_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
kld_list=&amp;quot;i915kms&amp;quot;&lt;br /&gt;
slim_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
pcscd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== u2f ==&lt;br /&gt;
&lt;br /&gt;
 pkg install u2f-devd&lt;br /&gt;
 service devd restart&lt;br /&gt;
 pw group mod u2f -m eadam&lt;br /&gt;
 service devd restart&lt;br /&gt;
&lt;br /&gt;
== suspend ==&lt;br /&gt;
&lt;br /&gt;
 acpiconf -s 3&lt;br /&gt;
&lt;br /&gt;
== backlight ==&lt;br /&gt;
&lt;br /&gt;
 pkg install intel-backlight&lt;br /&gt;
 intel_backlight 30&lt;br /&gt;
 # echo 'acpi_video_load=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /boot/loader.conf&lt;br /&gt;
 # cp /usr/local/share/examples/intel-backlight/acpi-video-intel-backlight.conf /usr/local/etc/devd/&lt;br /&gt;
 sysrc kld_list+=&amp;quot; acpi_video&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== wifi ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig wlan0 create wlandev iwm0&lt;br /&gt;
ifconfig wlan0 up scan&lt;br /&gt;
if [ $1 = &amp;quot;withings&amp;quot; ]; then&lt;br /&gt;
  wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf &amp;amp;&lt;br /&gt;
else&lt;br /&gt;
  wpa_supplicant -i wlan0 -c /etc/wpa_supplicant_home.conf &amp;amp;&lt;br /&gt;
fi&lt;br /&gt;
sleep 3&lt;br /&gt;
dhclient wlan0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== sound ==&lt;br /&gt;
&lt;br /&gt;
 kldload snd_driver&lt;br /&gt;
 echo &amp;quot;hw.snd.default_unit=1&lt;br /&gt;
 hw.snd.default_auto=0&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
== webcam ==&lt;br /&gt;
&lt;br /&gt;
 pkg install webcamd pwcview v4l-utils v4l_compat&lt;br /&gt;
 echo 'webcamd_enable=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
 echo 'cuse_load=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /boot/loader.conf&lt;br /&gt;
 pw groupmod webcamd -m eadam&lt;br /&gt;
&lt;br /&gt;
== todo ==&lt;br /&gt;
&lt;br /&gt;
- home backup&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=System/FreeBSD&amp;diff=303</id>
		<title>System/FreeBSD</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=System/FreeBSD&amp;diff=303"/>
		<updated>2022-11-13T20:30:55Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== base &amp;amp; X ==&lt;br /&gt;
&lt;br /&gt;
 pkg install sudo bash vim wpa_supplicant drm-kmod screen password-store rsync&lt;br /&gt;
 pw groupmod wheel -m eadam&lt;br /&gt;
 chsh -s /usr/local/bin/bash eadam&lt;br /&gt;
 visudo =&amp;gt; uncomment sudo for wheel group&lt;br /&gt;
 chsh -s /usr/local/bin/bash root&lt;br /&gt;
&lt;br /&gt;
 pkg install xorg i3 i3status i3lock mate rofi chromium firefox&lt;br /&gt;
&lt;br /&gt;
edit .xinitrc&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;kern.ipc.shm_allow_removed=1&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
 echo &amp;quot;kern.vt.enable_bell=0&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
'''cat /boot/loader.conf'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
aesni_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
geom_eli_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
security.bsd.allow_destructive_dtrace=0&lt;br /&gt;
kern.geom.label.disk_ident.enable=&amp;quot;0&amp;quot;&lt;br /&gt;
kern.geom.label.gptid.enable=&amp;quot;0&amp;quot;&lt;br /&gt;
cryptodev_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
zfs_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
kern.vty=vt&lt;br /&gt;
sem_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
linux_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
```cat /etc/rc.conf```&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
clear_tmp_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
syslogd_flags=&amp;quot;-ss&amp;quot;&lt;br /&gt;
sendmail_enable=&amp;quot;NONE&amp;quot;&lt;br /&gt;
hostname=&amp;quot;eadam-laptop&amp;quot;&lt;br /&gt;
keymap=&amp;quot;us.kbd&amp;quot;&lt;br /&gt;
ifconfig_ue0=&amp;quot;DHCP&amp;quot;&lt;br /&gt;
sshd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
ntpd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
moused_nondefault_enable=&amp;quot;NO&amp;quot;&lt;br /&gt;
# Set dumpdev to &amp;quot;AUTO&amp;quot; to enable crash dumps, &amp;quot;NO&amp;quot; to disable&lt;br /&gt;
dumpdev=&amp;quot;AUTO&amp;quot;&lt;br /&gt;
zfs_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
dbus_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
hald_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
kld_list=&amp;quot;i915kms&amp;quot;&lt;br /&gt;
slim_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
pcscd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== u2f ==&lt;br /&gt;
&lt;br /&gt;
 pkg install u2f-devd&lt;br /&gt;
 service devd restart&lt;br /&gt;
 pw group mod u2f -m eadam&lt;br /&gt;
 service devd restart&lt;br /&gt;
&lt;br /&gt;
== suspend ==&lt;br /&gt;
&lt;br /&gt;
 acpiconf -s 3&lt;br /&gt;
&lt;br /&gt;
== backlight ==&lt;br /&gt;
&lt;br /&gt;
 pkg install intel-backlight&lt;br /&gt;
 intel_backlight 30&lt;br /&gt;
 # echo 'acpi_video_load=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /boot/loader.conf&lt;br /&gt;
 # cp /usr/local/share/examples/intel-backlight/acpi-video-intel-backlight.conf /usr/local/etc/devd/&lt;br /&gt;
 sysrc kld_list+=&amp;quot; acpi_video&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== wifi ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig wlan0 create wlandev iwm0&lt;br /&gt;
ifconfig wlan0 up scan&lt;br /&gt;
if [ $1 = &amp;quot;withings&amp;quot; ]; then&lt;br /&gt;
  wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf &amp;amp;&lt;br /&gt;
else&lt;br /&gt;
  wpa_supplicant -i wlan0 -c /etc/wpa_supplicant_home.conf &amp;amp;&lt;br /&gt;
fi&lt;br /&gt;
sleep 3&lt;br /&gt;
dhclient wlan0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== sound ==&lt;br /&gt;
&lt;br /&gt;
 kldload snd_driver&lt;br /&gt;
 echo &amp;quot;hw.snd.default_unit=1&lt;br /&gt;
 hw.snd.default_auto=0&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
== webcam ==&lt;br /&gt;
&lt;br /&gt;
 pkg install webcamd pwcview v4l-utils v4l_compat&lt;br /&gt;
 echo 'webcamd_enable=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
 echo 'cuse_load=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /boot/loader.conf&lt;br /&gt;
 pw groupmod webcamd -m eadam&lt;br /&gt;
&lt;br /&gt;
== todo ==&lt;br /&gt;
&lt;br /&gt;
- home backup&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=System/FreeBSD&amp;diff=302</id>
		<title>System/FreeBSD</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=System/FreeBSD&amp;diff=302"/>
		<updated>2022-11-13T20:30:34Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== base &amp;amp; X ==&lt;br /&gt;
&lt;br /&gt;
 pkg install sudo bash vim wpa_supplicant drm-kmod screen password-store rsync&lt;br /&gt;
 pw groupmod wheel -m eadam&lt;br /&gt;
 chsh -s /usr/local/bin/bash eadam&lt;br /&gt;
 visudo =&amp;gt; uncomment sudo for wheel group&lt;br /&gt;
 chsh -s /usr/local/bin/bash root&lt;br /&gt;
&lt;br /&gt;
 pkg install xorg i3 i3status i3lock mate rofi chromium firefox&lt;br /&gt;
&lt;br /&gt;
edit .xinitrc&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;kern.ipc.shm_allow_removed=1&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
 echo &amp;quot;kern.vt.enable_bell=0&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
```cat /boot/loader.conf```&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
aesni_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
geom_eli_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
security.bsd.allow_destructive_dtrace=0&lt;br /&gt;
kern.geom.label.disk_ident.enable=&amp;quot;0&amp;quot;&lt;br /&gt;
kern.geom.label.gptid.enable=&amp;quot;0&amp;quot;&lt;br /&gt;
cryptodev_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
zfs_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
kern.vty=vt&lt;br /&gt;
sem_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
linux_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
```cat /etc/rc.conf```&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
clear_tmp_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
syslogd_flags=&amp;quot;-ss&amp;quot;&lt;br /&gt;
sendmail_enable=&amp;quot;NONE&amp;quot;&lt;br /&gt;
hostname=&amp;quot;eadam-laptop&amp;quot;&lt;br /&gt;
keymap=&amp;quot;us.kbd&amp;quot;&lt;br /&gt;
ifconfig_ue0=&amp;quot;DHCP&amp;quot;&lt;br /&gt;
sshd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
ntpd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
moused_nondefault_enable=&amp;quot;NO&amp;quot;&lt;br /&gt;
# Set dumpdev to &amp;quot;AUTO&amp;quot; to enable crash dumps, &amp;quot;NO&amp;quot; to disable&lt;br /&gt;
dumpdev=&amp;quot;AUTO&amp;quot;&lt;br /&gt;
zfs_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
dbus_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
hald_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
kld_list=&amp;quot;i915kms&amp;quot;&lt;br /&gt;
slim_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
pcscd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== u2f ==&lt;br /&gt;
&lt;br /&gt;
 pkg install u2f-devd&lt;br /&gt;
 service devd restart&lt;br /&gt;
 pw group mod u2f -m eadam&lt;br /&gt;
 service devd restart&lt;br /&gt;
&lt;br /&gt;
== suspend ==&lt;br /&gt;
&lt;br /&gt;
 acpiconf -s 3&lt;br /&gt;
&lt;br /&gt;
== backlight ==&lt;br /&gt;
&lt;br /&gt;
 pkg install intel-backlight&lt;br /&gt;
 intel_backlight 30&lt;br /&gt;
 # echo 'acpi_video_load=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /boot/loader.conf&lt;br /&gt;
 # cp /usr/local/share/examples/intel-backlight/acpi-video-intel-backlight.conf /usr/local/etc/devd/&lt;br /&gt;
 sysrc kld_list+=&amp;quot; acpi_video&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== wifi ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig wlan0 create wlandev iwm0&lt;br /&gt;
ifconfig wlan0 up scan&lt;br /&gt;
if [ $1 = &amp;quot;withings&amp;quot; ]; then&lt;br /&gt;
  wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf &amp;amp;&lt;br /&gt;
else&lt;br /&gt;
  wpa_supplicant -i wlan0 -c /etc/wpa_supplicant_home.conf &amp;amp;&lt;br /&gt;
fi&lt;br /&gt;
sleep 3&lt;br /&gt;
dhclient wlan0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== sound ==&lt;br /&gt;
&lt;br /&gt;
 kldload snd_driver&lt;br /&gt;
 echo &amp;quot;hw.snd.default_unit=1&lt;br /&gt;
 hw.snd.default_auto=0&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
== webcam ==&lt;br /&gt;
&lt;br /&gt;
 pkg install webcamd pwcview v4l-utils v4l_compat&lt;br /&gt;
 echo 'webcamd_enable=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
 echo 'cuse_load=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /boot/loader.conf&lt;br /&gt;
 pw groupmod webcamd -m eadam&lt;br /&gt;
&lt;br /&gt;
== todo ==&lt;br /&gt;
&lt;br /&gt;
- home backup&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=System/FreeBSD&amp;diff=301</id>
		<title>System/FreeBSD</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=System/FreeBSD&amp;diff=301"/>
		<updated>2022-11-13T20:29:13Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== base &amp;amp; X ==&lt;br /&gt;
&lt;br /&gt;
 pkg install sudo bash vim wpa_supplicant drm-kmod screen password-store rsync&lt;br /&gt;
 pw groupmod wheel -m eadam&lt;br /&gt;
 chsh -s /usr/local/bin/bash eadam&lt;br /&gt;
 visudo =&amp;gt; uncomment sudo for wheel group&lt;br /&gt;
 chsh -s /usr/local/bin/bash root&lt;br /&gt;
&lt;br /&gt;
pkg install xorg i3 i3status i3lock mate rofi chromium firefox&lt;br /&gt;
&lt;br /&gt;
edit .xinitrc&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;kern.ipc.shm_allow_removed=1&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;kern.vt.enable_bell=0&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
```cat /boot/loader.conf```&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
aesni_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
geom_eli_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
security.bsd.allow_destructive_dtrace=0&lt;br /&gt;
kern.geom.label.disk_ident.enable=&amp;quot;0&amp;quot;&lt;br /&gt;
kern.geom.label.gptid.enable=&amp;quot;0&amp;quot;&lt;br /&gt;
cryptodev_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
zfs_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
kern.vty=vt&lt;br /&gt;
sem_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
linux_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# cat /etc/rc.conf&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
clear_tmp_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
syslogd_flags=&amp;quot;-ss&amp;quot;&lt;br /&gt;
sendmail_enable=&amp;quot;NONE&amp;quot;&lt;br /&gt;
hostname=&amp;quot;eadam-laptop&amp;quot;&lt;br /&gt;
keymap=&amp;quot;us.kbd&amp;quot;&lt;br /&gt;
ifconfig_ue0=&amp;quot;DHCP&amp;quot;&lt;br /&gt;
sshd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
ntpd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
moused_nondefault_enable=&amp;quot;NO&amp;quot;&lt;br /&gt;
# Set dumpdev to &amp;quot;AUTO&amp;quot; to enable crash dumps, &amp;quot;NO&amp;quot; to disable&lt;br /&gt;
dumpdev=&amp;quot;AUTO&amp;quot;&lt;br /&gt;
zfs_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
dbus_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
hald_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
kld_list=&amp;quot;i915kms&amp;quot;&lt;br /&gt;
slim_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
pcscd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== u2f ==&lt;br /&gt;
&lt;br /&gt;
pkg install u2f-devd&lt;br /&gt;
service devd restart&lt;br /&gt;
pw group mod u2f -m eadam&lt;br /&gt;
service devd restart&lt;br /&gt;
&lt;br /&gt;
== suspend ==&lt;br /&gt;
&lt;br /&gt;
acpiconf -s 3&lt;br /&gt;
&lt;br /&gt;
== backlight ==&lt;br /&gt;
&lt;br /&gt;
pkg install intel-backlight&lt;br /&gt;
intel_backlight 30&lt;br /&gt;
# echo 'acpi_video_load=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /boot/loader.conf&lt;br /&gt;
# cp /usr/local/share/examples/intel-backlight/acpi-video-intel-backlight.conf /usr/local/etc/devd/&lt;br /&gt;
sysrc kld_list+=&amp;quot; acpi_video&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== wifi ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig wlan0 create wlandev iwm0&lt;br /&gt;
ifconfig wlan0 up scan&lt;br /&gt;
if [ $1 = &amp;quot;withings&amp;quot; ]; then&lt;br /&gt;
  wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf &amp;amp;&lt;br /&gt;
else&lt;br /&gt;
  wpa_supplicant -i wlan0 -c /etc/wpa_supplicant_home.conf &amp;amp;&lt;br /&gt;
fi&lt;br /&gt;
sleep 3&lt;br /&gt;
dhclient wlan0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== sound ==&lt;br /&gt;
&lt;br /&gt;
kldload snd_driver&lt;br /&gt;
echo &amp;quot;hw.snd.default_unit=1&lt;br /&gt;
hw.snd.default_auto=0&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
== webcam ==&lt;br /&gt;
&lt;br /&gt;
pkg install webcamd pwcview v4l-utils v4l_compat&lt;br /&gt;
echo 'webcamd_enable=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
echo 'cuse_load=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /boot/loader.conf&lt;br /&gt;
pw groupmod webcamd -m eadam&lt;br /&gt;
&lt;br /&gt;
== todo ==&lt;br /&gt;
- home backup&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=System/FreeBSD&amp;diff=300</id>
		<title>System/FreeBSD</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=System/FreeBSD&amp;diff=300"/>
		<updated>2022-11-13T20:28:43Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== base &amp;amp; X ==&lt;br /&gt;
&lt;br /&gt;
pkg install sudo bash vim wpa_supplicant drm-kmod screen password-store rsync&lt;br /&gt;
pw groupmod wheel -m eadam&lt;br /&gt;
chsh -s /usr/local/bin/bash eadam&lt;br /&gt;
visudo =&amp;gt; uncomment sudo for wheel group&lt;br /&gt;
chsh -s /usr/local/bin/bash root&lt;br /&gt;
&lt;br /&gt;
pkg install xorg i3 i3status i3lock mate rofi chromium firefox&lt;br /&gt;
&lt;br /&gt;
edit .xinitrc&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;kern.ipc.shm_allow_removed=1&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;kern.vt.enable_bell=0&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
# cat /boot/loader.conf&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
aesni_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
geom_eli_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
security.bsd.allow_destructive_dtrace=0&lt;br /&gt;
kern.geom.label.disk_ident.enable=&amp;quot;0&amp;quot;&lt;br /&gt;
kern.geom.label.gptid.enable=&amp;quot;0&amp;quot;&lt;br /&gt;
cryptodev_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
zfs_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
kern.vty=vt&lt;br /&gt;
sem_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
linux_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# cat /etc/rc.conf&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
clear_tmp_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
syslogd_flags=&amp;quot;-ss&amp;quot;&lt;br /&gt;
sendmail_enable=&amp;quot;NONE&amp;quot;&lt;br /&gt;
hostname=&amp;quot;eadam-laptop&amp;quot;&lt;br /&gt;
keymap=&amp;quot;us.kbd&amp;quot;&lt;br /&gt;
ifconfig_ue0=&amp;quot;DHCP&amp;quot;&lt;br /&gt;
sshd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
ntpd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
moused_nondefault_enable=&amp;quot;NO&amp;quot;&lt;br /&gt;
# Set dumpdev to &amp;quot;AUTO&amp;quot; to enable crash dumps, &amp;quot;NO&amp;quot; to disable&lt;br /&gt;
dumpdev=&amp;quot;AUTO&amp;quot;&lt;br /&gt;
zfs_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
dbus_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
hald_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
kld_list=&amp;quot;i915kms&amp;quot;&lt;br /&gt;
slim_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
pcscd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== u2f ==&lt;br /&gt;
&lt;br /&gt;
pkg install u2f-devd&lt;br /&gt;
service devd restart&lt;br /&gt;
pw group mod u2f -m eadam&lt;br /&gt;
service devd restart&lt;br /&gt;
&lt;br /&gt;
== suspend ==&lt;br /&gt;
&lt;br /&gt;
acpiconf -s 3&lt;br /&gt;
&lt;br /&gt;
== backlight ==&lt;br /&gt;
&lt;br /&gt;
pkg install intel-backlight&lt;br /&gt;
intel_backlight 30&lt;br /&gt;
# echo 'acpi_video_load=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /boot/loader.conf&lt;br /&gt;
# cp /usr/local/share/examples/intel-backlight/acpi-video-intel-backlight.conf /usr/local/etc/devd/&lt;br /&gt;
sysrc kld_list+=&amp;quot; acpi_video&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== wifi ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig wlan0 create wlandev iwm0&lt;br /&gt;
ifconfig wlan0 up scan&lt;br /&gt;
if [ $1 = &amp;quot;withings&amp;quot; ]; then&lt;br /&gt;
  wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf &amp;amp;&lt;br /&gt;
else&lt;br /&gt;
  wpa_supplicant -i wlan0 -c /etc/wpa_supplicant_home.conf &amp;amp;&lt;br /&gt;
fi&lt;br /&gt;
sleep 3&lt;br /&gt;
dhclient wlan0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== sound ==&lt;br /&gt;
&lt;br /&gt;
kldload snd_driver&lt;br /&gt;
echo &amp;quot;hw.snd.default_unit=1&lt;br /&gt;
hw.snd.default_auto=0&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
== webcam ==&lt;br /&gt;
&lt;br /&gt;
pkg install webcamd pwcview v4l-utils v4l_compat&lt;br /&gt;
echo 'webcamd_enable=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
echo 'cuse_load=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /boot/loader.conf&lt;br /&gt;
pw groupmod webcamd -m eadam&lt;br /&gt;
&lt;br /&gt;
== todo ==&lt;br /&gt;
- home backup&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=System/FreeBSD&amp;diff=299</id>
		<title>System/FreeBSD</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=System/FreeBSD&amp;diff=299"/>
		<updated>2022-11-13T20:27:47Z</updated>

		<summary type="html">&lt;p&gt;Eadam: Created page with &amp;quot;== base &amp;amp; X ==  pkg install sudo bash vim wpa_supplicant drm-kmod screen password-store rsync pw groupmod wheel -m eadam chsh -s /usr/local/bin/bash eadam visudo =&amp;gt; uncomment...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== base &amp;amp; X ==&lt;br /&gt;
&lt;br /&gt;
pkg install sudo bash vim wpa_supplicant drm-kmod screen password-store rsync&lt;br /&gt;
pw groupmod wheel -m eadam&lt;br /&gt;
chsh -s /usr/local/bin/bash eadam&lt;br /&gt;
visudo =&amp;gt; uncomment sudo for wheel group&lt;br /&gt;
chsh -s /usr/local/bin/bash root&lt;br /&gt;
&lt;br /&gt;
pkg install xorg i3 i3status i3lock mate rofi chromium firefox&lt;br /&gt;
&lt;br /&gt;
edit .xinitrc&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;kern.ipc.shm_allow_removed=1&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;kern.vt.enable_bell=0&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
# cat /boot/loader.conf&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
aesni_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
geom_eli_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
security.bsd.allow_destructive_dtrace=0&lt;br /&gt;
kern.geom.label.disk_ident.enable=&amp;quot;0&amp;quot;&lt;br /&gt;
kern.geom.label.gptid.enable=&amp;quot;0&amp;quot;&lt;br /&gt;
cryptodev_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
zfs_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
kern.vty=vt&lt;br /&gt;
sem_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
linux_load=&amp;quot;YES&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# cat /etc/rc.conf&lt;br /&gt;
clear_tmp_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
syslogd_flags=&amp;quot;-ss&amp;quot;&lt;br /&gt;
sendmail_enable=&amp;quot;NONE&amp;quot;&lt;br /&gt;
hostname=&amp;quot;eadam-laptop&amp;quot;&lt;br /&gt;
keymap=&amp;quot;us.kbd&amp;quot;&lt;br /&gt;
ifconfig_ue0=&amp;quot;DHCP&amp;quot;&lt;br /&gt;
sshd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
ntpd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
moused_nondefault_enable=&amp;quot;NO&amp;quot;&lt;br /&gt;
# Set dumpdev to &amp;quot;AUTO&amp;quot; to enable crash dumps, &amp;quot;NO&amp;quot; to disable&lt;br /&gt;
dumpdev=&amp;quot;AUTO&amp;quot;&lt;br /&gt;
zfs_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
dbus_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
hald_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
kld_list=&amp;quot;i915kms&amp;quot;&lt;br /&gt;
slim_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
pcscd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== u2f ==&lt;br /&gt;
&lt;br /&gt;
pkg install u2f-devd&lt;br /&gt;
service devd restart&lt;br /&gt;
pw group mod u2f -m eadam&lt;br /&gt;
service devd restart&lt;br /&gt;
&lt;br /&gt;
== suspend ==&lt;br /&gt;
&lt;br /&gt;
acpiconf -s 3&lt;br /&gt;
&lt;br /&gt;
== backlight ==&lt;br /&gt;
&lt;br /&gt;
pkg install intel-backlight&lt;br /&gt;
intel_backlight 30&lt;br /&gt;
# echo 'acpi_video_load=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /boot/loader.conf&lt;br /&gt;
# cp /usr/local/share/examples/intel-backlight/acpi-video-intel-backlight.conf /usr/local/etc/devd/&lt;br /&gt;
sysrc kld_list+=&amp;quot; acpi_video&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== wifi ==&lt;br /&gt;
&lt;br /&gt;
ifconfig wlan0 create wlandev iwm0&lt;br /&gt;
ifconfig wlan0 up scan&lt;br /&gt;
if [ $1 = &amp;quot;withings&amp;quot; ]; then&lt;br /&gt;
  wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf &amp;amp;&lt;br /&gt;
else&lt;br /&gt;
  wpa_supplicant -i wlan0 -c /etc/wpa_supplicant_home.conf &amp;amp;&lt;br /&gt;
fi&lt;br /&gt;
sleep 3&lt;br /&gt;
dhclient wlan0&lt;br /&gt;
&lt;br /&gt;
== sound ==&lt;br /&gt;
&lt;br /&gt;
kldload snd_driver&lt;br /&gt;
echo &amp;quot;hw.snd.default_unit=1&lt;br /&gt;
hw.snd.default_auto=0&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
== webcam ==&lt;br /&gt;
&lt;br /&gt;
pkg install webcamd pwcview v4l-utils v4l_compat&lt;br /&gt;
echo 'webcamd_enable=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /etc/rc.conf&lt;br /&gt;
echo 'cuse_load=&amp;quot;YES&amp;quot;' &amp;gt;&amp;gt; /boot/loader.conf&lt;br /&gt;
pw groupmod webcamd -m eadam&lt;br /&gt;
&lt;br /&gt;
== todo ==&lt;br /&gt;
- home backup&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=Balancoire&amp;diff=298</id>
		<title>Balancoire</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=Balancoire&amp;diff=298"/>
		<updated>2021-05-13T08:21:50Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
[[File:Balancoire-dans-arbre-noeud-assise.jpeg]]&lt;br /&gt;
&lt;br /&gt;
[[File:Balancoire-noeud-attache-haute.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
&lt;br /&gt;
https://fr.wikihow.com/suspendre-une-balan%C3%A7oire-%C3%A0-un-arbre&lt;br /&gt;
&lt;br /&gt;
https://media.ooreka.fr/public/image/668997-balanc%CC%A7oire-dans-arbre-1-3-source-14563105.png&lt;br /&gt;
&lt;br /&gt;
https://amenagement-de-jardin.ooreka.fr/fiche/voir/668997/installer-une-balancoire-dans-un-arbre&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=File:Balancoire-noeud-attache-haute.jpeg&amp;diff=297</id>
		<title>File:Balancoire-noeud-attache-haute.jpeg</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=File:Balancoire-noeud-attache-haute.jpeg&amp;diff=297"/>
		<updated>2021-05-13T08:21:36Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=Balancoire&amp;diff=296</id>
		<title>Balancoire</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=Balancoire&amp;diff=296"/>
		<updated>2021-05-13T08:21:12Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
[[File:Balancoire-dans-arbre-noeud-assise.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
&lt;br /&gt;
https://fr.wikihow.com/suspendre-une-balan%C3%A7oire-%C3%A0-un-arbre&lt;br /&gt;
&lt;br /&gt;
https://media.ooreka.fr/public/image/668997-balanc%CC%A7oire-dans-arbre-1-3-source-14563105.png&lt;br /&gt;
&lt;br /&gt;
https://amenagement-de-jardin.ooreka.fr/fiche/voir/668997/installer-une-balancoire-dans-un-arbre&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=File:Balancoire-dans-arbre-noeud-assise.jpeg&amp;diff=295</id>
		<title>File:Balancoire-dans-arbre-noeud-assise.jpeg</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=File:Balancoire-dans-arbre-noeud-assise.jpeg&amp;diff=295"/>
		<updated>2021-05-13T08:17:53Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=File:Hang-a-Tree-Swing-Step.webp&amp;diff=293</id>
		<title>File:Hang-a-Tree-Swing-Step.webp</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=File:Hang-a-Tree-Swing-Step.webp&amp;diff=293"/>
		<updated>2021-05-13T08:10:51Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=Balancoire&amp;diff=290</id>
		<title>Balancoire</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=Balancoire&amp;diff=290"/>
		<updated>2021-05-13T08:02:46Z</updated>

		<summary type="html">&lt;p&gt;Eadam: Created page with &amp;quot;  == Sources ==  https://fr.wikihow.com/suspendre-une-balan%C3%A7oire-%C3%A0-un-arbre  https://media.ooreka.fr/public/image/668997-balanc%CC%A7oire-dans-arbre-1-3-source-14563...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
&lt;br /&gt;
https://fr.wikihow.com/suspendre-une-balan%C3%A7oire-%C3%A0-un-arbre&lt;br /&gt;
&lt;br /&gt;
https://media.ooreka.fr/public/image/668997-balanc%CC%A7oire-dans-arbre-1-3-source-14563105.png&lt;br /&gt;
&lt;br /&gt;
https://amenagement-de-jardin.ooreka.fr/fiche/voir/668997/installer-une-balancoire-dans-un-arbre&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=Network/SSH&amp;diff=287</id>
		<title>Network/SSH</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=Network/SSH&amp;diff=287"/>
		<updated>2014-12-19T19:54:13Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Tunneling ==&lt;br /&gt;
&lt;br /&gt;
=== Script de création/suppression auto de tunnels ===&lt;br /&gt;
&lt;br /&gt;
Ce script est a l'origine destiné a Bacula.&lt;br /&gt;
&lt;br /&gt;
Pour rajouter un host, il suffit de modifier la ligne &amp;quot;HOSTS=...&amp;quot;. Le port a utiliser s'incremente tout seul, en partant de 9110.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
HOSTS=host1 host2&lt;br /&gt;
&lt;br /&gt;
# Stop all tunnels&lt;br /&gt;
TUNNEL_COUNT=$(ps ax|grep ssh|grep bacula-tun|awk '{print $1}'|wc -l)&lt;br /&gt;
&lt;br /&gt;
if [ ! $TUNNEL_COUNT == &amp;quot;0&amp;quot; ]; then&lt;br /&gt;
  kill $(ps ax|grep ssh|grep bacula-tun|awk '{print $1}')&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
PORT=1000&lt;br /&gt;
for H in $HOSTS; do&lt;br /&gt;
  echo $H:$PORT&lt;br /&gt;
  autossh -M0 -f -N -o &amp;quot;ServerAliveInterval 60&amp;quot; -o &amp;quot;ServerAliveCountMax 3&amp;quot; -L $PORT:localhost:9102 -R 9103:si0-2.gre.winsoft.fr:9103 bacula-tun@$H &amp;amp;&lt;br /&gt;
  let PORT=$PORT+1&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Proxy Socks ==&lt;br /&gt;
&lt;br /&gt;
Create Socks Proxy:&lt;br /&gt;
&lt;br /&gt;
 ssh -D 9999 eadam@x.x.x.x&lt;br /&gt;
&lt;br /&gt;
Config to connect to some host automatically through the socks proxy:&lt;br /&gt;
&lt;br /&gt;
'''$ cat .ssh/config'''&lt;br /&gt;
&lt;br /&gt;
 Host 192.168.96.*&lt;br /&gt;
   ProxyCommand='connect -5 -S localhost:9999 %h %p'&lt;br /&gt;
&lt;br /&gt;
You may need to install '''connect-proxy'''.&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=System/MySQL&amp;diff=286</id>
		<title>System/MySQL</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=System/MySQL&amp;diff=286"/>
		<updated>2014-08-26T08:27:46Z</updated>

		<summary type="html">&lt;p&gt;Eadam: /* Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Replication ==&lt;br /&gt;
&lt;br /&gt;
For replication configuration, see [[System/MySQL/Replication]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
sort_buffer_size       = 1M&lt;br /&gt;
query_cache_limit      = 4M&lt;br /&gt;
query_cache_size       = 32M&lt;br /&gt;
...&lt;br /&gt;
# INNODB&lt;br /&gt;
innodb_file_per_table = 1&lt;br /&gt;
innodb_buffer_pool_size = 128M&lt;br /&gt;
innodb_flush_log_at_trx_commit = 1&lt;br /&gt;
...&lt;br /&gt;
# LOG&lt;br /&gt;
log_slow_queries        = /var/log/mysql/mysql-slow.log&lt;br /&gt;
long_query_time = 2&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change max connections on the fly:&lt;br /&gt;
&lt;br /&gt;
 SET GLOBAL max_connections = 500;&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/InstallDebianOnQNAP&amp;diff=285</id>
		<title>HowTo/InstallDebianOnQNAP</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/InstallDebianOnQNAP&amp;diff=285"/>
		<updated>2014-05-31T07:07:32Z</updated>

		<summary type="html">&lt;p&gt;Eadam: /* Recovery mode of QNAP TS-41x/TS-42x devices */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installing Debian on the TS-420 ==&lt;br /&gt;
&lt;br /&gt;
Original source: http://www.cyrius.com/debian/kirkwood/qnap/ts-41x/install/&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In a nutshell, the installation of Debian on your QNAP TS-41x/TS-42x works like this: you use the QNAP firmware to write a Debian installer image to flash. When you restart your device, Debian installer starts and allows you to login via SSH to perform the installation. Debian will be installed to disk and a Debian kernel will be put in flash that will start Debian from disk.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If you follow this procedure, Debian 7 (wheezy) will be installed to your SATA disk and the QNAP firmware on disk and in flash will be replaced with Debian. Debian does not install a web interface to configure your machine, although it's possible to install such software. If this is not what you want, please don't proceed with the installation.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Requirements and Preparation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to install Debian on a QNAP device, you need the following:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A QNAP TS-410, TS-410U, TS-412, TS-419P, TS-419P+, TS-419P II, TS-419U, TS-419U+, TS-420 or TS-421.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
An internal SATA disk.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A network connection.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Another machine on which you have a telnet and an SSH client. Telnet is included in Linux and Windows. SSH is included in every Linux distribution as OpenSSH and there is &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html&amp;quot;&amp;gt;PuTTY&amp;lt;/a&amp;gt; for Windows.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Making a Backup ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You have to make a backup of all the data stored on your QNAP before starting with the installation of Debian since Debian will format the whole disk during the installation. Also, Debian will replace the QNAP firmware in flash, so it's also recommended to make a copy of the flash (mtd) partitions. Debian will only modify the first two flash partitions but it's a good idea to keep a copy of all partitions as you may need them to use the recovery mode. More detailed instructions for making a backup of your flash partitions will be given later.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Starting the Installer ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Start your QNAP device and login via SSH. Some time after you start your machine, you will hear a beep and a bit later you'll hear a longer beep. Wait for a few more seconds and then connect to the machine via SSH. The username is &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; and the password is &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; too.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Once you are logged in, you can save the content of your flash partitions to a USB stick. Connect a USB stick to your QNAP and wait for the system to mount it. In my case, it was mounted at &amp;lt;code&amp;gt;/share/external/sdi&amp;lt;/code&amp;gt; but you can find the location with the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mount | grep external&lt;br /&gt;
/dev/sdi1 on /share/external/&amp;lt;span class=&amp;quot;input&amp;quot;&amp;gt;sdi&amp;lt;/span&amp;gt; type vfat [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Now go to this directory and make a backup of your flash partitions:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /share/external/sdi&lt;br /&gt;
cat /dev/mtdblock0 &amp;amp;gt; mtd0&lt;br /&gt;
cat /dev/mtdblock1 &amp;amp;gt; mtd1&lt;br /&gt;
cat /dev/mtdblock2 &amp;amp;gt; mtd2&lt;br /&gt;
cat /dev/mtdblock3 &amp;amp;gt; mtd3&lt;br /&gt;
cat /dev/mtdblock4 &amp;amp;gt; mtd4&lt;br /&gt;
cat /dev/mtdblock5 &amp;amp;gt; mtd5&lt;br /&gt;
cd&lt;br /&gt;
umount /share/external/sdi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Disconnect your USB stick from your QNAP, connect it to your PC and to add the &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files to your regular backup.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Now you can go ahead and download the installer.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
Download and Flash the Installer&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to download the Debian installer images, issue the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/initrd.gz&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/kernel&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/flash-debian&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/model&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;These commands will download the Debian kernel, the installer ramdisk, a file with information about the support QNAP model, and a script to write the kernel and ramdisk to flash. You can now run the script by executing the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sh flash-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that this command will take about three minutes to run. You will see the following on your screen:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Updating MAC address...&lt;br /&gt;
Your MAC address is 00:08:9B:8C:xx:xx&lt;br /&gt;
Writing debian-installer to flash... done.&lt;br /&gt;
Please reboot your QNAP device.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Once the command has completed, you can reboot your QNAP device:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
reboot&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Installation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;After you have flashed the Debian installer image and restarted your QNAP device, the Debian installer will start. Since the TS-41x/TS-42x does not have any IO device, SSH will be used for the installation. The installer will bring up the network, start the OpenSSH server and you can then connect to the device using SSH. You have to wait a few minutes after starting the system before you can connect. When the installer is ready, the status LED will change to solid green and your device will beep briefly to indicate that you can now login via SSH.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that Ethernet port numeration differs between the QNAP firmware and Debian. Under Debian, &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; is the port marked with &amp;amp;quot;LAN2&amp;amp;quot;. On the TS-419P, this is the lower (and not the upper) connector!&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;net-config&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Since most TS-41x/TS-42x devices do not have an LCD, the installer cannot tell you which IP address to connect to or which password to use. (On the TS-41x, the LCD is currently not supported but will be supported in the future.) With regards to the IP address, the following strategy is used:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If your QNAP firmware is configured to use DHCP (the default configuration from QNAP), Debian installer will try to acquire an IP address with DHCP. If you have not initialized your QNAP firmware with QFinder, DHCP will be used. You can use the MAC address of your QNAP device to tell your DHCP server to give out a specific IP address to your machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If you configured a static address in your QNAP firmware, this configuration will be used. However, if your network configuration was incomplete (e.g. IP address or DNS were missing), the installer will use DHCP instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If DHCP is used but your DHCP server does not respond, the device will use the fallback address &amp;lt;code&amp;gt;192.168.1.100&amp;lt;/code&amp;gt;. If you are unsure what the address of your QNAP is, unplug the Ethernet cable, start the machine again, wait until Debian installer is ready for SSH and then plug the cable back in and connect to this fallback address.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please make sure that the QNAP is on a local network to which only you have access since the installer uses a very generic password, namely &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt;. The user is &amp;lt;code&amp;gt;installer&amp;lt;/code&amp;gt;. Before you can connect to the installer via SSH, you have to remove the SSH key from the QNAP firmware from your known_hosts file. The QNAP firmware uses a different SSH key than the Debian installer, so when you try to connect to Debian you will get an error saying that the remote host identification has changed. Edit ~/.ssh/known_hosts and remove the entry for the IP address of your QNAP device. Now connect to the installer (again, replacing the address in the example with the actual IP address of your QNAP) and login as user &amp;lt;code&amp;gt;installer&amp;lt;/code&amp;gt; with the password &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh installer@&amp;lt;span class=&amp;quot;input&amp;quot;&amp;gt;192.168.1.100&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The installation itself should be pretty standard and you can follow the &amp;lt;a&lt;br /&gt;
href = &amp;quot;http://www.debian.org/releases/stable/armel/&amp;quot;&amp;gt;installation guide&amp;lt;/a&amp;gt;. The installer knows about the TS-41x/TS-42x and at the end of the installation it will flash a kernel and ramdisk that will automatically boot into Debian. It will also install the &amp;lt;code&amp;gt;qcontrol&amp;lt;/code&amp;gt; package that can be used to control the fan, LEDs and beeper on your QNAP device.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Since the TS-41x/TS-42x boots from flash you don't have many limitations as to how you partition your hard drive. You can use LVM and RAID and a number of filesystems.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;At the end of the installation, the installer will write the new kernel to flash. Afterwards you will get a confirmation that the installation is complete. Confirm, wait for the installer to finish and once your SSH session terminates, wait a few minutes before you can connect to your newly installed system via SSH. Your QNAP device will beep when you can connect via SSH. You will be able to log in as &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; or your newly created user.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Success ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You should now have a complete Debian system running on your QNAP. You can use &amp;lt;code&amp;gt;apt-get&amp;lt;/code&amp;gt; and other tools to install additional software. The TS-41x/TS-42x is an ARM based device and the &amp;lt;code&amp;gt;armel&amp;lt;/code&amp;gt; architecture is fully supported by Debian.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Finally, make sure to read the &amp;lt;a href = &amp;quot;../tips/&amp;quot;&amp;gt;tips and tricks&amp;lt;/a&amp;gt; about running Debian on the QNAP TS-41x/TS-42x.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Restoring the original QNAP firmware ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you want to restore the original QNAP firmware on your TS-41x or TS-42x device for some reason, you can follow the instructions below. Please note that this will only work if your Debian system is still working. If your Debian system is broken but the machine itself works, you can use the recovery mode to restore the QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;There are two steps to restore the original QNAP firmware. First, you have to put the backup of the flash partitions from the QNAP firmware you made before the installation of Debian into flash.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd1 &amp;amp;gt; /dev/mtdblock1&lt;br /&gt;
cat mtd2 &amp;amp;gt; /dev/mtdblock2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Second, you have to restart your QNAP, and then go to the web interface to format your disk and install the full QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;After you put the QNAP firmware back in flash and installed the complete the QNAP software, your device will run the original software from QNAP again.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Recovery mode of QNAP TS-41x/TS-42x devices ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;QNAP TS-41x/TS-42x devices have a recovery mode that can be used when there is a problem with your installation of Debian that renders your device unbootable. The system recovery mode allows you write a recovery image to flash via the network using the TFTP protocol. This pages describes how how to create recovery images and how to use the recovery mode. As an alternative to the instructions on this page, you can use a [http://wiki.qnap.com/wiki/Firmware_Recovery Live CD provided by QNAP].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Creating recovery images&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to create a recovery image for your QNAP TS-41x/TS-42x, you have to take an exact copy of your flash memory. That is, the recovery image consists of the following parts of your flash in this order: &amp;lt;code&amp;gt;mtd0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd4&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd5&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd3&amp;lt;/code&amp;gt;. You may wonder about this strange order but this is the way in which the data is physically stored in the flash memory. During recovery mode, &amp;lt;code&amp;gt;mtd0&amp;lt;/code&amp;gt; (the boot loader), &amp;lt;code&amp;gt;mtd4&amp;lt;/code&amp;gt; (the boot loader configuration) and on some devices &amp;lt;code&amp;gt;mtd5&amp;lt;/code&amp;gt; (device configuration) are ignored and the other parts of flash are overwritten with the data from your recovery image. In order to make a valid QNAP recovery image, you therefore have to put all &amp;lt;code&amp;gt;mtd&amp;lt;/code&amp;gt; partitions into one file in the order described above.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Making a recovery image of the QNAP backup&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Before installing Debian, you should have made a backup of the QNAP firmware and have several &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files. You can now make a recovery image out of the backup with this command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd0 mtd4 mtd5 mtd1 mtd2 mtd3 &amp;amp;gt; F_TS-419P_qnap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Making a recovery image from a running system&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You can easily make a valid recovery image with the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /dev/mtdblock0 /dev/mtdblock4 /dev/mtdblock5 /dev/mtdblock1 /dev/mtdblock2 /dev/mtdblock3 &amp;amp;gt; F_TS-419P_debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;It is recommended to create periodic recovery images of your flash, so you have a recovery image in case something goes wrong.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Making a recovery image containing the Debian installer&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you want to make a QNAP recovery image containing the Debian installer, you can follow these steps. First of all, download the &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://ftp.uk.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/initrd.gz&amp;quot;&amp;gt;initrd&amp;lt;/a&amp;gt; and &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://ftp.uk.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/kernel&amp;quot;&amp;gt;kernel&amp;lt;/a&amp;gt; for the installer. You now have to pad the kernel so it is the right size and create an empty file 2 MB in size:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dd if=kernel of=kernel.pad ibs=2097152 conv=sync&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Finally, you can create a recovery image:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd0 mtd4 mtd5 kernel.pad initrd.gz mtd3 &amp;amp;gt; F_TS-419P_di&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Note that the &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files in this command refer to the backup you created earlier (before the installation).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Using the recovery mode&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In case your Debian system no longer boots after a system upgrade, you can use the QNAP system recovery mode to restore a previous image, an image of the Debian installer, or the QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The recovery mode will first request an IP address via DHCP and then request a recovery image by TFTP from a server on your network. You have to configure your DHCP server so it will request the right file from the right machine. In particular, you have to create an entry for your QNAP that specifies &amp;lt;code&amp;gt;filename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;next-server&amp;lt;/code&amp;gt;. The latter refers to the IP address of your TFTP server (likely the same as your DHCP server). The &amp;lt;code&amp;gt;filename&amp;lt;/code&amp;gt; of the recovery image has to start with a specific string depending on your machine (otherwise the machine won't load the image!).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can check the following table to find out which string to use:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;&lt;br /&gt;
Device&lt;br /&gt;
&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;&lt;br /&gt;
String&lt;br /&gt;
&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-410&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-410&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-412&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-412&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-410U&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-410U&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P+&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P II&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P2+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U+&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U II&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U2&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-420&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-420&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-421&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-421&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;One some devices (but not on the TS-419P+), you can check the backup you made of the flash to find out what the right string is for your machine:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
strings mtd4 | grep bootp_vendor_class&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that by default the MAC address used by your QNAP device in the recovery mode is different to the one used while running the QNAP firmware. When you install Debian, a script is run to ensure that the same MAC address is used everywhere. Therefore, depending on whether you ran that script, the MAC address will either be that from the QNAP firmware (the one printed on your device; it probably starts with &amp;lt;code&amp;gt;00:08:9B&amp;lt;/code&amp;gt;) or an address starting with &amp;lt;code&amp;gt;00:50:43&amp;lt;/code&amp;gt;. You can run the recovery mode and then look for &amp;lt;code&amp;gt;DHCPDISCOVER&amp;lt;/code&amp;gt; messages in &amp;lt;code&amp;gt;/var/log/syslog&amp;lt;/code&amp;gt; to find out the correct MAC address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Once you have the right MAC address, you can configure your DHCP server. I used the following entry in &amp;lt;code&amp;gt;/etc/dhcp3/dhcpd.conf&amp;lt;/code&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
host ts419p {&lt;br /&gt;
    hardware ethernet 00:50:43:3c:3b:5d;&lt;br /&gt;
    filename &amp;quot;F_TS-419P_debian&amp;quot;;&lt;br /&gt;
    fixed-address 192.168.1.71;&lt;br /&gt;
    next-server 192.168.1.2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Reload your DHCP server so the configuration change will take effect.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can activate the recovery mode by pressing the reset button on the back of your QNAP for about 10 seconds. I suggest you press the reset button and keep it pressed, and then turn on your QNAP device. After about 10 seconds, you will hear two short beeps. Your QNAP will now request a recovery image via TFTP. When it has obtained the recovery image and written it to flash (which takes about 3.5 minutes), your QNAP will make two short beeps again and restart.&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/InstallDebianOnQNAP&amp;diff=284</id>
		<title>HowTo/InstallDebianOnQNAP</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/InstallDebianOnQNAP&amp;diff=284"/>
		<updated>2014-05-31T07:07:18Z</updated>

		<summary type="html">&lt;p&gt;Eadam: /* Recovery mode of QNAP TS-41x/TS-42x devices */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installing Debian on the TS-420 ==&lt;br /&gt;
&lt;br /&gt;
Original source: http://www.cyrius.com/debian/kirkwood/qnap/ts-41x/install/&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In a nutshell, the installation of Debian on your QNAP TS-41x/TS-42x works like this: you use the QNAP firmware to write a Debian installer image to flash. When you restart your device, Debian installer starts and allows you to login via SSH to perform the installation. Debian will be installed to disk and a Debian kernel will be put in flash that will start Debian from disk.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If you follow this procedure, Debian 7 (wheezy) will be installed to your SATA disk and the QNAP firmware on disk and in flash will be replaced with Debian. Debian does not install a web interface to configure your machine, although it's possible to install such software. If this is not what you want, please don't proceed with the installation.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Requirements and Preparation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to install Debian on a QNAP device, you need the following:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A QNAP TS-410, TS-410U, TS-412, TS-419P, TS-419P+, TS-419P II, TS-419U, TS-419U+, TS-420 or TS-421.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
An internal SATA disk.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A network connection.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Another machine on which you have a telnet and an SSH client. Telnet is included in Linux and Windows. SSH is included in every Linux distribution as OpenSSH and there is &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html&amp;quot;&amp;gt;PuTTY&amp;lt;/a&amp;gt; for Windows.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Making a Backup ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You have to make a backup of all the data stored on your QNAP before starting with the installation of Debian since Debian will format the whole disk during the installation. Also, Debian will replace the QNAP firmware in flash, so it's also recommended to make a copy of the flash (mtd) partitions. Debian will only modify the first two flash partitions but it's a good idea to keep a copy of all partitions as you may need them to use the recovery mode. More detailed instructions for making a backup of your flash partitions will be given later.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Starting the Installer ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Start your QNAP device and login via SSH. Some time after you start your machine, you will hear a beep and a bit later you'll hear a longer beep. Wait for a few more seconds and then connect to the machine via SSH. The username is &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; and the password is &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; too.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Once you are logged in, you can save the content of your flash partitions to a USB stick. Connect a USB stick to your QNAP and wait for the system to mount it. In my case, it was mounted at &amp;lt;code&amp;gt;/share/external/sdi&amp;lt;/code&amp;gt; but you can find the location with the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mount | grep external&lt;br /&gt;
/dev/sdi1 on /share/external/&amp;lt;span class=&amp;quot;input&amp;quot;&amp;gt;sdi&amp;lt;/span&amp;gt; type vfat [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Now go to this directory and make a backup of your flash partitions:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /share/external/sdi&lt;br /&gt;
cat /dev/mtdblock0 &amp;amp;gt; mtd0&lt;br /&gt;
cat /dev/mtdblock1 &amp;amp;gt; mtd1&lt;br /&gt;
cat /dev/mtdblock2 &amp;amp;gt; mtd2&lt;br /&gt;
cat /dev/mtdblock3 &amp;amp;gt; mtd3&lt;br /&gt;
cat /dev/mtdblock4 &amp;amp;gt; mtd4&lt;br /&gt;
cat /dev/mtdblock5 &amp;amp;gt; mtd5&lt;br /&gt;
cd&lt;br /&gt;
umount /share/external/sdi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Disconnect your USB stick from your QNAP, connect it to your PC and to add the &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files to your regular backup.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Now you can go ahead and download the installer.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
Download and Flash the Installer&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to download the Debian installer images, issue the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/initrd.gz&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/kernel&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/flash-debian&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/model&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;These commands will download the Debian kernel, the installer ramdisk, a file with information about the support QNAP model, and a script to write the kernel and ramdisk to flash. You can now run the script by executing the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sh flash-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that this command will take about three minutes to run. You will see the following on your screen:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Updating MAC address...&lt;br /&gt;
Your MAC address is 00:08:9B:8C:xx:xx&lt;br /&gt;
Writing debian-installer to flash... done.&lt;br /&gt;
Please reboot your QNAP device.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Once the command has completed, you can reboot your QNAP device:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
reboot&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Installation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;After you have flashed the Debian installer image and restarted your QNAP device, the Debian installer will start. Since the TS-41x/TS-42x does not have any IO device, SSH will be used for the installation. The installer will bring up the network, start the OpenSSH server and you can then connect to the device using SSH. You have to wait a few minutes after starting the system before you can connect. When the installer is ready, the status LED will change to solid green and your device will beep briefly to indicate that you can now login via SSH.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that Ethernet port numeration differs between the QNAP firmware and Debian. Under Debian, &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; is the port marked with &amp;amp;quot;LAN2&amp;amp;quot;. On the TS-419P, this is the lower (and not the upper) connector!&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;net-config&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Since most TS-41x/TS-42x devices do not have an LCD, the installer cannot tell you which IP address to connect to or which password to use. (On the TS-41x, the LCD is currently not supported but will be supported in the future.) With regards to the IP address, the following strategy is used:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If your QNAP firmware is configured to use DHCP (the default configuration from QNAP), Debian installer will try to acquire an IP address with DHCP. If you have not initialized your QNAP firmware with QFinder, DHCP will be used. You can use the MAC address of your QNAP device to tell your DHCP server to give out a specific IP address to your machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If you configured a static address in your QNAP firmware, this configuration will be used. However, if your network configuration was incomplete (e.g. IP address or DNS were missing), the installer will use DHCP instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If DHCP is used but your DHCP server does not respond, the device will use the fallback address &amp;lt;code&amp;gt;192.168.1.100&amp;lt;/code&amp;gt;. If you are unsure what the address of your QNAP is, unplug the Ethernet cable, start the machine again, wait until Debian installer is ready for SSH and then plug the cable back in and connect to this fallback address.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please make sure that the QNAP is on a local network to which only you have access since the installer uses a very generic password, namely &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt;. The user is &amp;lt;code&amp;gt;installer&amp;lt;/code&amp;gt;. Before you can connect to the installer via SSH, you have to remove the SSH key from the QNAP firmware from your known_hosts file. The QNAP firmware uses a different SSH key than the Debian installer, so when you try to connect to Debian you will get an error saying that the remote host identification has changed. Edit ~/.ssh/known_hosts and remove the entry for the IP address of your QNAP device. Now connect to the installer (again, replacing the address in the example with the actual IP address of your QNAP) and login as user &amp;lt;code&amp;gt;installer&amp;lt;/code&amp;gt; with the password &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh installer@&amp;lt;span class=&amp;quot;input&amp;quot;&amp;gt;192.168.1.100&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The installation itself should be pretty standard and you can follow the &amp;lt;a&lt;br /&gt;
href = &amp;quot;http://www.debian.org/releases/stable/armel/&amp;quot;&amp;gt;installation guide&amp;lt;/a&amp;gt;. The installer knows about the TS-41x/TS-42x and at the end of the installation it will flash a kernel and ramdisk that will automatically boot into Debian. It will also install the &amp;lt;code&amp;gt;qcontrol&amp;lt;/code&amp;gt; package that can be used to control the fan, LEDs and beeper on your QNAP device.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Since the TS-41x/TS-42x boots from flash you don't have many limitations as to how you partition your hard drive. You can use LVM and RAID and a number of filesystems.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;At the end of the installation, the installer will write the new kernel to flash. Afterwards you will get a confirmation that the installation is complete. Confirm, wait for the installer to finish and once your SSH session terminates, wait a few minutes before you can connect to your newly installed system via SSH. Your QNAP device will beep when you can connect via SSH. You will be able to log in as &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; or your newly created user.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Success ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You should now have a complete Debian system running on your QNAP. You can use &amp;lt;code&amp;gt;apt-get&amp;lt;/code&amp;gt; and other tools to install additional software. The TS-41x/TS-42x is an ARM based device and the &amp;lt;code&amp;gt;armel&amp;lt;/code&amp;gt; architecture is fully supported by Debian.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Finally, make sure to read the &amp;lt;a href = &amp;quot;../tips/&amp;quot;&amp;gt;tips and tricks&amp;lt;/a&amp;gt; about running Debian on the QNAP TS-41x/TS-42x.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Restoring the original QNAP firmware ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you want to restore the original QNAP firmware on your TS-41x or TS-42x device for some reason, you can follow the instructions below. Please note that this will only work if your Debian system is still working. If your Debian system is broken but the machine itself works, you can use the recovery mode to restore the QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;There are two steps to restore the original QNAP firmware. First, you have to put the backup of the flash partitions from the QNAP firmware you made before the installation of Debian into flash.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd1 &amp;amp;gt; /dev/mtdblock1&lt;br /&gt;
cat mtd2 &amp;amp;gt; /dev/mtdblock2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Second, you have to restart your QNAP, and then go to the web interface to format your disk and install the full QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;After you put the QNAP firmware back in flash and installed the complete the QNAP software, your device will run the original software from QNAP again.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Recovery mode of QNAP TS-41x/TS-42x devices ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;QNAP TS-41x/TS-42x devices have a recovery mode that can be used when there is a problem with your installation of Debian that renders your device unbootable. The system recovery mode allows you write a recovery image to flash via the network using the TFTP protocol. This pages describes how how to create recovery images and how to use the recovery mode. As an alternative to the instructions on this page, you can use a [[http://wiki.qnap.com/wiki/Firmware_Recovery Live CD provided by QNAP]].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Creating recovery images&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to create a recovery image for your QNAP TS-41x/TS-42x, you have to take an exact copy of your flash memory. That is, the recovery image consists of the following parts of your flash in this order: &amp;lt;code&amp;gt;mtd0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd4&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd5&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd3&amp;lt;/code&amp;gt;. You may wonder about this strange order but this is the way in which the data is physically stored in the flash memory. During recovery mode, &amp;lt;code&amp;gt;mtd0&amp;lt;/code&amp;gt; (the boot loader), &amp;lt;code&amp;gt;mtd4&amp;lt;/code&amp;gt; (the boot loader configuration) and on some devices &amp;lt;code&amp;gt;mtd5&amp;lt;/code&amp;gt; (device configuration) are ignored and the other parts of flash are overwritten with the data from your recovery image. In order to make a valid QNAP recovery image, you therefore have to put all &amp;lt;code&amp;gt;mtd&amp;lt;/code&amp;gt; partitions into one file in the order described above.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Making a recovery image of the QNAP backup&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Before installing Debian, you should have made a backup of the QNAP firmware and have several &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files. You can now make a recovery image out of the backup with this command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd0 mtd4 mtd5 mtd1 mtd2 mtd3 &amp;amp;gt; F_TS-419P_qnap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Making a recovery image from a running system&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You can easily make a valid recovery image with the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /dev/mtdblock0 /dev/mtdblock4 /dev/mtdblock5 /dev/mtdblock1 /dev/mtdblock2 /dev/mtdblock3 &amp;amp;gt; F_TS-419P_debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;It is recommended to create periodic recovery images of your flash, so you have a recovery image in case something goes wrong.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Making a recovery image containing the Debian installer&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you want to make a QNAP recovery image containing the Debian installer, you can follow these steps. First of all, download the &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://ftp.uk.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/initrd.gz&amp;quot;&amp;gt;initrd&amp;lt;/a&amp;gt; and &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://ftp.uk.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/kernel&amp;quot;&amp;gt;kernel&amp;lt;/a&amp;gt; for the installer. You now have to pad the kernel so it is the right size and create an empty file 2 MB in size:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dd if=kernel of=kernel.pad ibs=2097152 conv=sync&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Finally, you can create a recovery image:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd0 mtd4 mtd5 kernel.pad initrd.gz mtd3 &amp;amp;gt; F_TS-419P_di&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Note that the &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files in this command refer to the backup you created earlier (before the installation).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Using the recovery mode&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In case your Debian system no longer boots after a system upgrade, you can use the QNAP system recovery mode to restore a previous image, an image of the Debian installer, or the QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The recovery mode will first request an IP address via DHCP and then request a recovery image by TFTP from a server on your network. You have to configure your DHCP server so it will request the right file from the right machine. In particular, you have to create an entry for your QNAP that specifies &amp;lt;code&amp;gt;filename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;next-server&amp;lt;/code&amp;gt;. The latter refers to the IP address of your TFTP server (likely the same as your DHCP server). The &amp;lt;code&amp;gt;filename&amp;lt;/code&amp;gt; of the recovery image has to start with a specific string depending on your machine (otherwise the machine won't load the image!).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can check the following table to find out which string to use:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;&lt;br /&gt;
Device&lt;br /&gt;
&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;&lt;br /&gt;
String&lt;br /&gt;
&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-410&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-410&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-412&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-412&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-410U&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-410U&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P+&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P II&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P2+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U+&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U II&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U2&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-420&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-420&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-421&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-421&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;One some devices (but not on the TS-419P+), you can check the backup you made of the flash to find out what the right string is for your machine:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
strings mtd4 | grep bootp_vendor_class&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that by default the MAC address used by your QNAP device in the recovery mode is different to the one used while running the QNAP firmware. When you install Debian, a script is run to ensure that the same MAC address is used everywhere. Therefore, depending on whether you ran that script, the MAC address will either be that from the QNAP firmware (the one printed on your device; it probably starts with &amp;lt;code&amp;gt;00:08:9B&amp;lt;/code&amp;gt;) or an address starting with &amp;lt;code&amp;gt;00:50:43&amp;lt;/code&amp;gt;. You can run the recovery mode and then look for &amp;lt;code&amp;gt;DHCPDISCOVER&amp;lt;/code&amp;gt; messages in &amp;lt;code&amp;gt;/var/log/syslog&amp;lt;/code&amp;gt; to find out the correct MAC address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Once you have the right MAC address, you can configure your DHCP server. I used the following entry in &amp;lt;code&amp;gt;/etc/dhcp3/dhcpd.conf&amp;lt;/code&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
host ts419p {&lt;br /&gt;
    hardware ethernet 00:50:43:3c:3b:5d;&lt;br /&gt;
    filename &amp;quot;F_TS-419P_debian&amp;quot;;&lt;br /&gt;
    fixed-address 192.168.1.71;&lt;br /&gt;
    next-server 192.168.1.2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Reload your DHCP server so the configuration change will take effect.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can activate the recovery mode by pressing the reset button on the back of your QNAP for about 10 seconds. I suggest you press the reset button and keep it pressed, and then turn on your QNAP device. After about 10 seconds, you will hear two short beeps. Your QNAP will now request a recovery image via TFTP. When it has obtained the recovery image and written it to flash (which takes about 3.5 minutes), your QNAP will make two short beeps again and restart.&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/InstallDebianOnQNAP&amp;diff=283</id>
		<title>HowTo/InstallDebianOnQNAP</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/InstallDebianOnQNAP&amp;diff=283"/>
		<updated>2014-05-31T07:06:42Z</updated>

		<summary type="html">&lt;p&gt;Eadam: /* Restoring the original QNAP firmware */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installing Debian on the TS-420 ==&lt;br /&gt;
&lt;br /&gt;
Original source: http://www.cyrius.com/debian/kirkwood/qnap/ts-41x/install/&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In a nutshell, the installation of Debian on your QNAP TS-41x/TS-42x works like this: you use the QNAP firmware to write a Debian installer image to flash. When you restart your device, Debian installer starts and allows you to login via SSH to perform the installation. Debian will be installed to disk and a Debian kernel will be put in flash that will start Debian from disk.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If you follow this procedure, Debian 7 (wheezy) will be installed to your SATA disk and the QNAP firmware on disk and in flash will be replaced with Debian. Debian does not install a web interface to configure your machine, although it's possible to install such software. If this is not what you want, please don't proceed with the installation.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Requirements and Preparation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to install Debian on a QNAP device, you need the following:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A QNAP TS-410, TS-410U, TS-412, TS-419P, TS-419P+, TS-419P II, TS-419U, TS-419U+, TS-420 or TS-421.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
An internal SATA disk.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A network connection.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Another machine on which you have a telnet and an SSH client. Telnet is included in Linux and Windows. SSH is included in every Linux distribution as OpenSSH and there is &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html&amp;quot;&amp;gt;PuTTY&amp;lt;/a&amp;gt; for Windows.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Making a Backup ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You have to make a backup of all the data stored on your QNAP before starting with the installation of Debian since Debian will format the whole disk during the installation. Also, Debian will replace the QNAP firmware in flash, so it's also recommended to make a copy of the flash (mtd) partitions. Debian will only modify the first two flash partitions but it's a good idea to keep a copy of all partitions as you may need them to use the recovery mode. More detailed instructions for making a backup of your flash partitions will be given later.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Starting the Installer ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Start your QNAP device and login via SSH. Some time after you start your machine, you will hear a beep and a bit later you'll hear a longer beep. Wait for a few more seconds and then connect to the machine via SSH. The username is &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; and the password is &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; too.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Once you are logged in, you can save the content of your flash partitions to a USB stick. Connect a USB stick to your QNAP and wait for the system to mount it. In my case, it was mounted at &amp;lt;code&amp;gt;/share/external/sdi&amp;lt;/code&amp;gt; but you can find the location with the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mount | grep external&lt;br /&gt;
/dev/sdi1 on /share/external/&amp;lt;span class=&amp;quot;input&amp;quot;&amp;gt;sdi&amp;lt;/span&amp;gt; type vfat [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Now go to this directory and make a backup of your flash partitions:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /share/external/sdi&lt;br /&gt;
cat /dev/mtdblock0 &amp;amp;gt; mtd0&lt;br /&gt;
cat /dev/mtdblock1 &amp;amp;gt; mtd1&lt;br /&gt;
cat /dev/mtdblock2 &amp;amp;gt; mtd2&lt;br /&gt;
cat /dev/mtdblock3 &amp;amp;gt; mtd3&lt;br /&gt;
cat /dev/mtdblock4 &amp;amp;gt; mtd4&lt;br /&gt;
cat /dev/mtdblock5 &amp;amp;gt; mtd5&lt;br /&gt;
cd&lt;br /&gt;
umount /share/external/sdi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Disconnect your USB stick from your QNAP, connect it to your PC and to add the &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files to your regular backup.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Now you can go ahead and download the installer.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
Download and Flash the Installer&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to download the Debian installer images, issue the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/initrd.gz&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/kernel&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/flash-debian&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/model&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;These commands will download the Debian kernel, the installer ramdisk, a file with information about the support QNAP model, and a script to write the kernel and ramdisk to flash. You can now run the script by executing the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sh flash-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that this command will take about three minutes to run. You will see the following on your screen:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Updating MAC address...&lt;br /&gt;
Your MAC address is 00:08:9B:8C:xx:xx&lt;br /&gt;
Writing debian-installer to flash... done.&lt;br /&gt;
Please reboot your QNAP device.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Once the command has completed, you can reboot your QNAP device:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
reboot&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Installation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;After you have flashed the Debian installer image and restarted your QNAP device, the Debian installer will start. Since the TS-41x/TS-42x does not have any IO device, SSH will be used for the installation. The installer will bring up the network, start the OpenSSH server and you can then connect to the device using SSH. You have to wait a few minutes after starting the system before you can connect. When the installer is ready, the status LED will change to solid green and your device will beep briefly to indicate that you can now login via SSH.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that Ethernet port numeration differs between the QNAP firmware and Debian. Under Debian, &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; is the port marked with &amp;amp;quot;LAN2&amp;amp;quot;. On the TS-419P, this is the lower (and not the upper) connector!&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;net-config&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Since most TS-41x/TS-42x devices do not have an LCD, the installer cannot tell you which IP address to connect to or which password to use. (On the TS-41x, the LCD is currently not supported but will be supported in the future.) With regards to the IP address, the following strategy is used:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If your QNAP firmware is configured to use DHCP (the default configuration from QNAP), Debian installer will try to acquire an IP address with DHCP. If you have not initialized your QNAP firmware with QFinder, DHCP will be used. You can use the MAC address of your QNAP device to tell your DHCP server to give out a specific IP address to your machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If you configured a static address in your QNAP firmware, this configuration will be used. However, if your network configuration was incomplete (e.g. IP address or DNS were missing), the installer will use DHCP instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If DHCP is used but your DHCP server does not respond, the device will use the fallback address &amp;lt;code&amp;gt;192.168.1.100&amp;lt;/code&amp;gt;. If you are unsure what the address of your QNAP is, unplug the Ethernet cable, start the machine again, wait until Debian installer is ready for SSH and then plug the cable back in and connect to this fallback address.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please make sure that the QNAP is on a local network to which only you have access since the installer uses a very generic password, namely &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt;. The user is &amp;lt;code&amp;gt;installer&amp;lt;/code&amp;gt;. Before you can connect to the installer via SSH, you have to remove the SSH key from the QNAP firmware from your known_hosts file. The QNAP firmware uses a different SSH key than the Debian installer, so when you try to connect to Debian you will get an error saying that the remote host identification has changed. Edit ~/.ssh/known_hosts and remove the entry for the IP address of your QNAP device. Now connect to the installer (again, replacing the address in the example with the actual IP address of your QNAP) and login as user &amp;lt;code&amp;gt;installer&amp;lt;/code&amp;gt; with the password &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh installer@&amp;lt;span class=&amp;quot;input&amp;quot;&amp;gt;192.168.1.100&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The installation itself should be pretty standard and you can follow the &amp;lt;a&lt;br /&gt;
href = &amp;quot;http://www.debian.org/releases/stable/armel/&amp;quot;&amp;gt;installation guide&amp;lt;/a&amp;gt;. The installer knows about the TS-41x/TS-42x and at the end of the installation it will flash a kernel and ramdisk that will automatically boot into Debian. It will also install the &amp;lt;code&amp;gt;qcontrol&amp;lt;/code&amp;gt; package that can be used to control the fan, LEDs and beeper on your QNAP device.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Since the TS-41x/TS-42x boots from flash you don't have many limitations as to how you partition your hard drive. You can use LVM and RAID and a number of filesystems.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;At the end of the installation, the installer will write the new kernel to flash. Afterwards you will get a confirmation that the installation is complete. Confirm, wait for the installer to finish and once your SSH session terminates, wait a few minutes before you can connect to your newly installed system via SSH. Your QNAP device will beep when you can connect via SSH. You will be able to log in as &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; or your newly created user.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Success ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You should now have a complete Debian system running on your QNAP. You can use &amp;lt;code&amp;gt;apt-get&amp;lt;/code&amp;gt; and other tools to install additional software. The TS-41x/TS-42x is an ARM based device and the &amp;lt;code&amp;gt;armel&amp;lt;/code&amp;gt; architecture is fully supported by Debian.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Finally, make sure to read the &amp;lt;a href = &amp;quot;../tips/&amp;quot;&amp;gt;tips and tricks&amp;lt;/a&amp;gt; about running Debian on the QNAP TS-41x/TS-42x.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Restoring the original QNAP firmware ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you want to restore the original QNAP firmware on your TS-41x or TS-42x device for some reason, you can follow the instructions below. Please note that this will only work if your Debian system is still working. If your Debian system is broken but the machine itself works, you can use the recovery mode to restore the QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;There are two steps to restore the original QNAP firmware. First, you have to put the backup of the flash partitions from the QNAP firmware you made before the installation of Debian into flash.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd1 &amp;amp;gt; /dev/mtdblock1&lt;br /&gt;
cat mtd2 &amp;amp;gt; /dev/mtdblock2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Second, you have to restart your QNAP, and then go to the web interface to format your disk and install the full QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;After you put the QNAP firmware back in flash and installed the complete the QNAP software, your device will run the original software from QNAP again.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Recovery mode of QNAP TS-41x/TS-42x devices ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;QNAP TS-41x/TS-42x devices have a recovery mode that can be used when there is a problem with your installation of Debian that renders your device unbootable. The system recovery mode allows you write a recovery image to flash via the network using the TFTP protocol. This pages describes how how to create recovery images and how to use the recovery mode. As an alternative to the instructions on this page, you can use a &amp;lt;a href=&amp;quot;http://wiki.qnap.com/wiki/Firmware_Recovery&amp;quot;&amp;gt;Live CD provided by QNAP&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Creating recovery images&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to create a recovery image for your QNAP TS-41x/TS-42x, you have to take an exact copy of your flash memory. That is, the recovery image consists of the following parts of your flash in this order: &amp;lt;code&amp;gt;mtd0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd4&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd5&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd3&amp;lt;/code&amp;gt;. You may wonder about this strange order but this is the way in which the data is physically stored in the flash memory. During recovery mode, &amp;lt;code&amp;gt;mtd0&amp;lt;/code&amp;gt; (the boot loader), &amp;lt;code&amp;gt;mtd4&amp;lt;/code&amp;gt; (the boot loader configuration) and on some devices &amp;lt;code&amp;gt;mtd5&amp;lt;/code&amp;gt; (device configuration) are ignored and the other parts of flash are overwritten with the data from your recovery image. In order to make a valid QNAP recovery image, you therefore have to put all &amp;lt;code&amp;gt;mtd&amp;lt;/code&amp;gt; partitions into one file in the order described above.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Making a recovery image of the QNAP backup&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Before installing Debian, you should have made a backup of the QNAP firmware and have several &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files. You can now make a recovery image out of the backup with this command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd0 mtd4 mtd5 mtd1 mtd2 mtd3 &amp;amp;gt; F_TS-419P_qnap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Making a recovery image from a running system&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You can easily make a valid recovery image with the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /dev/mtdblock0 /dev/mtdblock4 /dev/mtdblock5 /dev/mtdblock1 /dev/mtdblock2 /dev/mtdblock3 &amp;amp;gt; F_TS-419P_debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;It is recommended to create periodic recovery images of your flash, so you have a recovery image in case something goes wrong.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Making a recovery image containing the Debian installer&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you want to make a QNAP recovery image containing the Debian installer, you can follow these steps. First of all, download the &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://ftp.uk.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/initrd.gz&amp;quot;&amp;gt;initrd&amp;lt;/a&amp;gt; and &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://ftp.uk.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/kernel&amp;quot;&amp;gt;kernel&amp;lt;/a&amp;gt; for the installer. You now have to pad the kernel so it is the right size and create an empty file 2 MB in size:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dd if=kernel of=kernel.pad ibs=2097152 conv=sync&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Finally, you can create a recovery image:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd0 mtd4 mtd5 kernel.pad initrd.gz mtd3 &amp;amp;gt; F_TS-419P_di&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Note that the &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files in this command refer to the backup you created earlier (before the installation).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Using the recovery mode&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In case your Debian system no longer boots after a system upgrade, you can use the QNAP system recovery mode to restore a previous image, an image of the Debian installer, or the QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The recovery mode will first request an IP address via DHCP and then request a recovery image by TFTP from a server on your network. You have to configure your DHCP server so it will request the right file from the right machine. In particular, you have to create an entry for your QNAP that specifies &amp;lt;code&amp;gt;filename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;next-server&amp;lt;/code&amp;gt;. The latter refers to the IP address of your TFTP server (likely the same as your DHCP server). The &amp;lt;code&amp;gt;filename&amp;lt;/code&amp;gt; of the recovery image has to start with a specific string depending on your machine (otherwise the machine won't load the image!).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can check the following table to find out which string to use:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;&lt;br /&gt;
Device&lt;br /&gt;
&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;&lt;br /&gt;
String&lt;br /&gt;
&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-410&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-410&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-412&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-412&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-410U&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-410U&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P+&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P II&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P2+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U+&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U II&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U2&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-420&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-420&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-421&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-421&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;One some devices (but not on the TS-419P+), you can check the backup you made of the flash to find out what the right string is for your machine:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
strings mtd4 | grep bootp_vendor_class&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that by default the MAC address used by your QNAP device in the recovery mode is different to the one used while running the QNAP firmware. When you install Debian, a script is run to ensure that the same MAC address is used everywhere. Therefore, depending on whether you ran that script, the MAC address will either be that from the QNAP firmware (the one printed on your device; it probably starts with &amp;lt;code&amp;gt;00:08:9B&amp;lt;/code&amp;gt;) or an address starting with &amp;lt;code&amp;gt;00:50:43&amp;lt;/code&amp;gt;. You can run the recovery mode and then look for &amp;lt;code&amp;gt;DHCPDISCOVER&amp;lt;/code&amp;gt; messages in &amp;lt;code&amp;gt;/var/log/syslog&amp;lt;/code&amp;gt; to find out the correct MAC address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Once you have the right MAC address, you can configure your DHCP server. I used the following entry in &amp;lt;code&amp;gt;/etc/dhcp3/dhcpd.conf&amp;lt;/code&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
host ts419p {&lt;br /&gt;
    hardware ethernet 00:50:43:3c:3b:5d;&lt;br /&gt;
    filename &amp;quot;F_TS-419P_debian&amp;quot;;&lt;br /&gt;
    fixed-address 192.168.1.71;&lt;br /&gt;
    next-server 192.168.1.2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Reload your DHCP server so the configuration change will take effect.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can activate the recovery mode by pressing the reset button on the back of your QNAP for about 10 seconds. I suggest you press the reset button and keep it pressed, and then turn on your QNAP device. After about 10 seconds, you will hear two short beeps. Your QNAP will now request a recovery image via TFTP. When it has obtained the recovery image and written it to flash (which takes about 3.5 minutes), your QNAP will make two short beeps again and restart.&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/InstallDebianOnQNAP&amp;diff=282</id>
		<title>HowTo/InstallDebianOnQNAP</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/InstallDebianOnQNAP&amp;diff=282"/>
		<updated>2014-05-31T07:06:05Z</updated>

		<summary type="html">&lt;p&gt;Eadam: /* Recovery mode of QNAP TS-41x/TS-42x devices */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installing Debian on the TS-420 ==&lt;br /&gt;
&lt;br /&gt;
Original source: http://www.cyrius.com/debian/kirkwood/qnap/ts-41x/install/&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In a nutshell, the installation of Debian on your QNAP TS-41x/TS-42x works like this: you use the QNAP firmware to write a Debian installer image to flash. When you restart your device, Debian installer starts and allows you to login via SSH to perform the installation. Debian will be installed to disk and a Debian kernel will be put in flash that will start Debian from disk.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If you follow this procedure, Debian 7 (wheezy) will be installed to your SATA disk and the QNAP firmware on disk and in flash will be replaced with Debian. Debian does not install a web interface to configure your machine, although it's possible to install such software. If this is not what you want, please don't proceed with the installation.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Requirements and Preparation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to install Debian on a QNAP device, you need the following:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A QNAP TS-410, TS-410U, TS-412, TS-419P, TS-419P+, TS-419P II, TS-419U, TS-419U+, TS-420 or TS-421.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
An internal SATA disk.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A network connection.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Another machine on which you have a telnet and an SSH client. Telnet is included in Linux and Windows. SSH is included in every Linux distribution as OpenSSH and there is &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html&amp;quot;&amp;gt;PuTTY&amp;lt;/a&amp;gt; for Windows.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Making a Backup ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You have to make a backup of all the data stored on your QNAP before starting with the installation of Debian since Debian will format the whole disk during the installation. Also, Debian will replace the QNAP firmware in flash, so it's also recommended to make a copy of the flash (mtd) partitions. Debian will only modify the first two flash partitions but it's a good idea to keep a copy of all partitions as you may need them to use the recovery mode. More detailed instructions for making a backup of your flash partitions will be given later.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Starting the Installer ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Start your QNAP device and login via SSH. Some time after you start your machine, you will hear a beep and a bit later you'll hear a longer beep. Wait for a few more seconds and then connect to the machine via SSH. The username is &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; and the password is &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; too.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Once you are logged in, you can save the content of your flash partitions to a USB stick. Connect a USB stick to your QNAP and wait for the system to mount it. In my case, it was mounted at &amp;lt;code&amp;gt;/share/external/sdi&amp;lt;/code&amp;gt; but you can find the location with the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mount | grep external&lt;br /&gt;
/dev/sdi1 on /share/external/&amp;lt;span class=&amp;quot;input&amp;quot;&amp;gt;sdi&amp;lt;/span&amp;gt; type vfat [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Now go to this directory and make a backup of your flash partitions:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /share/external/sdi&lt;br /&gt;
cat /dev/mtdblock0 &amp;amp;gt; mtd0&lt;br /&gt;
cat /dev/mtdblock1 &amp;amp;gt; mtd1&lt;br /&gt;
cat /dev/mtdblock2 &amp;amp;gt; mtd2&lt;br /&gt;
cat /dev/mtdblock3 &amp;amp;gt; mtd3&lt;br /&gt;
cat /dev/mtdblock4 &amp;amp;gt; mtd4&lt;br /&gt;
cat /dev/mtdblock5 &amp;amp;gt; mtd5&lt;br /&gt;
cd&lt;br /&gt;
umount /share/external/sdi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Disconnect your USB stick from your QNAP, connect it to your PC and to add the &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files to your regular backup.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Now you can go ahead and download the installer.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
Download and Flash the Installer&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to download the Debian installer images, issue the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/initrd.gz&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/kernel&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/flash-debian&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/model&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;These commands will download the Debian kernel, the installer ramdisk, a file with information about the support QNAP model, and a script to write the kernel and ramdisk to flash. You can now run the script by executing the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sh flash-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that this command will take about three minutes to run. You will see the following on your screen:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Updating MAC address...&lt;br /&gt;
Your MAC address is 00:08:9B:8C:xx:xx&lt;br /&gt;
Writing debian-installer to flash... done.&lt;br /&gt;
Please reboot your QNAP device.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Once the command has completed, you can reboot your QNAP device:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
reboot&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Installation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;After you have flashed the Debian installer image and restarted your QNAP device, the Debian installer will start. Since the TS-41x/TS-42x does not have any IO device, SSH will be used for the installation. The installer will bring up the network, start the OpenSSH server and you can then connect to the device using SSH. You have to wait a few minutes after starting the system before you can connect. When the installer is ready, the status LED will change to solid green and your device will beep briefly to indicate that you can now login via SSH.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that Ethernet port numeration differs between the QNAP firmware and Debian. Under Debian, &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; is the port marked with &amp;amp;quot;LAN2&amp;amp;quot;. On the TS-419P, this is the lower (and not the upper) connector!&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;net-config&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Since most TS-41x/TS-42x devices do not have an LCD, the installer cannot tell you which IP address to connect to or which password to use. (On the TS-41x, the LCD is currently not supported but will be supported in the future.) With regards to the IP address, the following strategy is used:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If your QNAP firmware is configured to use DHCP (the default configuration from QNAP), Debian installer will try to acquire an IP address with DHCP. If you have not initialized your QNAP firmware with QFinder, DHCP will be used. You can use the MAC address of your QNAP device to tell your DHCP server to give out a specific IP address to your machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If you configured a static address in your QNAP firmware, this configuration will be used. However, if your network configuration was incomplete (e.g. IP address or DNS were missing), the installer will use DHCP instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If DHCP is used but your DHCP server does not respond, the device will use the fallback address &amp;lt;code&amp;gt;192.168.1.100&amp;lt;/code&amp;gt;. If you are unsure what the address of your QNAP is, unplug the Ethernet cable, start the machine again, wait until Debian installer is ready for SSH and then plug the cable back in and connect to this fallback address.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please make sure that the QNAP is on a local network to which only you have access since the installer uses a very generic password, namely &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt;. The user is &amp;lt;code&amp;gt;installer&amp;lt;/code&amp;gt;. Before you can connect to the installer via SSH, you have to remove the SSH key from the QNAP firmware from your known_hosts file. The QNAP firmware uses a different SSH key than the Debian installer, so when you try to connect to Debian you will get an error saying that the remote host identification has changed. Edit ~/.ssh/known_hosts and remove the entry for the IP address of your QNAP device. Now connect to the installer (again, replacing the address in the example with the actual IP address of your QNAP) and login as user &amp;lt;code&amp;gt;installer&amp;lt;/code&amp;gt; with the password &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh installer@&amp;lt;span class=&amp;quot;input&amp;quot;&amp;gt;192.168.1.100&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The installation itself should be pretty standard and you can follow the &amp;lt;a&lt;br /&gt;
href = &amp;quot;http://www.debian.org/releases/stable/armel/&amp;quot;&amp;gt;installation guide&amp;lt;/a&amp;gt;. The installer knows about the TS-41x/TS-42x and at the end of the installation it will flash a kernel and ramdisk that will automatically boot into Debian. It will also install the &amp;lt;code&amp;gt;qcontrol&amp;lt;/code&amp;gt; package that can be used to control the fan, LEDs and beeper on your QNAP device.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Since the TS-41x/TS-42x boots from flash you don't have many limitations as to how you partition your hard drive. You can use LVM and RAID and a number of filesystems.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;At the end of the installation, the installer will write the new kernel to flash. Afterwards you will get a confirmation that the installation is complete. Confirm, wait for the installer to finish and once your SSH session terminates, wait a few minutes before you can connect to your newly installed system via SSH. Your QNAP device will beep when you can connect via SSH. You will be able to log in as &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; or your newly created user.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Success ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You should now have a complete Debian system running on your QNAP. You can use &amp;lt;code&amp;gt;apt-get&amp;lt;/code&amp;gt; and other tools to install additional software. The TS-41x/TS-42x is an ARM based device and the &amp;lt;code&amp;gt;armel&amp;lt;/code&amp;gt; architecture is fully supported by Debian.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Finally, make sure to read the &amp;lt;a href = &amp;quot;../tips/&amp;quot;&amp;gt;tips and tricks&amp;lt;/a&amp;gt; about running Debian on the QNAP TS-41x/TS-42x.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Restoring the original QNAP firmware ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you want to restore the original QNAP firmware on your TS-41x or TS-42x device for some reason, you can follow the instructions below. Please note that this will only work if your Debian system is still working. If your Debian system is broken but the machine itself works, you can use the &amp;lt;a href = &amp;quot;../recovery/&amp;quot;&amp;gt;recovery mode&amp;lt;/a&amp;gt; to restore the QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;There are two steps to restore the original QNAP firmware. First, you have to put the backup of the flash partitions from the QNAP firmware you made &amp;lt;a href = &amp;quot;../unpack/&amp;quot;&amp;gt;before the installation of Debian&amp;lt;/a&amp;gt; into flash.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd1 &amp;amp;gt; /dev/mtdblock1&lt;br /&gt;
cat mtd2 &amp;amp;gt; /dev/mtdblock2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Second, you have to restart your QNAP, and then go to the web interface to format your disk and install the full QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;After you put the QNAP firmware back in flash and installed the complete the QNAP software, your device will run the original software from QNAP again.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovery mode of QNAP TS-41x/TS-42x devices ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;QNAP TS-41x/TS-42x devices have a recovery mode that can be used when there is a problem with your installation of Debian that renders your device unbootable. The system recovery mode allows you write a recovery image to flash via the network using the TFTP protocol. This pages describes how how to create recovery images and how to use the recovery mode. As an alternative to the instructions on this page, you can use a &amp;lt;a href=&amp;quot;http://wiki.qnap.com/wiki/Firmware_Recovery&amp;quot;&amp;gt;Live CD provided by QNAP&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Creating recovery images&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to create a recovery image for your QNAP TS-41x/TS-42x, you have to take an exact copy of your flash memory. That is, the recovery image consists of the following parts of your flash in this order: &amp;lt;code&amp;gt;mtd0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd4&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd5&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd3&amp;lt;/code&amp;gt;. You may wonder about this strange order but this is the way in which the data is physically stored in the flash memory. During recovery mode, &amp;lt;code&amp;gt;mtd0&amp;lt;/code&amp;gt; (the boot loader), &amp;lt;code&amp;gt;mtd4&amp;lt;/code&amp;gt; (the boot loader configuration) and on some devices &amp;lt;code&amp;gt;mtd5&amp;lt;/code&amp;gt; (device configuration) are ignored and the other parts of flash are overwritten with the data from your recovery image. In order to make a valid QNAP recovery image, you therefore have to put all &amp;lt;code&amp;gt;mtd&amp;lt;/code&amp;gt; partitions into one file in the order described above.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Making a recovery image of the QNAP backup&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Before installing Debian, you should have made a backup of the QNAP firmware and have several &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files. You can now make a recovery image out of the backup with this command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd0 mtd4 mtd5 mtd1 mtd2 mtd3 &amp;amp;gt; F_TS-419P_qnap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Making a recovery image from a running system&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You can easily make a valid recovery image with the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /dev/mtdblock0 /dev/mtdblock4 /dev/mtdblock5 /dev/mtdblock1 /dev/mtdblock2 /dev/mtdblock3 &amp;amp;gt; F_TS-419P_debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;It is recommended to create periodic recovery images of your flash, so you have a recovery image in case something goes wrong.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Making a recovery image containing the Debian installer&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you want to make a QNAP recovery image containing the Debian installer, you can follow these steps. First of all, download the &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://ftp.uk.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/initrd.gz&amp;quot;&amp;gt;initrd&amp;lt;/a&amp;gt; and &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://ftp.uk.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/kernel&amp;quot;&amp;gt;kernel&amp;lt;/a&amp;gt; for the installer. You now have to pad the kernel so it is the right size and create an empty file 2 MB in size:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dd if=kernel of=kernel.pad ibs=2097152 conv=sync&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Finally, you can create a recovery image:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd0 mtd4 mtd5 kernel.pad initrd.gz mtd3 &amp;amp;gt; F_TS-419P_di&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Note that the &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files in this command refer to the backup you created earlier (before the installation).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Using the recovery mode&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In case your Debian system no longer boots after a system upgrade, you can use the QNAP system recovery mode to restore a previous image, an image of the Debian installer, or the QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The recovery mode will first request an IP address via DHCP and then request a recovery image by TFTP from a server on your network. You have to configure your DHCP server so it will request the right file from the right machine. In particular, you have to create an entry for your QNAP that specifies &amp;lt;code&amp;gt;filename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;next-server&amp;lt;/code&amp;gt;. The latter refers to the IP address of your TFTP server (likely the same as your DHCP server). The &amp;lt;code&amp;gt;filename&amp;lt;/code&amp;gt; of the recovery image has to start with a specific string depending on your machine (otherwise the machine won't load the image!).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can check the following table to find out which string to use:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;&lt;br /&gt;
Device&lt;br /&gt;
&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;&lt;br /&gt;
String&lt;br /&gt;
&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-410&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-410&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-412&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-412&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-410U&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-410U&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P+&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P II&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P2+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U+&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U II&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U2&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-420&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-420&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-421&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-421&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;One some devices (but not on the TS-419P+), you can check the backup you made of the flash to find out what the right string is for your machine:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
strings mtd4 | grep bootp_vendor_class&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that by default the MAC address used by your QNAP device in the recovery mode is different to the one used while running the QNAP firmware. When you install Debian, a script is run to ensure that the same MAC address is used everywhere. Therefore, depending on whether you ran that script, the MAC address will either be that from the QNAP firmware (the one printed on your device; it probably starts with &amp;lt;code&amp;gt;00:08:9B&amp;lt;/code&amp;gt;) or an address starting with &amp;lt;code&amp;gt;00:50:43&amp;lt;/code&amp;gt;. You can run the recovery mode and then look for &amp;lt;code&amp;gt;DHCPDISCOVER&amp;lt;/code&amp;gt; messages in &amp;lt;code&amp;gt;/var/log/syslog&amp;lt;/code&amp;gt; to find out the correct MAC address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Once you have the right MAC address, you can configure your DHCP server. I used the following entry in &amp;lt;code&amp;gt;/etc/dhcp3/dhcpd.conf&amp;lt;/code&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
host ts419p {&lt;br /&gt;
    hardware ethernet 00:50:43:3c:3b:5d;&lt;br /&gt;
    filename &amp;quot;F_TS-419P_debian&amp;quot;;&lt;br /&gt;
    fixed-address 192.168.1.71;&lt;br /&gt;
    next-server 192.168.1.2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Reload your DHCP server so the configuration change will take effect.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can activate the recovery mode by pressing the reset button on the back of your QNAP for about 10 seconds. I suggest you press the reset button and keep it pressed, and then turn on your QNAP device. After about 10 seconds, you will hear two short beeps. Your QNAP will now request a recovery image via TFTP. When it has obtained the recovery image and written it to flash (which takes about 3.5 minutes), your QNAP will make two short beeps again and restart.&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/InstallDebianOnQNAP&amp;diff=281</id>
		<title>HowTo/InstallDebianOnQNAP</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/InstallDebianOnQNAP&amp;diff=281"/>
		<updated>2014-05-31T07:04:59Z</updated>

		<summary type="html">&lt;p&gt;Eadam: /* Starting the Installer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installing Debian on the TS-420 ==&lt;br /&gt;
&lt;br /&gt;
Original source: http://www.cyrius.com/debian/kirkwood/qnap/ts-41x/install/&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In a nutshell, the installation of Debian on your QNAP TS-41x/TS-42x works like this: you use the QNAP firmware to write a Debian installer image to flash. When you restart your device, Debian installer starts and allows you to login via SSH to perform the installation. Debian will be installed to disk and a Debian kernel will be put in flash that will start Debian from disk.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If you follow this procedure, Debian 7 (wheezy) will be installed to your SATA disk and the QNAP firmware on disk and in flash will be replaced with Debian. Debian does not install a web interface to configure your machine, although it's possible to install such software. If this is not what you want, please don't proceed with the installation.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Requirements and Preparation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to install Debian on a QNAP device, you need the following:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A QNAP TS-410, TS-410U, TS-412, TS-419P, TS-419P+, TS-419P II, TS-419U, TS-419U+, TS-420 or TS-421.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
An internal SATA disk.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A network connection.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Another machine on which you have a telnet and an SSH client. Telnet is included in Linux and Windows. SSH is included in every Linux distribution as OpenSSH and there is &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html&amp;quot;&amp;gt;PuTTY&amp;lt;/a&amp;gt; for Windows.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Making a Backup ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You have to make a backup of all the data stored on your QNAP before starting with the installation of Debian since Debian will format the whole disk during the installation. Also, Debian will replace the QNAP firmware in flash, so it's also recommended to make a copy of the flash (mtd) partitions. Debian will only modify the first two flash partitions but it's a good idea to keep a copy of all partitions as you may need them to use the recovery mode. More detailed instructions for making a backup of your flash partitions will be given later.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Starting the Installer ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Start your QNAP device and login via SSH. Some time after you start your machine, you will hear a beep and a bit later you'll hear a longer beep. Wait for a few more seconds and then connect to the machine via SSH. The username is &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; and the password is &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; too.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Once you are logged in, you can save the content of your flash partitions to a USB stick. Connect a USB stick to your QNAP and wait for the system to mount it. In my case, it was mounted at &amp;lt;code&amp;gt;/share/external/sdi&amp;lt;/code&amp;gt; but you can find the location with the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mount | grep external&lt;br /&gt;
/dev/sdi1 on /share/external/&amp;lt;span class=&amp;quot;input&amp;quot;&amp;gt;sdi&amp;lt;/span&amp;gt; type vfat [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Now go to this directory and make a backup of your flash partitions:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /share/external/sdi&lt;br /&gt;
cat /dev/mtdblock0 &amp;amp;gt; mtd0&lt;br /&gt;
cat /dev/mtdblock1 &amp;amp;gt; mtd1&lt;br /&gt;
cat /dev/mtdblock2 &amp;amp;gt; mtd2&lt;br /&gt;
cat /dev/mtdblock3 &amp;amp;gt; mtd3&lt;br /&gt;
cat /dev/mtdblock4 &amp;amp;gt; mtd4&lt;br /&gt;
cat /dev/mtdblock5 &amp;amp;gt; mtd5&lt;br /&gt;
cd&lt;br /&gt;
umount /share/external/sdi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Disconnect your USB stick from your QNAP, connect it to your PC and to add the &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files to your regular backup.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Now you can go ahead and download the installer.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
Download and Flash the Installer&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to download the Debian installer images, issue the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/initrd.gz&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/kernel&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/flash-debian&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/model&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;These commands will download the Debian kernel, the installer ramdisk, a file with information about the support QNAP model, and a script to write the kernel and ramdisk to flash. You can now run the script by executing the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sh flash-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that this command will take about three minutes to run. You will see the following on your screen:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Updating MAC address...&lt;br /&gt;
Your MAC address is 00:08:9B:8C:xx:xx&lt;br /&gt;
Writing debian-installer to flash... done.&lt;br /&gt;
Please reboot your QNAP device.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Once the command has completed, you can reboot your QNAP device:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
reboot&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Installation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;After you have flashed the Debian installer image and restarted your QNAP device, the Debian installer will start. Since the TS-41x/TS-42x does not have any IO device, SSH will be used for the installation. The installer will bring up the network, start the OpenSSH server and you can then connect to the device using SSH. You have to wait a few minutes after starting the system before you can connect. When the installer is ready, the status LED will change to solid green and your device will beep briefly to indicate that you can now login via SSH.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that Ethernet port numeration differs between the QNAP firmware and Debian. Under Debian, &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; is the port marked with &amp;amp;quot;LAN2&amp;amp;quot;. On the TS-419P, this is the lower (and not the upper) connector!&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;net-config&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Since most TS-41x/TS-42x devices do not have an LCD, the installer cannot tell you which IP address to connect to or which password to use. (On the TS-41x, the LCD is currently not supported but will be supported in the future.) With regards to the IP address, the following strategy is used:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If your QNAP firmware is configured to use DHCP (the default configuration from QNAP), Debian installer will try to acquire an IP address with DHCP. If you have not initialized your QNAP firmware with QFinder, DHCP will be used. You can use the MAC address of your QNAP device to tell your DHCP server to give out a specific IP address to your machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If you configured a static address in your QNAP firmware, this configuration will be used. However, if your network configuration was incomplete (e.g. IP address or DNS were missing), the installer will use DHCP instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If DHCP is used but your DHCP server does not respond, the device will use the fallback address &amp;lt;code&amp;gt;192.168.1.100&amp;lt;/code&amp;gt;. If you are unsure what the address of your QNAP is, unplug the Ethernet cable, start the machine again, wait until Debian installer is ready for SSH and then plug the cable back in and connect to this fallback address.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please make sure that the QNAP is on a local network to which only you have access since the installer uses a very generic password, namely &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt;. The user is &amp;lt;code&amp;gt;installer&amp;lt;/code&amp;gt;. Before you can connect to the installer via SSH, you have to remove the SSH key from the QNAP firmware from your known_hosts file. The QNAP firmware uses a different SSH key than the Debian installer, so when you try to connect to Debian you will get an error saying that the remote host identification has changed. Edit ~/.ssh/known_hosts and remove the entry for the IP address of your QNAP device. Now connect to the installer (again, replacing the address in the example with the actual IP address of your QNAP) and login as user &amp;lt;code&amp;gt;installer&amp;lt;/code&amp;gt; with the password &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh installer@&amp;lt;span class=&amp;quot;input&amp;quot;&amp;gt;192.168.1.100&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The installation itself should be pretty standard and you can follow the &amp;lt;a&lt;br /&gt;
href = &amp;quot;http://www.debian.org/releases/stable/armel/&amp;quot;&amp;gt;installation guide&amp;lt;/a&amp;gt;. The installer knows about the TS-41x/TS-42x and at the end of the installation it will flash a kernel and ramdisk that will automatically boot into Debian. It will also install the &amp;lt;code&amp;gt;qcontrol&amp;lt;/code&amp;gt; package that can be used to control the fan, LEDs and beeper on your QNAP device.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Since the TS-41x/TS-42x boots from flash you don't have many limitations as to how you partition your hard drive. You can use LVM and RAID and a number of filesystems.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;At the end of the installation, the installer will write the new kernel to flash. Afterwards you will get a confirmation that the installation is complete. Confirm, wait for the installer to finish and once your SSH session terminates, wait a few minutes before you can connect to your newly installed system via SSH. Your QNAP device will beep when you can connect via SSH. You will be able to log in as &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; or your newly created user.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Success ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You should now have a complete Debian system running on your QNAP. You can use &amp;lt;code&amp;gt;apt-get&amp;lt;/code&amp;gt; and other tools to install additional software. The TS-41x/TS-42x is an ARM based device and the &amp;lt;code&amp;gt;armel&amp;lt;/code&amp;gt; architecture is fully supported by Debian.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Finally, make sure to read the &amp;lt;a href = &amp;quot;../tips/&amp;quot;&amp;gt;tips and tricks&amp;lt;/a&amp;gt; about running Debian on the QNAP TS-41x/TS-42x.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Restoring the original QNAP firmware ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you want to restore the original QNAP firmware on your TS-41x or TS-42x device for some reason, you can follow the instructions below. Please note that this will only work if your Debian system is still working. If your Debian system is broken but the machine itself works, you can use the &amp;lt;a href = &amp;quot;../recovery/&amp;quot;&amp;gt;recovery mode&amp;lt;/a&amp;gt; to restore the QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;There are two steps to restore the original QNAP firmware. First, you have to put the backup of the flash partitions from the QNAP firmware you made &amp;lt;a href = &amp;quot;../unpack/&amp;quot;&amp;gt;before the installation of Debian&amp;lt;/a&amp;gt; into flash.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd1 &amp;amp;gt; /dev/mtdblock1&lt;br /&gt;
cat mtd2 &amp;amp;gt; /dev/mtdblock2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Second, you have to restart your QNAP, and then go to the web interface to format your disk and install the full QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;After you put the QNAP firmware back in flash and installed the complete the QNAP software, your device will run the original software from QNAP again.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovery mode of QNAP TS-41x/TS-42x devices ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;QNAP TS-41x/TS-42x devices have a recovery mode that can be used when there is a problem with your installation of Debian that renders your device unbootable. The system recovery mode allows you write a recovery image to flash via the network using the TFTP protocol. This pages describes how how to create recovery images and how to use the recovery mode. As an alternative to the instructions on this page, you can use a &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://wiki.qnap.com/wiki/Firmware_Recovery&amp;quot;&amp;gt;Live CD provided by QNAP&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;create&amp;quot;&amp;gt;Creating recovery images&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to create a recovery image for your QNAP TS-41x/TS-42x, you have to take an exact copy of your flash memory. That is, the recovery image consists of the following parts of your flash in this order: &amp;lt;code&amp;gt;mtd0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd4&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd5&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd3&amp;lt;/code&amp;gt;. You may wonder about this strange order but this is the way in which the data is physically stored in the flash memory. During recovery mode, &amp;lt;code&amp;gt;mtd0&amp;lt;/code&amp;gt; (the boot loader), &amp;lt;code&amp;gt;mtd4&amp;lt;/code&amp;gt; (the boot loader configuration) and on some devices &amp;lt;code&amp;gt;mtd5&amp;lt;/code&amp;gt; (device configuration) are ignored and the other parts of flash are overwritten with the data from your recovery image. In order to make a valid QNAP recovery image, you therefore have to put all &amp;lt;code&amp;gt;mtd&amp;lt;/code&amp;gt; partitions into one file in the order described above.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;image-qnap&amp;quot;&amp;gt;Making a recovery image of the QNAP backup&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Before installing Debian, you should have made a backup of the QNAP firmware and have several &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files. You can now make a recovery image out of the backup with this command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd0 mtd4 mtd5 mtd1 mtd2 mtd3 &amp;amp;gt; F_TS-419P_qnap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;image-system&amp;quot;&amp;gt;Making a recovery image from a running system&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You can easily make a valid recovery image with the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /dev/mtdblock0 /dev/mtdblock4 /dev/mtdblock5 /dev/mtdblock1 /dev/mtdblock2 /dev/mtdblock3 &amp;amp;gt; F_TS-419P_debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;It is recommended to create periodic recovery images of your flash, so you have a recovery image in case something goes wrong.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;image-di&amp;quot;&amp;gt;Making a recovery image containing the Debian installer&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you want to make a QNAP recovery image containing the Debian installer, you can follow these steps. First of all, download the &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://ftp.uk.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/initrd.gz&amp;quot;&amp;gt;initrd&amp;lt;/a&amp;gt; and &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://ftp.uk.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/kernel&amp;quot;&amp;gt;kernel&amp;lt;/a&amp;gt; for the installer. You now have to pad the kernel so it is the right size and create an empty file 2 MB in size:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dd if=kernel of=kernel.pad ibs=2097152 conv=sync&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Finally, you can create a recovery image:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd0 mtd4 mtd5 kernel.pad initrd.gz mtd3 &amp;amp;gt; F_TS-419P_di&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Note that the &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files in this command refer to the backup you created earlier (before the installation).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;use&amp;quot;&amp;gt;Using the recovery mode&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In case your Debian system no longer boots after a system upgrade, you can use the QNAP system recovery mode to restore a previous image, an image of the Debian installer, or the QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The recovery mode will first request an IP address via DHCP and then request a recovery image by TFTP from a server on your network. You have to configure your DHCP server so it will request the right file from the right machine. In particular, you have to create an entry for your QNAP that specifies &amp;lt;code&amp;gt;filename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;next-server&amp;lt;/code&amp;gt;. The latter refers to the IP address of your TFTP server (likely the same as your DHCP server). The &amp;lt;code&amp;gt;filename&amp;lt;/code&amp;gt; of the recovery image has to start with a specific string depending on your machine (otherwise the machine won't load the image!).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can check the following table to find out which string to use:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;&lt;br /&gt;
Device&lt;br /&gt;
&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;&lt;br /&gt;
String&lt;br /&gt;
&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-410&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-410&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-412&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-412&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-410U&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-410U&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P+&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P II&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P2+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U+&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U II&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U2&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-420&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-420&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-421&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-421&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;One some devices (but not on the TS-419P+), you can check the backup you made of the flash to find out what the right string is for your machine:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
strings mtd4 | grep bootp_vendor_class&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that by default the MAC address used by your QNAP device in the recovery mode is different to the one used while running the QNAP firmware. When you install Debian, a script is run to ensure that the same MAC address is used everywhere. Therefore, depending on whether you ran that script, the MAC address will either be that from the QNAP firmware (the one printed on your device; it probably starts with &amp;lt;code&amp;gt;00:08:9B&amp;lt;/code&amp;gt;) or an address starting with &amp;lt;code&amp;gt;00:50:43&amp;lt;/code&amp;gt;. You can run the recovery mode and then look for &amp;lt;code&amp;gt;DHCPDISCOVER&amp;lt;/code&amp;gt; messages in &amp;lt;code&amp;gt;/var/log/syslog&amp;lt;/code&amp;gt; to find out the correct MAC address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Once you have the right MAC address, you can configure your DHCP server. I used the following entry in &amp;lt;code&amp;gt;/etc/dhcp3/dhcpd.conf&amp;lt;/code&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
host ts419p {&lt;br /&gt;
    hardware ethernet 00:50:43:3c:3b:5d;&lt;br /&gt;
    filename &amp;quot;F_TS-419P_debian&amp;quot;;&lt;br /&gt;
    fixed-address 192.168.1.71;&lt;br /&gt;
    next-server 192.168.1.2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Reload your DHCP server so the configuration change will take effect.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can activate the recovery mode by pressing the reset button on the back of your QNAP for about 10 seconds. I suggest you press the reset button and keep it pressed, and then turn on your QNAP device. After about 10 seconds, you will hear two short beeps. Your QNAP will now request a recovery image via TFTP. When it has obtained the recovery image and written it to flash (which takes about 3.5 minutes), your QNAP will make two short beeps again and restart.&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/InstallDebianOnQNAP&amp;diff=280</id>
		<title>HowTo/InstallDebianOnQNAP</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/InstallDebianOnQNAP&amp;diff=280"/>
		<updated>2014-05-31T07:04:30Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installing Debian on the TS-420 ==&lt;br /&gt;
&lt;br /&gt;
Original source: http://www.cyrius.com/debian/kirkwood/qnap/ts-41x/install/&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In a nutshell, the installation of Debian on your QNAP TS-41x/TS-42x works like this: you use the QNAP firmware to write a Debian installer image to flash. When you restart your device, Debian installer starts and allows you to login via SSH to perform the installation. Debian will be installed to disk and a Debian kernel will be put in flash that will start Debian from disk.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If you follow this procedure, Debian 7 (wheezy) will be installed to your SATA disk and the QNAP firmware on disk and in flash will be replaced with Debian. Debian does not install a web interface to configure your machine, although it's possible to install such software. If this is not what you want, please don't proceed with the installation.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Requirements and Preparation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to install Debian on a QNAP device, you need the following:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A QNAP TS-410, TS-410U, TS-412, TS-419P, TS-419P+, TS-419P II, TS-419U, TS-419U+, TS-420 or TS-421.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
An internal SATA disk.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A network connection.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Another machine on which you have a telnet and an SSH client. Telnet is included in Linux and Windows. SSH is included in every Linux distribution as OpenSSH and there is &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html&amp;quot;&amp;gt;PuTTY&amp;lt;/a&amp;gt; for Windows.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Making a Backup ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You have to make a backup of all the data stored on your QNAP before starting with the installation of Debian since Debian will format the whole disk during the installation. Also, Debian will replace the QNAP firmware in flash, so it's also recommended to make a copy of the flash (mtd) partitions. Debian will only modify the first two flash partitions but it's a good idea to keep a copy of all partitions as you may need them to use the recovery mode. More detailed instructions for making a backup of your flash partitions will be given later.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Starting the Installer ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Start your QNAP device and login via SSH. Some time after you start your machine, you will hear a beep and a bit later you'll hear a longer beep. Wait for a few more seconds and then connect to the machine via SSH. The username is &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; and the password is &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; too.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Once you are logged in, you can save the content of your flash partitions to a USB stick. Connect a USB stick to your QNAP and wait for the system to mount it. In my case, it was mounted at &amp;lt;code&amp;gt;/share/external/sdi&amp;lt;/code&amp;gt; but you can find the location with the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mount | grep external&lt;br /&gt;
/dev/sdi1 on /share/external/&amp;lt;span class=&amp;quot;input&amp;quot;&amp;gt;sdi&amp;lt;/span&amp;gt; type vfat [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Now go to this directory and make a backup of your flash partitions:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /share/external/sdi&lt;br /&gt;
cat /dev/mtdblock0 &amp;amp;gt; mtd0&lt;br /&gt;
cat /dev/mtdblock1 &amp;amp;gt; mtd1&lt;br /&gt;
cat /dev/mtdblock2 &amp;amp;gt; mtd2&lt;br /&gt;
cat /dev/mtdblock3 &amp;amp;gt; mtd3&lt;br /&gt;
cat /dev/mtdblock4 &amp;amp;gt; mtd4&lt;br /&gt;
cat /dev/mtdblock5 &amp;amp;gt; mtd5&lt;br /&gt;
cd&lt;br /&gt;
umount /share/external/sdi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Disconnect your USB stick from your QNAP, connect it to your PC and to add the &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files to your regular backup.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Now you can go ahead and download the installer.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;download&amp;quot;&amp;gt;Download and Flash the Installer&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to download the Debian installer images, issue the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/initrd.gz&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/kernel&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/flash-debian&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/model&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;These commands will download the Debian kernel, the installer ramdisk, a file with information about the support QNAP model, and a script to write the kernel and ramdisk to flash. You can now run the script by executing the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sh flash-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that this command will take about three minutes to run. You will see the following on your screen:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Updating MAC address...&lt;br /&gt;
Your MAC address is 00:08:9B:8C:xx:xx&lt;br /&gt;
Writing debian-installer to flash... done.&lt;br /&gt;
Please reboot your QNAP device.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Once the command has completed, you can reboot your QNAP device:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
reboot&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The Installation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;After you have flashed the Debian installer image and restarted your QNAP device, the Debian installer will start. Since the TS-41x/TS-42x does not have any IO device, SSH will be used for the installation. The installer will bring up the network, start the OpenSSH server and you can then connect to the device using SSH. You have to wait a few minutes after starting the system before you can connect. When the installer is ready, the status LED will change to solid green and your device will beep briefly to indicate that you can now login via SSH.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that Ethernet port numeration differs between the QNAP firmware and Debian. Under Debian, &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; is the port marked with &amp;amp;quot;LAN2&amp;amp;quot;. On the TS-419P, this is the lower (and not the upper) connector!&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;net-config&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Since most TS-41x/TS-42x devices do not have an LCD, the installer cannot tell you which IP address to connect to or which password to use. (On the TS-41x, the LCD is currently not supported but will be supported in the future.) With regards to the IP address, the following strategy is used:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If your QNAP firmware is configured to use DHCP (the default configuration from QNAP), Debian installer will try to acquire an IP address with DHCP. If you have not initialized your QNAP firmware with QFinder, DHCP will be used. You can use the MAC address of your QNAP device to tell your DHCP server to give out a specific IP address to your machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If you configured a static address in your QNAP firmware, this configuration will be used. However, if your network configuration was incomplete (e.g. IP address or DNS were missing), the installer will use DHCP instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If DHCP is used but your DHCP server does not respond, the device will use the fallback address &amp;lt;code&amp;gt;192.168.1.100&amp;lt;/code&amp;gt;. If you are unsure what the address of your QNAP is, unplug the Ethernet cable, start the machine again, wait until Debian installer is ready for SSH and then plug the cable back in and connect to this fallback address.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please make sure that the QNAP is on a local network to which only you have access since the installer uses a very generic password, namely &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt;. The user is &amp;lt;code&amp;gt;installer&amp;lt;/code&amp;gt;. Before you can connect to the installer via SSH, you have to remove the SSH key from the QNAP firmware from your known_hosts file. The QNAP firmware uses a different SSH key than the Debian installer, so when you try to connect to Debian you will get an error saying that the remote host identification has changed. Edit ~/.ssh/known_hosts and remove the entry for the IP address of your QNAP device. Now connect to the installer (again, replacing the address in the example with the actual IP address of your QNAP) and login as user &amp;lt;code&amp;gt;installer&amp;lt;/code&amp;gt; with the password &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh installer@&amp;lt;span class=&amp;quot;input&amp;quot;&amp;gt;192.168.1.100&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The installation itself should be pretty standard and you can follow the &amp;lt;a&lt;br /&gt;
href = &amp;quot;http://www.debian.org/releases/stable/armel/&amp;quot;&amp;gt;installation guide&amp;lt;/a&amp;gt;. The installer knows about the TS-41x/TS-42x and at the end of the installation it will flash a kernel and ramdisk that will automatically boot into Debian. It will also install the &amp;lt;code&amp;gt;qcontrol&amp;lt;/code&amp;gt; package that can be used to control the fan, LEDs and beeper on your QNAP device.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Since the TS-41x/TS-42x boots from flash you don't have many limitations as to how you partition your hard drive. You can use LVM and RAID and a number of filesystems.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;At the end of the installation, the installer will write the new kernel to flash. Afterwards you will get a confirmation that the installation is complete. Confirm, wait for the installer to finish and once your SSH session terminates, wait a few minutes before you can connect to your newly installed system via SSH. Your QNAP device will beep when you can connect via SSH. You will be able to log in as &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; or your newly created user.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Success ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You should now have a complete Debian system running on your QNAP. You can use &amp;lt;code&amp;gt;apt-get&amp;lt;/code&amp;gt; and other tools to install additional software. The TS-41x/TS-42x is an ARM based device and the &amp;lt;code&amp;gt;armel&amp;lt;/code&amp;gt; architecture is fully supported by Debian.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Finally, make sure to read the &amp;lt;a href = &amp;quot;../tips/&amp;quot;&amp;gt;tips and tricks&amp;lt;/a&amp;gt; about running Debian on the QNAP TS-41x/TS-42x.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Restoring the original QNAP firmware ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you want to restore the original QNAP firmware on your TS-41x or TS-42x device for some reason, you can follow the instructions below. Please note that this will only work if your Debian system is still working. If your Debian system is broken but the machine itself works, you can use the &amp;lt;a href = &amp;quot;../recovery/&amp;quot;&amp;gt;recovery mode&amp;lt;/a&amp;gt; to restore the QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;There are two steps to restore the original QNAP firmware. First, you have to put the backup of the flash partitions from the QNAP firmware you made &amp;lt;a href = &amp;quot;../unpack/&amp;quot;&amp;gt;before the installation of Debian&amp;lt;/a&amp;gt; into flash.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd1 &amp;amp;gt; /dev/mtdblock1&lt;br /&gt;
cat mtd2 &amp;amp;gt; /dev/mtdblock2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Second, you have to restart your QNAP, and then go to the web interface to format your disk and install the full QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;After you put the QNAP firmware back in flash and installed the complete the QNAP software, your device will run the original software from QNAP again.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovery mode of QNAP TS-41x/TS-42x devices ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;QNAP TS-41x/TS-42x devices have a recovery mode that can be used when there is a problem with your installation of Debian that renders your device unbootable. The system recovery mode allows you write a recovery image to flash via the network using the TFTP protocol. This pages describes how how to create recovery images and how to use the recovery mode. As an alternative to the instructions on this page, you can use a &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://wiki.qnap.com/wiki/Firmware_Recovery&amp;quot;&amp;gt;Live CD provided by QNAP&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;create&amp;quot;&amp;gt;Creating recovery images&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to create a recovery image for your QNAP TS-41x/TS-42x, you have to take an exact copy of your flash memory. That is, the recovery image consists of the following parts of your flash in this order: &amp;lt;code&amp;gt;mtd0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd4&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd5&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd3&amp;lt;/code&amp;gt;. You may wonder about this strange order but this is the way in which the data is physically stored in the flash memory. During recovery mode, &amp;lt;code&amp;gt;mtd0&amp;lt;/code&amp;gt; (the boot loader), &amp;lt;code&amp;gt;mtd4&amp;lt;/code&amp;gt; (the boot loader configuration) and on some devices &amp;lt;code&amp;gt;mtd5&amp;lt;/code&amp;gt; (device configuration) are ignored and the other parts of flash are overwritten with the data from your recovery image. In order to make a valid QNAP recovery image, you therefore have to put all &amp;lt;code&amp;gt;mtd&amp;lt;/code&amp;gt; partitions into one file in the order described above.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;image-qnap&amp;quot;&amp;gt;Making a recovery image of the QNAP backup&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Before installing Debian, you should have made a backup of the QNAP firmware and have several &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files. You can now make a recovery image out of the backup with this command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd0 mtd4 mtd5 mtd1 mtd2 mtd3 &amp;amp;gt; F_TS-419P_qnap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;image-system&amp;quot;&amp;gt;Making a recovery image from a running system&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You can easily make a valid recovery image with the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /dev/mtdblock0 /dev/mtdblock4 /dev/mtdblock5 /dev/mtdblock1 /dev/mtdblock2 /dev/mtdblock3 &amp;amp;gt; F_TS-419P_debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;It is recommended to create periodic recovery images of your flash, so you have a recovery image in case something goes wrong.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;image-di&amp;quot;&amp;gt;Making a recovery image containing the Debian installer&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you want to make a QNAP recovery image containing the Debian installer, you can follow these steps. First of all, download the &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://ftp.uk.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/initrd.gz&amp;quot;&amp;gt;initrd&amp;lt;/a&amp;gt; and &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://ftp.uk.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/kernel&amp;quot;&amp;gt;kernel&amp;lt;/a&amp;gt; for the installer. You now have to pad the kernel so it is the right size and create an empty file 2 MB in size:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dd if=kernel of=kernel.pad ibs=2097152 conv=sync&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Finally, you can create a recovery image:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd0 mtd4 mtd5 kernel.pad initrd.gz mtd3 &amp;amp;gt; F_TS-419P_di&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Note that the &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files in this command refer to the backup you created earlier (before the installation).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;use&amp;quot;&amp;gt;Using the recovery mode&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In case your Debian system no longer boots after a system upgrade, you can use the QNAP system recovery mode to restore a previous image, an image of the Debian installer, or the QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The recovery mode will first request an IP address via DHCP and then request a recovery image by TFTP from a server on your network. You have to configure your DHCP server so it will request the right file from the right machine. In particular, you have to create an entry for your QNAP that specifies &amp;lt;code&amp;gt;filename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;next-server&amp;lt;/code&amp;gt;. The latter refers to the IP address of your TFTP server (likely the same as your DHCP server). The &amp;lt;code&amp;gt;filename&amp;lt;/code&amp;gt; of the recovery image has to start with a specific string depending on your machine (otherwise the machine won't load the image!).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can check the following table to find out which string to use:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;&lt;br /&gt;
Device&lt;br /&gt;
&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;&lt;br /&gt;
String&lt;br /&gt;
&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-410&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-410&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-412&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-412&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-410U&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-410U&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P+&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P II&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P2+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U+&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U II&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U2&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-420&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-420&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-421&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-421&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;One some devices (but not on the TS-419P+), you can check the backup you made of the flash to find out what the right string is for your machine:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
strings mtd4 | grep bootp_vendor_class&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that by default the MAC address used by your QNAP device in the recovery mode is different to the one used while running the QNAP firmware. When you install Debian, a script is run to ensure that the same MAC address is used everywhere. Therefore, depending on whether you ran that script, the MAC address will either be that from the QNAP firmware (the one printed on your device; it probably starts with &amp;lt;code&amp;gt;00:08:9B&amp;lt;/code&amp;gt;) or an address starting with &amp;lt;code&amp;gt;00:50:43&amp;lt;/code&amp;gt;. You can run the recovery mode and then look for &amp;lt;code&amp;gt;DHCPDISCOVER&amp;lt;/code&amp;gt; messages in &amp;lt;code&amp;gt;/var/log/syslog&amp;lt;/code&amp;gt; to find out the correct MAC address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Once you have the right MAC address, you can configure your DHCP server. I used the following entry in &amp;lt;code&amp;gt;/etc/dhcp3/dhcpd.conf&amp;lt;/code&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
host ts419p {&lt;br /&gt;
    hardware ethernet 00:50:43:3c:3b:5d;&lt;br /&gt;
    filename &amp;quot;F_TS-419P_debian&amp;quot;;&lt;br /&gt;
    fixed-address 192.168.1.71;&lt;br /&gt;
    next-server 192.168.1.2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Reload your DHCP server so the configuration change will take effect.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can activate the recovery mode by pressing the reset button on the back of your QNAP for about 10 seconds. I suggest you press the reset button and keep it pressed, and then turn on your QNAP device. After about 10 seconds, you will hear two short beeps. Your QNAP will now request a recovery image via TFTP. When it has obtained the recovery image and written it to flash (which takes about 3.5 minutes), your QNAP will make two short beeps again and restart.&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/InstallDebianOnQNAP&amp;diff=279</id>
		<title>HowTo/InstallDebianOnQNAP</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/InstallDebianOnQNAP&amp;diff=279"/>
		<updated>2014-05-31T07:02:21Z</updated>

		<summary type="html">&lt;p&gt;Eadam: /* Recovery mode of QNAP TS-41x/TS-42x devices */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h2&amp;gt;&lt;br /&gt;
Overview&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In a nutshell, the installation of Debian on your QNAP TS-41x/TS-42x works like this: you use the QNAP firmware to write a Debian installer image to flash. When you restart your device, Debian installer starts and allows you to login via SSH to perform the installation. Debian will be installed to disk and a Debian kernel will be put in flash that will start Debian from disk.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If you follow this procedure, Debian 7 (wheezy) will be installed to your SATA disk and the QNAP firmware on disk and in flash will be replaced with Debian. Debian does not install a web interface to configure your machine, although it's possible to install such software. If this is not what you want, please don't proceed with the installation.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
Requirements and Preparation&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to install Debian on a QNAP device, you need the following:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A QNAP TS-410, TS-410U, TS-412, TS-419P, TS-419P+, TS-419P II, TS-419U, TS-419U+, TS-420 or TS-421.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
An internal SATA disk.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A network connection.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Another machine on which you have a telnet and an SSH client. Telnet is included in Linux and Windows. SSH is included in every Linux distribution as OpenSSH and there is &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html&amp;quot;&amp;gt;PuTTY&amp;lt;/a&amp;gt; for Windows.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
Making a Backup&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You have to make a backup of all the data stored on your QNAP before starting with the installation of Debian since Debian will format the whole disk during the installation. Also, Debian will replace the QNAP firmware in flash, so it's also recommended to make a copy of the flash (mtd) partitions. Debian will only modify the first two flash partitions but it's a good idea to keep a copy of all partitions as you may need them to use the recovery mode. More detailed instructions for making a backup of your flash partitions will be given later.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
Starting the Installer&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Start your QNAP device and login via SSH. Some time after you start your machine, you will hear a beep and a bit later you'll hear a longer beep. Wait for a few more seconds and then connect to the machine via SSH. The username is &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; and the password is &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; too.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Once you are logged in, you can save the content of your flash partitions to a USB stick. Connect a USB stick to your QNAP and wait for the system to mount it. In my case, it was mounted at &amp;lt;code&amp;gt;/share/external/sdi&amp;lt;/code&amp;gt; but you can find the location with the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mount | grep external&lt;br /&gt;
/dev/sdi1 on /share/external/&amp;lt;span class=&amp;quot;input&amp;quot;&amp;gt;sdi&amp;lt;/span&amp;gt; type vfat [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Now go to this directory and make a backup of your flash partitions:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /share/external/sdi&lt;br /&gt;
cat /dev/mtdblock0 &amp;amp;gt; mtd0&lt;br /&gt;
cat /dev/mtdblock1 &amp;amp;gt; mtd1&lt;br /&gt;
cat /dev/mtdblock2 &amp;amp;gt; mtd2&lt;br /&gt;
cat /dev/mtdblock3 &amp;amp;gt; mtd3&lt;br /&gt;
cat /dev/mtdblock4 &amp;amp;gt; mtd4&lt;br /&gt;
cat /dev/mtdblock5 &amp;amp;gt; mtd5&lt;br /&gt;
cd&lt;br /&gt;
umount /share/external/sdi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Disconnect your USB stick from your QNAP, connect it to your PC and to add the &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files to your regular backup.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Now you can go ahead and download the installer.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;download&amp;quot;&amp;gt;Download and Flash the Installer&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to download the Debian installer images, issue the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/initrd.gz&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/kernel&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/flash-debian&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/model&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;These commands will download the Debian kernel, the installer ramdisk, a file with information about the support QNAP model, and a script to write the kernel and ramdisk to flash. You can now run the script by executing the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sh flash-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that this command will take about three minutes to run. You will see the following on your screen:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Updating MAC address...&lt;br /&gt;
Your MAC address is 00:08:9B:8C:xx:xx&lt;br /&gt;
Writing debian-installer to flash... done.&lt;br /&gt;
Please reboot your QNAP device.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Once the command has completed, you can reboot your QNAP device:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
reboot&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;install&amp;quot;&amp;gt;The Installation&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;After you have flashed the Debian installer image and restarted your QNAP device, the Debian installer will start. Since the TS-41x/TS-42x does not have any IO device, SSH will be used for the installation. The installer will bring up the network, start the OpenSSH server and you can then connect to the device using SSH. You have to wait a few minutes after starting the system before you can connect. When the installer is ready, the status LED will change to solid green and your device will beep briefly to indicate that you can now login via SSH.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that Ethernet port numeration differs between the QNAP firmware and Debian. Under Debian, &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; is the port marked with &amp;amp;quot;LAN2&amp;amp;quot;. On the TS-419P, this is the lower (and not the upper) connector!&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;net-config&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Since most TS-41x/TS-42x devices do not have an LCD, the installer cannot tell you which IP address to connect to or which password to use. (On the TS-41x, the LCD is currently not supported but will be supported in the future.) With regards to the IP address, the following strategy is used:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If your QNAP firmware is configured to use DHCP (the default configuration from QNAP), Debian installer will try to acquire an IP address with DHCP. If you have not initialized your QNAP firmware with QFinder, DHCP will be used. You can use the MAC address of your QNAP device to tell your DHCP server to give out a specific IP address to your machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If you configured a static address in your QNAP firmware, this configuration will be used. However, if your network configuration was incomplete (e.g. IP address or DNS were missing), the installer will use DHCP instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If DHCP is used but your DHCP server does not respond, the device will use the fallback address &amp;lt;code&amp;gt;192.168.1.100&amp;lt;/code&amp;gt;. If you are unsure what the address of your QNAP is, unplug the Ethernet cable, start the machine again, wait until Debian installer is ready for SSH and then plug the cable back in and connect to this fallback address.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please make sure that the QNAP is on a local network to which only you have access since the installer uses a very generic password, namely &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt;. The user is &amp;lt;code&amp;gt;installer&amp;lt;/code&amp;gt;. Before you can connect to the installer via SSH, you have to remove the SSH key from the QNAP firmware from your known_hosts file. The QNAP firmware uses a different SSH key than the Debian installer, so when you try to connect to Debian you will get an error saying that the remote host identification has changed. Edit ~/.ssh/known_hosts and remove the entry for the IP address of your QNAP device. Now connect to the installer (again, replacing the address in the example with the actual IP address of your QNAP) and login as user &amp;lt;code&amp;gt;installer&amp;lt;/code&amp;gt; with the password &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh installer@&amp;lt;span class=&amp;quot;input&amp;quot;&amp;gt;192.168.1.100&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The installation itself should be pretty standard and you can follow the &amp;lt;a&lt;br /&gt;
href = &amp;quot;http://www.debian.org/releases/stable/armel/&amp;quot;&amp;gt;installation guide&amp;lt;/a&amp;gt;. The installer knows about the TS-41x/TS-42x and at the end of the installation it will flash a kernel and ramdisk that will automatically boot into Debian. It will also install the &amp;lt;code&amp;gt;qcontrol&amp;lt;/code&amp;gt; package that can be used to control the fan, LEDs and beeper on your QNAP device.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Since the TS-41x/TS-42x boots from flash you don't have many limitations as to how you partition your hard drive. You can use LVM and RAID and a number of filesystems.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;At the end of the installation, the installer will write the new kernel to flash. Afterwards you will get a confirmation that the installation is complete. Confirm, wait for the installer to finish and once your SSH session terminates, wait a few minutes before you can connect to your newly installed system via SSH. Your QNAP device will beep when you can connect via SSH. You will be able to log in as &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; or your newly created user.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You should now have a complete Debian system running on your QNAP. You can use &amp;lt;code&amp;gt;apt-get&amp;lt;/code&amp;gt; and other tools to install additional software. The TS-41x/TS-42x is an ARM based device and the &amp;lt;code&amp;gt;armel&amp;lt;/code&amp;gt; architecture is fully supported by Debian.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Finally, make sure to read the &amp;lt;a href = &amp;quot;../tips/&amp;quot;&amp;gt;tips and tricks&amp;lt;/a&amp;gt; about running Debian on the QNAP TS-41x/TS-42x.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;&lt;br /&gt;
Restoring the original QNAP firmware&lt;br /&gt;
&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you want to restore the original QNAP firmware on your TS-41x or TS-42x device for some reason, you can follow the instructions below. Please note that this will only work if your Debian system is still working. If your Debian system is broken but the machine itself works, you can use the &amp;lt;a href = &amp;quot;../recovery/&amp;quot;&amp;gt;recovery mode&amp;lt;/a&amp;gt; to restore the QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;There are two steps to restore the original QNAP firmware. First, you have to put the backup of the flash partitions from the QNAP firmware you made &amp;lt;a href = &amp;quot;../unpack/&amp;quot;&amp;gt;before the installation of Debian&amp;lt;/a&amp;gt; into flash.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd1 &amp;amp;gt; /dev/mtdblock1&lt;br /&gt;
cat mtd2 &amp;amp;gt; /dev/mtdblock2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Second, you have to restart your QNAP, and then go to the web interface to format your disk and install the full QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;After you put the QNAP firmware back in flash and installed the complete the QNAP software, your device will run the original software from QNAP again.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovery mode of QNAP TS-41x/TS-42x devices ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;QNAP TS-41x/TS-42x devices have a recovery mode that can be used when there is a problem with your installation of Debian that renders your device unbootable. The system recovery mode allows you write a recovery image to flash via the network using the TFTP protocol. This pages describes how how to create recovery images and how to use the recovery mode. As an alternative to the instructions on this page, you can use a &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://wiki.qnap.com/wiki/Firmware_Recovery&amp;quot;&amp;gt;Live CD provided by QNAP&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;create&amp;quot;&amp;gt;Creating recovery images&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to create a recovery image for your QNAP TS-41x/TS-42x, you have to take an exact copy of your flash memory. That is, the recovery image consists of the following parts of your flash in this order: &amp;lt;code&amp;gt;mtd0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd4&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd5&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd3&amp;lt;/code&amp;gt;. You may wonder about this strange order but this is the way in which the data is physically stored in the flash memory. During recovery mode, &amp;lt;code&amp;gt;mtd0&amp;lt;/code&amp;gt; (the boot loader), &amp;lt;code&amp;gt;mtd4&amp;lt;/code&amp;gt; (the boot loader configuration) and on some devices &amp;lt;code&amp;gt;mtd5&amp;lt;/code&amp;gt; (device configuration) are ignored and the other parts of flash are overwritten with the data from your recovery image. In order to make a valid QNAP recovery image, you therefore have to put all &amp;lt;code&amp;gt;mtd&amp;lt;/code&amp;gt; partitions into one file in the order described above.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;image-qnap&amp;quot;&amp;gt;Making a recovery image of the QNAP backup&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Before installing Debian, you should have made a backup of the QNAP firmware and have several &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files. You can now make a recovery image out of the backup with this command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd0 mtd4 mtd5 mtd1 mtd2 mtd3 &amp;amp;gt; F_TS-419P_qnap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;image-system&amp;quot;&amp;gt;Making a recovery image from a running system&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You can easily make a valid recovery image with the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /dev/mtdblock0 /dev/mtdblock4 /dev/mtdblock5 /dev/mtdblock1 /dev/mtdblock2 /dev/mtdblock3 &amp;amp;gt; F_TS-419P_debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;It is recommended to create periodic recovery images of your flash, so you have a recovery image in case something goes wrong.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;image-di&amp;quot;&amp;gt;Making a recovery image containing the Debian installer&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you want to make a QNAP recovery image containing the Debian installer, you can follow these steps. First of all, download the &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://ftp.uk.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/initrd.gz&amp;quot;&amp;gt;initrd&amp;lt;/a&amp;gt; and &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://ftp.uk.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/kernel&amp;quot;&amp;gt;kernel&amp;lt;/a&amp;gt; for the installer. You now have to pad the kernel so it is the right size and create an empty file 2 MB in size:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dd if=kernel of=kernel.pad ibs=2097152 conv=sync&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Finally, you can create a recovery image:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd0 mtd4 mtd5 kernel.pad initrd.gz mtd3 &amp;amp;gt; F_TS-419P_di&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Note that the &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files in this command refer to the backup you created earlier (before the installation).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;use&amp;quot;&amp;gt;Using the recovery mode&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In case your Debian system no longer boots after a system upgrade, you can use the QNAP system recovery mode to restore a previous image, an image of the Debian installer, or the QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The recovery mode will first request an IP address via DHCP and then request a recovery image by TFTP from a server on your network. You have to configure your DHCP server so it will request the right file from the right machine. In particular, you have to create an entry for your QNAP that specifies &amp;lt;code&amp;gt;filename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;next-server&amp;lt;/code&amp;gt;. The latter refers to the IP address of your TFTP server (likely the same as your DHCP server). The &amp;lt;code&amp;gt;filename&amp;lt;/code&amp;gt; of the recovery image has to start with a specific string depending on your machine (otherwise the machine won't load the image!).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can check the following table to find out which string to use:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;&lt;br /&gt;
Device&lt;br /&gt;
&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;&lt;br /&gt;
String&lt;br /&gt;
&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-410&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-410&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-412&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-412&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-410U&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-410U&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P+&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P II&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P2+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U+&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U II&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U2&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-420&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-420&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-421&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-421&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;One some devices (but not on the TS-419P+), you can check the backup you made of the flash to find out what the right string is for your machine:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
strings mtd4 | grep bootp_vendor_class&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that by default the MAC address used by your QNAP device in the recovery mode is different to the one used while running the QNAP firmware. When you install Debian, a script is run to ensure that the same MAC address is used everywhere. Therefore, depending on whether you ran that script, the MAC address will either be that from the QNAP firmware (the one printed on your device; it probably starts with &amp;lt;code&amp;gt;00:08:9B&amp;lt;/code&amp;gt;) or an address starting with &amp;lt;code&amp;gt;00:50:43&amp;lt;/code&amp;gt;. You can run the recovery mode and then look for &amp;lt;code&amp;gt;DHCPDISCOVER&amp;lt;/code&amp;gt; messages in &amp;lt;code&amp;gt;/var/log/syslog&amp;lt;/code&amp;gt; to find out the correct MAC address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Once you have the right MAC address, you can configure your DHCP server. I used the following entry in &amp;lt;code&amp;gt;/etc/dhcp3/dhcpd.conf&amp;lt;/code&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
host ts419p {&lt;br /&gt;
    hardware ethernet 00:50:43:3c:3b:5d;&lt;br /&gt;
    filename &amp;quot;F_TS-419P_debian&amp;quot;;&lt;br /&gt;
    fixed-address 192.168.1.71;&lt;br /&gt;
    next-server 192.168.1.2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Reload your DHCP server so the configuration change will take effect.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can activate the recovery mode by pressing the reset button on the back of your QNAP for about 10 seconds. I suggest you press the reset button and keep it pressed, and then turn on your QNAP device. After about 10 seconds, you will hear two short beeps. Your QNAP will now request a recovery image via TFTP. When it has obtained the recovery image and written it to flash (which takes about 3.5 minutes), your QNAP will make two short beeps again and restart.&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/InstallDebianOnQNAP&amp;diff=278</id>
		<title>HowTo/InstallDebianOnQNAP</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/InstallDebianOnQNAP&amp;diff=278"/>
		<updated>2014-05-31T07:02:04Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h2&amp;gt;&lt;br /&gt;
Overview&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In a nutshell, the installation of Debian on your QNAP TS-41x/TS-42x works like this: you use the QNAP firmware to write a Debian installer image to flash. When you restart your device, Debian installer starts and allows you to login via SSH to perform the installation. Debian will be installed to disk and a Debian kernel will be put in flash that will start Debian from disk.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If you follow this procedure, Debian 7 (wheezy) will be installed to your SATA disk and the QNAP firmware on disk and in flash will be replaced with Debian. Debian does not install a web interface to configure your machine, although it's possible to install such software. If this is not what you want, please don't proceed with the installation.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
Requirements and Preparation&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to install Debian on a QNAP device, you need the following:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A QNAP TS-410, TS-410U, TS-412, TS-419P, TS-419P+, TS-419P II, TS-419U, TS-419U+, TS-420 or TS-421.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
An internal SATA disk.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A network connection.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Another machine on which you have a telnet and an SSH client. Telnet is included in Linux and Windows. SSH is included in every Linux distribution as OpenSSH and there is &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html&amp;quot;&amp;gt;PuTTY&amp;lt;/a&amp;gt; for Windows.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
Making a Backup&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You have to make a backup of all the data stored on your QNAP before starting with the installation of Debian since Debian will format the whole disk during the installation. Also, Debian will replace the QNAP firmware in flash, so it's also recommended to make a copy of the flash (mtd) partitions. Debian will only modify the first two flash partitions but it's a good idea to keep a copy of all partitions as you may need them to use the recovery mode. More detailed instructions for making a backup of your flash partitions will be given later.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
Starting the Installer&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Start your QNAP device and login via SSH. Some time after you start your machine, you will hear a beep and a bit later you'll hear a longer beep. Wait for a few more seconds and then connect to the machine via SSH. The username is &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; and the password is &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; too.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Once you are logged in, you can save the content of your flash partitions to a USB stick. Connect a USB stick to your QNAP and wait for the system to mount it. In my case, it was mounted at &amp;lt;code&amp;gt;/share/external/sdi&amp;lt;/code&amp;gt; but you can find the location with the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mount | grep external&lt;br /&gt;
/dev/sdi1 on /share/external/&amp;lt;span class=&amp;quot;input&amp;quot;&amp;gt;sdi&amp;lt;/span&amp;gt; type vfat [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Now go to this directory and make a backup of your flash partitions:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /share/external/sdi&lt;br /&gt;
cat /dev/mtdblock0 &amp;amp;gt; mtd0&lt;br /&gt;
cat /dev/mtdblock1 &amp;amp;gt; mtd1&lt;br /&gt;
cat /dev/mtdblock2 &amp;amp;gt; mtd2&lt;br /&gt;
cat /dev/mtdblock3 &amp;amp;gt; mtd3&lt;br /&gt;
cat /dev/mtdblock4 &amp;amp;gt; mtd4&lt;br /&gt;
cat /dev/mtdblock5 &amp;amp;gt; mtd5&lt;br /&gt;
cd&lt;br /&gt;
umount /share/external/sdi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Disconnect your USB stick from your QNAP, connect it to your PC and to add the &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files to your regular backup.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Now you can go ahead and download the installer.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;download&amp;quot;&amp;gt;Download and Flash the Installer&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to download the Debian installer images, issue the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/initrd.gz&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/kernel&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/flash-debian&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/model&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;These commands will download the Debian kernel, the installer ramdisk, a file with information about the support QNAP model, and a script to write the kernel and ramdisk to flash. You can now run the script by executing the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sh flash-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that this command will take about three minutes to run. You will see the following on your screen:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Updating MAC address...&lt;br /&gt;
Your MAC address is 00:08:9B:8C:xx:xx&lt;br /&gt;
Writing debian-installer to flash... done.&lt;br /&gt;
Please reboot your QNAP device.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Once the command has completed, you can reboot your QNAP device:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
reboot&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;install&amp;quot;&amp;gt;The Installation&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;After you have flashed the Debian installer image and restarted your QNAP device, the Debian installer will start. Since the TS-41x/TS-42x does not have any IO device, SSH will be used for the installation. The installer will bring up the network, start the OpenSSH server and you can then connect to the device using SSH. You have to wait a few minutes after starting the system before you can connect. When the installer is ready, the status LED will change to solid green and your device will beep briefly to indicate that you can now login via SSH.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that Ethernet port numeration differs between the QNAP firmware and Debian. Under Debian, &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; is the port marked with &amp;amp;quot;LAN2&amp;amp;quot;. On the TS-419P, this is the lower (and not the upper) connector!&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;net-config&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Since most TS-41x/TS-42x devices do not have an LCD, the installer cannot tell you which IP address to connect to or which password to use. (On the TS-41x, the LCD is currently not supported but will be supported in the future.) With regards to the IP address, the following strategy is used:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If your QNAP firmware is configured to use DHCP (the default configuration from QNAP), Debian installer will try to acquire an IP address with DHCP. If you have not initialized your QNAP firmware with QFinder, DHCP will be used. You can use the MAC address of your QNAP device to tell your DHCP server to give out a specific IP address to your machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If you configured a static address in your QNAP firmware, this configuration will be used. However, if your network configuration was incomplete (e.g. IP address or DNS were missing), the installer will use DHCP instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If DHCP is used but your DHCP server does not respond, the device will use the fallback address &amp;lt;code&amp;gt;192.168.1.100&amp;lt;/code&amp;gt;. If you are unsure what the address of your QNAP is, unplug the Ethernet cable, start the machine again, wait until Debian installer is ready for SSH and then plug the cable back in and connect to this fallback address.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please make sure that the QNAP is on a local network to which only you have access since the installer uses a very generic password, namely &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt;. The user is &amp;lt;code&amp;gt;installer&amp;lt;/code&amp;gt;. Before you can connect to the installer via SSH, you have to remove the SSH key from the QNAP firmware from your known_hosts file. The QNAP firmware uses a different SSH key than the Debian installer, so when you try to connect to Debian you will get an error saying that the remote host identification has changed. Edit ~/.ssh/known_hosts and remove the entry for the IP address of your QNAP device. Now connect to the installer (again, replacing the address in the example with the actual IP address of your QNAP) and login as user &amp;lt;code&amp;gt;installer&amp;lt;/code&amp;gt; with the password &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh installer@&amp;lt;span class=&amp;quot;input&amp;quot;&amp;gt;192.168.1.100&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The installation itself should be pretty standard and you can follow the &amp;lt;a&lt;br /&gt;
href = &amp;quot;http://www.debian.org/releases/stable/armel/&amp;quot;&amp;gt;installation guide&amp;lt;/a&amp;gt;. The installer knows about the TS-41x/TS-42x and at the end of the installation it will flash a kernel and ramdisk that will automatically boot into Debian. It will also install the &amp;lt;code&amp;gt;qcontrol&amp;lt;/code&amp;gt; package that can be used to control the fan, LEDs and beeper on your QNAP device.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Since the TS-41x/TS-42x boots from flash you don't have many limitations as to how you partition your hard drive. You can use LVM and RAID and a number of filesystems.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;At the end of the installation, the installer will write the new kernel to flash. Afterwards you will get a confirmation that the installation is complete. Confirm, wait for the installer to finish and once your SSH session terminates, wait a few minutes before you can connect to your newly installed system via SSH. Your QNAP device will beep when you can connect via SSH. You will be able to log in as &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; or your newly created user.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You should now have a complete Debian system running on your QNAP. You can use &amp;lt;code&amp;gt;apt-get&amp;lt;/code&amp;gt; and other tools to install additional software. The TS-41x/TS-42x is an ARM based device and the &amp;lt;code&amp;gt;armel&amp;lt;/code&amp;gt; architecture is fully supported by Debian.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Finally, make sure to read the &amp;lt;a href = &amp;quot;../tips/&amp;quot;&amp;gt;tips and tricks&amp;lt;/a&amp;gt; about running Debian on the QNAP TS-41x/TS-42x.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;&lt;br /&gt;
Restoring the original QNAP firmware&lt;br /&gt;
&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you want to restore the original QNAP firmware on your TS-41x or TS-42x device for some reason, you can follow the instructions below. Please note that this will only work if your Debian system is still working. If your Debian system is broken but the machine itself works, you can use the &amp;lt;a href = &amp;quot;../recovery/&amp;quot;&amp;gt;recovery mode&amp;lt;/a&amp;gt; to restore the QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;There are two steps to restore the original QNAP firmware. First, you have to put the backup of the flash partitions from the QNAP firmware you made &amp;lt;a href = &amp;quot;../unpack/&amp;quot;&amp;gt;before the installation of Debian&amp;lt;/a&amp;gt; into flash.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd1 &amp;amp;gt; /dev/mtdblock1&lt;br /&gt;
cat mtd2 &amp;amp;gt; /dev/mtdblock2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Second, you have to restart your QNAP, and then go to the web interface to format your disk and install the full QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;After you put the QNAP firmware back in flash and installed the complete the QNAP software, your device will run the original software from QNAP again.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recovery mode of QNAP TS-41x/TS-42x devices ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;QNAP TS-41x/TS-42x devices have a recovery mode that can be used when there is a problem with your installation of Debian that renders your device unbootable. The system recovery mode allows you write a recovery image to flash via the network using the TFTP protocol. This pages describes how how to create recovery images and how to use the recovery mode. As an alternative to the instructions on this page, you can use a &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://wiki.qnap.com/wiki/Firmware_Recovery&amp;quot;&amp;gt;Live CD provided by QNAP&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;create&amp;quot;&amp;gt;Creating recovery images&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to create a recovery image for your QNAP TS-41x/TS-42x, you have to take an exact copy of your flash memory. That is, the recovery image consists of the following parts of your flash in this order: &amp;lt;code&amp;gt;mtd0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd4&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd5&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mtd3&amp;lt;/code&amp;gt;. You may wonder about this strange order but this is the way in which the data is physically stored in the flash memory. During recovery mode, &amp;lt;code&amp;gt;mtd0&amp;lt;/code&amp;gt; (the boot loader), &amp;lt;code&amp;gt;mtd4&amp;lt;/code&amp;gt; (the boot loader configuration) and on some devices &amp;lt;code&amp;gt;mtd5&amp;lt;/code&amp;gt; (device configuration) are ignored and the other parts of flash are overwritten with the data from your recovery image. In order to make a valid QNAP recovery image, you therefore have to put all &amp;lt;code&amp;gt;mtd&amp;lt;/code&amp;gt; partitions into one file in the order described above.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;image-qnap&amp;quot;&amp;gt;Making a recovery image of the QNAP backup&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Before installing Debian, you should have made a backup of the QNAP firmware and have several &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files. You can now make a recovery image out of the backup with this command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd0 mtd4 mtd5 mtd1 mtd2 mtd3 &amp;amp;gt; F_TS-419P_qnap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;image-system&amp;quot;&amp;gt;Making a recovery image from a running system&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You can easily make a valid recovery image with the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /dev/mtdblock0 /dev/mtdblock4 /dev/mtdblock5 /dev/mtdblock1 /dev/mtdblock2 /dev/mtdblock3 &amp;amp;gt; F_TS-419P_debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;It is recommended to create periodic recovery images of your flash, so you have a recovery image in case something goes wrong.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;image-di&amp;quot;&amp;gt;Making a recovery image containing the Debian installer&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you want to make a QNAP recovery image containing the Debian installer, you can follow these steps. First of all, download the &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://ftp.uk.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/initrd.gz&amp;quot;&amp;gt;initrd&amp;lt;/a&amp;gt; and &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://ftp.uk.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/kernel&amp;quot;&amp;gt;kernel&amp;lt;/a&amp;gt; for the installer. You now have to pad the kernel so it is the right size and create an empty file 2 MB in size:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dd if=kernel of=kernel.pad ibs=2097152 conv=sync&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Finally, you can create a recovery image:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd0 mtd4 mtd5 kernel.pad initrd.gz mtd3 &amp;amp;gt; F_TS-419P_di&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Note that the &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files in this command refer to the backup you created earlier (before the installation).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;use&amp;quot;&amp;gt;Using the recovery mode&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In case your Debian system no longer boots after a system upgrade, you can use the QNAP system recovery mode to restore a previous image, an image of the Debian installer, or the QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The recovery mode will first request an IP address via DHCP and then request a recovery image by TFTP from a server on your network. You have to configure your DHCP server so it will request the right file from the right machine. In particular, you have to create an entry for your QNAP that specifies &amp;lt;code&amp;gt;filename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;next-server&amp;lt;/code&amp;gt;. The latter refers to the IP address of your TFTP server (likely the same as your DHCP server). The &amp;lt;code&amp;gt;filename&amp;lt;/code&amp;gt; of the recovery image has to start with a specific string depending on your machine (otherwise the machine won't load the image!).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can check the following table to find out which string to use:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;&lt;br /&gt;
Device&lt;br /&gt;
&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;&lt;br /&gt;
String&lt;br /&gt;
&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-410&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-410&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-412&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-412&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-410U&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-410U&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P+&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419P II&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419P2+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U+&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U+&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-419U II&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-419U2&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-420&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-420&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
TS-421&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;F_TS-421&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;One some devices (but not on the TS-419P+), you can check the backup you made of the flash to find out what the right string is for your machine:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
strings mtd4 | grep bootp_vendor_class&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that by default the MAC address used by your QNAP device in the recovery mode is different to the one used while running the QNAP firmware. When you install Debian, a script is run to ensure that the same MAC address is used everywhere. Therefore, depending on whether you ran that script, the MAC address will either be that from the QNAP firmware (the one printed on your device; it probably starts with &amp;lt;code&amp;gt;00:08:9B&amp;lt;/code&amp;gt;) or an address starting with &amp;lt;code&amp;gt;00:50:43&amp;lt;/code&amp;gt;. You can run the recovery mode and then look for &amp;lt;code&amp;gt;DHCPDISCOVER&amp;lt;/code&amp;gt; messages in &amp;lt;code&amp;gt;/var/log/syslog&amp;lt;/code&amp;gt; to find out the correct MAC address.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Once you have the right MAC address, you can configure your DHCP server. I used the following entry in &amp;lt;code&amp;gt;/etc/dhcp3/dhcpd.conf&amp;lt;/code&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
host ts419p {&lt;br /&gt;
    hardware ethernet 00:50:43:3c:3b:5d;&lt;br /&gt;
    filename &amp;quot;F_TS-419P_debian&amp;quot;;&lt;br /&gt;
    fixed-address 192.168.1.71;&lt;br /&gt;
    next-server 192.168.1.2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Reload your DHCP server so the configuration change will take effect.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can activate the recovery mode by pressing the reset button on the back of your QNAP for about 10 seconds. I suggest you press the reset button and keep it pressed, and then turn on your QNAP device. After about 10 seconds, you will hear two short beeps. Your QNAP will now request a recovery image via TFTP. When it has obtained the recovery image and written it to flash (which takes about 3.5 minutes), your QNAP will make two short beeps again and restart.&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/InstallDebianOnQNAP&amp;diff=277</id>
		<title>HowTo/InstallDebianOnQNAP</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/InstallDebianOnQNAP&amp;diff=277"/>
		<updated>2014-05-31T07:00:58Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h2&amp;gt;&lt;br /&gt;
Overview&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In a nutshell, the installation of Debian on your QNAP TS-41x/TS-42x works like this: you use the QNAP firmware to write a Debian installer image to flash. When you restart your device, Debian installer starts and allows you to login via SSH to perform the installation. Debian will be installed to disk and a Debian kernel will be put in flash that will start Debian from disk.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If you follow this procedure, Debian 7 (wheezy) will be installed to your SATA disk and the QNAP firmware on disk and in flash will be replaced with Debian. Debian does not install a web interface to configure your machine, although it's possible to install such software. If this is not what you want, please don't proceed with the installation.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
Requirements and Preparation&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to install Debian on a QNAP device, you need the following:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A QNAP TS-410, TS-410U, TS-412, TS-419P, TS-419P+, TS-419P II, TS-419U, TS-419U+, TS-420 or TS-421.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
An internal SATA disk.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A network connection.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Another machine on which you have a telnet and an SSH client. Telnet is included in Linux and Windows. SSH is included in every Linux distribution as OpenSSH and there is &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html&amp;quot;&amp;gt;PuTTY&amp;lt;/a&amp;gt; for Windows.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
Making a Backup&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You have to make a backup of all the data stored on your QNAP before starting with the installation of Debian since Debian will format the whole disk during the installation. Also, Debian will replace the QNAP firmware in flash, so it's also recommended to make a copy of the flash (mtd) partitions. Debian will only modify the first two flash partitions but it's a good idea to keep a copy of all partitions as you may need them to use the recovery mode. More detailed instructions for making a backup of your flash partitions will be given later.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
Starting the Installer&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Start your QNAP device and login via SSH. Some time after you start your machine, you will hear a beep and a bit later you'll hear a longer beep. Wait for a few more seconds and then connect to the machine via SSH. The username is &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; and the password is &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; too.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Once you are logged in, you can save the content of your flash partitions to a USB stick. Connect a USB stick to your QNAP and wait for the system to mount it. In my case, it was mounted at &amp;lt;code&amp;gt;/share/external/sdi&amp;lt;/code&amp;gt; but you can find the location with the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mount | grep external&lt;br /&gt;
/dev/sdi1 on /share/external/&amp;lt;span class=&amp;quot;input&amp;quot;&amp;gt;sdi&amp;lt;/span&amp;gt; type vfat [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Now go to this directory and make a backup of your flash partitions:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /share/external/sdi&lt;br /&gt;
cat /dev/mtdblock0 &amp;amp;gt; mtd0&lt;br /&gt;
cat /dev/mtdblock1 &amp;amp;gt; mtd1&lt;br /&gt;
cat /dev/mtdblock2 &amp;amp;gt; mtd2&lt;br /&gt;
cat /dev/mtdblock3 &amp;amp;gt; mtd3&lt;br /&gt;
cat /dev/mtdblock4 &amp;amp;gt; mtd4&lt;br /&gt;
cat /dev/mtdblock5 &amp;amp;gt; mtd5&lt;br /&gt;
cd&lt;br /&gt;
umount /share/external/sdi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Disconnect your USB stick from your QNAP, connect it to your PC and to add the &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files to your regular backup.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Now you can go ahead and download the installer.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;download&amp;quot;&amp;gt;Download and Flash the Installer&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to download the Debian installer images, issue the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/initrd.gz&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/kernel&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/flash-debian&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/model&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;These commands will download the Debian kernel, the installer ramdisk, a file with information about the support QNAP model, and a script to write the kernel and ramdisk to flash. You can now run the script by executing the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sh flash-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that this command will take about three minutes to run. You will see the following on your screen:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Updating MAC address...&lt;br /&gt;
Your MAC address is 00:08:9B:8C:xx:xx&lt;br /&gt;
Writing debian-installer to flash... done.&lt;br /&gt;
Please reboot your QNAP device.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Once the command has completed, you can reboot your QNAP device:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
reboot&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;install&amp;quot;&amp;gt;The Installation&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;After you have flashed the Debian installer image and restarted your QNAP device, the Debian installer will start. Since the TS-41x/TS-42x does not have any IO device, SSH will be used for the installation. The installer will bring up the network, start the OpenSSH server and you can then connect to the device using SSH. You have to wait a few minutes after starting the system before you can connect. When the installer is ready, the status LED will change to solid green and your device will beep briefly to indicate that you can now login via SSH.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that Ethernet port numeration differs between the QNAP firmware and Debian. Under Debian, &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; is the port marked with &amp;amp;quot;LAN2&amp;amp;quot;. On the TS-419P, this is the lower (and not the upper) connector!&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;net-config&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Since most TS-41x/TS-42x devices do not have an LCD, the installer cannot tell you which IP address to connect to or which password to use. (On the TS-41x, the LCD is currently not supported but will be supported in the future.) With regards to the IP address, the following strategy is used:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If your QNAP firmware is configured to use DHCP (the default configuration from QNAP), Debian installer will try to acquire an IP address with DHCP. If you have not initialized your QNAP firmware with QFinder, DHCP will be used. You can use the MAC address of your QNAP device to tell your DHCP server to give out a specific IP address to your machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If you configured a static address in your QNAP firmware, this configuration will be used. However, if your network configuration was incomplete (e.g. IP address or DNS were missing), the installer will use DHCP instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If DHCP is used but your DHCP server does not respond, the device will use the fallback address &amp;lt;code&amp;gt;192.168.1.100&amp;lt;/code&amp;gt;. If you are unsure what the address of your QNAP is, unplug the Ethernet cable, start the machine again, wait until Debian installer is ready for SSH and then plug the cable back in and connect to this fallback address.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please make sure that the QNAP is on a local network to which only you have access since the installer uses a very generic password, namely &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt;. The user is &amp;lt;code&amp;gt;installer&amp;lt;/code&amp;gt;. Before you can connect to the installer via SSH, you have to remove the SSH key from the QNAP firmware from your known_hosts file. The QNAP firmware uses a different SSH key than the Debian installer, so when you try to connect to Debian you will get an error saying that the remote host identification has changed. Edit ~/.ssh/known_hosts and remove the entry for the IP address of your QNAP device. Now connect to the installer (again, replacing the address in the example with the actual IP address of your QNAP) and login as user &amp;lt;code&amp;gt;installer&amp;lt;/code&amp;gt; with the password &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh installer@&amp;lt;span class=&amp;quot;input&amp;quot;&amp;gt;192.168.1.100&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The installation itself should be pretty standard and you can follow the &amp;lt;a&lt;br /&gt;
href = &amp;quot;http://www.debian.org/releases/stable/armel/&amp;quot;&amp;gt;installation guide&amp;lt;/a&amp;gt;. The installer knows about the TS-41x/TS-42x and at the end of the installation it will flash a kernel and ramdisk that will automatically boot into Debian. It will also install the &amp;lt;code&amp;gt;qcontrol&amp;lt;/code&amp;gt; package that can be used to control the fan, LEDs and beeper on your QNAP device.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Since the TS-41x/TS-42x boots from flash you don't have many limitations as to how you partition your hard drive. You can use LVM and RAID and a number of filesystems.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;At the end of the installation, the installer will write the new kernel to flash. Afterwards you will get a confirmation that the installation is complete. Confirm, wait for the installer to finish and once your SSH session terminates, wait a few minutes before you can connect to your newly installed system via SSH. Your QNAP device will beep when you can connect via SSH. You will be able to log in as &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; or your newly created user.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You should now have a complete Debian system running on your QNAP. You can use &amp;lt;code&amp;gt;apt-get&amp;lt;/code&amp;gt; and other tools to install additional software. The TS-41x/TS-42x is an ARM based device and the &amp;lt;code&amp;gt;armel&amp;lt;/code&amp;gt; architecture is fully supported by Debian.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Finally, make sure to read the &amp;lt;a href = &amp;quot;../tips/&amp;quot;&amp;gt;tips and tricks&amp;lt;/a&amp;gt; about running Debian on the QNAP TS-41x/TS-42x.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;&lt;br /&gt;
Restoring the original QNAP firmware&lt;br /&gt;
&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you want to restore the original QNAP firmware on your TS-41x or TS-42x device for some reason, you can follow the instructions below. Please note that this will only work if your Debian system is still working. If your Debian system is broken but the machine itself works, you can use the &amp;lt;a href = &amp;quot;../recovery/&amp;quot;&amp;gt;recovery mode&amp;lt;/a&amp;gt; to restore the QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;There are two steps to restore the original QNAP firmware. First, you have to put the backup of the flash partitions from the QNAP firmware you made &amp;lt;a href = &amp;quot;../unpack/&amp;quot;&amp;gt;before the installation of Debian&amp;lt;/a&amp;gt; into flash.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat mtd1 &amp;amp;gt; /dev/mtdblock1&lt;br /&gt;
cat mtd2 &amp;amp;gt; /dev/mtdblock2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Second, you have to restart your QNAP, and then go to the web interface to format your disk and install the full QNAP firmware.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;After you put the QNAP firmware back in flash and installed the complete the QNAP software, your device will run the original software from QNAP again.&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/InstallDebianOnQNAP&amp;diff=276</id>
		<title>HowTo/InstallDebianOnQNAP</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/InstallDebianOnQNAP&amp;diff=276"/>
		<updated>2014-05-31T06:59:55Z</updated>

		<summary type="html">&lt;p&gt;Eadam: Created page with &amp;quot;&amp;lt;h2&amp;gt; Overview &amp;lt;/h2&amp;gt;  &amp;lt;p&amp;gt;In a nutshell, the installation of Debian on your QNAP TS-41x/TS-42x works like this: you use the QNAP firmware to write a Debian installer image to fl...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h2&amp;gt;&lt;br /&gt;
Overview&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In a nutshell, the installation of Debian on your QNAP TS-41x/TS-42x works like this: you use the QNAP firmware to write a Debian installer image to flash. When you restart your device, Debian installer starts and allows you to login via SSH to perform the installation. Debian will be installed to disk and a Debian kernel will be put in flash that will start Debian from disk.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If you follow this procedure, Debian 7 (wheezy) will be installed to your SATA disk and the QNAP firmware on disk and in flash will be replaced with Debian. Debian does not install a web interface to configure your machine, although it's possible to install such software. If this is not what you want, please don't proceed with the installation.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
Requirements and Preparation&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to install Debian on a QNAP device, you need the following:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A QNAP TS-410, TS-410U, TS-412, TS-419P, TS-419P+, TS-419P II, TS-419U, TS-419U+, TS-420 or TS-421.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
An internal SATA disk.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
A network connection.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Another machine on which you have a telnet and an SSH client. Telnet is included in Linux and Windows. SSH is included in every Linux distribution as OpenSSH and there is &amp;lt;a href =&lt;br /&gt;
&amp;quot;http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html&amp;quot;&amp;gt;PuTTY&amp;lt;/a&amp;gt; for Windows.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
Making a Backup&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You have to make a backup of all the data stored on your QNAP before starting with the installation of Debian since Debian will format the whole disk during the installation. Also, Debian will replace the QNAP firmware in flash, so it's also recommended to make a copy of the flash (mtd) partitions. Debian will only modify the first two flash partitions but it's a good idea to keep a copy of all partitions as you may need them to use the recovery mode. More detailed instructions for making a backup of your flash partitions will be given later.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
Starting the Installer&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Start your QNAP device and login via SSH. Some time after you start your machine, you will hear a beep and a bit later you'll hear a longer beep. Wait for a few more seconds and then connect to the machine via SSH. The username is &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; and the password is &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; too.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Once you are logged in, you can save the content of your flash partitions to a USB stick. Connect a USB stick to your QNAP and wait for the system to mount it. In my case, it was mounted at &amp;lt;code&amp;gt;/share/external/sdi&amp;lt;/code&amp;gt; but you can find the location with the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mount | grep external&lt;br /&gt;
/dev/sdi1 on /share/external/&amp;lt;span class=&amp;quot;input&amp;quot;&amp;gt;sdi&amp;lt;/span&amp;gt; type vfat [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Now go to this directory and make a backup of your flash partitions:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /share/external/sdi&lt;br /&gt;
cat /dev/mtdblock0 &amp;amp;gt; mtd0&lt;br /&gt;
cat /dev/mtdblock1 &amp;amp;gt; mtd1&lt;br /&gt;
cat /dev/mtdblock2 &amp;amp;gt; mtd2&lt;br /&gt;
cat /dev/mtdblock3 &amp;amp;gt; mtd3&lt;br /&gt;
cat /dev/mtdblock4 &amp;amp;gt; mtd4&lt;br /&gt;
cat /dev/mtdblock5 &amp;amp;gt; mtd5&lt;br /&gt;
cd&lt;br /&gt;
umount /share/external/sdi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Disconnect your USB stick from your QNAP, connect it to your PC and to add the &amp;lt;code&amp;gt;mtdX&amp;lt;/code&amp;gt; files to your regular backup.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Now you can go ahead and download the installer.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;download&amp;quot;&amp;gt;Download and Flash the Installer&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to download the Debian installer images, issue the following commands:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/initrd.gz&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/kernel&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/flash-debian&lt;br /&gt;
busybox wget http://ftp.debian.org/debian/dists/stable/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-41x/model&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;These commands will download the Debian kernel, the installer ramdisk, a file with information about the support QNAP model, and a script to write the kernel and ramdisk to flash. You can now run the script by executing the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sh flash-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that this command will take about three minutes to run. You will see the following on your screen:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Updating MAC address...&lt;br /&gt;
Your MAC address is 00:08:9B:8C:xx:xx&lt;br /&gt;
Writing debian-installer to flash... done.&lt;br /&gt;
Please reboot your QNAP device.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Once the command has completed, you can reboot your QNAP device:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
reboot&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;install&amp;quot;&amp;gt;The Installation&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;After you have flashed the Debian installer image and restarted your QNAP device, the Debian installer will start. Since the TS-41x/TS-42x does not have any IO device, SSH will be used for the installation. The installer will bring up the network, start the OpenSSH server and you can then connect to the device using SSH. You have to wait a few minutes after starting the system before you can connect. When the installer is ready, the status LED will change to solid green and your device will beep briefly to indicate that you can now login via SSH.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Please note that Ethernet port numeration differs between the QNAP firmware and Debian. Under Debian, &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; is the port marked with &amp;amp;quot;LAN2&amp;amp;quot;. On the TS-419P, this is the lower (and not the upper) connector!&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;a id = &amp;quot;net-config&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Since most TS-41x/TS-42x devices do not have an LCD, the installer cannot tell you which IP address to connect to or which password to use. (On the TS-41x, the LCD is currently not supported but will be supported in the future.) With regards to the IP address, the following strategy is used:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If your QNAP firmware is configured to use DHCP (the default configuration from QNAP), Debian installer will try to acquire an IP address with DHCP. If you have not initialized your QNAP firmware with QFinder, DHCP will be used. You can use the MAC address of your QNAP device to tell your DHCP server to give out a specific IP address to your machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If you configured a static address in your QNAP firmware, this configuration will be used. However, if your network configuration was incomplete (e.g. IP address or DNS were missing), the installer will use DHCP instead.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
If DHCP is used but your DHCP server does not respond, the device will use the fallback address &amp;lt;code&amp;gt;192.168.1.100&amp;lt;/code&amp;gt;. If you are unsure what the address of your QNAP is, unplug the Ethernet cable, start the machine again, wait until Debian installer is ready for SSH and then plug the cable back in and connect to this fallback address.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please make sure that the QNAP is on a local network to which only you have access since the installer uses a very generic password, namely &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt;. The user is &amp;lt;code&amp;gt;installer&amp;lt;/code&amp;gt;. Before you can connect to the installer via SSH, you have to remove the SSH key from the QNAP firmware from your known_hosts file. The QNAP firmware uses a different SSH key than the Debian installer, so when you try to connect to Debian you will get an error saying that the remote host identification has changed. Edit ~/.ssh/known_hosts and remove the entry for the IP address of your QNAP device. Now connect to the installer (again, replacing the address in the example with the actual IP address of your QNAP) and login as user &amp;lt;code&amp;gt;installer&amp;lt;/code&amp;gt; with the password &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh installer@&amp;lt;span class=&amp;quot;input&amp;quot;&amp;gt;192.168.1.100&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The installation itself should be pretty standard and you can follow the &amp;lt;a&lt;br /&gt;
href = &amp;quot;http://www.debian.org/releases/stable/armel/&amp;quot;&amp;gt;installation guide&amp;lt;/a&amp;gt;. The installer knows about the TS-41x/TS-42x and at the end of the installation it will flash a kernel and ramdisk that will automatically boot into Debian. It will also install the &amp;lt;code&amp;gt;qcontrol&amp;lt;/code&amp;gt; package that can be used to control the fan, LEDs and beeper on your QNAP device.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Since the TS-41x/TS-42x boots from flash you don't have many limitations as to how you partition your hard drive. You can use LVM and RAID and a number of filesystems.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;At the end of the installation, the installer will write the new kernel to flash. Afterwards you will get a confirmation that the installation is complete. Confirm, wait for the installer to finish and once your SSH session terminates, wait a few minutes before you can connect to your newly installed system via SSH. Your QNAP device will beep when you can connect via SSH. You will be able to log in as &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; or your newly created user.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&lt;br /&gt;
Success&lt;br /&gt;
&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You should now have a complete Debian system running on your QNAP. You can use &amp;lt;code&amp;gt;apt-get&amp;lt;/code&amp;gt; and other tools to install additional software. The TS-41x/TS-42x is an ARM based device and the &amp;lt;code&amp;gt;armel&amp;lt;/code&amp;gt; architecture is fully supported by Debian.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Finally, make sure to read the &amp;lt;a href = &amp;quot;../tips/&amp;quot;&amp;gt;tips and tricks&amp;lt;/a&amp;gt; about running Debian on the QNAP TS-41x/TS-42x.&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=System/MySQL/Replication&amp;diff=275</id>
		<title>System/MySQL/Replication</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=System/MySQL/Replication&amp;diff=275"/>
		<updated>2014-03-09T22:19:32Z</updated>

		<summary type="html">&lt;p&gt;Eadam: /* Slave initialization commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Configuration ==&lt;br /&gt;
&lt;br /&gt;
For a more general mysql configuration, see [[System/MySQL]]&lt;br /&gt;
&lt;br /&gt;
Edit /etc/my.cnf to have the following options (change server-id if necessary):&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 server-id               = 1&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 expire_logs_days        = 10&lt;br /&gt;
 max_binlog_size         = 100M&lt;br /&gt;
 auto-increment-increment = 2&lt;br /&gt;
 auto-increment-offset = 1&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
And for each database you want to replicate:&lt;br /&gt;
&lt;br /&gt;
 replicate-wild-do-table = db1.%&lt;br /&gt;
 replicate-wild-do-table = db2.%&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
== Init and start a slave ==&lt;br /&gt;
&lt;br /&gt;
First, on the master, dump the data _with_ the --master-data and --single-transaction parameters:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p -R --master-data --single-transaction --databases db1 db2 &amp;gt; dump.sql&lt;br /&gt;
&lt;br /&gt;
Then source it on the slave and start slave:&lt;br /&gt;
&lt;br /&gt;
 cat dump.sql | mysql -u root -p&lt;br /&gt;
 mysql -u root -p -e &amp;quot;start slave&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Replication user on Master ==&lt;br /&gt;
&lt;br /&gt;
 GRANT REPLICATION SLAVE ON *.* TO 'repl'@'%' IDENTIFIED BY 'passwd';&lt;br /&gt;
&lt;br /&gt;
== Slave initialization commands ==&lt;br /&gt;
&lt;br /&gt;
 CHANGE MASTER TO MASTER_HOST = 'x.x.x.x', MASTER_USER = 'repl', MASTER_PASSWORD = 'passwd', MASTER_LOG_FILE = 'mysql-bin.000001', MASTER_LOG_POS = 259, MASTER_SSL = 0;&lt;br /&gt;
&lt;br /&gt;
== Repairing after a failed replicated statement ==&lt;br /&gt;
&lt;br /&gt;
 SHOW SLAVE STATUS;&lt;br /&gt;
 STOP SLAVE;&lt;br /&gt;
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;&lt;br /&gt;
 START SLAVE;&lt;br /&gt;
 SHOW SLAVE STATUS;&lt;br /&gt;
&lt;br /&gt;
== Auto instanciation script of slave ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
set -x&lt;br /&gt;
&lt;br /&gt;
REPL_USER=&amp;lt;replication user&amp;gt;&lt;br /&gt;
REPL_PASS=&amp;lt;replication pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TARGET_USER=root&lt;br /&gt;
TARGET_PASS=&lt;br /&gt;
TARGET_HOST=&amp;lt;local host&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SOURCE_USER=&amp;lt;source user&amp;gt;&lt;br /&gt;
SOURCE_PASS=&amp;lt;source pass&amp;gt;&lt;br /&gt;
SOURCE_HOST=&amp;lt;source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ssh deploy@$SOURCE_HOST &amp;quot;time mysqldump -u $SOURCE_USER -p$SOURCE_PASS -A --master-data | gzip &amp;gt; /tmp/fulldump.sql.gz&amp;quot;&lt;br /&gt;
scp deploy@$SOURCE_HOST:/tmp/fulldump.sql.gz /var/tmp/&lt;br /&gt;
ssh deploy@$SOURCE_HOST 'rm /tmp/fulldump.sql.gz'&lt;br /&gt;
&lt;br /&gt;
gunzip -c /var/tmp/fulldump.sql.gz | mysql -h 127.0.0.1 -P 3307 -u $TARGET_USER&lt;br /&gt;
&lt;br /&gt;
CHGMASTER=$(gunzip -c /var/tmp/fulldump.sql.gz | head -n 40 | grep 'CHANGE MASTER' | sed 's/;//g')&lt;br /&gt;
echo &amp;quot;&amp;lt;CHANGEMASTER&amp;gt;, MASTER_HOST='$SOURCE_HOST', MASTER_USER='$REPL_USER', MASTER_PASSWORD='$REPL_PASS', MASTER_SSL = 0;&amp;quot; | sed &amp;quot;s/&amp;lt;CHANGEMASTER&amp;gt;/$CHGMASTER/g&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Temporarily deactivate Binary Log ==&lt;br /&gt;
&lt;br /&gt;
 SET sql_log_bin = 0;&lt;br /&gt;
&lt;br /&gt;
= Nagios check =&lt;br /&gt;
&lt;br /&gt;
Check for replication lag by connecting to master1 and master2&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# Nagios alert status&lt;br /&gt;
STATE_OK=0&lt;br /&gt;
STATE_WARNING=1&lt;br /&gt;
STATE_CRITICAL=2&lt;br /&gt;
STATE_UNKNOWN=3&lt;br /&gt;
STATE_DEPENDENT=4&lt;br /&gt;
&lt;br /&gt;
# Script Variables&lt;br /&gt;
REPLUSERNAME=repl&lt;br /&gt;
REPLPASSWD=''&lt;br /&gt;
&lt;br /&gt;
REPL2=&amp;lt;remote host&amp;gt;&lt;br /&gt;
REPL2USERNAME=repl&lt;br /&gt;
REPL2PASSWD=''&lt;br /&gt;
&lt;br /&gt;
CRITICAL_VALUE=3000&lt;br /&gt;
WARNING_VALUE=1000&lt;br /&gt;
&lt;br /&gt;
Slave_1=`mysql -h $REPL2 -u $REPL2USERNAME -p$REPL2PASSWD -e &amp;quot;show slave status&amp;quot; | grep bin | cut -f7`&lt;br /&gt;
Master_1=`mysql -u $REPLUSERNAME -p$REPLPASSWD -e &amp;quot;show master status&amp;quot; | grep bin | cut -f2`&lt;br /&gt;
Diff_1=`expr $Master_1 - $Slave_1`&lt;br /&gt;
&lt;br /&gt;
Slave_2=`mysql -u $REPLUSERNAME -p$REPLPASSWD -e &amp;quot;show slave status&amp;quot; | grep bin | cut -f7`&lt;br /&gt;
Master_2=`mysql -h $REPL2 -u $REPL2USERNAME -p$REPL2PASSWD -e &amp;quot;show master status&amp;quot; | grep bin | cut -f2`&lt;br /&gt;
Diff_2=`expr $Master_2 - $Slave_2`&lt;br /&gt;
echo &amp;quot;Master1 (local):&amp;quot;$Master_1&amp;quot; Slave1:&amp;quot;$Slave_1&amp;quot; [&amp;quot;$Diff_1&amp;quot;] Master2 (&amp;quot;$REPL2&amp;quot;):&amp;quot;$Master_2&amp;quot; Slave2:&amp;quot;$Slave_2&amp;quot; [&amp;quot;$Diff_2&amp;quot;]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if [ $Diff_1 -gt $CRITICAL_VALUE ]; then&lt;br /&gt;
        exit $STATE_CRITICAL&lt;br /&gt;
elif [ $Diff_1 -gt $WARNING_VALUE ]; then&lt;br /&gt;
        exit $STATE_WARNING&lt;br /&gt;
elif [ $Diff_2 -gt $CRITICAL_VALUE ]; then&lt;br /&gt;
        exit $STATE_CRITICAL&lt;br /&gt;
elif [ $Diff_2 -gt $WARNING_VALUE ]; then&lt;br /&gt;
        exit $STATE_WARNING&lt;br /&gt;
else&lt;br /&gt;
        exit $STATE_OK&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=Network/Bridge&amp;diff=274</id>
		<title>Network/Bridge</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=Network/Bridge&amp;diff=274"/>
		<updated>2014-02-20T08:44:39Z</updated>

		<summary type="html">&lt;p&gt;Eadam: /* Online.net */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Host configuration =&lt;br /&gt;
&lt;br /&gt;
== Debian ==&lt;br /&gt;
&lt;br /&gt;
 apt-get install bridge-utils&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cat /etc/network/interfaces &lt;br /&gt;
&lt;br /&gt;
auto lo br0&lt;br /&gt;
&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&lt;br /&gt;
iface eth0 inet manual&lt;br /&gt;
&lt;br /&gt;
iface br0 inet static&lt;br /&gt;
	bridge_ports eth0	&lt;br /&gt;
	address 142.4.209.206&lt;br /&gt;
	netmask 255.255.255.0&lt;br /&gt;
	network 142.4.209.0&lt;br /&gt;
	broadcast 142.4.209.255&lt;br /&gt;
	gateway 142.4.209.254&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CentOS ==&lt;br /&gt;
&lt;br /&gt;
'''br0.sh'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
CFGPATH=/etc/sysconfig/network-scripts&lt;br /&gt;
REFCFGPATH=/root&lt;br /&gt;
&lt;br /&gt;
# keep the original&lt;br /&gt;
if [ ! -f &amp;quot;$REFCFGPATH/ifcfg-eth0.ref&amp;quot; ]; then&lt;br /&gt;
  cp $CFGPATH/ifcfg-eth0 $REFCFGPATH/ifcfg-eth0.ref&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# build new eth0&lt;br /&gt;
grep -E '(DEVICE|HWADDR|ONBOOT)' $REFCFGPATH/ifcfg-eth0.ref &amp;gt; $CFGPATH/ifcfg-eth0&lt;br /&gt;
echo &amp;quot;BRIDGE=br0&amp;quot; &amp;gt;&amp;gt; $CFGPATH/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
# build br0&lt;br /&gt;
grep -v -E '(HWADDR|UUID)' $REFCFGPATH/ifcfg-eth0.ref | sed 's/eth0/br0/g' | sed 's/BOOTPROTO=[&amp;quot;]*none[&amp;quot;]*/BOOTPROTO=static/g' | sed 's/TYPE=[&amp;quot;]*Ethernet[&amp;quot;]*/TYPE=&amp;quot;Bridge&amp;quot;/g' | sed 's/NM_CONTROLLED=[&amp;quot;a-z]*/NM_CONTROLLED=&amp;quot;no&amp;quot;/g' &amp;gt; $CFGPATH/ifcfg-br0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= VM configuration =&lt;br /&gt;
&lt;br /&gt;
== Online.net ==&lt;br /&gt;
&lt;br /&gt;
With an eth0 as a local network, and eth1 as the bridged interface:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# The loopback network interface&lt;br /&gt;
auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&lt;br /&gt;
# The primary network interface&lt;br /&gt;
auto eth0&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
&lt;br /&gt;
auto eth1&lt;br /&gt;
iface eth1 inet static&lt;br /&gt;
  hwaddress ether &amp;amp;lt;failover mac&amp;amp;gt;&lt;br /&gt;
  address &amp;amp;lt;failover ip&amp;amp;gt;&lt;br /&gt;
  netmask 255.255.255.255&lt;br /&gt;
  broadcast &amp;amp;lt;failover ip&amp;amp;gt;&lt;br /&gt;
  post-up route add &amp;amp;lt;host gateway&amp;amp;gt; dev eth1&lt;br /&gt;
  post-up route add default gw &amp;amp;lt;host gateway&amp;amp;gt;&lt;br /&gt;
  dns-nameservers &amp;amp;lt;dns ip&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=Network/Bridge&amp;diff=273</id>
		<title>Network/Bridge</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=Network/Bridge&amp;diff=273"/>
		<updated>2014-02-20T08:44:05Z</updated>

		<summary type="html">&lt;p&gt;Eadam: /* Online.net */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Host configuration =&lt;br /&gt;
&lt;br /&gt;
== Debian ==&lt;br /&gt;
&lt;br /&gt;
 apt-get install bridge-utils&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cat /etc/network/interfaces &lt;br /&gt;
&lt;br /&gt;
auto lo br0&lt;br /&gt;
&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&lt;br /&gt;
iface eth0 inet manual&lt;br /&gt;
&lt;br /&gt;
iface br0 inet static&lt;br /&gt;
	bridge_ports eth0	&lt;br /&gt;
	address 142.4.209.206&lt;br /&gt;
	netmask 255.255.255.0&lt;br /&gt;
	network 142.4.209.0&lt;br /&gt;
	broadcast 142.4.209.255&lt;br /&gt;
	gateway 142.4.209.254&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CentOS ==&lt;br /&gt;
&lt;br /&gt;
'''br0.sh'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
CFGPATH=/etc/sysconfig/network-scripts&lt;br /&gt;
REFCFGPATH=/root&lt;br /&gt;
&lt;br /&gt;
# keep the original&lt;br /&gt;
if [ ! -f &amp;quot;$REFCFGPATH/ifcfg-eth0.ref&amp;quot; ]; then&lt;br /&gt;
  cp $CFGPATH/ifcfg-eth0 $REFCFGPATH/ifcfg-eth0.ref&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# build new eth0&lt;br /&gt;
grep -E '(DEVICE|HWADDR|ONBOOT)' $REFCFGPATH/ifcfg-eth0.ref &amp;gt; $CFGPATH/ifcfg-eth0&lt;br /&gt;
echo &amp;quot;BRIDGE=br0&amp;quot; &amp;gt;&amp;gt; $CFGPATH/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
# build br0&lt;br /&gt;
grep -v -E '(HWADDR|UUID)' $REFCFGPATH/ifcfg-eth0.ref | sed 's/eth0/br0/g' | sed 's/BOOTPROTO=[&amp;quot;]*none[&amp;quot;]*/BOOTPROTO=static/g' | sed 's/TYPE=[&amp;quot;]*Ethernet[&amp;quot;]*/TYPE=&amp;quot;Bridge&amp;quot;/g' | sed 's/NM_CONTROLLED=[&amp;quot;a-z]*/NM_CONTROLLED=&amp;quot;no&amp;quot;/g' &amp;gt; $CFGPATH/ifcfg-br0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= VM configuration =&lt;br /&gt;
&lt;br /&gt;
== Online.net ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# The loopback network interface&lt;br /&gt;
auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&lt;br /&gt;
# The primary network interface&lt;br /&gt;
auto eth0&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
&lt;br /&gt;
auto eth1&lt;br /&gt;
iface eth1 inet static&lt;br /&gt;
  hwaddress ether &amp;amp;lt;failover mac&amp;amp;gt;&lt;br /&gt;
  address &amp;amp;lt;failover ip&amp;amp;gt;&lt;br /&gt;
  netmask 255.255.255.255&lt;br /&gt;
  broadcast &amp;amp;lt;failover ip&amp;amp;gt;&lt;br /&gt;
  post-up route add &amp;amp;lt;host gateway&amp;amp;gt; dev eth1&lt;br /&gt;
  post-up route add default gw &amp;amp;lt;host gateway&amp;amp;gt;&lt;br /&gt;
  dns-nameservers &amp;amp;lt;dns ip&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=Network/Bridge&amp;diff=272</id>
		<title>Network/Bridge</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=Network/Bridge&amp;diff=272"/>
		<updated>2014-02-20T08:43:16Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Host configuration =&lt;br /&gt;
&lt;br /&gt;
== Debian ==&lt;br /&gt;
&lt;br /&gt;
 apt-get install bridge-utils&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cat /etc/network/interfaces &lt;br /&gt;
&lt;br /&gt;
auto lo br0&lt;br /&gt;
&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&lt;br /&gt;
iface eth0 inet manual&lt;br /&gt;
&lt;br /&gt;
iface br0 inet static&lt;br /&gt;
	bridge_ports eth0	&lt;br /&gt;
	address 142.4.209.206&lt;br /&gt;
	netmask 255.255.255.0&lt;br /&gt;
	network 142.4.209.0&lt;br /&gt;
	broadcast 142.4.209.255&lt;br /&gt;
	gateway 142.4.209.254&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CentOS ==&lt;br /&gt;
&lt;br /&gt;
'''br0.sh'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
CFGPATH=/etc/sysconfig/network-scripts&lt;br /&gt;
REFCFGPATH=/root&lt;br /&gt;
&lt;br /&gt;
# keep the original&lt;br /&gt;
if [ ! -f &amp;quot;$REFCFGPATH/ifcfg-eth0.ref&amp;quot; ]; then&lt;br /&gt;
  cp $CFGPATH/ifcfg-eth0 $REFCFGPATH/ifcfg-eth0.ref&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# build new eth0&lt;br /&gt;
grep -E '(DEVICE|HWADDR|ONBOOT)' $REFCFGPATH/ifcfg-eth0.ref &amp;gt; $CFGPATH/ifcfg-eth0&lt;br /&gt;
echo &amp;quot;BRIDGE=br0&amp;quot; &amp;gt;&amp;gt; $CFGPATH/ifcfg-eth0&lt;br /&gt;
&lt;br /&gt;
# build br0&lt;br /&gt;
grep -v -E '(HWADDR|UUID)' $REFCFGPATH/ifcfg-eth0.ref | sed 's/eth0/br0/g' | sed 's/BOOTPROTO=[&amp;quot;]*none[&amp;quot;]*/BOOTPROTO=static/g' | sed 's/TYPE=[&amp;quot;]*Ethernet[&amp;quot;]*/TYPE=&amp;quot;Bridge&amp;quot;/g' | sed 's/NM_CONTROLLED=[&amp;quot;a-z]*/NM_CONTROLLED=&amp;quot;no&amp;quot;/g' &amp;gt; $CFGPATH/ifcfg-br0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= VM configuration =&lt;br /&gt;
&lt;br /&gt;
== Online.net ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# The loopback network interface&lt;br /&gt;
auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&lt;br /&gt;
# The primary network interface&lt;br /&gt;
auto eth0&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
&lt;br /&gt;
auto eth1&lt;br /&gt;
iface eth1 inet static&lt;br /&gt;
  hwaddress ether 52:54:00:00:0e:af&lt;br /&gt;
  address 212.83.131.101&lt;br /&gt;
  netmask 255.255.255.255&lt;br /&gt;
  broadcast 212.83.131.101&lt;br /&gt;
  post-up route add 88.190.58.1 dev eth1&lt;br /&gt;
  post-up route add default gw 88.190.58.1&lt;br /&gt;
  dns-nameservers &amp;amp;lt;dns ip&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/MigratePostgres&amp;diff=271</id>
		<title>HowTo/MigratePostgres</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/MigratePostgres&amp;diff=271"/>
		<updated>2013-09-11T12:42:11Z</updated>

		<summary type="html">&lt;p&gt;Eadam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Migration vers PostgreSQL 9.2 =&lt;br /&gt;
&lt;br /&gt;
== Installation de PostgreSQL 9.2 ==&lt;br /&gt;
&lt;br /&gt;
L'installation d'une nouvelle version de postgres peut entraîner le redémarrage de toutes les autres instances installées. Pour éviter cela, il faut éditer le fichier /etc/postgresql/X.Y/cluster/start.conf et modifier le type de démarrage à manual le temps de l'installation. Il faut bien évidemment le remettre à auto une fois l'installation finie si les anciennes versions doivent rester démarrées ultérieurement.&lt;br /&gt;
&lt;br /&gt;
Utilisation du dépôt ''apt'' communautaire.&lt;br /&gt;
&lt;br /&gt;
En tant que root, à faire sur les deux serveurs (maître et esclave):&lt;br /&gt;
Positionner l'instance 8.4 en gestion manuelle dans le fichier /etc/postgresql/X.Y/cluster/start.conf&lt;br /&gt;
&lt;br /&gt;
Déclaration du dépôt dans le fichier /etc/apt/sources.list.d/pgdg.list :&lt;br /&gt;
&lt;br /&gt;
 deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main&lt;br /&gt;
&lt;br /&gt;
Ajout de la clé du dépôt :&lt;br /&gt;
&lt;br /&gt;
 wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -&lt;br /&gt;
&lt;br /&gt;
Mise à jour de la liste des paquets :&lt;br /&gt;
 apt-get update&lt;br /&gt;
&lt;br /&gt;
Installation des paquets de PostgreSQL 9.2 :&lt;br /&gt;
&lt;br /&gt;
 apt-get install postgresql-9.2 postgresql-client-9.2 postgresql-contrib-9.2 postgresql-server-dev-9.2 postgresql-plperl-9.2&lt;br /&gt;
&lt;br /&gt;
Sur l'esclave, en tant qu'utilisateur postgres:&lt;br /&gt;
&lt;br /&gt;
Création du répertoire d'archivage :&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/wal92&lt;br /&gt;
&lt;br /&gt;
Si la modification du fichier start.conf a été effectuée correctement, cette étape n'a aucune influence sur les instances postgres existantes.&lt;br /&gt;
&lt;br /&gt;
== Paramétrage de PostgreSQL 9.2 ==&lt;br /&gt;
&lt;br /&gt;
Comme il s'agit d'un serveur sous-dimensionné par rapport aux serveurs de productions, les valeurs renseignées ici ne sont pas représentatives de la configuration qu'il faudra appliquer en production. De plus, sans informations sur le système disque sous-jacent, il est impossible de configurer efficacement les paramètres liés aux disques.&lt;br /&gt;
&lt;br /&gt;
En tant qu'utilisateur root :&lt;br /&gt;
&lt;br /&gt;
Mise en place de cette configuration dans le fichier /etc/postgresql/9.2/main/postgresql.conf :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
listen_addresses = '*'&lt;br /&gt;
port = 5433&lt;br /&gt;
max_connections = 100&lt;br /&gt;
shared_buffers = 1GB -&amp;gt; 10GB&lt;br /&gt;
maintenance_work_mem = 800MB -&amp;gt; 1GB&lt;br /&gt;
wal_level = hot_standby&lt;br /&gt;
wal_buffers = 32MB&lt;br /&gt;
checkpoint_segments = 70&lt;br /&gt;
checkpoint_completion_target = 0.9&lt;br /&gt;
archive_mode = on&lt;br /&gt;
archive_command = 'rsync %p postgres@&amp;lt;ip&amp;gt;:/var/lib/postgresql/wal92/%f'&lt;br /&gt;
max_wal_senders = 3&lt;br /&gt;
autovacuum = on&lt;br /&gt;
hot_standby = on&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bien vérifier que l'adresse IP correspond à celle de l'esclave !&lt;br /&gt;
&lt;br /&gt;
Selon la quantité de mémoire allouée à PostgreSQL, il pourra être nécessaire de modifier le paramètre shmmax. Par exemple :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 echo &amp;quot;kernel.shmmax=10737418240&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
 sysctl -p&lt;br /&gt;
&lt;br /&gt;
 kernel.shmmax=68719476736&lt;br /&gt;
 kernel.shmall=4294967296&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Redémarrage de la nouvelle instance PostgreSQL :&lt;br /&gt;
pg_ctlcluster 9.2 main restart&lt;br /&gt;
Récupération de la configuration du fichier pg_hba.conf de la 8.4 pour la 9.2. Le fichier est présent dans le répertoire /etc/postgresql/8.4/main et son contenu doit être copié dans le répertoire /etc/postgresql/9.2/main.&lt;br /&gt;
&lt;br /&gt;
== Streaming replication ==&lt;br /&gt;
&lt;br /&gt;
Création d'un utilisateur pour la réplication :&lt;br /&gt;
&lt;br /&gt;
 psql -p 5433 -c &amp;quot;CREATE ROLE replicateur LOGIN REPLICATION PASSWORD 'un mot de passe compliqué'&amp;quot; postgres&lt;br /&gt;
&lt;br /&gt;
Ajout d'une ligne dans le fichier /etc/postgresql/9.2/main/pg_hba.conf pour autoriser l'utilisateur postgres à se connecter en streaming replication :&lt;br /&gt;
&lt;br /&gt;
 host    replication     replicateur        &amp;lt;ip host&amp;gt;/32         md5&lt;br /&gt;
&lt;br /&gt;
Rechargement de la configuration de PostgreSQL :&lt;br /&gt;
&lt;br /&gt;
 pg_ctlcluster 9.2 main reload&lt;br /&gt;
&lt;br /&gt;
== Mise en place de l'esclave ==&lt;br /&gt;
&lt;br /&gt;
En tant qu'utilisateur postgres, sur l'esclave :&lt;br /&gt;
Éteindre postgres sur l'esclave :&lt;br /&gt;
pg_ctlcluster 9.2 main stop&lt;br /&gt;
&lt;br /&gt;
Création du fichier ~postgres/.pgpass:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
192.168.96.201:5433:*:replicateur:un mot de passe compliqué.&lt;br /&gt;
_EOF&lt;br /&gt;
chmod 600 ~postgres/.pgpass&lt;br /&gt;
Penser à récupérer le mot de passe généré plus haut !&lt;br /&gt;
Initialisation du répertoire $PGDATA :&lt;br /&gt;
rm -rf /var/lib/postgresql/9.2/main/&lt;br /&gt;
mkdir /var/lib/postgresql/9.2/main/&lt;br /&gt;
chmod 700 /var/lib/postgresql/9.2/main/&lt;br /&gt;
/usr/lib/postgresql/9.2/bin/pg_basebackup -U postgres -h 192.168.96.201 -p 5433 -U replicateur -P -c fast -D /var/lib/postgresql/9.2/main/&lt;br /&gt;
echo &amp;gt; /var/lib/postgresql/9.2/main/recovery.conf &amp;lt;&amp;lt;EOF&lt;br /&gt;
restore_command = 'cp /var/lib/postgresql/wal92/%f %p'&lt;br /&gt;
standby_mode = on&lt;br /&gt;
primary_conninfo = 'host=192.168.96.201 port=5433 user=replicateur application_name=slave'&lt;br /&gt;
archive_cleanup_command = '/usr/lib/postgresql/9.2/bin/pg_archivecleanup /var/lib/postgresql/wal92/ %r'&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bien vérifier que l'adresse IP correspond à celle du maître ! (attention, elle est présente deux fois)&lt;br /&gt;
&lt;br /&gt;
Recopier les fichiers '''/etc/postgresql/9.2/main/pg_hba.conf''' et '''/etc/postgresql/9.2/main/postgresql.conf''' du maître dans le même répertoire sur l'esclave à savoir /etc/postgresql/9.2/main/.&lt;br /&gt;
&lt;br /&gt;
Démarrage de postgres :&lt;br /&gt;
&lt;br /&gt;
 pg_ctlcluster 9.2 main start&lt;br /&gt;
&lt;br /&gt;
Vérifier que la connexion en streaming replication est bien visible depuis le maître, grâce à la vue pg_stat_replication.&lt;br /&gt;
&lt;br /&gt;
== Sauvegarde de l'instance 8.4 ==&lt;br /&gt;
&lt;br /&gt;
Couper les accès au serveur dans le pg_hba.conf&lt;br /&gt;
&lt;br /&gt;
Dans le cadre d'un changement de version majeure, la sauvegarde doit toujours se faire à l'aide des binaires de la version la plus récente.&lt;br /&gt;
&lt;br /&gt;
La sauvegarde est réalisée à l'aide d'un petit script que voici :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
PGBIN=/usr/lib/postgresql/9.2/bin&lt;br /&gt;
DST=/var/lib/postgresql/dump&lt;br /&gt;
&lt;br /&gt;
export PGPORT=5432&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;sauvegarde des bases...&amp;quot;&lt;br /&gt;
for i in $($PGBIN/psql -At -c &amp;quot;select datname from pg_database where datname != 'postgres' and not datistemplate&amp;quot;); do&lt;br /&gt;
  echo &amp;quot;Sauvegarde de la base $i...&amp;quot;&lt;br /&gt;
  time $PGBIN/pg_dump -Fc $i &amp;gt; $DST/$i.dump&lt;br /&gt;
done&lt;br /&gt;
echo &amp;quot;Sauvegardes des objets globaux...&amp;quot;&lt;br /&gt;
time $PGBIN/pg_dumpall -g &amp;gt; $DST/globals.sql&lt;br /&gt;
echo &amp;quot;Fin.&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Et est lancée ainsi :&lt;br /&gt;
&lt;br /&gt;
 ./sauvegarde92.sh 2&amp;gt;&amp;amp;1 | tee sauvegarde92.log&lt;br /&gt;
&lt;br /&gt;
Sur le serveur de test (srvtest01), la sauvegarde a pris environ 30 minutes. Sur le deuxième serveur (rds01), plus proche de la prod, la dernière sauvegarde a duré 18 minutes 35 secondes.&lt;br /&gt;
&lt;br /&gt;
== Restauration sur l'instance 9.2 ==&lt;br /&gt;
&lt;br /&gt;
Sur les serveur de productions, il sera certainement plus efficace d'utiliser un plus grand nombre de job, en modifiant le paramètre -j.&lt;br /&gt;
&lt;br /&gt;
La restauration se fait à l'aide de ce script :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
PGBIN=/usr/lib/postgresql/9.2/bin&lt;br /&gt;
DST=/var/lib/postgresql/dump&lt;br /&gt;
&lt;br /&gt;
export PGPORT=5433&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;restauration des globaux...&amp;quot;&lt;br /&gt;
$PGBIN/psql -f $DST/globals.sql&lt;br /&gt;
&lt;br /&gt;
for i in $(ls $DST/*.dump); do&lt;br /&gt;
  echo &amp;quot;Restauration de la sauvegarde $i...&amp;quot;&lt;br /&gt;
  time $PGBIN/pg_restore -U postgres -C -d postgres -j2 $i&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Et est lancée ainsi :&lt;br /&gt;
&lt;br /&gt;
 ./restauration92.sh 2&amp;gt;&amp;amp;1 | tee restauration.log&lt;br /&gt;
&lt;br /&gt;
Sur le serveur de test (srvtest01), la restauration a pris environ 4 heures. Sur le deuxième serveur (rds01), plus proche de la prod, la restauration a duré 38 minutes et 45 secondes.&lt;br /&gt;
&lt;br /&gt;
== Mise à jour des statistiques ==&lt;br /&gt;
&lt;br /&gt;
Cette mise à jour se fait à l'aide de ce script :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
PGBIN=/usr/lib/postgresql/9.2/bin&lt;br /&gt;
export PGPORT=5433&lt;br /&gt;
&lt;br /&gt;
for i in $($PGBIN/psql -At -c &amp;quot;select datname from pg_database where datname != 'postgres' and not datistemplate&amp;quot;); do&lt;br /&gt;
  echo &amp;quot;Analyze de la base $i...&amp;quot;&lt;br /&gt;
  time $PGBIN/psql -c &amp;quot;VACUUM ANALYZE;&amp;quot; $i&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Et est lancée ainsi :&lt;br /&gt;
&lt;br /&gt;
 ./vacuumanalyze92.sh 2&amp;gt;&amp;amp;1 | tee vacuumanalyze.log&lt;br /&gt;
&lt;br /&gt;
Sur le serveur rds01, plus proche de la prod, la restauration a duré 5 minutes et 5 secondes.&lt;br /&gt;
&lt;br /&gt;
== Changement de port de l'instance 9.2 ==&lt;br /&gt;
&lt;br /&gt;
Avant sa mise à disposition de la production, l'instance 9.2 doit être placée sur le port 5432 :&lt;br /&gt;
&lt;br /&gt;
Arrêt des instances en 8.4 sur les 2 serveurs :&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/postgresql stop 8.4&lt;br /&gt;
&lt;br /&gt;
Modification sur les deux serveurs du port de l'instance 9.2 à 5432 dans le fichier de configuration  &lt;br /&gt;
&lt;br /&gt;
 /etc/postgresql/9.2/main/postgresql.conf&lt;br /&gt;
&lt;br /&gt;
Modification du port à 5432 dans le fichier PGPASS /var/lib/postgresql/.pgpass&lt;br /&gt;
&lt;br /&gt;
Redémarrage des instances sur les deux serveurs :&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/postgresql restart 9.2&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/MigratePostgres&amp;diff=270</id>
		<title>HowTo/MigratePostgres</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/MigratePostgres&amp;diff=270"/>
		<updated>2013-09-11T12:40:57Z</updated>

		<summary type="html">&lt;p&gt;Eadam: /* Paramétrage de PostgreSQL 9.2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Migration vers PostgreSQL 9.2 =&lt;br /&gt;
&lt;br /&gt;
== Installation de PostgreSQL 9.2 ==&lt;br /&gt;
&lt;br /&gt;
L'installation d'une nouvelle version de postgres peut entraîner le redémarrage de toutes les autres instances installées. Pour éviter cela, il faut éditer le fichier /etc/postgresql/X.Y/cluster/start.conf et modifier le type de démarrage à manual le temps de l'installation. Il faut bien évidemment le remettre à auto une fois l'installation finie si les anciennes versions doivent rester démarrées ultérieurement.&lt;br /&gt;
&lt;br /&gt;
Utilisation du dépôt ''apt'' communautaire.&lt;br /&gt;
&lt;br /&gt;
En tant que root, à faire sur les deux serveurs (maître et esclave):&lt;br /&gt;
Positionner l'instance 8.4 en gestion manuelle dans le fichier /etc/postgresql/X.Y/cluster/start.conf&lt;br /&gt;
&lt;br /&gt;
Déclaration du dépôt dans le fichier /etc/apt/sources.list.d/pgdg.list :&lt;br /&gt;
&lt;br /&gt;
 deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main&lt;br /&gt;
&lt;br /&gt;
Ajout de la clé du dépôt :&lt;br /&gt;
&lt;br /&gt;
 wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -&lt;br /&gt;
&lt;br /&gt;
Mise à jour de la liste des paquets :&lt;br /&gt;
 apt-get update&lt;br /&gt;
&lt;br /&gt;
Installation des paquets de PostgreSQL 9.2 :&lt;br /&gt;
&lt;br /&gt;
 apt-get install postgresql-9.2 postgresql-client-9.2 postgresql-contrib-9.2 postgresql-server-dev-9.2 postgresql-plperl-9.2&lt;br /&gt;
&lt;br /&gt;
Sur l'esclave, en tant qu'utilisateur postgres:&lt;br /&gt;
&lt;br /&gt;
Création du répertoire d'archivage :&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/wal92&lt;br /&gt;
&lt;br /&gt;
Si la modification du fichier start.conf a été effectuée correctement, cette étape n'a aucune influence sur les instances postgres existantes.&lt;br /&gt;
&lt;br /&gt;
== Paramétrage de PostgreSQL 9.2 ==&lt;br /&gt;
&lt;br /&gt;
Comme il s'agit d'un serveur sous-dimensionné par rapport aux serveurs de productions, les valeurs renseignées ici ne sont pas représentatives de la configuration qu'il faudra appliquer en production. De plus, sans informations sur le système disque sous-jacent, il est impossible de configurer efficacement les paramètres liés aux disques.&lt;br /&gt;
&lt;br /&gt;
En tant qu'utilisateur root :&lt;br /&gt;
&lt;br /&gt;
Mise en place de cette configuration dans le fichier /etc/postgresql/9.2/main/postgresql.conf :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
listen_addresses = '*'&lt;br /&gt;
port = 5433&lt;br /&gt;
max_connections = 100&lt;br /&gt;
shared_buffers = 1GB -&amp;gt; 10GB&lt;br /&gt;
maintenance_work_mem = 800MB -&amp;gt; 1GB&lt;br /&gt;
wal_level = hot_standby&lt;br /&gt;
wal_buffers = 32MB&lt;br /&gt;
checkpoint_segments = 70&lt;br /&gt;
checkpoint_completion_target = 0.9&lt;br /&gt;
archive_mode = on&lt;br /&gt;
archive_command = 'rsync %p postgres@&amp;lt;ip&amp;gt;:/var/lib/postgresql/wal92/%f'&lt;br /&gt;
max_wal_senders = 3&lt;br /&gt;
autovacuum = on&lt;br /&gt;
hot_standby = on&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bien vérifier que l'adresse IP correspond à celle de l'esclave !&lt;br /&gt;
&lt;br /&gt;
Selon la quantité de mémoire allouée à PostgreSQL, il pourra être nécessaire de modifier le paramètre shmmax. Par exemple :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 echo &amp;quot;kernel.shmmax=10737418240&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
 sysctl -p&lt;br /&gt;
&lt;br /&gt;
 kernel.shmmax=68719476736&lt;br /&gt;
 kernel.shmall=4294967296&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Redémarrage de la nouvelle instance PostgreSQL :&lt;br /&gt;
pg_ctlcluster 9.2 main restart&lt;br /&gt;
Récupération de la configuration du fichier pg_hba.conf de la 8.4 pour la 9.2. Le fichier est présent dans le répertoire /etc/postgresql/8.4/main et son contenu doit être copié dans le répertoire /etc/postgresql/9.2/main.&lt;br /&gt;
&lt;br /&gt;
Streaming replication&lt;br /&gt;
&lt;br /&gt;
Création d'un utilisateur pour la réplication :&lt;br /&gt;
&lt;br /&gt;
 psql -p 5433 -c &amp;quot;CREATE ROLE replicateur LOGIN REPLICATION PASSWORD 'un mot de passe compliqué'&amp;quot; postgres&lt;br /&gt;
&lt;br /&gt;
Ajout d'une ligne dans le fichier /etc/postgresql/9.2/main/pg_hba.conf pour autoriser l'utilisateur postgres à se connecter en streaming replication :&lt;br /&gt;
&lt;br /&gt;
 host    replication     replicateur        &amp;lt;ip host&amp;gt;/32         md5&lt;br /&gt;
&lt;br /&gt;
Rechargement de la configuration de PostgreSQL :&lt;br /&gt;
&lt;br /&gt;
 pg_ctlcluster 9.2 main reload&lt;br /&gt;
&lt;br /&gt;
Mise en place de l'esclave&lt;br /&gt;
&lt;br /&gt;
En tant qu'utilisateur postgres, sur l'esclave :&lt;br /&gt;
Éteindre postgres sur l'esclave :&lt;br /&gt;
pg_ctlcluster 9.2 main stop&lt;br /&gt;
&lt;br /&gt;
Création du fichier ~postgres/.pgpass:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
192.168.96.201:5433:*:replicateur:un mot de passe compliqué.&lt;br /&gt;
_EOF&lt;br /&gt;
chmod 600 ~postgres/.pgpass&lt;br /&gt;
Penser à récupérer le mot de passe généré plus haut !&lt;br /&gt;
Initialisation du répertoire $PGDATA :&lt;br /&gt;
rm -rf /var/lib/postgresql/9.2/main/&lt;br /&gt;
mkdir /var/lib/postgresql/9.2/main/&lt;br /&gt;
chmod 700 /var/lib/postgresql/9.2/main/&lt;br /&gt;
/usr/lib/postgresql/9.2/bin/pg_basebackup -U postgres -h 192.168.96.201 -p 5433 -U replicateur -P -c fast -D /var/lib/postgresql/9.2/main/&lt;br /&gt;
echo &amp;gt; /var/lib/postgresql/9.2/main/recovery.conf &amp;lt;&amp;lt;EOF&lt;br /&gt;
restore_command = 'cp /var/lib/postgresql/wal92/%f %p'&lt;br /&gt;
standby_mode = on&lt;br /&gt;
primary_conninfo = 'host=192.168.96.201 port=5433 user=replicateur application_name=slave'&lt;br /&gt;
archive_cleanup_command = '/usr/lib/postgresql/9.2/bin/pg_archivecleanup /var/lib/postgresql/wal92/ %r'&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bien vérifier que l'adresse IP correspond à celle du maître ! (attention, elle est présente deux fois)&lt;br /&gt;
&lt;br /&gt;
Recopier les fichiers '''/etc/postgresql/9.2/main/pg_hba.conf''' et '''/etc/postgresql/9.2/main/postgresql.conf''' du maître dans le même répertoire sur l'esclave à savoir /etc/postgresql/9.2/main/.&lt;br /&gt;
&lt;br /&gt;
Démarrage de postgres :&lt;br /&gt;
&lt;br /&gt;
 pg_ctlcluster 9.2 main start&lt;br /&gt;
&lt;br /&gt;
Vérifier que la connexion en streaming replication est bien visible depuis le maître, grâce à la vue pg_stat_replication.&lt;br /&gt;
&lt;br /&gt;
Sauvegarde de l'instance 8.4&lt;br /&gt;
&lt;br /&gt;
Couper les accès au serveur dans le pg_hba.conf&lt;br /&gt;
&lt;br /&gt;
Dans le cadre d'un changement de version majeure, la sauvegarde doit toujours se faire à l'aide des binaires de la version la plus récente.&lt;br /&gt;
&lt;br /&gt;
La sauvegarde est réalisée à l'aide d'un petit script que voici :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
PGBIN=/usr/lib/postgresql/9.2/bin&lt;br /&gt;
DST=/var/lib/postgresql/dump&lt;br /&gt;
&lt;br /&gt;
export PGPORT=5432&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;sauvegarde des bases...&amp;quot;&lt;br /&gt;
for i in $($PGBIN/psql -At -c &amp;quot;select datname from pg_database where datname != 'postgres' and not datistemplate&amp;quot;); do&lt;br /&gt;
  echo &amp;quot;Sauvegarde de la base $i...&amp;quot;&lt;br /&gt;
  time $PGBIN/pg_dump -Fc $i &amp;gt; $DST/$i.dump&lt;br /&gt;
done&lt;br /&gt;
echo &amp;quot;Sauvegardes des objets globaux...&amp;quot;&lt;br /&gt;
time $PGBIN/pg_dumpall -g &amp;gt; $DST/globals.sql&lt;br /&gt;
echo &amp;quot;Fin.&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Et est lancée ainsi :&lt;br /&gt;
&lt;br /&gt;
 ./sauvegarde92.sh 2&amp;gt;&amp;amp;1 | tee sauvegarde92.log&lt;br /&gt;
&lt;br /&gt;
Sur le serveur de test (srvtest01), la sauvegarde a pris environ 30 minutes. Sur le deuxième serveur (rds01), plus proche de la prod, la dernière sauvegarde a duré 18 minutes 35 secondes.&lt;br /&gt;
&lt;br /&gt;
Restauration sur l'instance 9.2&lt;br /&gt;
&lt;br /&gt;
Sur les serveur de productions, il sera certainement plus efficace d'utiliser un plus grand nombre de job, en modifiant le paramètre -j.&lt;br /&gt;
&lt;br /&gt;
La restauration se fait à l'aide de ce script :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
PGBIN=/usr/lib/postgresql/9.2/bin&lt;br /&gt;
DST=/var/lib/postgresql/dump&lt;br /&gt;
&lt;br /&gt;
export PGPORT=5433&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;restauration des globaux...&amp;quot;&lt;br /&gt;
$PGBIN/psql -f $DST/globals.sql&lt;br /&gt;
&lt;br /&gt;
for i in $(ls $DST/*.dump); do&lt;br /&gt;
  echo &amp;quot;Restauration de la sauvegarde $i...&amp;quot;&lt;br /&gt;
  time $PGBIN/pg_restore -U postgres -C -d postgres -j2 $i&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Et est lancée ainsi :&lt;br /&gt;
&lt;br /&gt;
 ./restauration92.sh 2&amp;gt;&amp;amp;1 | tee restauration.log&lt;br /&gt;
&lt;br /&gt;
Sur le serveur de test (srvtest01), la restauration a pris environ 4 heures. Sur le deuxième serveur (rds01), plus proche de la prod, la restauration a duré 38 minutes et 45 secondes.&lt;br /&gt;
&lt;br /&gt;
Mise à jour des statistiques sur l'instance 9.2&lt;br /&gt;
&lt;br /&gt;
Cette mise à jour se fait à l'aide de ce script :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
PGBIN=/usr/lib/postgresql/9.2/bin&lt;br /&gt;
export PGPORT=5433&lt;br /&gt;
&lt;br /&gt;
for i in $($PGBIN/psql -At -c &amp;quot;select datname from pg_database where datname != 'postgres' and not datistemplate&amp;quot;); do&lt;br /&gt;
  echo &amp;quot;Analyze de la base $i...&amp;quot;&lt;br /&gt;
  time $PGBIN/psql -c &amp;quot;VACUUM ANALYZE;&amp;quot; $i&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Et est lancée ainsi :&lt;br /&gt;
&lt;br /&gt;
 ./vacuumanalyze92.sh 2&amp;gt;&amp;amp;1 | tee vacuumanalyze.log&lt;br /&gt;
&lt;br /&gt;
Sur le serveur rds01, plus proche de la prod, la restauration a duré 5 minutes et 5 secondes.&lt;br /&gt;
&lt;br /&gt;
Changement de port de l'instance 9.2&lt;br /&gt;
&lt;br /&gt;
Avant sa mise à disposition de la production, l'instance 9.2 doit être placée sur le port 5432 :&lt;br /&gt;
&lt;br /&gt;
Arrêt des instances en 8.4 sur les 2 serveurs :&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/postgresql stop 8.4&lt;br /&gt;
&lt;br /&gt;
Modification sur les deux serveurs du port de l'instance 9.2 à 5432 dans le fichier de configuration  &lt;br /&gt;
&lt;br /&gt;
 /etc/postgresql/9.2/main/postgresql.conf&lt;br /&gt;
&lt;br /&gt;
Modification du port à 5432 dans le fichier PGPASS /var/lib/postgresql/.pgpass&lt;br /&gt;
&lt;br /&gt;
Redémarrage des instances sur les deux serveurs :&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/postgresql restart 9.2&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/MigratePostgres&amp;diff=269</id>
		<title>HowTo/MigratePostgres</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/MigratePostgres&amp;diff=269"/>
		<updated>2013-09-11T12:40:41Z</updated>

		<summary type="html">&lt;p&gt;Eadam: /* Paramétrage de PostgreSQL 9.2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Migration vers PostgreSQL 9.2 =&lt;br /&gt;
&lt;br /&gt;
== Installation de PostgreSQL 9.2 ==&lt;br /&gt;
&lt;br /&gt;
L'installation d'une nouvelle version de postgres peut entraîner le redémarrage de toutes les autres instances installées. Pour éviter cela, il faut éditer le fichier /etc/postgresql/X.Y/cluster/start.conf et modifier le type de démarrage à manual le temps de l'installation. Il faut bien évidemment le remettre à auto une fois l'installation finie si les anciennes versions doivent rester démarrées ultérieurement.&lt;br /&gt;
&lt;br /&gt;
Utilisation du dépôt ''apt'' communautaire.&lt;br /&gt;
&lt;br /&gt;
En tant que root, à faire sur les deux serveurs (maître et esclave):&lt;br /&gt;
Positionner l'instance 8.4 en gestion manuelle dans le fichier /etc/postgresql/X.Y/cluster/start.conf&lt;br /&gt;
&lt;br /&gt;
Déclaration du dépôt dans le fichier /etc/apt/sources.list.d/pgdg.list :&lt;br /&gt;
&lt;br /&gt;
 deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main&lt;br /&gt;
&lt;br /&gt;
Ajout de la clé du dépôt :&lt;br /&gt;
&lt;br /&gt;
 wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -&lt;br /&gt;
&lt;br /&gt;
Mise à jour de la liste des paquets :&lt;br /&gt;
 apt-get update&lt;br /&gt;
&lt;br /&gt;
Installation des paquets de PostgreSQL 9.2 :&lt;br /&gt;
&lt;br /&gt;
 apt-get install postgresql-9.2 postgresql-client-9.2 postgresql-contrib-9.2 postgresql-server-dev-9.2 postgresql-plperl-9.2&lt;br /&gt;
&lt;br /&gt;
Sur l'esclave, en tant qu'utilisateur postgres:&lt;br /&gt;
&lt;br /&gt;
Création du répertoire d'archivage :&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/wal92&lt;br /&gt;
&lt;br /&gt;
Si la modification du fichier start.conf a été effectuée correctement, cette étape n'a aucune influence sur les instances postgres existantes.&lt;br /&gt;
&lt;br /&gt;
== Paramétrage de PostgreSQL 9.2 ==&lt;br /&gt;
&lt;br /&gt;
Comme il s'agit d'un serveur sous-dimensionné par rapport aux serveurs de productions, les valeurs renseignées ici ne sont pas représentatives de la configuration qu'il faudra appliquer en production. De plus, sans informations sur le système disque sous-jacent, il est impossible de configurer efficacement les paramètres liés aux disques.&lt;br /&gt;
&lt;br /&gt;
En tant qu'utilisateur root :&lt;br /&gt;
&lt;br /&gt;
Mise en place de cette configuration dans le fichier /etc/postgresql/9.2/main/postgresql.conf :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
listen_addresses = '*'&lt;br /&gt;
port = 5433&lt;br /&gt;
max_connections = 100&lt;br /&gt;
shared_buffers = 1GB -&amp;gt; 10GB&lt;br /&gt;
maintenance_work_mem = 800MB -&amp;gt; 1GB&lt;br /&gt;
wal_level = hot_standby&lt;br /&gt;
wal_buffers = 32MB&lt;br /&gt;
checkpoint_segments = 70&lt;br /&gt;
checkpoint_completion_target = 0.9&lt;br /&gt;
archive_mode = on&lt;br /&gt;
archive_command = 'rsync %p postgres@&amp;lt;ip&amp;gt;:/var/lib/postgresql/wal92/%f'&lt;br /&gt;
max_wal_senders = 3&lt;br /&gt;
autovacuum = on&lt;br /&gt;
hot_standby = on&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bien vérifier que l'adresse IP correspond à celle de l'esclave !&lt;br /&gt;
&lt;br /&gt;
Selon la quantité de mémoire allouée à PostgreSQL, il pourra être nécessaire de modifier le paramètre shmmax. Par exemple :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 echo &amp;quot;kernel.shmmax=10737418240&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
 sysctl -p&lt;br /&gt;
&lt;br /&gt;
 kernel.shmmax=68719476736&lt;br /&gt;
 kernel.shmall=4294967296&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Redémarrage de la nouvelle instance PostgreSQL :&lt;br /&gt;
pg_ctlcluster 9.2 main restart&lt;br /&gt;
Récupération de la configuration du fichier pg_hba.conf de la 8.4 pour la 9.2. Le fichier est présent dans le répertoire /etc/postgresql/8.4/main et son contenu doit être copié dans le répertoire /etc/postgresql/9.2/main.&lt;br /&gt;
&lt;br /&gt;
Streaming replication&lt;br /&gt;
&lt;br /&gt;
Création d'un utilisateur pour la réplication :&lt;br /&gt;
&lt;br /&gt;
 psql -p 5433 -c &amp;quot;CREATE ROLE replicateur LOGIN REPLICATION PASSWORD 'un mot de passe compliqué'&amp;quot; postgres&lt;br /&gt;
&lt;br /&gt;
Ajout d'une ligne dans le fichier /etc/postgresql/9.2/main/pg_hba.conf pour autoriser l'utilisateur postgres à se connecter en streaming replication :&lt;br /&gt;
&lt;br /&gt;
 host    replication     replicateur        &amp;lt;ip host&amp;gt;/32         md5&lt;br /&gt;
&lt;br /&gt;
Rechargement de la configuration de PostgreSQL :&lt;br /&gt;
&lt;br /&gt;
 pg_ctlcluster 9.2 main reload&lt;br /&gt;
&lt;br /&gt;
Mise en place de l'esclave&lt;br /&gt;
&lt;br /&gt;
En tant qu'utilisateur postgres, sur l'esclave :&lt;br /&gt;
Éteindre postgres sur l'esclave :&lt;br /&gt;
pg_ctlcluster 9.2 main stop&lt;br /&gt;
&lt;br /&gt;
Création du fichier ~postgres/.pgpass:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
192.168.96.201:5433:*:replicateur:un mot de passe compliqué.&lt;br /&gt;
_EOF&lt;br /&gt;
chmod 600 ~postgres/.pgpass&lt;br /&gt;
Penser à récupérer le mot de passe généré plus haut !&lt;br /&gt;
Initialisation du répertoire $PGDATA :&lt;br /&gt;
rm -rf /var/lib/postgresql/9.2/main/&lt;br /&gt;
mkdir /var/lib/postgresql/9.2/main/&lt;br /&gt;
chmod 700 /var/lib/postgresql/9.2/main/&lt;br /&gt;
/usr/lib/postgresql/9.2/bin/pg_basebackup -U postgres -h 192.168.96.201 -p 5433 -U replicateur -P -c fast -D /var/lib/postgresql/9.2/main/&lt;br /&gt;
echo &amp;gt; /var/lib/postgresql/9.2/main/recovery.conf &amp;lt;&amp;lt;EOF&lt;br /&gt;
restore_command = 'cp /var/lib/postgresql/wal92/%f %p'&lt;br /&gt;
standby_mode = on&lt;br /&gt;
primary_conninfo = 'host=192.168.96.201 port=5433 user=replicateur application_name=slave'&lt;br /&gt;
archive_cleanup_command = '/usr/lib/postgresql/9.2/bin/pg_archivecleanup /var/lib/postgresql/wal92/ %r'&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
Bien vérifier que l'adresse IP correspond à celle du maître ! (attention, elle est présente deux fois)&lt;br /&gt;
&lt;br /&gt;
Recopier les fichiers '''/etc/postgresql/9.2/main/pg_hba.conf''' et '''/etc/postgresql/9.2/main/postgresql.conf''' du maître dans le même répertoire sur l'esclave à savoir /etc/postgresql/9.2/main/.&lt;br /&gt;
&lt;br /&gt;
Démarrage de postgres :&lt;br /&gt;
&lt;br /&gt;
 pg_ctlcluster 9.2 main start&lt;br /&gt;
&lt;br /&gt;
Vérifier que la connexion en streaming replication est bien visible depuis le maître, grâce à la vue pg_stat_replication.&lt;br /&gt;
&lt;br /&gt;
Sauvegarde de l'instance 8.4&lt;br /&gt;
&lt;br /&gt;
Couper les accès au serveur dans le pg_hba.conf&lt;br /&gt;
&lt;br /&gt;
Dans le cadre d'un changement de version majeure, la sauvegarde doit toujours se faire à l'aide des binaires de la version la plus récente.&lt;br /&gt;
&lt;br /&gt;
La sauvegarde est réalisée à l'aide d'un petit script que voici :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
PGBIN=/usr/lib/postgresql/9.2/bin&lt;br /&gt;
DST=/var/lib/postgresql/dump&lt;br /&gt;
&lt;br /&gt;
export PGPORT=5432&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;sauvegarde des bases...&amp;quot;&lt;br /&gt;
for i in $($PGBIN/psql -At -c &amp;quot;select datname from pg_database where datname != 'postgres' and not datistemplate&amp;quot;); do&lt;br /&gt;
  echo &amp;quot;Sauvegarde de la base $i...&amp;quot;&lt;br /&gt;
  time $PGBIN/pg_dump -Fc $i &amp;gt; $DST/$i.dump&lt;br /&gt;
done&lt;br /&gt;
echo &amp;quot;Sauvegardes des objets globaux...&amp;quot;&lt;br /&gt;
time $PGBIN/pg_dumpall -g &amp;gt; $DST/globals.sql&lt;br /&gt;
echo &amp;quot;Fin.&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Et est lancée ainsi :&lt;br /&gt;
&lt;br /&gt;
 ./sauvegarde92.sh 2&amp;gt;&amp;amp;1 | tee sauvegarde92.log&lt;br /&gt;
&lt;br /&gt;
Sur le serveur de test (srvtest01), la sauvegarde a pris environ 30 minutes. Sur le deuxième serveur (rds01), plus proche de la prod, la dernière sauvegarde a duré 18 minutes 35 secondes.&lt;br /&gt;
&lt;br /&gt;
Restauration sur l'instance 9.2&lt;br /&gt;
&lt;br /&gt;
Sur les serveur de productions, il sera certainement plus efficace d'utiliser un plus grand nombre de job, en modifiant le paramètre -j.&lt;br /&gt;
&lt;br /&gt;
La restauration se fait à l'aide de ce script :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
PGBIN=/usr/lib/postgresql/9.2/bin&lt;br /&gt;
DST=/var/lib/postgresql/dump&lt;br /&gt;
&lt;br /&gt;
export PGPORT=5433&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;restauration des globaux...&amp;quot;&lt;br /&gt;
$PGBIN/psql -f $DST/globals.sql&lt;br /&gt;
&lt;br /&gt;
for i in $(ls $DST/*.dump); do&lt;br /&gt;
  echo &amp;quot;Restauration de la sauvegarde $i...&amp;quot;&lt;br /&gt;
  time $PGBIN/pg_restore -U postgres -C -d postgres -j2 $i&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Et est lancée ainsi :&lt;br /&gt;
&lt;br /&gt;
 ./restauration92.sh 2&amp;gt;&amp;amp;1 | tee restauration.log&lt;br /&gt;
&lt;br /&gt;
Sur le serveur de test (srvtest01), la restauration a pris environ 4 heures. Sur le deuxième serveur (rds01), plus proche de la prod, la restauration a duré 38 minutes et 45 secondes.&lt;br /&gt;
&lt;br /&gt;
Mise à jour des statistiques sur l'instance 9.2&lt;br /&gt;
&lt;br /&gt;
Cette mise à jour se fait à l'aide de ce script :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
PGBIN=/usr/lib/postgresql/9.2/bin&lt;br /&gt;
export PGPORT=5433&lt;br /&gt;
&lt;br /&gt;
for i in $($PGBIN/psql -At -c &amp;quot;select datname from pg_database where datname != 'postgres' and not datistemplate&amp;quot;); do&lt;br /&gt;
  echo &amp;quot;Analyze de la base $i...&amp;quot;&lt;br /&gt;
  time $PGBIN/psql -c &amp;quot;VACUUM ANALYZE;&amp;quot; $i&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Et est lancée ainsi :&lt;br /&gt;
&lt;br /&gt;
 ./vacuumanalyze92.sh 2&amp;gt;&amp;amp;1 | tee vacuumanalyze.log&lt;br /&gt;
&lt;br /&gt;
Sur le serveur rds01, plus proche de la prod, la restauration a duré 5 minutes et 5 secondes.&lt;br /&gt;
&lt;br /&gt;
Changement de port de l'instance 9.2&lt;br /&gt;
&lt;br /&gt;
Avant sa mise à disposition de la production, l'instance 9.2 doit être placée sur le port 5432 :&lt;br /&gt;
&lt;br /&gt;
Arrêt des instances en 8.4 sur les 2 serveurs :&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/postgresql stop 8.4&lt;br /&gt;
&lt;br /&gt;
Modification sur les deux serveurs du port de l'instance 9.2 à 5432 dans le fichier de configuration  &lt;br /&gt;
&lt;br /&gt;
 /etc/postgresql/9.2/main/postgresql.conf&lt;br /&gt;
&lt;br /&gt;
Modification du port à 5432 dans le fichier PGPASS /var/lib/postgresql/.pgpass&lt;br /&gt;
&lt;br /&gt;
Redémarrage des instances sur les deux serveurs :&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/postgresql restart 9.2&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/MigratePostgres&amp;diff=268</id>
		<title>HowTo/MigratePostgres</title>
		<link rel="alternate" type="text/html" href="http://wiki.lunasys.fr/mediawiki/index.php?title=HowTo/MigratePostgres&amp;diff=268"/>
		<updated>2013-09-11T12:37:56Z</updated>

		<summary type="html">&lt;p&gt;Eadam: /* Paramétrage de PostgreSQL 9.2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Migration vers PostgreSQL 9.2 =&lt;br /&gt;
&lt;br /&gt;
== Installation de PostgreSQL 9.2 ==&lt;br /&gt;
&lt;br /&gt;
L'installation d'une nouvelle version de postgres peut entraîner le redémarrage de toutes les autres instances installées. Pour éviter cela, il faut éditer le fichier /etc/postgresql/X.Y/cluster/start.conf et modifier le type de démarrage à manual le temps de l'installation. Il faut bien évidemment le remettre à auto une fois l'installation finie si les anciennes versions doivent rester démarrées ultérieurement.&lt;br /&gt;
&lt;br /&gt;
Utilisation du dépôt ''apt'' communautaire.&lt;br /&gt;
&lt;br /&gt;
En tant que root, à faire sur les deux serveurs (maître et esclave):&lt;br /&gt;
Positionner l'instance 8.4 en gestion manuelle dans le fichier /etc/postgresql/X.Y/cluster/start.conf&lt;br /&gt;
&lt;br /&gt;
Déclaration du dépôt dans le fichier /etc/apt/sources.list.d/pgdg.list :&lt;br /&gt;
&lt;br /&gt;
 deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main&lt;br /&gt;
&lt;br /&gt;
Ajout de la clé du dépôt :&lt;br /&gt;
&lt;br /&gt;
 wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -&lt;br /&gt;
&lt;br /&gt;
Mise à jour de la liste des paquets :&lt;br /&gt;
 apt-get update&lt;br /&gt;
&lt;br /&gt;
Installation des paquets de PostgreSQL 9.2 :&lt;br /&gt;
&lt;br /&gt;
 apt-get install postgresql-9.2 postgresql-client-9.2 postgresql-contrib-9.2 postgresql-server-dev-9.2 postgresql-plperl-9.2&lt;br /&gt;
&lt;br /&gt;
Sur l'esclave, en tant qu'utilisateur postgres:&lt;br /&gt;
&lt;br /&gt;
Création du répertoire d'archivage :&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/wal92&lt;br /&gt;
&lt;br /&gt;
Si la modification du fichier start.conf a été effectuée correctement, cette étape n'a aucune influence sur les instances postgres existantes.&lt;br /&gt;
&lt;br /&gt;
== Paramétrage de PostgreSQL 9.2 ==&lt;br /&gt;
&lt;br /&gt;
Comme il s'agit d'un serveur sous-dimensionné par rapport aux serveurs de productions, les valeurs renseignées ici ne sont pas représentatives de la configuration qu'il faudra appliquer en production. De plus, sans informations sur le système disque sous-jacent, il est impossible de configurer efficacement les paramètres liés aux disques.&lt;br /&gt;
&lt;br /&gt;
En tant qu'utilisateur root :&lt;br /&gt;
&lt;br /&gt;
Mise en place de cette configuration dans le fichier /etc/postgresql/9.2/main/postgresql.conf :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
listen_addresses = '*'&lt;br /&gt;
port = 5433&lt;br /&gt;
max_connections = 100&lt;br /&gt;
shared_buffers = 1GB -&amp;gt; 10GB&lt;br /&gt;
maintenance_work_mem = 800MB -&amp;gt; 1GB&lt;br /&gt;
wal_level = hot_standby&lt;br /&gt;
wal_buffers = 32MB&lt;br /&gt;
checkpoint_segments = 70&lt;br /&gt;
checkpoint_completion_target = 0.9&lt;br /&gt;
archive_mode = on&lt;br /&gt;
archive_command = 'rsync %p postgres@&amp;lt;ip&amp;gt;:/var/lib/postgresql/wal92/%f'&lt;br /&gt;
max_wal_senders = 3&lt;br /&gt;
autovacuum = on&lt;br /&gt;
hot_standby = on&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bien vérifier que l'adresse IP correspond à celle de l'esclave !&lt;br /&gt;
&lt;br /&gt;
Selon la quantité de mémoire allouée à PostgreSQL, il pourra être nécessaire de modifier le paramètre shmmax. Par exemple :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 echo &amp;quot;kernel.shmmax=10737418240&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
 sysctl -p&lt;br /&gt;
&lt;br /&gt;
 kernel.shmmax=68719476736&lt;br /&gt;
 kernel.shmall=4294967296&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Redémarrage de la nouvelle instance PostgreSQL :&lt;br /&gt;
pg_ctlcluster 9.2 main restart&lt;br /&gt;
Récupération de la configuration du fichier pg_hba.conf de la 8.4 pour la 9.2. Le fichier est présent dans le répertoire /etc/postgresql/8.4/main et son contenu doit être copié dans le répertoire /etc/postgresql/9.2/main.&lt;br /&gt;
&lt;br /&gt;
Streaming replication&lt;br /&gt;
&lt;br /&gt;
Création d'un utilisateur pour la réplication :&lt;br /&gt;
psql -p 5433 -c &amp;quot;CREATE ROLE replicateur LOGIN REPLICATION PASSWORD 'un mot de passe compliqué'&amp;quot; postgres&lt;br /&gt;
Penser à changer le mot de passe !&lt;br /&gt;
Ajout d'une ligne dans le fichier /etc/postgresql/9.2/main/pg_hba.conf pour autoriser l'utilisateur postgres à se connecter en streaming replication :&lt;br /&gt;
host    replication     replicateur        192.168.0.59/32         md5&lt;br /&gt;
Bien vérifier que l'adresse IP correspond à celle de l'esclave !&lt;br /&gt;
Rechargement de la configuration de PostgreSQL :&lt;br /&gt;
pg_ctlcluster 9.2 main reload&lt;br /&gt;
&lt;br /&gt;
Mise en place de l'esclave&lt;br /&gt;
&lt;br /&gt;
En tant qu'utilisateur postgres, sur l'esclave :&lt;br /&gt;
Éteindre postgres sur l'esclave :&lt;br /&gt;
pg_ctlcluster 9.2 main stop&lt;br /&gt;
Création du fichier .pgpass :&lt;br /&gt;
cat &amp;lt;&amp;lt;_EOF &amp;gt;&amp;gt;~postgres/.pgpass&lt;br /&gt;
192.168.96.201:5433:*:replicateur:un mot de passe compliqué.&lt;br /&gt;
_EOF&lt;br /&gt;
chmod 600 ~postgres/.pgpass&lt;br /&gt;
Penser à récupérer le mot de passe généré plus haut !&lt;br /&gt;
Initialisation du répertoire $PGDATA :&lt;br /&gt;
rm -rf /var/lib/postgresql/9.2/main/&lt;br /&gt;
mkdir /var/lib/postgresql/9.2/main/&lt;br /&gt;
chmod 700 /var/lib/postgresql/9.2/main/&lt;br /&gt;
/usr/lib/postgresql/9.2/bin/pg_basebackup -U postgres -h 192.168.96.201 -p 5433 -U replicateur -P -c fast -D /var/lib/postgresql/9.2/main/&lt;br /&gt;
echo &amp;gt; /var/lib/postgresql/9.2/main/recovery.conf &amp;lt;&amp;lt;EOF&lt;br /&gt;
restore_command = 'cp /var/lib/postgresql/wal92/%f %p'&lt;br /&gt;
standby_mode = on&lt;br /&gt;
primary_conninfo = 'host=192.168.96.201 port=5433 user=replicateur application_name=slave'&lt;br /&gt;
archive_cleanup_command = '/usr/lib/postgresql/9.2/bin/pg_archivecleanup /var/lib/postgresql/wal92/ %r'&lt;br /&gt;
EOF&lt;br /&gt;
Bien vérifier que l'adresse IP correspond à celle du maître ! (attention, elle est présente deux fois)&lt;br /&gt;
Recopier les fichiers /etc/postgresql/9.2/main/pg_hba.conf et /etc/postgresql/9.2/main/postgresql.conf du maître dans le même répertoire sur l'esclave à savoir /etc/postgresql/9.2/main/.&lt;br /&gt;
Démarrage de postgres :&lt;br /&gt;
pg_ctlcluster 9.2 main start&lt;br /&gt;
Vérifier que la connexion en streaming replication est bien visible depuis le maître, grâce à la vue pg_stat_replication.&lt;br /&gt;
&lt;br /&gt;
Sauvegarde de l'instance 8.4&lt;br /&gt;
couper les accès au serveur dans le pg_hba.conf&lt;br /&gt;
Dans le cadre d'un changement de version majeure, la sauvegarde doit toujours se faire à l'aide des binaires de la version la plus récente.&lt;br /&gt;
La sauvegarde est réalisée à l'aide d'un petit script que voici :&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
PGBIN=/usr/lib/postgresql/9.2/bin&lt;br /&gt;
DST=/var/lib/postgresql/dump&lt;br /&gt;
&lt;br /&gt;
export PGPORT=5432&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;sauvegarde des bases...&amp;quot;&lt;br /&gt;
for i in $($PGBIN/psql -At -c &amp;quot;select datname from pg_database where datname != 'postgres' and not datistemplate&amp;quot;); do&lt;br /&gt;
  echo &amp;quot;Sauvegarde de la base $i...&amp;quot;&lt;br /&gt;
  time $PGBIN/pg_dump -Fc $i &amp;gt; $DST/$i.dump&lt;br /&gt;
done&lt;br /&gt;
echo &amp;quot;Sauvegardes des objets globaux...&amp;quot;&lt;br /&gt;
time $PGBIN/pg_dumpall -g &amp;gt; $DST/globals.sql&lt;br /&gt;
echo &amp;quot;Fin.&amp;quot;&lt;br /&gt;
Et est lancée ainsi :&lt;br /&gt;
./sauvegarde92.sh 2&amp;gt;&amp;amp;1 | tee sauvegarde92.log&lt;br /&gt;
Sur le serveur de test (srvtest01), la sauvegarde a pris environ 30 minutes. Sur le deuxième serveur (rds01), plus proche de la prod, la dernière sauvegarde a duré 18 minutes 35 secondes.&lt;br /&gt;
&lt;br /&gt;
Restauration sur l'instance 9.2&lt;br /&gt;
Sur les serveur de productions, il sera certainement plus efficace d'utiliser un plus grand nombre de job, en modifiant le paramètre -j.&lt;br /&gt;
La restauration se fait à l'aide de ce script :&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
PGBIN=/usr/lib/postgresql/9.2/bin&lt;br /&gt;
DST=/var/lib/postgresql/dump&lt;br /&gt;
&lt;br /&gt;
export PGPORT=5433&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;restauration des globaux...&amp;quot;&lt;br /&gt;
$PGBIN/psql -f $DST/globals.sql&lt;br /&gt;
&lt;br /&gt;
for i in $(ls $DST/*.dump); do&lt;br /&gt;
  echo &amp;quot;Restauration de la sauvegarde $i...&amp;quot;&lt;br /&gt;
  time $PGBIN/pg_restore -U postgres -C -d postgres -j2 $i&lt;br /&gt;
done&lt;br /&gt;
Et est lancée ainsi :&lt;br /&gt;
./restauration92.sh 2&amp;gt;&amp;amp;1 | tee restauration.log&lt;br /&gt;
Sur le serveur de test (srvtest01), la restauration a pris environ 4 heures. Sur le deuxième serveur (rds01), plus proche de la prod, la restauration a duré 38 minutes et 45 secondes.&lt;br /&gt;
&lt;br /&gt;
Mise à jour des statistiques sur l'instance 9.2&lt;br /&gt;
Cette mise à jour se fait à l'aide de ce script :&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
PGBIN=/usr/lib/postgresql/9.2/bin&lt;br /&gt;
export PGPORT=5433&lt;br /&gt;
&lt;br /&gt;
for i in $($PGBIN/psql -At -c &amp;quot;select datname from pg_database where datname != 'postgres' and not datistemplate&amp;quot;); do&lt;br /&gt;
  echo &amp;quot;Analyze de la base $i...&amp;quot;&lt;br /&gt;
  time $PGBIN/psql -c &amp;quot;VACUUM ANALYZE;&amp;quot; $i&lt;br /&gt;
done&lt;br /&gt;
Et est lancée ainsi :&lt;br /&gt;
./vacuumanalyze92.sh 2&amp;gt;&amp;amp;1 | tee vacuumanalyze.log&lt;br /&gt;
Sur le serveur rds01, plus proche de la prod, la restauration a duré 5 minutes et 5 secondes.&lt;br /&gt;
&lt;br /&gt;
Changement de port de l'instance 9.2&lt;br /&gt;
Avant sa mise à disposition de la production, l'instance 9.2 doit être placée sur le port 5432 :&lt;br /&gt;
Arrêt des instances en 8.4 sur les 2 serveurs :&lt;br /&gt;
/etc/init.d/postgresql stop 8.4&lt;br /&gt;
Modification sur les deux serveurs du port de l'instance 9.2 à 5432 dans le fichier de configuration /etc/postgresql/9.2/main/postgresql.conf&lt;br /&gt;
Modification du port à 5432 dans le fichier PGPASS /var/lib/postgresql/.pgpass&lt;br /&gt;
Redémarrage des instances sur les deux serveurs :&lt;br /&gt;
/etc/init.d/postgresql restart 9.2&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
TODO:&lt;br /&gt;
Ajouter la partie recettage post migration (par Withings)&lt;br /&gt;
&lt;br /&gt;
support/withings/issue/2464.txt · Dernière modification: 2013/09/11 09:57 par marc&lt;br /&gt;
Haut de page&lt;/div&gt;</summary>
		<author><name>Eadam</name></author>
		
	</entry>
</feed>