Posts Tagged ‘linux’

creating images of encrypted partitions with partimage

Wednesday, October 28th, 2009

partimage is a tool for creating images of whole partitions. It supports all major file systems, like ext2/ext3. It will only backup the used blocks of a partition and thus save space. In order to do so, it needs to detect the type of the file system. Encrypted file systems can not be used directly. You first have to open the device:

cryptsetup luksOpen /dev/sdXX SOMENAME

After that you can use the new device /dev/mapper/SOMENAME. You have to specify this device directly on the command line, because it will not be auto detected by partimage in the ncurses mode. Another important option is -M, which will not backup the MBR. If you forget this parameter the whole thing will fail. In the end the command looks like that:

partimage -z1 -d -M save /dev/mapper/SOMENAME FILENAME.img.gz

ubuntu/debian raid10 installation

Monday, October 19th, 2009

I’m currently setting up a new file server. My first plan was to use Ubuntu 8.04 LTS. The system has four sata drives, that should be combined to a raid10. Actually I wanted to use two raid1 which are combined into a striped logical volume via LVM. The server has no cd/dvd drive. Therefor an installation via PXE is the way to go. The text installer is capable of creation md raids and LVM volumes. Though I didn’t find any possibility to create a striped volume, neither in the debian nor in the ubuntu installer.

The solution is the following:
1. create the md raids and the LVM volumes outside the installer, with some live system.(CD/DVD or USB)
2. start the PXE installer
3. in the partition editor choose “manual setup”(or something similar)
4. the system will detect the created volumes which can be further used

This is only possibile with the current stable Debian installer, not with the Ubuntu 8.04 LTS installer. I don’t know if the situation change in a newer Ubuntu version. It probably did as they take the code from Debian. Whatever…so my server will be a Debian system.

software raid10 under linux

Saturday, October 17th, 2009

There are two different ways to build a raid10 software raid under linux. The first just uses md to build a raid10 and layer a Logical Volume Manager (LVM) ontop. The LVM is not necessarily needed, but it offers useful features like snapshots. The other approach involves creating two raid1 arrays with md and combining those to a stripe inside the LVM. I can’t tell which is technically the better solution. I read somewhere that the pure raid10 setup had a better performance. In order to find out I did a short benchmark with bonnnie++ on a machine with four sata drives. The results can be seen here:









Sequential Output Sequential Input Random
Seeks
Sequential Create Random Create
Size:Chunk SizePer CharBlockRewritePer CharBlockNum FilesCreateReadDeleteCreateReadDelete
K/sec% CPUK/sec% CPUK/sec% CPUK/sec% CPUK/sec% CPU/ sec% CPU/ sec% CPU/ sec% CPU/ sec% CPU/ sec% CPU/ sec% CPU/ sec% CPU
2x RAID1 + LVM1488M12595978176892676595714597988301117372.432561070768615615438225858056379510291218
RAID10 + LVM1488M12599978016588351642913970945534313371.52256121297657381340612399666332179314119

The benchmark shows, that there is not that big of a difference between those two.

But there is one point that made my decision. It is currently not possible to resize a raid10. Though is is possible to resize the two raid1 arrays individually.