Weblog Tomasza Przechlewskiego [Zdjęcie T. Przechlewskiego]


scrum
random image [Photo gallery]
Zestawienie tagów
1-wire | 18b20 | 1wire | 2140 | 3rz | adamowicz | afera | alsamixer | amazon | amber | amman | anniversary | antypis | apache | api | applebaum | arm | armenia | astronomy | asus | atom.xml | awk | aws | bachotek | bakłażan | balcerowicz | balta | banan | bash | batumi | berlin | białowieża | białystok | bibtex | bieszczady | biznes | blogger | blogging | blosxom | bme280 | bono | borne-sulinowo | breugel | bt747 | budapeszt | budyniowo | budyń | bursztyn | campagnolo | canon | cedewu | chaos | chello | chiller | chillerpl | chown | christophe dominici | chujowetaśmy | ciasto | cmentarz | contour | coronavirus | covi19 | covid | covid19 | cron | css | csv | cukinia | curl | cycling | d54250wykh | darkages | dbi | debian | dejavu | dhcp | dht22 | dia | docbook | dom | dp1500 | ds18b20 | duda | dulkiewicz | dulkiewiczowa | dyndns | dynia | ebay | economy | ecowitt | ekonomia | elka | elm | emacs | emacs23 | english | ep | erasmus | erasmusplus | ess | eu | eurostat | excel | exif | exiftool | f11 | fc | fc11 | fc15 | fc29 | fc5 | fc8 | fedora | fedora21 | fenix | ffmpeg | finepix | firefox | flickr | folau | fontforge | fontspec | fonty | food | fop | forms | foto | france | francja | fripp | froggit | fuczki | fuji | fuse | gammu | garden | garmin | gas | gawk | gazwyb | gdańsk | gdynia | gender | geo | geocoding | georgia | gft | ggplot | ghost | git | github | gmail | gmaps | gnokii | gnus | google | google apps script | googlecl | googleearth | googlemaps | gotowanie | gphoto | gphoto2 | gps | gpsbabel | gpsphoto | gpx | gpx-viewer | greasemonkey | gruzja | grzyby | gus | gw1000 | haldaemon | handbrake | hhi | historia | history | hitler | holocaust | holokaust | hp1000se | hpmini | humour | iblue747 | ical | iiyama | ikea | imagemagick | imap | inkscape | inne | internet | j10i2 | javascript | jhead | jordania | k800i | kajak | kamera | karob | kibbeh | kleinertest | kml | kmobiletools | knuth | kociewie kołem | kod | kolibki | komorowski | konwersja | krutynia | krynki | kuchnia | kurski | kłamstwo | latex | latex2rtf | latex3 | lcd | legend | lenny | lesund | lewactwo | lgbt-folly | liban | liberation | linksys | linux | lisp | lisrel | litwa | lizbona | logika | ltr | lubowla | lwp | lwów | m2wś | malta | mapquest | mapsource | maradona | marchew | marimekko | marvell | math | mathjax | mazury | mbank | mediolan | mencoder | mevo | mex | mh17 | michalak | michlmayr | microsoft | monitor | mp4box | mplayer | ms | msc | mssql | msw | mswindows | mtkbabel | museum | muzyka | mymaps | mysql | mz | nafisa | nanopi | natbib | navin | neapol | nekrolog | neo | neopi | netbook | niemcy | niemieckie zbrodnie | nikon | nmea | nowazelandia | nuc | nxml | oauth | oauth2 | obituary | ocr | odessa | okular | olympus | ooffice | ooxml | opera | osm | otf | otftotfm | other | ov5647 | overclocking | ozbekiston | padwa | panoramio | paryż | pdf | pdfpages | pdftex | pdftk | pedophilia | perl | photo | photography | pi | picasa | picasaweb | pim | pine | pis | pit | pizero | plain | plotly | pls | plugin | po | podcast | podlasie | podróże | pogoda | politics | polityka | polsat | portugalia | postęp | powerpoint | połtawa | prelink | problem | propaganda | pseudointeligencja | pstoedit | putin | python | pywws | r | r1984 | radio | random | raspberry | raspberry pi | raspberrypi | raspbian | refugees | relaxng | ridley | router | rower | rowery | roztocze | rpi | rsync | rtf | ruby | rugby | rumunia | russia | rwc | rwc2007 | rwc2011 | rwc2019 | rzym | salerno | samba | sds011 | selenium | sem | senah | sernik | sheevaplug | sienkiewicz | signature | sikorski | sks | skype | skytraq | smoleńsk | sqlite | srtm | sshfs | ssl | staszek wawrykiewicz | statistcs | statistics | stats | statystyka | stix | stretch | supraśl | suwałki | svg | svn | swanetia | swornegacie | szwajcaria | słowacja | tbilisi | terrorism | tesseract | tex | texgyre | texlive | thunderbird | tomato | totalnaopozycja | tourism | tramp | trang | transylwania | truetype | trzaskowski | ttf | turcja | turkey | turystyka | tusk | tv | tv5monde | tweepy | twitter | tykocin | typetools | ubuntu | uchodźcy | udev | ue | ukraina | umap | unix | upc | updmap | ups | utf8 | uzbekistan | varia | video | vienna | virb edit | virbedit | vostro | wammu | wdc | wdfs | weather | weathercloud | webcam | webdav | webscrapping | weewx | wenecja | wh2080 | wiedeń | wikicommons | wilno | win10 | windows | windows8 | wine | wioślarstwo | wojna | word | wordpress | wrt54gl | ws1080 | wtyczka | wunderground | ww2 | www | wybory | wybory2015 | włochy | węgry | xemex | xetex | xft | xhtml | xine | xml | xmllint | xsd | xslt | xvidtune | youtube | yum | zaatar | zakopane | zakupy | zawodzie | zdf | zdrowie | zeropi | zgarden | zgony | zprojekt | łeba | świdnica | żywność
Archiwum
02/2023 | 01/2023 | 11/2022 | 10/2022 | 09/2022 | 07/2022 | 06/2022 | 04/2022 | 03/2022 | 02/2022 | 12/2021 | 09/2021 | 03/2021 | 01/2021 | 12/2020 | 11/2020 | 10/2020 | 09/2020 | 08/2020 | 07/2020 | 04/2020 | 03/2020 | 02/2020 | 01/2020 | 12/2019 | 11/2019 | 10/2019 | 09/2019 | 08/2019 | 07/2019 | 06/2019 | 04/2019 | 02/2019 | 01/2019 | 12/2018 | 11/2018 | 10/2018 | 09/2018 | 08/2018 | 07/2018 | 05/2018 | 04/2018 | 03/2018 | 02/2018 | 01/2018 | 11/2017 | 10/2017 | 09/2017 | 08/2017 | 07/2017 | 06/2017 | 05/2017 | 04/2017 | 03/2017 | 02/2017 | 01/2017 | 12/2016 | 11/2016 | 10/2016 | 09/2016 | 08/2016 | 06/2016 | 05/2016 | 04/2016 | 02/2016 | 12/2015 | 11/2015 | 09/2015 | 07/2015 | 06/2015 | 05/2015 | 02/2015 | 01/2015 | 12/2014 | 09/2014 | 07/2014 | 06/2014 | 04/2014 | 02/2014 | 01/2014 | 12/2013 | 11/2013 | 10/2013 | 09/2013 | 08/2013 | 07/2013 | 05/2013 | 04/2013 | 03/2013 | 02/2013 | 01/2013 | 12/2012 | 11/2012 | 10/2012 | 09/2012 | 08/2012 | 07/2012 | 05/2012 | 03/2012 | 02/2012 | 01/2012 | 12/2011 | 11/2011 | 10/2011 | 09/2011 | 08/2011 | 07/2011 | 06/2011 | 05/2011 | 04/2011 | 03/2011 | 02/2011 | 01/2011 | 12/2010 | 11/2010 | 10/2010 | 09/2010 | 08/2010 | 07/2010 | 06/2010 | 05/2010 | 04/2010 | 03/2010 | 02/2010 | 01/2010 | 12/2009 | 11/2009 | 10/2009 | 09/2009 | 08/2009 | 07/2009 | 06/2009 | 05/2009 | 04/2009 | 03/2009 | 02/2009 | 01/2009 | 12/2008 | 11/2008 | 10/2008 | 09/2008 | 08/2008 | 07/2008 | 06/2008 | 05/2008 | 04/2008 | 03/2008 | 02/2008 | 01/2008 | 12/2007 | 11/2007 | 10/2007 | 09/2007 | 08/2007 | 07/2007 |
O stronie
wykorzystywany jest blosxom plus następujące wtyczki: tagging, flatarchives, rss10, lastbuilddatexhtmlmime. Niektóre musiałem dopasować nieco do swoich potrzeb. Więcej o blosxom jest tutaj
Subskrypcja
RSS 1.0
Running old Debian on a new Plug computer

Although Sheevaplug has appeared to be not particularly reliable piece of hardware (this claim is based on personal experience and numerous reports of other users), it is a great fun as well, so I gave it next (the last one) chance and have bought another new plug to replace the broken one.

I planned to use SDHC card with Debian which worked seamessly with my previous plug computer, so I follow the procedure described below.

Connect PC to Sheevaplug with USB-miniUSB cable

Turn on the plug computer.

Run cu:

cu -s 115200 -l /dev/ttyUSB0

press any key. In response to boot loader prompt type:

Marvel>> version
U-Boot 1.1.4 (Dec 27 2009 - 22:03:21) Marvell version: 3.4.27

The u-boot boot loader have to be upgraded before installing Debian (cf. http://www.cyrius.com/debian/kirkwood/sheevaplug/uboot-upgrade.html).

Copy the U-Boot binary u-boot.kwb to a USB stick formated with the FAT filesystem.

Plug the USB stick into a plug computer, connect the serial console and type the following commands:

usb start
fatload usb 0:1 0x0800000 u-boot.kwb
nand erase 0x0 0x60000
nand write 0x0800000 0x0 0x60000

Regardless of how U-Boot was installed, one have to restart the machine to load the new version of U-Boot:

reset

Boot the system (cf. http://www.cyrius.com/debian/kirkwood/sheevaplug/unpack.html).

Configure the boot loader now. First of all, one has to change a setting so the device will boot the kernel which is used by Debian:

setenv mainlineLinux yes
setenv arcNumber 2097
saveenv
reset

Restart the device so the changes will take effect. Now configure the machine to boot:

setenv bootargs_console console=ttyS0,115200
setenv bootargs_root 'root=/dev/mmcblk0p2'
setenv bootcmd_mmc 'mmc init; ext2load mmc 0:1 0x00800000 /uImage; ext2load mmc 0:1 0x01100000 /uInitrd'
setenv bootcmd 'setenv bootargs $(bootargs_console) $(bootargs_root); run bootcmd_mmc; bootm 0x00800000 0x01100000'
saveenv

At this point SheevaPlug is ready to boot Debian automatically from SD card. So, I inserted my SDHC card with Debian 5.0 installed some 2 years ago and tried to connect via ssh.

ssh -l <user> 192.168.1.88

Linux neptune.pinkaccordions.org 2.6.30-5-kirkwood #1 Wed Jan 12 15:27:07 UTC 2011 armv5tel

System is up and running so it seems reusing SDHC card with old Debian installation was sucessfull, but shortly I discovered there were problems...

System clock is terribly fast and there are problems communicating with USB port. Upon consulting google I have discovered kernel upgrade is recommended (cf. http://www.cyrius.com/debian/kirkwood/sheevaplug/boot.html and http://www.cyrius.com/journal/debian/kirkwood/sheevaplug/):

apt-get update
apt-get dist-upgrade
flash-kernel     

First command generated lots of 404 errors because Lenny is not supported anymore (I was not aware of that). I decided not to upgrade to Lenny and fixed /etc/apt/sources.list instead (cf. http://superuser.com/questions/404806/did-debian-lenny-repositories-vanish):

deb http://archive.debian.org/debian/ lenny main non-free contrib
deb-src http://archive.debian.org/debian/ lenny main non-free contrib
# Volatile:
deb http://archive.debian.org/debian-volatile lenny/volatile main contrib non-free
deb-src http://archive.debian.org/debian-volatile lenny/volatile main contrib non-free
# Backports:
deb http://archive.debian.org/debian-backports lenny-backports main contrib non-free
# Previously announced security updates:
deb http://archive.debian.org/debian-security lenny/updates main

Then, apt-get dist-upgrade and flash-kernel was completed without errors.

After reboot, system works fine. I plan to upgrade it to Squeeze in the nearest future.

The moral from the story is: with God's and Google help one has not to be an expert to cope with running Linux.

url | Tue, 07/08/2012 16:57 | tagi: , , , , ,
Kopia zapasowa karty SDHC, rsync i problemy

Uruchomiłem na Szewie #2 serwer WWW, dostępny pod adresem pinkaccordions.homelinux.org (darmowa domena z serwisu dyndys.com -- w moim przypadku konieczność, bo mam tzw. zmienne IP). Jak już jest serwer, to trzeba robić -- w sposób systematyczny, a nie ad hoc -- kopie zapasowe na wypadek gdyby, np. karta padła (co podobno nie jest takie rzadkie...). Po konsultacji z tym co w tym temacie proponują inni postanowiłem robić to za pomocą rsynca, uruchamianego z zewnętrznego komputera.

Sheevaplug
SheevaPlug

SDHC
Pamięć zewnętrzna + kopia

W tym celu trzeba zainstalować rsync na obu komputerach źródłowym i tym, na którym będzie tworzona kopia:

apt-get install rsync

Teraz należy skonfigurować rsync po stronie źródła (czyli tego komputera, z którego mają być kopiowane dane) modyfikując /etc/rsyncd.conf. Zawartość pliku /etc/rsyncd.conf w moim przypadku wygląda następująco:

## http://encodable.com/tech/blog/2005/10/13/Secure_Remote_Backups_via_rsync
uid = 0
gid = 0
hosts allow = *****
transfer logging = no
read only = yes

[wholefs]
path = /
comment whole root fs

[pinkaccordions]
path = /var/www_pinkaccordions/
comment pinkaccordions www

Można sprawdzić czy działa (neptune jest zadeklarowany w /etc/hosts):

rsync neptune::wholefs/ 

Tworzenie kopii realizuje skrypt rsync_neptune.sh uruchamiany po stronie przeznaczenia:

#!/bin/bash
SOURCE=neptune::wholefs/
EXCLUDE=/root/.rsync/backup_exclude.lst
DESTDIR=/backup/neptune/rootfs

echo "=== Syncing ${SOURCE} at `date` ==="
rsync -av --exclude-from=${EXCLUDE} --delete ${SOURCE} ${DESTDIR}

Plik $EXCLUDE zawiera te katalogi, które nie powinny -- z oczywistych względów -- być kopiowane (zawartości katalogów /proc, /sys oraz /tmp):

## Exclude
- /proc/*
- /sys/*
- /tmp/*

Skrypt rsync_neptune.sh jest zaś uruchamiany poprzez crona:

0 4 * * 7 /root/bin/rsync_neptune.sh >> /root/logs/RSync/RSync.log 2>&1

Idea jest taka: kopia całego rootfs z karty SDHC ma być wykonywana na dysk USB raz w tygodniu (z innego komputera, konkretnie Szewy #1). W razie potrzeby (awarii karty SDHC) kopia ta może być szybko przeniesiona na inną kartę SDHC... Można też kopiować bezpośrednio na kartę SDHC wsadzoną na zicher w czytnik kart, ale nie widzę sensu podłączania czytnika wyłącznie i tylko po to, żeby w razie awarii, mieć kopię karty od razu a nie po 3 minutach.

Zatem:

#!/bin/bash
EXCLUDE=/root/.rsync/backup_exclude.lst
SOURCE=/public/sheeva/backup/neptune/rootfs/
DESTDIR=/media/sd_backup

# http://www.cyberciti.biz/tips/shell-root-user-check-script.html
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
   echo "This script must be run as root" 1>&2 ; exit 1
fi

## sprawdz czy karta jest w czytniku i jest zamontowana
if [ -d "$DESTDIR" ]  ; then 
    echo "** OK: $DESTDIR!"
else
    echo "** ERROR: $DESTDIR not mounted!"; exit 1;
fi

rsync -av --exclude-from=${EXCLUDE} --delete ${SOURCE} ${DESTDIR}

No i tu porażka:

rsync: readlink_stat("/media/sd_backup/etc/shadow") failed: Input/output error (5)
rsync: readlink_stat("/media/sd_backup/etc/resolv.conf") failed: Input/output error (5)
rsync: recv_generator: failed to stat "/media/sd_backup/etc/resolv.conf": Input/output error (5)
rsync: recv_generator: failed to stat "/media/sd_backup/etc/shadow": Input/output error (5)
rsync: recv_generator: failed to stat "/media/sd_backup/etc/network/run/ifstate": Input/output error (5)
rsync: recv_generator: failed to stat "/media/sd_backup/var/lib/urandom/random-seed": Input/output error (5)
rsync: recv_generator: failed to stat "/media/sd_backup/var/log/lastlog": Input/output error (5)
rsync: recv_generator: failed to stat "/media/sd_backup/var/run/dhclient.eth0.pid": Input/output error (5)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1058) [sender=3.0.5]

Trefne pliki (w liczbie sześciu, jak widać) mają długość 0 bajtów, a próba np. ls -li /media/sd_backup/etc/shadow powoduje komunikat I/O error. Usunąć tego też się nie da (rm -f nie daje rady)...

Wobec powyższego, sformatowałem partycję i wykonałem kopię za pomocą następującego polecenia wykorzystując tara:

tar cf - . | (cd /media/sd_backup/; tar xvpf - ) 2> ../../tar.log

Po wsadzeniu kopii zamiast oryginału do Szewy, system wydaje się działać. Czemu rsync zawiódł nie wiem (na razie)...

Dopisane 27 maja 2010 (po południu): Log tara (2> ../../tar.log) zawierał masę wpisów: implausibly old time stamp 1960-04-13 04:17:36. Data jest absurdalna. Żeby było śmieszniej w systemie była inna (w przód 2028 rok -- licznik się przekręcił tarowi?). Pliki z błędnym czasem modyfikacji były głównie w katalogach /dev/ /var/ oraz /etc/; wygląda jakby w czasie inicjalizacji, przed uruchomieniem ntpdate ,,fabryczny'' zegar Szewy wskazywał coś dziwacznego.

Czasy poprawiłem touchem. Zrobiłem rsync na dysk, a potem z dysku na kartę zapasową. Tym razem błędów nie było...

Dopisane 10 Kwietnia 2011: Poprawiłem skrypt rsync_neptune.sh na możliwą okoliczność wykonania kopii z uszkodzonych danych. W nowej wersji tworzone są trzy kopie z dwutygodniowym horyzontem czasowym:

#!/bin/bash
# rsync_neptune.sh (wersja poprawiona)
SOURCE=neptune::wholefs/

EXCLUDE=/root/.rsync/backup_exclude.lst
DESTDIR=/public/sheeva/backup/neptune/rootfs
COPYDIR=/public/sheeva/backup/neptune

### Zachowaj stara kopie pod inna nazwa:
cp -f ${COPYDIR}/1week.tar.gz ${COPYDIR}/2week.tar.gz

### Zachowaj stare dane (sprzed tygodnia):
tar -zcPf ${COPYDIR}/1week.tar.gz ${DESTDIR}

echo "=== Syncing ${SOURCE} at `date` ==="
rsync -av --exclude-from=${EXCLUDE} --delete ${SOURCE} ${DESTDIR}

Powinienem w ciągu dwóch tygodni się połapać, że coś jest nie tak, np. z kartą.

url | Tue, 25/05/2010 12:38 | tagi: , , , ,