Reading v13’s blog post about Raspberry Pi under QEMU i was insired to do a similar post for archliux.
This is the easy-way (you can find a lot of copylefts here) !
Step Zero: Downdload the archlinux version of raspberry pi
Go to the archlinux arm site and download the disk image: archlinux-hf-2013-06-06.img
Decompress the image
$ unzip archlinux-hf-2013-06-06.zip
and here you are !
Step One: Find a propel kernel to boot the disk image
V13 built his own kernel - i am lazy !
From xecdesign i’ve downloaded their kernel:
wget -c http://xecdesign.com/downloads/linux-qemu/kernel-qemu
Step Two: You are ready to boot your archlinuxarm disk image:
tldr note:
qemu-system-arm
-kernel kernel-qemu
-cpu arm1176
-m 256
-M versatilepb
-no-reboot -serial stdio
-append "root=/dev/sda2 panic=0"
-hda archlinux-hf-2013-06-06.img
Step Three: Play
Do you want to know a little more ?
Click here
a summary - without notes
assuming you are using a http server
cd /var/www/html/
mkdir -pv archlinux/x86_64/
cd archlinux/
wget -c http://ftp.otenet.gr/linux/archlinux/iso/latest/arch/aitab
wget -c http://ftp.otenet.gr/linux/archlinux/iso/latest/arch/checksum.x86_64.md5
cd x86_64/
wget -c http://ftp.otenet.gr/linux/archlinux/iso/latest/arch/boot/x86_64/vmlinuz
wget -c http://ftp.otenet.gr/linux/archlinux/iso/latest/arch/boot/x86_64/archiso.img
wget -c http://ftp.otenet.gr/linux/archlinux/iso/latest/arch/x86_64/root-image.fs.sfs
add these lines to your pxelinux.cfg/default file
LABEL ArchLinux x86_64
MENU LABEL ArchLinux x86_64
KERNEL http://10.10.10.1/archlinux/x86_64/vmlinuz
INITRD http://10.10.10.1/archlinux/x86_64/archiso.img
APPEND ip=dhcp archiso_http_srv=http://10.10.10.1 archisobasedir=archlinux/ checksum=y
an ongoing list for prons & cons
people usually start with prons - but a con maybe a deal breaker.
Cons:
- You HAVE to sign/create an account on Kobo site or login with your facebook account.
- There is no file browsing - library of books is just a find on supported format files
-
Havent found a bookmark work around - good UX but needs work
Why the above are cons:
I dont have a FB account !
I dont want to “give” my email to kobo site.
If i dont to that - i cant use my hardware (this is wrong in so many ways).
I use my computer to create folders and organize my ebooks. I wanted shelves to be related to folders.
I have 100 books (at this moment) and i need to manually create kobo shelves or search to find an ebook that i have already organized it my folder.
bookmarks - i want to borrow my kobo to a friend to read a book (like i do in real life) when i am at work or on dentist.
He/she can read the book but will mess with my reading stats. I worked around this - using an annotation.
But it could be great to have bookmarks support.
Pros:
- Fast rendering
- github account: kobolabs
- touch screen - only two buttons: backlit and sleep/power off/on
- you can configure margins and line spacing
- you can add your own fonts
- pdf are readable !
- Can follow url links on epub format (useful)
- wifi - web browser
- has a good concept of gamification with awards and facebook (not related with me - but i appreciate the effort)
- chess/sudoko and sketch pad (extras)
- you can add notes (annotations - work around for bookmarking)
- dictionaries & translation dictionaries
- you can add bookmarks by touching the right upper corner
Annotations are powerful with this kobo.
Starting a new category!
I’ve recently bought an ebook reader: Kobo Glo
Here are a picture:
Project Fonts
I wanted to add some opensource fonts.
So i’ve gathered my ttf fonts to a folder and attached my Kobo Glo to my ArchLinux Box
Copied to Kobo Glo
and after that reboot my ebook reader
I’ve made a test to find the best “compressed” solution for thin provisioning on virtual machines.
f18.qcow2 is a default minimal Fedora 18 installation.
$ qemu-img info f18.qcow2
image: f18.qcow2
file format: qcow2
virtual size: 20G (21474836480 bytes)
disk size: 1.1G
cluster_size: 65536
Below is the result, sorted by size
1170252 f18.qcow2
746188 f18.qcow2.spars
253552 f18.qcow2.spars.compressed
236860 f18.qcow2.spars.compressed.lrz
236076 f18.qcow2.spars.compressed.xz
151028 f18.qcow2.xz
146172 f18.qcow2.spars.xz
141276 f18.qcow2.spars.lrz
141048 f18.qcow2.lrz
It seems that Con Kolivas has made an extraordinary work with lrzip
And these are the commands i’ve run (sorted by the result of above output):
f18.qcow2 | qemu-kvm f18.qcow2 -cdrom Fedora-18-x86_64-netinst.iso -cpu host -usbdevice tablet -m 2048 |
f18.qcow2.spars | virt-sparsify f18.qcow2 f18.qcow2.spars |
f18.qcow2.spars.compressed | virt-sparsify - -compress f18.qcow2 f18.qcow2.spars.compressed |
f18.qcow2.spars.compressed.lrz | lrzip f18.qcow2.spars.compressed |
f18.qcow2.spars.compressed.xz | xz -k f18.qcow2.spars.compressed |
f18.qcow2.xz | xz -k f18.qcow2 |
f18.qcow2.spars.xz | xz -k f18.qcow2.spars |
f18.qcow2.spars.lrz | lrzip f18.qcow2.spars |
f18.qcow2.lrz | lrzip f18.qcow2 |
My specs are:
$ grep 'model name' /proc/cpuinfo | head -1
model name : Intel(R) Core(TM) i7-3517U CPU @ 1.90GHz
$ grep -c processor /proc/cpuinfo
4
$ grep MemTotal /proc/meminfo
MemTotal: 8038060 kB
I’ve recently bought a new laptop.
It has a hybrid disk (470G HDD and a 30G SSD).
On the 30G ssd disk i’ve rsynced my archlinux from my previous laptop to the new one.
The boot process takes almost a full two minutes !
I thought i was drafting to the dark side and my sanity wasnt as good as a couple days ago.
After asking to archlinux forum, they suggest to use
# journalctl -b
I have found that there was an entry at /etc/crypttab (that doesnt exist) and the timeout was almost 90 seconds.
Comment that out and then 14sec to login !!!
I am doing a rather large dd and its being a long time (over 30minutes) so far.
How can i find the status of dd ?
at hsgr someone is telling me: KILL KILL KILL
searching through dd manual page, i came up with:
Sending a USR1 signal to a running ‘dd’ process makes it print I/O statistics to standard error and then resume copying.
eg.
# kill -USR1 5579
on the dd terminal:
7626752+0 records in
7626752+0 records out
3904897024 bytes (3,9 GB) copied, 2442,27 s, 1,6 MB/s
for more info
man 7 signal
things that make me angry:
1. Empty Subject:
Its really annoying when people are not writing a subject in their emails.
I am sure that in hell exist a circle (dante’s inferno) only for that people.
2. Irrelevant Subject:
Its as annoying to write an irrelevant subject tittle as to not write at all.
eg.
Subject: Is internet down?
Body: i am having problem login into thunderbird, but google.com is opening just fine!
3. Body test in Subject:
Another annoying thing is when people are using subject title as the begin of their body:
Subject: Yesterday one of the servers
Body: crashed but i fix it
This isnt elegant - Be lazy on the right things
4. Large subject - aka write body text into subject:
no comment on that.
eg.
Subject: “Re: Fwd: Plz investigate the problem in communication between contact.center@example.com and customer.service@example.com accounts with the domain thisisnotanexample.com”
5. RE: & FWD:
aka mail chain spam
eg.
Subject: RE: FWD: FWD: FWD: RE: FWD: RE: hello kitty
i want to punch these people really hard
6. Urgent & SOS
eg.
Subject: URGENT THIS EMAIL IS URGENT - PLZ SOS
Body: I cant login into webmail
those types of email for unknown to me reason are always on my Trash!
emailcharter
There are a gazillion other things that can drive your coworkers to spit in your coffee, so read this:
emailcharter
Suggestion:
PLz Try using tags as subjects in your emails.
There are very useful in search and keep your recipients sane.
eg.
Subject: login problem with webmail
Body: I am opening google.com (so i know i have connectivity), but i cant login into webmail.
The msg error is: Wrong Credentials
And on that i would reply instantly with:
Subject: RE: login problem with webmail
Body: We are using the wrong password, try another.
and problem solved !
The last few days i am working with febootstrap.
febootstrap is a tool to build a tiny linux appliance based on your system.
To build an appliance, febootstrap downloads every package it needs from the internet, using the defined repositories on your pacman.conf file.
If you want to test different packages or you have to build libguestfs, febootstrap will try to download again and again the packages from the internet.
The main reason is that it use a custom cachedir and root dir for fakeroot to take place and setup your new appliance.
I work-around that i posted a guide a few days back here. But that guide is telling you to edit your basic pacman.conf.
The developer of febootstrap, Richard WM Jones has a great amount of tolerance so i’ve bugged him enough to think about adding at febootstrap a command option for using your own pacman.conf file.
From today we (archers) can use febootstrap (from git at the moment - PKGBUILD is here) with our own custom pacman.conf file.
Below is a quick setup of using your own local/custom-repo/mirror with febootstrap without editing /etc/pacman.conf file.
If you have already downloaded or saved your packages to a custom location, you can bypass the first step.
The whole process doesnt need root privileges.
Step One:
$ mkdir -pv /tmp/cachedir
$ cp /var/cache/pacman/pkg/*pkg.tar.xz /tmp/cachedir/
$ repo-add /tmp/cachedir/local.db.tar.gz /tmp/cachedir/*
Step Two:
$ cp /etc/pacman.conf /tmp/
$ vim /tmp/pacman.conf
comment out the exist repo sections: core - extra - community
add the below lines
[local]
SigLevel = Never
Server = file:///tmp/cachedir/
Step three :
test it !
$ febootstrap -o /tmp/ -v --names rsync --packager-config /tmp/pacman.conf
There is an updated blog post about febootstrap. Click here
At some point, especially if you are using libguestfs, you will end up using febootstrap.
febootstrap is a tool to build a supermin appliance to boot strap a tiny base.img with the packages you need.
febootstrap support archlinux so we (archers) can use febootstrap or libguestfs based on an archlinux boot strap tiny appliance. So no extra work for archlinux in rescue virtual-machines or mount virtual disks.
febootstrap has the ability of searching through Arch User Repository to include any extra packages that dont exist in default repositories. This isnt the right way of installing packages from aur … but for lazy people febootstrap seems to do exactly what it should be.
Yesterday i’ve sent my first tiny ocaml patch at febootstrap for changing the location of aur packages.
You can check the patch here.
Hopefully its ok.
Today i want to write down the right way of installing extra packages from aur. The main reason is that aur has a lot of flagged-out-of-date packages and some of them are really … lets say the PKGBUILDs arent up-to-date or with proper dependencies. I am not expert in archlinux packaging so this from a user perspective guide.
1.
First, download the PKGBUILD you want (or use a customize abs PKGBUILD) of the package you need to install in febootstrap.
Check the PKGBUILD, correct the version, add checksum (for package integrity), review the dependencies, make the pkg. Check it again.
This is the most important thing. Try hard not to be lazy on this.
2.
Create the package with makepkg command. You’ll need base-devel packages for this.
Check the files inside the package
pacman -Qpl *.pkg.tar.xz
binaries must be under /usr/bin, libraries under /usr/lib
Be careful
3.
Create a new directory to hold your custom build packages from aur or abs.
eg.
mkdir -pv /opt/custom_repo/
and move your *.pkg.tar.xz file (or files) under this directory
eg.
move *.pkg.tar.xz /opt/custom_repo/
4.
At this point you are ready to create your custom repo db file
eg.
repo-add /opt/custom_repo/repo.db.tar.gz /opt/custom_repo/*pkg.tar.xz
and
5.
append the below lines at your /etc/pacman.conf file
[repo]
SigLevel = Never
Server = file:///opt/custom_repo/
type
pacman -Syy
to sync your repositories and you are done!
Now you can use febootstrap without searching in aur.archlinux.org for extra packages.
using virt-df is simple as writing df on your terminal.
Below a real life example:
# virsh list --all
Id Name State
----------------------------------------------------
1 win2003 running
4 win2008 running
# virt-df -d win2008 -h
Filesystem Size Used Available Use%
win2008:/dev/sda1 40G 38G 1.9G 96%
I am using OpenId and i have a personal OpenID provider based on simpleid.
I used to be able to login to sourceforge via https://balaskas.gr but i’ve removed my SSL from my website
(My SSL cert is signed by cacert and firefox doesnt accept cacert - thats another story).
So i wanted to re-configure my sourceforce access with http and openid.
I cant !
“There was an error using your OpenID.”
My logs
216.34.181.60 - - [21/Nov/2012:08:39:33 +0200] “GET / HTTP/1.1” 200 951 “-” “Zend_OpenId”
216.34.181.60 - - [21/Nov/2012:08:39:33 +0200] “POST / HTTP/1.1” 200 951 “-” “Zend_OpenId”
i’ve opened a support ticket but i got this:
“While we certainly allow users to use custom OpenIDs, we cannot guarantee that they work with our site. As such, we’re not going spend time troubleshooting that.”
right …. custom OpenID !
for the love of Bob, i am using a personal OpenID provider - i dont have a custom openid !
This is a rather large post, so you need to have some time to read through it.
I was interested into learning/identifying how data are written on a hard disk using LVM2.
All that begun when i was trying to extract partitions from a corrupted disk with no partition table!
Steps:
- Create a disk image
- Create Physical Volume
- Create Volume Group
- Create Logical Volume
- Format Filesystem
using only basic cmds [ du, fdisk, file, hexdump, losetup, strings, truncate ] and LVM2 basic cmds.
to reduce the size of this post, the latest couple hexdumps are located in separate files (12K and 172K) provide them with links.
Plz click on them just to see the output. They are very interesting.
So lets start
A. Create disk image file
# truncate -s 5G file.img
# du file.img
0 file.img
# du --apparent-size file.img
5242880 file.img
# qemu-img info file.img
image: file.img
file format: raw
virtual size: 5.0G (5368709120 bytes)
disk size: 0
# losetup /dev/loop1 file.img
# fdisk -l /dev/loop1
Disk /dev/loop1: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
B. Create Physical Volume
# pvcreate /dev/loop1
# pvck -v /dev/loop1
Scanning /dev/loop1
Found label on /dev/loop1, sector 1, type=LVM2 001
Found text metadata area: offset=4096, size=1044480
# pvdisplay
"/dev/loop1" is a new physical volume of "5,00 GiB"
--- NEW Physical volume ---
PV Name /dev/loop1
VG Name
PV Size 5,00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID Zh67aj-xAV6-wBow-qfW9-2GU5-xWEe-eHDmrr
# file file.img
file.img: LVM2 PV (Linux Logical Volume Manager), UUID: Zh67aj-xAV6-wBow-qfW9-2GU5-xWEe-eHDmrr, size: 5368709120
# qemu-img info file.img
image: file.img
file format: raw
virtual size: 5.0G (5368709120 bytes)
disk size: 8.0K
# du -k file.img
8 file.img
# du --apparent-size file.img
5242880 file.img
# hexdump -C file.img
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000200 4c 41 42 45 4c 4f 4e 45 01 00 00 00 00 00 00 00 |LABELONE........|
00000210 58 36 35 f2 20 00 00 00 4c 56 4d 32 20 30 30 31 |X65. ...LVM2 001|
00000220 5a 68 36 37 61 6a 78 41 56 36 77 42 6f 77 71 66 |Zh67ajxAV6wBowqf|
00000230 57 39 32 47 55 35 78 57 45 65 65 48 44 6d 72 72 |W92GU5xWEeeHDmrr|
00000240 00 00 00 40 01 00 00 00 00 00 10 00 00 00 00 00 |...@............|
00000250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000260 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 |................|
00000270 00 f0 0f 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000280 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00001000 16 d6 8e db 20 4c 56 4d 32 20 78 5b 35 41 25 72 |.... LVM2 x[5A%r|
00001010 30 4e 2a 3e 01 00 00 00 00 10 00 00 00 00 00 00 |0N*>............|
00001020 00 f0 0f 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00001030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
# strings -t d file.img
512 LABELONE
536 LVM2 001Zh67ajxAV6wBowqfW92GU5xWEeeHDmrr
4100 LVM2 x[5A%r0N*>
C. Create Volume Group
# vgcreate volgr01 /dev/loop1
Volume group "volgr01" successfully created
# vgdisplay
--- Volume group ---
VG Name volgr01
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 5,00 GiB
PE Size 4,00 MiB
Total PE 1279
Alloc PE / Size 0 / 0
Free PE / Size 1279 / 5,00 GiB
VG UUID Ub2ISW-x7wd-R8iy-GexG-JGUG-ECI1-kdpBrK
# file file.img
file.img: LVM2 PV (Linux Logical Volume Manager), UUID: Zh67aj-xAV6-wBow-qfW9-2GU5-xWEe-eHDmrr, size: 5368709120
# qemu-img info file.img
image: file.img
file format: raw
virtual size: 5.0G (5368709120 bytes)
disk size: 8.0K
# du -k file.img
8 file.img
# du --apparent-size file.img
5242880 file.img
# hexdump -C file.img
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000200 4c 41 42 45 4c 4f 4e 45 01 00 00 00 00 00 00 00 |LABELONE........|
00000210 58 36 35 f2 20 00 00 00 4c 56 4d 32 20 30 30 31 |X65. ...LVM2 001|
00000220 5a 68 36 37 61 6a 78 41 56 36 77 42 6f 77 71 66 |Zh67ajxAV6wBowqf|
00000230 57 39 32 47 55 35 78 57 45 65 65 48 44 6d 72 72 |W92GU5xWEeeHDmrr|
00000240 00 00 00 40 01 00 00 00 00 00 10 00 00 00 00 00 |...@............|
00000250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000260 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 |................|
00000270 00 f0 0f 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000280 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00001000 93 f4 58 bc 20 4c 56 4d 32 20 78 5b 35 41 25 72 |..X. LVM2 x[5A%r|
00001010 30 4e 2a 3e 01 00 00 00 00 10 00 00 00 00 00 00 |0N*>............|
00001020 00 f0 0f 00 00 00 00 00 00 02 00 00 00 00 00 00 |................|
00001030 c5 02 00 00 00 00 00 00 97 b4 9e 26 00 00 00 00 |...........&....|
00001040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00001200 76 6f 6c 67 72 30 31 20 7b 0a 69 64 20 3d 20 22 |volgr01 {.id = "|
00001210 55 62 32 49 53 57 2d 78 37 77 64 2d 52 38 69 79 |Ub2ISW-x7wd-R8iy|
00001220 2d 47 65 78 47 2d 4a 47 55 47 2d 45 43 49 31 2d |-GexG-JGUG-ECI1-|
00001230 6b 64 70 42 72 4b 22 0a 73 65 71 6e 6f 20 3d 20 |kdpBrK".seqno = |
00001240 31 0a 66 6f 72 6d 61 74 20 3d 20 22 6c 76 6d 32 |1.format = "lvm2|
00001250 22 20 23 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 61 |" # informationa|
00001260 6c 0a 73 74 61 74 75 73 20 3d 20 5b 22 52 45 53 |l.status = ["RES|
00001270 49 5a 45 41 42 4c 45 22 2c 20 22 52 45 41 44 22 |IZEABLE", "READ"|
00001280 2c 20 22 57 52 49 54 45 22 5d 0a 66 6c 61 67 73 |, "WRITE"].flags|
00001290 20 3d 20 5b 5d 0a 65 78 74 65 6e 74 5f 73 69 7a | = [].extent_siz|
000012a0 65 20 3d 20 38 31 39 32 0a 6d 61 78 5f 6c 76 20 |e = 8192.max_lv |
000012b0 3d 20 30 0a 6d 61 78 5f 70 76 20 3d 20 30 0a 6d |= 0.max_pv = 0.m|
000012c0 65 74 61 64 61 74 61 5f 63 6f 70 69 65 73 20 3d |etadata_copies =|
000012d0 20 30 0a 0a 70 68 79 73 69 63 61 6c 5f 76 6f 6c | 0..physical_vol|
000012e0 75 6d 65 73 20 7b 0a 0a 70 76 30 20 7b 0a 69 64 |umes {..pv0 {.id|
000012f0 20 3d 20 22 5a 68 36 37 61 6a 2d 78 41 56 36 2d | = "Zh67aj-xAV6-|
00001300 77 42 6f 77 2d 71 66 57 39 2d 32 47 55 35 2d 78 |wBow-qfW9-2GU5-x|
00001310 57 45 65 2d 65 48 44 6d 72 72 22 0a 64 65 76 69 |WEe-eHDmrr".devi|
00001320 63 65 20 3d 20 22 2f 64 65 76 2f 6c 6f 6f 70 31 |ce = "/dev/loop1|
00001330 22 0a 0a 73 74 61 74 75 73 20 3d 20 5b 22 41 4c |"..status = ["AL|
00001340 4c 4f 43 41 54 41 42 4c 45 22 5d 0a 66 6c 61 67 |LOCATABLE"].flag|
00001350 73 20 3d 20 5b 5d 0a 64 65 76 5f 73 69 7a 65 20 |s = [].dev_size |
00001360 3d 20 31 30 34 38 35 37 36 30 0a 70 65 5f 73 74 |= 10485760.pe_st|
00001370 61 72 74 20 3d 20 32 30 34 38 0a 70 65 5f 63 6f |art = 2048.pe_co|
00001380 75 6e 74 20 3d 20 31 32 37 39 0a 7d 0a 7d 0a 0a |unt = 1279.}.}..|
00001390 7d 0a 23 20 47 65 6e 65 72 61 74 65 64 20 62 79 |}.# Generated by|
000013a0 20 4c 56 4d 32 20 76 65 72 73 69 6f 6e 20 32 2e | LVM2 version 2.|
000013b0 30 32 2e 39 38 28 32 29 20 28 32 30 31 32 2d 31 |02.98(2) (2012-1|
000013c0 30 2d 31 35 29 3a 20 54 68 75 20 4e 6f 76 20 20 |0-15): Thu Nov |
000013d0 38 20 31 31 3a 33 31 3a 35 34 20 32 30 31 32 0a |8 11:31:54 2012.|
000013e0 0a 63 6f 6e 74 65 6e 74 73 20 3d 20 22 54 65 78 |.contents = "Tex|
000013f0 74 20 46 6f 72 6d 61 74 20 56 6f 6c 75 6d 65 20 |t Format Volume |
00001400 47 72 6f 75 70 22 0a 76 65 72 73 69 6f 6e 20 3d |Group".version =|
00001410 20 31 0a 0a 64 65 73 63 72 69 70 74 69 6f 6e 20 | 1..description |
00001420 3d 20 22 22 0a 0a 63 72 65 61 74 69 6f 6e 5f 68 |= ""..creation_h|
00001430 6f 73 74 20 3d 20 22 6d 79 77 6f 72 6b 22 09 23 |ost = "mywork".#|
00001440 20 4c 69 6e 75 78 20 6d 79 77 6f 72 6b 20 33 2e | Linux mywork 3.|
00001450 36 2e 36 2d 31 2d 41 52 43 48 20 23 31 20 53 4d |6.6-1-ARCH #1 SM|
00001460 50 20 50 52 45 45 4d 50 54 20 4d 6f 6e 20 4e 6f |P PREEMPT Mon No|
00001470 76 20 35 20 31 31 3a 35 37 3a 32 32 20 43 45 54 |v 5 11:57:22 CET|
00001480 20 32 30 31 32 20 78 38 36 5f 36 34 0a 63 72 65 | 2012 x86_64.cre|
00001490 61 74 69 6f 6e 5f 74 69 6d 65 20 3d 20 31 33 35 |ation_time = 135|
000014a0 32 33 36 37 31 31 34 09 23 20 54 68 75 20 4e 6f |2367114.# Thu No|
000014b0 76 20 20 38 20 31 31 3a 33 31 3a 35 34 20 32 30 |v 8 11:31:54 20|
000014c0 31 32 0a 0a 00 00 00 00 00 00 00 00 00 00 00 00 |12..............|
000014d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
# strings -t d file.img
512 LABELONE
536 LVM2 001Zh67ajxAV6wBowqfW92GU5xWEeeHDmrr
4100 LVM2 x[5A%r0N*>
4608 volgr01 {
4618 id = "Ub2ISW-x7wd-R8iy-GexG-JGUG-ECI1-kdpBrK"
4664 seqno = 1
4674 format = "lvm2" # informational
4706 status = ["RESIZEABLE", "READ", "WRITE"]
4747 flags = []
4758 extent_size = 8192
4777 max_lv = 0
4788 max_pv = 0
4799 metadata_copies = 0
4820 physical_volumes {
4840 pv0 {
4846 id = "Zh67aj-xAV6-wBow-qfW9-2GU5-xWEe-eHDmrr"
4892 device = "/dev/loop1"
4915 status = ["ALLOCATABLE"]
4940 flags = []
4951 dev_size = 10485760
4971 pe_start = 2048
4987 pe_count = 1279
5010 # Generated by LVM2 version 2.02.98(2) (2012-10-15): Thu Nov 8 11:31:54 2012
5089 contents = "Text Format Volume Group"
5127 version = 1
5140 description = ""
5158 creation_host = "mywork" # Linux mywork 3.6.6-1-ARCH #1 SMP PREEMPT Mon Nov 5 11:57:22 CET 2012 x86_64
5261 creation_time = 1352367114 # Thu Nov 8 11:31:54 2012
From this point hexdump will be out of this post, so i you want (it would be useful) click on the relative links.
D. Create Logical Volume
# lvcreate -l +100%FREE -n /dev/volgr01/lv_volume
Logical volume "lv_volume" created
# lvdisplay
--- Logical volume ---
LV Path /dev/volgr01/lv_volume
LV Name lv_volume
VG Name volgr01
LV UUID OpoaHx-kD4m-9mSO-Nj7W-i7LN-2Sxg-KFhkXw
LV Write Access read/write
LV Creation host, time mywork, 2012-11-08 11:41:51 +0200
LV Status available
# open 0
LV Size 5,00 GiB
Current LE 1279
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:22
# file file.img
file.img: LVM2 PV (Linux Logical Volume Manager), UUID: Zh67aj-xAV6-wBow-qfW9-2GU5-xWEe-eHDmrr, size: 5368709120
# qemu-img info file.img
image: file.img
file format: raw
virtual size: 5.0G (5368709120 bytes)
disk size: 12K
# du -k file.img
12 file.img
# du --apparent-size file.img
5242880 file.img
# hexdump -C file.img
Click here to see the hexdump (12K)
# strings -t d file.img
512 LABELONE
536 LVM2 001Zh67ajxAV6wBowqfW92GU5xWEeeHDmrr
4100 LVM2 x[5A%r0N*>
4608 volgr01 {
4618 id = "Ub2ISW-x7wd-R8iy-GexG-JGUG-ECI1-kdpBrK"
4664 seqno = 1
4674 format = "lvm2" # informational
4706 status = ["RESIZEABLE", "READ", "WRITE"]
4747 flags = []
4758 extent_size = 8192
4777 max_lv = 0
4788 max_pv = 0
4799 metadata_copies = 0
4820 physical_volumes {
4840 pv0 {
4846 id = "Zh67aj-xAV6-wBow-qfW9-2GU5-xWEe-eHDmrr"
4892 device = "/dev/loop1"
4915 status = ["ALLOCATABLE"]
4940 flags = []
4951 dev_size = 10485760
4971 pe_start = 2048
4987 pe_count = 1279
5010 # Generated by LVM2 version 2.02.98(2) (2012-10-15): Thu Nov 8 11:31:54 2012
5089 contents = "Text Format Volume Group"
5127 version = 1
5140 description = ""
5158 creation_host = "mywork" # Linux mywork 3.6.6-1-ARCH #1 SMP PREEMPT Mon Nov 5 11:57:22 CET 2012 x86_64
5261 creation_time = 1352367114 # Thu Nov 8 11:31:54 2012
5632 volgr01 {
5642 id = "Ub2ISW-x7wd-R8iy-GexG-JGUG-ECI1-kdpBrK"
5688 seqno = 2
5698 format = "lvm2" # informational
5730 status = ["RESIZEABLE", "READ", "WRITE"]
5771 flags = []
5782 extent_size = 8192
5801 max_lv = 0
5812 max_pv = 0
5823 metadata_copies = 0
5844 physical_volumes {
5864 pv0 {
5870 id = "Zh67aj-xAV6-wBow-qfW9-2GU5-xWEe-eHDmrr"
5916 device = "/dev/loop1"
5939 status = ["ALLOCATABLE"]
5964 flags = []
5975 dev_size = 10485760
5995 pe_start = 2048
6011 pe_count = 1279
6032 logical_volumes {
6051 lv_volume {
6063 id = "OpoaHx-kD4m-9mSO-Nj7W-i7LN-2Sxg-KFhkXw"
6109 status = ["READ", "WRITE", "VISIBLE"]
6147 flags = []
6158 creation_host = "mywork"
6183 creation_time = 1352367711
6210 segment_count = 1
6229 segment1 {
6240 start_extent = 0
6257 extent_count = 1279
6278 type = "striped"
6295 stripe_count = 1 # linear
6322 stripes = [
6334 "pv0", 0
6353 # Generated by LVM2 version 2.02.98(2) (2012-10-15): Thu Nov 8 11:41:51 2012
6432 contents = "Text Format Volume Group"
6470 version = 1
6483 description = ""
6501 creation_host = "mywork" # Linux mywork 3.6.6-1-ARCH #1 SMP PREEMPT Mon Nov 5 11:57:22 CET 2012 x86_64
6604 creation_time = 1352367711 # Thu Nov 8 11:41:51 2012
E. Format FileSystem
# mkfs.ext2 /dev/volgr01/lv_volume
mke2fs 1.42.6 (21-Sep-2012)
Discarding device blocks: done
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
327680 inodes, 1309696 blocks
65484 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1342177280
40 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
# mount /dev/volgr01/lv_volume /mnt/
# df -h /mnt/
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/volgr01-lv_volume 5,0G 10M 4,7G 1% /mnt
# file file.img
file.img: LVM2 PV (Linux Logical Volume Manager), UUID: Zh67aj-xAV6-wBow-qfW9-2GU5-xWEe-eHDmrr, size: 5368709120
# qemu-img info file.img
image: file.img
file format: raw
virtual size: 5.0G (5368709120 bytes)
disk size: 82M
# du -k file.img
83680 file.img
# du --apparent-size file.img
5242880 file.img
# hexdump -C file.img
Click here to see the hexdump (172K)
# strings -t d file.img
512 LABELONE
536 LVM2 001Zh67ajxAV6wBowqfW92GU5xWEeeHDmrr
4100 LVM2 x[5A%r0N*>
4608 volgr01 {
4618 id = "Ub2ISW-x7wd-R8iy-GexG-JGUG-ECI1-kdpBrK"
4664 seqno = 1
4674 format = "lvm2" # informational
4706 status = ["RESIZEABLE", "READ", "WRITE"]
4747 flags = []
4758 extent_size = 8192
4777 max_lv = 0
4788 max_pv = 0
4799 metadata_copies = 0
4820 physical_volumes {
4840 pv0 {
4846 id = "Zh67aj-xAV6-wBow-qfW9-2GU5-xWEe-eHDmrr"
4892 device = "/dev/loop1"
4915 status = ["ALLOCATABLE"]
4940 flags = []
4951 dev_size = 10485760
4971 pe_start = 2048
4987 pe_count = 1279
5010 # Generated by LVM2 version 2.02.98(2) (2012-10-15): Thu Nov 8 11:31:54 2012
5089 contents = "Text Format Volume Group"
5127 version = 1
5140 description = ""
5158 creation_host = "mywork" # Linux mywork 3.6.6-1-ARCH #1 SMP PREEMPT Mon Nov 5 11:57:22 CET 2012 x86_64
5261 creation_time = 1352367114 # Thu Nov 8 11:31:54 2012
5632 volgr01 {
5642 id = "Ub2ISW-x7wd-R8iy-GexG-JGUG-ECI1-kdpBrK"
5688 seqno = 2
5698 format = "lvm2" # informational
5730 status = ["RESIZEABLE", "READ", "WRITE"]
5771 flags = []
5782 extent_size = 8192
5801 max_lv = 0
5812 max_pv = 0
5823 metadata_copies = 0
5844 physical_volumes {
5864 pv0 {
5870 id = "Zh67aj-xAV6-wBow-qfW9-2GU5-xWEe-eHDmrr"
5916 device = "/dev/loop1"
5939 status = ["ALLOCATABLE"]
5964 flags = []
5975 dev_size = 10485760
5995 pe_start = 2048
6011 pe_count = 1279
6032 logical_volumes {
6051 lv_volume {
6063 id = "OpoaHx-kD4m-9mSO-Nj7W-i7LN-2Sxg-KFhkXw"
6109 status = ["READ", "WRITE", "VISIBLE"]
6147 flags = []
6158 creation_host = "mywork"
6183 creation_time = 1352367711
6210 segment_count = 1
6229 segment1 {
6240 start_extent = 0
6257 extent_count = 1279
6278 type = "striped"
6295 stripe_count = 1 # linear
6322 stripes = [
6334 "pv0", 0
6353 # Generated by LVM2 version 2.02.98(2) (2012-10-15): Thu Nov 8 11:41:51 2012
6432 contents = "Text Format Volume Group"
6470 version = 1
6483 description = ""
6501 creation_host = "mywork" # Linux mywork 3.6.6-1-ARCH #1 SMP PREEMPT Mon Nov 5 11:57:22 CET 2012 x86_64
6604 creation_time = 1352367711 # Thu Nov 8 11:41:51 2012
4468768 lost+found
To whom dont know what busybox is, plz stop using linux, android or any embedded device.
Step 1. Learn what version of kernel your device has.
my mobile use Marvel (ARMv6) kernel.
Step 2. Download your binary from here download busybox
wget -c http://www.busybox.net/downloads/binaries/latest/busybox-armv6l
Step 3. Copy busybox to your device
adb push busybox-armv6l /mnt/sdcard/
Step 4. Enter your device
adb shell
Step 5. Remount /system with read-write access
mount -o rw,remount /system
cd /system/xbin/
Step 6. Copy busybox to your system xbin dir
cp /mnt/sdcard/busybox-armv6l /system/xbin/
Step 7. Change permissions
chmod 0755 /system/xbin/busybox-armv6l
Step 8. Move your old busybox - dont remove it
cp busybox BusyBox-v1.19.4-cm7
Step 9. replace busybox
# busybox-armv6l cp busybox-armv6l busybox
simple as that !
A customer of mine, had me approached to install a virtualization solution at his company.
The first goal was portability the second productivity.
I had to find a way (transparent from their employes) to remove their work environment from their hardware.
Productivity is easy … just remove any unnecessary software and keep their desktops as clean as they can be.
“Attention Span” is the big monster.
I found that with no-sound they couldnt listen to youtube or to internet radio stations or mp3 and they had to install a radio at their office.
One radio station, one music for all. That approach was much better than every other solution i could figure out.
Imaging a work space with 15 people, how every one wants to listen to a different music/news, youtube or whatever.
That was noise - and noise is the enemy!
As for portability - we dont want to use this old hardware - was easy enough too.
I’ve built a tinycorelinux image and convert every PC to a thin or thick client.
RDP to their Terminal Server was the only thing i had to ensure is working.
Dnsmasq is the simplest and best solution to do that (PXE).
created /tftpboot/ dir and worked my way through that.
I used fedora cause it is a virtualization box with all the latest versions of software.
I wanted to test fedora and selinux wasnt so bad after all.
Till the latest upgrade!
/tftpboot directory system_u:object_r:tftpdir_t:s0
/tftpboot/.* all files system_u:object_r:tftpdir_t:s0
dnsmasq now needs dnsmasq_t
type=AVC msg=audit(1349450414.500:20456): avc: denied { read } for pid=27175 comm="dnsmasq" name="tftpboot" dev="dm-1" ino=524451 scontext=system_u:system_r:dnsmasq_t:s0 tcontext=unconfined_u:object_r:tftpdir_t:s0 tclass=dir
relabeling is out of question.
The solution is to transfer all the necessaries files to a new directory that
semanage fcontext -l
doesnt marked as something else and chcon the entire directory (recursive) to label to dnsmasq_t all files and dirs.
or to add a new policy rule that accepts dnsmasq_t for /tftpboot directory
or DISABLE selinux cause you’ll never now what else will through to you !
Its unacceptable to make such core changes without have a plan for backwards compatibility or a way to inform your faithful admin that he/shee will have a problem because you have destroyed everything he/she built the last year!.
This blog post is based on Sotiris Tsimbonis’s work.
You should always checkzone the dns zone file you have just edited.
But you can also automate this, with a vim wrapper.
small changes @ Thu, 04 Oct 2012 14:03:15 +0300
#!/bin/sh
# ebal, Thu, 04 Oct 2012 14:03:15 +0300
/usr/sbin/named-checkconf
RES=$?
if [ ${RES} -gt 0 ]; then
echo ""
echo "Fix the above errors before editing your zone file"
echo ""
exit ${RES}
fi
ZONE=$1
PREFIX="/var/named/"
CHECKSUM=`/usr/bin/sha1sum ${PREFIX}/${ZONE}`
/usr/bin/vim ${PREFIX}/${ZONE}
echo ""
echo "Checking ${ZONE} for errors..."
echo ""
/usr/sbin/named-checkzone -i local ${ZONE} ${PREFIX}/${ZONE}
RES=$?
if [ ${RES} -gt 0 ]; then
echo ""
echo "You need to fix the errors and try again."
echo ""
exit ${RES}
fi
SHA1SUM=`/usr/bin/sha1sum ${PREFIX}/${ZONE}`
if [[ "$CHECKSUM" != "$SHA1SUM" ]]; then
echo "reloading zone ..."
/usr/sbin/rndc reload ${ZONE}
fi
I use vim as my primary editor.
btw i've never believed in Vim Vs Emacs cause the are two very different programs that do very different staffs with very different ways. Apples and Orange. The only (by me) common thing is that you can use them as editors too.
I use mutt as my primary MUA with $EDITOR=vim.
Writing frequently emails in more than one language can be harsh with no key bindings or a spell checker. You have to be very careful cause a tiny typo error can confuse a lot of people or worse.
People in sysadmin jobs understand what i mean a little better than others.
vim has been integrated with spell checking functionality. English (of course) are embedded.
To read all about that, open vim and on command mode write:
: help spell
If you want globally to map a function key to English spell checking functionality then, in /etc/vimrc write something like that:
:map <f5> :setlocal spell spelllang=en_us<return>
Next time you open vim (or editing an email through mutt) you can press F5 to spell check your text/email.
For Greek spell you need to google it. If you do that, then you’ll find instructions of using openoffice greek spell zip file for creating yours vim spell file (hint: mkspell). You can map it with F6 key and use it as above.
But I am writing both English & Greek and i am boring of typing F[what ever] key or switching languages and mpla mpla mpla mpla …
I use english_greek_spelling_dictionary of Firefox.
So how cool should be if a similar spell checking mechanism exist for vim ? A few days ago, linuxinside.gr had a tribute on pkst (Κώστας Παπαδήμας) and the idea strike me at that moment.
Here are the instructions of making your own
wget -c https://addons.mozilla.org/firefox/downloads/file/108368/english_greek_spelling_dictionary-0.5.5-tb+fx+sm.xpi
unzip english_greek_spelling_dictionary-0.5.5-tb+fx+sm.xpi
cd dictionaries/
At this point we will use mkspell.
Open vim:
vim
and on command mode type:
:mkspell engr English & Greek
The result is something like this:
Reading affix file English & Greek.aff ...
Trailing text in English & Greek.aff line 532: υ
Affix name too long in English & Greek.aff line 871: AA
Reading dictionary file English & Greek.dic ...
First duplicate word in English & Greek.dic line 588565: ΑΒΑ
12794 duplicate word(s) in English & Greek.dic
Compressing word tree...
Compressed 12575870 of 13454281 nodes; 878411 (6%) remaining
Compressed 15867 of 20446 nodes; 4579 (22%) remaining
Writing spell file engr.utf-8.spl ...
Done!
Estimated runtime memory use: 4415720 bytes
If you try to use a region name, then you will be facing the below error msg:
:mkspell en_gr English & Greek
E751: Output file name must not have region name
The result is : engr.utf-8.spl
We can move this to vim default spell location:
sudo cp engr.utf-8.spl /usr/share/vim/vim73/spell/
To map a key to English-Greek spell dictionary, open /etc/vimrc and add the below line:
:map <f6> :setlocal spell spelllang=engr<return>
Here is an example:
and here is the file (if you dont want to make it)
This is one of the most idiotic questions i am reading all the time on the web (linux related).
So lets take the most frequent answer on this:
file /bin/ls
If the result is 32 then you are using a 32bit distro.
If the result is 64 then you are using a 64bit distro.
SO ?
I ‘ve already knew that cause i installed a 32bit linux on my machine !
It’s obvious !
When people asking this question at 99,9999% of the times, they want to know if their machine has 64bit capabilities.
And at that point you have to give them a hint, that they have to look on their CPU flags.
I’ve comment on a blog (ubuntu related) that this isnt the right way cause you can install a 32bit distro on a 64bit CPU and if you are using file linux command you cant understand if your CPU is 64bit !
They immediately removed my comment (wat?)
My comment had an extra tip :
If the below command has output
grep ^flags /proc/cpuinfo | grep ' lm '
or in one line:
grep -E '^flags.* lm .*' /proc/cpuinfo
then your cpu has Long Mode (x86-64) capabilities.
The definition of flags are in cpufeature.h
and can be found online here:
One other way is to search online the model name of your cpu. The model name can be also located in /proc/cpuinfo
Σήμερα στο hsgr έχουμε ανοιχτή συνέλευση: Meeting
Είναι ιδανική μέρα για να έρθετε, να μιλήσουμε, να μας γνωρίζεται, να συζητήσουμε τις ιδέες σας ή να λύσουμε κάποιες από τις ερωτήσεις σας.
Πατήστε εδώ για να δείτε πως θα έρθετε.
” Το Hackerspace είναι ένας ανοιχτός χώρος δημιουργικότητας, συνεργασίας, έρευνας, ανάπτυξης και φυσικά μάθησης. Είναι όμως και κάτι περισσότερο από ένας φυσικός χώρος. Είναι μια ενεργή κοινότητα ανθρώπων με ιδέες που πηγάζουν απ’ τη φιλοσοφία του Ελεύθερου Λογισμικού. “
Α. Νέα Μέλη
Εάν πιστεύεται ότι συμφωνείτε με το πως ρολλάρουμε κι επίσης συμμερίζεστε το όραμά μας, συμπληρώστε μια αίτηση για νέο μέλος (υπενθύμιση ότι το hsgr είναι φυσικός χώρος κι έτσι οι μέντορες ζητούν φυσική παρουσία από τα υποψήφια νέα μέλη).
Β. Εξοπλισμός
Donate for Hackerspace.gr Equip
Εάν έχετε διαθέσιμο εξοπλισμό να δωρίσετε στο hsgr (ή έχετε τρόπο να μας προσφέρετε εξοπλισμό ή έκπτωση) υπάρχει σε εξέλιξη αυτή η hsgr campaign.
φαίνεται πως έχουν παγώσει οι δωρεές - λογικό αυτό τον καιρό - μα κάθε βοήθεια ευπρόσδεκτη.
Γ. Τεχνικά Βιβλία
Εάν θέλετε να δωρίσετε τα τεχνικά σας βιβλία στο hsgr, με χαρά μας να τα δεχθούμε. Ίσως να μην τα πάρουμε όλα ! αλλά σίγουρα κάτι θα βρούμε για να εμπλουτίσουμε την βιβλιοθήκη μας.
Μερικά από τα ήδη υπάρχοντα βιβλία/περιοδικά στον χώρο είναι τα εξής: books
Ελεύθερα μπορείτε να έρθετε στο Hsgr για να διαβάσετε ένα από αυτά, χωρίς καμία δέσμευση.
Δ. Υπολογιστές
Έχουμε διαθέσιμα αρκετά spare κομμάτια ήδη. Δεν ζητάμε παραπάνω. Ζητάμε τεχνικούς με μεράκι να μας βοηθήσουν να τα συναρμολογήσουμε ώστε να φέρουμε σε ζωή παλιό εξοπλισμό. Για όσους υπολογιστές φτιάξουμε και δεν χρησιμοποιηθούν στο hsgr, θα γίνουν δωρεά σε ανθρώπους ή νέα παιδιά που δεν έχουν. Εάν έχεις χρόνο στην διάθεσή σου και ξέρεις να συναρμολογείς μπορείς να βοηθήσεις. Κι έναν να φτιάξεις για εμάς είναι αρκετό.
E. Workshops / Παρουσιάσεις aka Events
Είμαστε διαθέσιμοι για να ανοίξουμε τον χώρο σε όποιον φίλο θέλει να κάνει κάποια παρουσίαση ή workshop στον τομέα του.
open source is a philosophy - keep that in mind !
ΣΤ. Σύλλογοι / Ομάδες εργασίας
Ο χώρος είναι διαθέσιμος να φιλοξενήσει οποιοδήποτε ομάδα ή σύλλογο θέλει να κάνει τις συναντήσεις του στο hsgr.
Εάν υπάρχει μέλος του hsgr διαθέσιμο να σας ανοίξει, τότε απλά βλέπετε το πρόγραμμα του hsgr και δεσμεύεται την ημερομηνία.
Εάν δεν υπάρχει κάποιο μέλος του hsgr και θέλετε σε μηνιαία (ή εβδομαδιαία) βάση να έρχεστε, τότε το hsgr είναι ναι μεν διαθέσιμο (θα βρούμε εμείς κάποιο μέλος να ανοίγει τον χώρο), αλλά θα σας συζήσουμε μια μικρή συνδρομή για τα έξοδα του χώρου.
Ζ. Ψυγείο / Προμήθειες.
Στο χώρο έχουμε ένα ψυγείο. Μπορείτε να βοηθήσετε γεμίζοντάς το με αναψυκτικά ή μπύρεςςςςςςς!
Μπορείτε να βοηθήσετε κι απλά φέρνοντας ένα πακέτο καφέ, ζάχαρη (τσάι, σάμαλι, γαλλικό, ελληνικό, εσπρέσσο κλπ κλπ κλπ κλπ).
Η. Supporters
Σε αυτή την σελίδα έχουμε καταγράψει τους Supporters του hsgr:
ή ανώνυμα υπάρχει ένα donation box μέσα στο hsgr !
Κι εάν είστε μακριά και δεν μπορείτε να έρθετε, ορίστε πως μπορείτε να προσφέρετε:
Donate
Θ. Προπαγάνδα
Μπορείτε να μας βοηθήσετε κι απλά συμμετέχοντας στην προπαγάνδα μας:
Για να μην σας ταλαιπωρώ άλλο με το εκτενές post μου, ρίξτε μια ματιά στα events που έχουμε φιλοξενήσει μέχρι τώρα.
I am using LVM for storage to virtual machines.
One simply way to make backups (even if the machine is online) is through dd.
(but if you are using a database, online is out of question).
dd will backup the entire partition to a raw image.
Lets make an example:
# time dd if=/dev/vg01/winxp of=winxp.img bs=1024
5242880+0 records in
5242880+0 records out
5368709120 bytes (5,4 GB) copied, 111,164 s, 48,3 MB/s
So we have a 5Gb backup raw image with sparse files into.
If only there was a way to remove sparse files to reduce the size!
Wait … it does exist: virt-sparsify
# virt-sparsify winxp.img winxp.img.spars
...
Sparsify operation completed with no errors. Before deleting the old
disk, carefully check that the target disk boots and works correctly.
# ls -ltr
-rw-r--r-- 1 root root 5368709120 Αύγ 28 11:55 winxp.img
-rw-r--r-- 1 root root 5368709120 Αύγ 28 11:59 winxp.img.spars
# du -h *
5,1G winxp.img
3,1G winxp.img.spars
2gb sparse files have just removed !
Now you can compress the backup image to reduce the size even more:
# du -h winxp.img*
5,1G winxp.img
3,1G winxp.img.spars
1,4G winxp.img.spars.lrz
We can now remove winxp.img & winxp.img.spars (8.2Gb) from our backup storage.