Apache 2.4 mod ldap authnz_ldap debian squeeze closed (connection lost)

It does not work out of the box.

You need to open and edit

/etc/ldap/ldap.conf

and add:

# TLS certificates (needed for GnuTLS)
TLS_CACERT /etc/ssl/certs/ca-certificates.crt

Let me know if this helped.

(Visited 33 times, 1 visits today)

Letsencrypt is broken on Debian Jessie

You need backports,

so first add the jessie-backports to your favourite apt source.list

# Backport
deb http://http.debian.net/debian jessie-backports main

Then apt-get update, and then install back letsencrypt forcing the use of the backports:

apt-get install -t jessie-backports letsencrypt

That’s it,

Giuseppe

(Visited 269 times, 1 visits today)

hostname: Name or service not known

This error is caused by the file /etc/hostname being empty,  unreadable, corrupted

Did this help?

 

 

Incoming search terms:

  • hostname -fhostname: Name or service not known (2)
  • debian hostname -f name or service not known (1)
  • hostname returns hostname: Name or service not known (1)
(Visited 626 times, 1 visits today)

Installing and configuring Bareos (Bacula fork) with web front-end on Debian Wheezy.

And taking nice backups easy to be restored.

The story is quiet simple: some times ago I would have liked to have a kind of 8 months old backup for a friend of mine, but it was too late. So now, I want backups with a decent retention. So I can go “back in time” and recover files. Another choice could have been Subversion, but I’m going to backup images as well so, for this reason I’ll not take Subversion into consideration.

I’ll proceed with Bareos as it seems to be a Free Software fork of Bacula (so I hope it will be stable and robust as Bacula)  but with features that normally are sold as commercial by the Bacula project team.

I’ll use the Bareos official repository, where to download and install Bareos from.

Components

Bareos is made out of three main components and console:

  • Director
  • Storage Service
  • File Daemon
  • – Console

Not all of these components are needed for a client machine, let’s see what do we need in order to run the each component efficiently and start taking backups.

Before starting I’ll use this fantastic feature offered by Transip: the Snapshot. So if something goes wrong it will be very easy to rollback to the pre-screw-up image.

Some pre-requirements

These are required packages, if you already have them the following command doesn’t hurt.

apt-get -y install mysql-server apache2 php5 php5-mysql sudo

Then I will install their repositories and install Bareos from them like this:

URL=http://download.bareos.org/bareos/release/latest/Debian_7.0/
printf "deb $URL /\n" > /etc/apt/sources.list.d/bareos.list

# add package key
wget -q $URL/Release.key -O- | apt-key add -

apt-get update
apt-get install bareos bareos-database-mysql

If you are going to use the instructions on the Bareos website, please watch out the debian version which now is 6.0. So if you use Wheezy, just change the 6 into 7, as I did. Oh yes and in their example PostgreSQL is used in place of Mysql.

Some configuration to do.

For completing the Bareos configuration, we should setup the database and the tables and so there are some sql files to be executed, but for these files to work we need passwordless access to mysql for root. For some minutes only. If this was mysql5.6+ we could use the special variable –login-path=local, but we are on 5.5 so we can either create a .my_cnf in the root home directory or restarting mysql using the –skip-grant-tables option which will make mysql go with no passwords.

I’ll chose the second one. By the other things, this procedure is very useful in order to reset the mysql password without having a valid mysql account. So what to do is:

  • Stop mysql
  • Restart mysql with the –skip-grant-tables option
  • Run scripts below
  • Kill mysqld_safe
  • Restart Mysql in normal mode using the usual init.d script.
/etc/init.d/mysql stop
/usr/bin/mysqld_safe --skip-grant-tables

At this point you should HIT CTRL+Z so you can continue using your terminal.
When finished you can get back to the mysqld_safe process by typing ‘fg‘ as requested later in this post. (CTRL+Z sends the process in background, ‘fg‘ instead brings it back to ForeGround).

/usr/lib/bareos/scripts/create_bareos_database
/usr/lib/bareos/scripts/make_bareos_tables
/usr/lib/bareos/scripts/grant_bareos_privileges

This last command gives some problems because you started mysql with the skip-grant-tables option so it cannot use those tables for executing queries.

Kill the mysql with –skip-grant-tables, as we don’t need it any more with:

fg
CTRL + C

Open the file /usr/lib/bareos/scripts/grant_mysql_privileges and change the line

if $bindir/mysql $* -uroot  -f <<END-OF-DATA

into

if $bindir/mysql $* -uroot -p -f <<END-OF-DATA

So the password will be requested as user input.

The Director

The file in /etc/bareos-dir.conf contains the main part of the configuration.  The main important sections and some very small explanations of them are:

  • JobDefs
    This defines element in common for two or more job so there is less configuration to write. They can contain almost all is contained in a Job
  • Job
    This define the client to backup, the fileset, the storage to use etc
  • Schedule
    This controls the timing of the jobs, define a schedule with a name here, and then use it by name in Job or JobDefs
  • FileSet
    This define a fileset to be used for a job, then the name of this fileset is used in Job or JobDefs
  • Client
    This define the client by name to be used in Job or JobDefs
  • Storage
    This Defines a storage by name to be used in Job or JobDefs
  • Catalog
    This defines the database where to store information about for example owner and file permissions.
  • Messages
    The Notification configuration
  • Pool
    The way storage devices (tapes or files) are managed.
  • Console
    This configures credentials for using the console and interacting with the director.

What to configure

After a fresh install, there is some basic configuration for Bareos in /etc/bareos. This configuration wants to illustrate how to set up various component but it is also working for making a backup of Bareos itself and the MySQL catalog.

Precisely there are 5 files and each of them has a sample configuration for the director itself in  order to backup both catalog and files.

I want to add pretty much the same thing : mysql database dumps and files coming from web dirs. But before doing this I want to know how much disk space a full backup is going to take so I can configure the storage and so.

1.3G web sites folder/

320M mysql dump of all dbs

So I’m going to need some space too have a long retention. Let’s just start with a ‘normal’ retention then we will always be able to increase  it. But meanwhile we can keep an eye on the backup files created on this side, monitoring their growth and being able so to have an estimation about the initial disk space needed.

I’m not going to use tapes for my backups, but a second machine will store the backups  (as data files) and those backup are nightly transferred on the NAS in my house through a cron job which runs on a NAS running Linux.

Speaking about the web folders and MySQL  here, means speaking about WordPress blogs, like this one, so what they do is basically adding new contents into the database, and new images and media on the disk. So the only part which could be neglected is WordPress itself, but since the disk space taken for those files is infinitely small compared to the images, we are going to backup those files as well, thus, by the way, we will backup plug-ins and themes instead of  having to remember their names. So yes, it is definitely worth to save those file as well.

There are some configuration keys referenced in other configuration files. I’ll keep it consistent so do the same. These are for example, the storage.storage name, the storage.device name the fileset.name and so. The Device is defined in /etc/bareos/bareos-sd.conf, we’ll see later.

This is the Mysql part.

/etc/bareos/bareos-dir.conf

JobDefs {
    Name = MySqlDefs
    Type = Backup
    Level = Incremental
    Accurate = Yes
    Write Bootstrap = "/var/lib/bareos/%c-%n.bsr"
    Fileset = MysqlDumps
    Pool = MysqlPool
    Schedule = "WeeklyCycle"
    Storage = MysqlBackupStorage
    Messages = Standard
    Priority = 10
    Write Bootstrap = "/var/lib/bareos/%c.bsr"
    Write Bootstrap = "|/usr/sbin/bsmtp -h localhost -f \"\(Bareos\) \" -s \"Bootstrap for Job %j\" giuseppe@giuseppeurso.net"
}

Job {
  Name = "BackupMysql"
  Client = "Mysql"
  JobDefs = "MySqlDefs"
}

Client {
  Name = Mysql
  Address = 192.168.0.1
  Password = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  File Retention = 30 days            # 30 days
  Job Retention = 6 months            # six months
  AutoPrune = yes                      # Prune expired Jobs/Files
}

Storage {
    Name = MysqlBackupStorage
    # N.B. Use a fully qualified name here
    Address = backupper.mylan.com 
    Password = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    Device = FileStorageMysql
    Media Type = File
}

FileSet {
   Name = "MysqlDumps"
   Include {
     Options {
       signature = MD5
     }
     File = "/var/backups/server/mysql"
     File = "/etc/mysql/"
   }
}

Pool {
    Name = MysqlPool
    Pool Type = Backup
    Recycle = yes # Bareos can automatically recycle Volumes
    AutoPrune = yes # Prune expired volumes
    Volume Retention = 365 days
    Maximum Volume Bytes = 2G
    Maximum Volumes = 100
}

This is the web folders part with php scripts, images and so.

JobDefs {
 Name = WebDefs
 Type = Backup
 Level = Incremental
 Accurate = Yes
 Write Bootstrap = "/var/lib/bareos/%c-%n.bsr"
 Fileset = Webcopy
 Pool = WebPool
 Schedule = "WeeklyCycle"
 Storage = Web1BackupStorage
 Messages = Standard
 Priority = 10
 Write Bootstrap = "/var/lib/bareos/%c.bsr"
 Write Bootstrap = "|/usr/sbin/bsmtp -h localhost -f \"\(Bareos\) \" -s \"Bootstrap for Job %j\" giuseppe@giuseppeurso.net"
 }

Job {
 Name = "BackupWeb1"
 Client = "Web1"
 JobDefs = "WebDefs"
 }

Client {
 Name = Web1
 Address = 192.168.0.1
 Password = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
 File Retention = 30 days # 30 days
 Job Retention = 6 months # six months
 AutoPrune = yes # Prune expired Jobs/Files
 }

Storage { 
  Name = Web1BackupStorage
  # N.B. Use a fully qualified name here
  Address = backupper.mylan.com
  Password = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  Device = FileStorageWeb
  Media Type = File
 }

FileSet {
 Name = "Webcopy"
    Include {
       Options {
           signature = MD5
        }
        File = "/var/www"
        File = "/etc/apache2/sites-available"
     }
 }

Pool {
 Name = WebPool
 Pool Type = Backup
 Recycle = yes # Bareos can automatically recycle Volumes
 AutoPrune = yes # Prune expired volumes
 Volume Retention = 365 days
 Maximum Volume Bytes = 2G
 Maximum Volumes = 100
 }

 

For the storage part we need to edit:

nano /etc/bareos/bareos-0sd.conf

and add one device for mysql backups and one for web backups:

Device {
 Name = FileStorageMysql
 Media Type = File
 Archive Device = /backups/bareos/storage
 LabelMedia = yes; # lets Bareos label unlabeled media
 Random Access = Yes;
 AutomaticMount = yes; # when device opened, read it
 RemovableMedia = no;
 AlwaysOpen = no;
}
Device {
 Name = FileStorageWeb
 Media Type = File
 Archive Device = /backups/bareos/storage
 LabelMedia = yes; # lets Bareos label unlabeled media
 Random Access = Yes;
 AutomaticMount = yes; # when device opened, read it
 RemovableMedia = no;
 AlwaysOpen = no;
}

Installing the client part

The following part is about installing the bareos client on the machine to be backed up. It will expose one service on a tcp port. We will make sure also that the two machines will talk each other using a private network.

We will call this machine, the one to be backed up, “Client”. As we already did for the server, let’s add the Bareos repository to our software package manager:

URL=http://download.bareos.org/bareos/release/latest/Debian_7.0/
printf "deb $URL /\n" > /etc/apt/sources.list.d/bareos.list

# add package key
wget -q $URL/Release.key -O- | apt-key add -

apt-get update
apt-get install bareos-client

At this point we need to configure roles and authentication between components to make it work and for this purpose the following image stolen from the bareos project website is very useful:

bareos-components-autentication

This image made very easy understanding who is who. In the case of the client we should take into consideration just the bareos-fd part.

At this point i restart the services on the server machine and on the client machine.

On server:

/etc/init.d/bareos-fd restart
/etc/init.d/bareos-sd restart
/etc/init.d/bareos-dir restart

And on Client

/etc/init.d/bareos-fd restart

Then I can use the bconsole to check what’s going on, it’s very easy, just enter into bconsole typing ‘bconsole’ and then ‘help’

bconsole
Connecting to Director eventhorizon:9101
Enter a period to cancel a command.
*help
 Command Description
 ======= ===========
 add Add media to a pool
 autodisplay Autodisplay console messages
 automount Automount after label
 cancel Cancel a job
 create Create DB Pool from resource
 delete Delete volume, pool or job
 disable Disable a job
 enable Enable a job
 estimate Performs FileSet estimate, listing gives full listing
 exit Terminate Bconsole session
 export Export volumes from normal slots to import/export slots
 gui Non-interactive gui mode
 help Print help on specific command
 import Import volumes from import/export slots to normal slots
 label Label a tape
 list List objects from catalog
 llist Full or long list like list command
 messages Display pending messages
 memory Print current memory usage
 mount Mount storage
 move Move slots in an autochanger
 prune Prune records from catalog
 purge Purge records from catalog
 quit Terminate Bconsole session
 query Query catalog
 restore Restore files
 relabel Relabel a tape
 release Release storage
 reload Reload conf file
 rerun Rerun a job
 run Run a job
 status Report status
 setbandwidth Sets bandwidth
 setdebug Sets debug level
 setip Sets new client address -- if authorized
 show Show resource records
 sqlquery Use SQL to query catalog
 time Print current time
 trace Turn on/off trace to file
 unmount Unmount storage
 umount Umount - for old-time Unix guys, see unmount
 update Update volume, pool or stats
 use Use specific catalog
 var Does variable expansion
 version Print Director version
 wait Wait until no jobs are running
When at a prompt, entering a period cancels the command.
You have messages.
*

The web front-end

Let’s find a convenient location where to download webacula and download it.

cd /var/tmp
svn co https://github.com/tim4dev/webacula webacula

This last command will download the entire svn of webacula. So we will use the latest version contained. First thing: make a folder for webacula under /var/www and then copy some folders into this folder

mkdir -p /var/www/webacula
cp -pr /var/tmp/webacula/trunk/html /var/www/webacula/
cp -pr /var/tmp/webacula/trunk/application /var/www/webacula/
cp -pr /var/tmp/webacula/trunk/data /var/www/webacula/
cp -pr /var/tmp/webacula/trunk/docs /var/www/webacula/
cp -pr /var/tmp/webacula/trunk/install /var/www/webacula/
cp -pr /var/tmp/webacula/trunk/languages /var/www/webacula/
cp -pr /var/tmp/webacula/trunk/library /var/www/webacula/
chown -R www-data.www-data /var/www/webacula
usermod -aG bareos www-data
chown root:bareos /usr/sbin/bconsole
chmod u=rw,g=r,o= /etc/bareos/bconsole.conf
cp /var/tmp/webacula/trunk/install/apache/webacula.conf /etc/apache2/sites-available/webacula.conf
sed -i 's/\/usr\/share/\/var\/www/' /etc/apache2/sites-available/webacula.conf
a2ensite webacula.conf
a2enmod rewrite
service apache2 restart
[Sat Dec 28 03:56:51 2013] [warn] module rewrite_module is already loaded, skipping
apache2: Syntax error on line 268 of /etc/apache2/apache2.conf: Syntax error on line 18 of /etc/apache2/sites-enabled/webacula.conf: /etc/apache2/sites-enabled/webacula.conf:18: <Directory> was not closed.
Action 'configtest' failed.
The Apache error log may have more information.
failed!

Don’t worry about the last error, I reported it here because probably a lot of people will have this problem with the tag 5.5.1 of Webacula. There is an easy fix which is adding a ‘<‘ to the /etc/apache2/sites-enabled/webacula.conf file. Quiet easy. this is where to add it:

There is one line starting by

/Directory>

Note the missing opening ‘<‘ , Instead of

</Directory>

This is what we need to change in order to fix the problem. Once done, save and reload Apache2 configuration with:

/etc/init.d/apache2 reload

Now we need to make the user www-data capable to run the bconsole, in order to be able to read and write data. For this reason we need Sudo, so let’s install it and then we can add www-data to the sudoers file with a specific command.

apt-get install sudo
visudo

Add this line under the root one

www-data ALL=NOPASSWD: /usr/sbin/bconsole

At this point we need to download and install the Zend PHP framework minimal edition to make Webacula work. So download ZendFramework-1.12.3-minimal.tar.gz (check for the version number)  from http://www.zend.com/en/company/community/downloads. You will need a login (I know it sucks). Put it on /var/tmp

cd /var/tmp
tar -xzf ZendFramework-1.12.3-minimal.tar.gz
cp -pr /var/tmp/ZendFramework-1.12.3-minimal/library/Zend /var/www/webacula/library/Zend/

edit and configure the following file:

nano /var/www/webacula/application/config.ini

Remember to change

bacula.bconsole = "/sbin/bconsole"

into

bacula.bconsole = "/usr/sbin/bconsole"

And

bacula.bconsolecmd = "-n -c /etc/bacula/bconsole.conf"

into

bacula.bconsolecmd = "-n -c /etc/bareos/bconsole.conf"

Now it’s time to configure a database access for webacula. For this the developers provide us with some scripts. There is a configuration to be edited with database name, database password for root, before running the scripts:

nano /usr/src/webacula/trunk/install/db.conf
cd usr/src/webacula/trunk/install/MySql/
./10_make_tables.sh
./20_acl_make_tables.sh

There is one more thing to be fixed in order to make webacula run. Theoretically we have done now and we “should” be able to run our webapp at the address http://server/webacula. But, depending on your error reporting configuration for php, our result here will vary from a white page and an error page. I had a white one so i had to take a look at the error loga to see what was going on. The error log reported:

[Sat Dec 28 12:48:23 2013] [error] [client 10.0.0.1] PHP Fatal error:  Uncaught exception 'Zend_Exception' with message 'Bacula version mismatch for the Catalog database. Wanted 12, got 2001. ' in /var/www/webacula/html/index.php:186\nStack trace:\n#0 {main}\n  thrown in /var/www/webacula/html/index.php on line 186

This is probably due to the different versioning numbers going on between Bacula and Bareos. You will be tempted to  fix this from the database table “Version” which seems to be there exactly for this reason, but don’t because remember also bareos components use the database and they probably check that field as well (i did it actually, this is why I’m so damn sure). The solution is here https://github.com/bareos/contrib-webacula/blob/bareos-master/application/config.ini and I shouldn’t have used a tag… anyway, just open index.php and look for this line

define('BACULA_VERSION', 12); // Bacula Catalog version

And replace it with this one

define('BACULA_VERSION', 2001); // Bacula Catalog version

Before you start using bareos you have to lable the Volumes using the bconsole. The following is an example made with the configuration explained here:

bconsole 
Connecting to Director eventhorizon:9101
Enter a period to cancel a command.
*label
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
The defined Storage resources are:
 1: File
 2: MysqlBackupStorage
 3: Web1BackupStorage
Select Storage resource (1-3): 1
FileStorage
Defined Pools:
 1: Default
 2: File
 3: Scratch
 4: MysqlPool
 5: WebPool
Select the Pool (1-5): 1
Connecting to Storage daemon File at eventhorizon.giuseppeurso.net:9103 ...
Sending label command for Volume "FileStorage" Slot 0 ...
3000 OK label. VolBytes=211 Volume="FileStorage" Device="FileStorage" (/backups/bareos)
Catalog record for Volume "FileStorage", Slot 0 successfully created.
Requesting to mount FileStorage ...
3906 File device ""FileStorage" (/backups/bareos)" is always mounted.
You have messages.
*label
The defined Storage resources are:
 1: File
 2: MysqlBackupStorage
 3: Web1BackupStorage
Select Storage resource (1-3): 2
Enter new Volume name: MysqlStorage
Defined Pools:
 1: Default
 2: File
 3: Scratch
 4: MysqlPool
 5: WebPool
Select the Pool (1-5): 4
Connecting to Storage daemon MysqlBackupStorage at 192.168.0.2:9103 ...
Sending label command for Volume "MysqlStorage" Slot 0 ...
3000 OK label. VolBytes=214 Volume="MysqlStorage" Device="FileStorageMysql" (/var/lib/bareos/storage)
Catalog record for Volume "MysqlStorage", Slot 0 successfully created.
Requesting to mount FileStorageMysql ...
3906 File device ""FileStorageMysql" (/var/lib/bareos/storage)" is always mounted.
*label
The defined Storage resources are:
 1: File
 2: MysqlBackupStorage
 3: Web1BackupStorage
Select Storage resource (1-3): 1
Enter new Volume name: Web1Storage
Defined Pools:
 1: Default
 2: File
 3: Scratch
 4: MysqlPool
 5: WebPool
Select the Pool (1-5): 5
Connecting to Storage daemon File at eventhorizon.giuseppeurso.net:9103 ...
Sending label command for Volume "Web1Storage" Slot 0 ...
3000 OK label. VolBytes=211 Volume="Web1Storage" Device="FileStorage" (/backups/bareos)
Catalog record for Volume "Web1Storage", Slot 0 successfully created.
Requesting to mount FileStorage ...
3906 File device ""FileStorage" (/backups/bareos)" is always mounted.
*label
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
The defined Storage resources are:
     1: File
     2: MysqlBackupStorage
     3: Web1BackupStorage
Select Storage resource (1-3): 1
Enter new Volume name: FileSTorage
Defined Pools:
     1: Default
     2: File
     3: Scratch
     4: MysqlPool
     5: WebPool
Select the Pool (1-5): 2
Connecting to Storage daemon File at eventhorizon.giuseppeurso.net:9103 ...
Sending label command for Volume "FileSTorage" Slot 0 ...
3000 OK label. VolBytes=208 Volume="FileSTorage" Device="FileStorage" (/backups/bareos)
Catalog record for Volume "FileSTorage", Slot 0  successfully created.
Requesting to mount FileStorage ...
3001 OK mount requested. Device="FileStorage" (/backups/bareos)
*quit

You will get also this error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Media.VolParts' in 'field list'

I honestly don’t know what that field is supposed to contain but I want my app to work so I just create that field as a varchar 255 like this:

 mysql -uroot -p -e "use bareos; alter table Media add VolParts varchar (255);"

This should be all. Now point yur browser to the address where webacula is supposed to answer and check if you see the login prompt like this:

webacula_login_form

 

Username is root, the password is the one you choose while configuring the sql install script

That’s it. If you have comments or questions, please just use the form below this article.

Ciao

 

P.S.

I want to add this information: In this post I used fictional names for machines and for machines addresses. So I had some trouble once put this configuration working and I spotted a couple of typos and I had to fix the various passwords in various configuration files.

This image illustrates better:

webacula-after-tuning

This was Installing and configuring Bareos on Debian squeeze/wheezy with web front-end

Incoming search terms:

  • bareos (19)
  • bareos raspberry pi (3)
  • https://blog giuseppeurso net/installing-bareos-bacula-fork-web-front-end-debian-wheezy/ (3)
  • bareos vs bacula (2)
  • bareos ubuntu (2)
  • bacula debian install (1)
  • how to install bareos (1)
  • how to install bareos webui on debian 8 (1)
  • install bareos webui (1)
  • install bareos webui on debian 8 (1)
(Visited 31,395 times, 2 visits today)

Debian, managing LVM on a live system.

Playing with LVM on Debian Weehzy.

Resizing or deleting  partitions, gaining space and then redistribute it across the partition you need to resize.

Basically the logical operations are pretty simple and straightforward if taken into a ‘logical’ vie. Of course you have to shrink the partition first and then the volume, while, at the opposite if you want to grow a partition you have to resize the volume in order to be able to contain the bigger partition.

But you can’t do this on a running system. You have to restart into recovery mode. So you will be able to umount partitions as you will be using just the memory.

Particularly this applies to the machine from a dutch provider called Transip  who sells these convenient VPS and more, these have huge a disk space amount (the basic VPS has 50 gigs).

They offer a very nice Control Panel, although in dutch, is very easy to use and it offers advanced features like the chance to set the reverse dns by yourself, or or creating a private network with your virtual machine in order to carry on internal operation such as for example backups, or build your load balancing, your mysql cluster and so. Very very nice, their interface is built by themselves, very smart company.

Anyway, back to my problem, they have this console you can use to install the operating system from scratch and Icouldn’t manage to get into a partition manager that  allowed me to decide how many and how large partition to use. So i had to use one of the predefined setup (“Use entire disk and setup LVM” then “Use separate partition like /usr, / home, /var etc”).  This is a picture of the starting situation:

partition scheme transip

But I don’t really enjoy that kind of partitions and their size. So I’ll let the installation finish and then I’ll start modifying my lvm.

This machine will be used to keep some backups from mysql and some web folders under /var/www, from another machine. For this reason I will install and configure Bareos.

 

With “df -h” i can identify the following partitions, the ones I’m interested in. I want to get some free space from shrinking /home and merging /usr into the root partition (/):

/home 36 Gb
/    322 Mb
/tmp  368Mb
/usr   8.3Gb
/var   2.8 Gb
/blah

First, I want to get rid of /usr and merge it with / (the root partition).

For this reason I will:

cp -pr /usr /home/usr
umount /dev/machine-name/usr
lvremove /dev/machine-name/usr

then with

vgdisplay

I’ll be able to check the actual free disk space gained. You should see at the end of the output a line starting by (look at the picture below):

Free PE / Size.

That is the measure you can increase another partition of, or of the redistributable space. Here I’m going to make backups so I’m going to create a new partition called “/backups” where I will store my backups. This is supposed to be a very big partition, so i’ll start merging and shrinking partitions in order to leave the most of the space available for backups.

So now for example I’ll reduce the filesystem first and then teh volume size for the partition /home.

umount /dev/machine-name/home
e2fsck -f /dev/machine-name/home -p 2G
lvreduce -L 2G /dev/machine-name/home

Then this is what I have after all these operations:

after shrinking and deleting partitions and volumes

 

 

At this point I have still to merge /usr into / (the root partition), but i have to make it bigger first. So I’ll give more space to the logical volume first and then I’ll extend the file system as well.

lvextend -L 3G /dev/machine-name/root
resize2fs -p /dev/machine-name/root 3G
rm -fr /usr
mv /home/usr /

At this point we want to remove the /usr entry from /etc/fstab otherwise we will get errors because that partition doesn’t exist any more on our system. (little advice: since we are going to create a new partition and a new mount point at this point you could consider instead of deleting the entry, to modify it for the new mount point so there will be no need to come back on this file again, but it’s up to you).

 

Then create a new partition , but first the logical volume

lvcreate -L 39G -n backups vg-name

Create then a file system

 

 

mkfs .ext4 /dev/machine-name/backups

Let’s create a mount point

mkdir /backups

and let’s add the partition to /etc/fstab (just copy the line for /var taling care of renaming where needed)

If it’s all ok now we can reboot in a normal way and check whether the new partition mounts correctly etc.

So, reboot and connect with ssh. Then with “df -h” i’ll verify all.

root@eventhorizon:~# df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 3.0G 308M 2.5G 11% /
udev 10M 0 10M 0% /dev
tmpfs 101M 232K 101M 1% /run
/dev/mapper/eventhorizon-root 3.0G 308M 2.5G 11% /
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 201M 0 201M 0% /run/shm
/dev/vda1 228M 18M 199M 9% /boot
/dev/mapper/eventhorizon-home 2.0G 153M 1.8G 8% /home
/dev/mapper/eventhorizon-tmp 368M 11M 339M 3% /tmp
/dev/mapper/eventhorizon-backups 39G 176M 37G 1% /backups
/dev/mapper/eventhorizon-var 2.8G 181M 2.5G 7% /var

Great! all is as expected.
Now i can install and configure Bareos, so follow my next posts!!
Giuseppe

(Visited 2,288 times, 1 visits today)

Notes About compiling Kernel 3.9 on my Asus X202E with Debian

thanks to http://linuxg.net/compile-kernel-3-9-on-debian-wheezy/

Very short notes for personal use:

Install the needed packages:

$ sudo apt-get install kernel-package fakeroot build-essential ncurses-dev

Download the new kernel:

$ wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.9.tar.bz2

Extract the archive and cd into it:

$ tar xvf linux-3.9.tar.bz2
$ cd linux-3.9/

Do this tweaks:

$ cat /boot/config-`uname -r`>.config
$ make oldconfig

You will be asked a lot of questions. If in doubt, choose the default answer (press enter).

Next, do:

$ make-kpkg clean

Compile the kernel:

$ sudo time fakeroot make-kpkg -j4 --initrd kernel_image kernel_headers

Replace 4 with the number of cores on your computer.

Install the Kernel:

$ sudo dpkg -i ../linux-image-3.9.0_3.9.0-10.00.Custom_amd64.deb ../linux-headers-3.9.0_3.9.0-10.00.Custom_amd64.deb

(Visited 714 times, 1 visits today)

Asus X202E Debian Wheezy Kernel 3.9

I bought this machine in Haarlem on July the 11 2013

Only remark: change the drive with an SSD and performance and battery will be better.

  • Processor Intel® Core™ i3 Processor
  • Operating System Gnu Debian Linux (Wheezy)
  • Chipset Intel® HM76 Express Chipset
  • Memory DDR3 1333 MHz SDRAM
  • Display 11.6″ 16:9 HD/GL/LED (1366×768)
  • Graphic Integrated Intel® HD Graphics
  • Storage 2.5″ SATA 500GB 5400 RPM
  • Card Reader 2 -in-1 card reader ( SD/ SDHC/ SDXC/ MMC)
  • Camera HD Web Camera
  • Networking Integrated or 802.11 a/b/g/n (Optional)
    Built-in Bluetooth™ V4.0
    10/100 Base T
  • Interface
    1 x COMBO audio jack
    1 x VGA port/Mini D-sub 15-pin for external monitor
    1 x USB 3.0 port(s)
    2 x USB 2.0 port(s)
    1 x RJ45 LAN Jack for LAN insert
    1 x HDMI
  • Audio
    Built-in Speakers And Microphone
  • Battery
    2Cells 5136 mAh 38 Whrs Polymer Battery
  • Power Adapter
    Output :
    19 V DC, 1.75 A, 33 W
    Input :
    100 -240 V AC, 50/60 Hz universal
  • Dimensions
    12 x 7.8 x 0.85 inch (WxDxH)

Hd Speed test

giuseppe@hitchy:~$ sudo hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   8826 MB in  2.00 seconds = 4416.24 MB/sec
 Timing buffered disk reads: 320 MB in  3.01 seconds = 106.42 MB/sec
giuseppe@hitchy:~$ sudo hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   6260 MB in  2.00 seconds = 3131.87 MB/sec
 Timing buffered disk reads: 320 MB in  3.02 seconds = 106.13 MB/sec
giuseppe@hitchy:~$ sudo hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   8688 MB in  2.00 seconds = 4347.58 MB/sec
 Timing buffered disk reads: 318 MB in  3.00 seconds = 105.92 MB/sec
giuseppe@hitchy:~$ sudo hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   8896 MB in  2.00 seconds = 4451.93 MB/sec
 Timing buffered disk reads: 294 MB in  3.05 seconds =  96.52 MB/sec

I changed my Hdd with an SSD one (kingstone 256gb) and this is the result:

giuseppe@hitchy:~$ sudo hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   9066 MB in  2.00 seconds = 4536.79 MB/sec
 Timing buffered disk reads: 1326 MB in  3.00 seconds = 441.40 MB/sec
giuseppe@hitchy:~$ sudo hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   8986 MB in  2.00 seconds = 4500.88 MB/sec
 Timing buffered disk reads: 1322 MB in  3.00 seconds = 440.64 MB/sec
giuseppe@hitchy:~$ sudo hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   8564 MB in  2.00 seconds = 4285.12 MB/sec
 Timing buffered disk reads: 1326 MB in  3.00 seconds = 441.30 MB/sec
giuseppe@hitchy:~$

CPU info

giuseppe@hitchy:~$ cat /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 58
model name	: Intel(R) Core(TM) i3-3217U CPU @ 1.80GHz
stepping	: 9
microcode	: 0x15
cpu MHz		: 800.000
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 2
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer xsave avx f16c lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms
bogomips	: 3591.53
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 58
model name	: Intel(R) Core(TM) i3-3217U CPU @ 1.80GHz
stepping	: 9
microcode	: 0x15
cpu MHz		: 800.000
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 1
cpu cores	: 2
apicid		: 2
initial apicid	: 2
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer xsave avx f16c lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms
bogomips	: 3591.83
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 2
vendor_id	: GenuineIntel
cpu family	: 6
model		: 58
model name	: Intel(R) Core(TM) i3-3217U CPU @ 1.80GHz
stepping	: 9
microcode	: 0x15
cpu MHz		: 800.000
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 2
apicid		: 1
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer xsave avx f16c lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms
bogomips	: 3591.83
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 3
vendor_id	: GenuineIntel
cpu family	: 6
model		: 58
model name	: Intel(R) Core(TM) i3-3217U CPU @ 1.80GHz
stepping	: 9
microcode	: 0x15
cpu MHz		: 800.000
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 1
cpu cores	: 2
apicid		: 3
initial apicid	: 3
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer xsave avx f16c lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms
bogomips	: 3591.83
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

Memory info

giuseppe@hitchy:~$ cat /proc/meminfo
MemTotal:        3944568 kB
MemFree:          496140 kB
Buffers:          219088 kB
Cached:          1233868 kB
SwapCached:         3004 kB
Active:          2438584 kB
Inactive:         754240 kB
Active(anon):    1770592 kB
Inactive(anon):   425496 kB
Active(file):     667992 kB
Inactive(file):   328744 kB
Unevictable:          80 kB
Mlocked:              80 kB
SwapTotal:       8151036 kB
SwapFree:        8130268 kB
Dirty:                88 kB
Writeback:             0 kB
AnonPages:       1736936 kB
Mapped:           221064 kB
Shmem:            456216 kB
Slab:             174340 kB
SReclaimable:     110672 kB
SUnreclaim:        63668 kB
KernelStack:        3848 kB
PageTables:        36396 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    10123320 kB
Committed_AS:    5287456 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      443312 kB
VmallocChunk:   34359222256 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:       73728 kB
DirectMap2M:     4091904 kB

lspci

giuseppe@hitchy:~$ lspci
00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
00:04.0 Signal processing controller: Intel Corporation Device 0153 (rev 09)
00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)
00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4)
00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4)
00:1c.3 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 4 (rev c4)
00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)
00:1f.6 Signal processing controller: Intel Corporation 7 Series/C210 Series Chipset Family Thermal Management Controller (rev 04)
02:00.0 Network controller: Atheros Communications Inc. AR9485 Wireless Network Adapter (rev 01)
03:00.0 Ethernet controller: Atheros Communications Inc. AR8162 Fast Ethernet (rev 10)

Some more testing

I want to do some more tests so i can compare these results with the ones from my macbook and my office dell.
so i install first the software:

sudo apt-get install sysbench

and then

giuseppe@hitchy:~$ sudo sysbench --test=cpu --cpu-max-prime=20000 run
sysbench 0.4.12:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 1

Doing CPU performance benchmark

Threads started!
Done.

Maximum prime number checked in CPU test: 20000

Test execution summary:
    total time:                          46.9925s
    total number of events:              10000
    total time taken by event execution: 46.9904
    per-request statistics:
         min:                                  4.67ms
         avg:                                  4.70ms
         max:                                 10.80ms
         approx.  95 percentile:               4.75ms

Threads fairness:
    events (avg/stddev):           10000.0000/0.00
    execution time (avg/stddev):   46.9904/0.00

This is the configuration file for Kernel 3.9.0 which is needed (unless someone teelsme how to…) to make the touchscreen work in gnome.

Linux-3.9-kernel-config <- Bluetooth and Ethernet Card DON’T WORK, Touchscreen works, all rest work the same.

If someone wants to share or help, thanks in advance.

Giuseppe

(Visited 1,276 times, 1 visits today)

Installing Skype on Debian Wheezy 64bit

How to install Skype on your brand new Debian Wheezy 64bitSkype-debian

I’m migrating all my personal computers to Debian Wheezy (or Jessie in some cases). Personally i hate Skype but i have friends who don’t want to understand the importance of using open source software only, and for this reason i need Skype at least to school them to the open source life style.

Skype will come in what they claim being a multi  architecture package, but in the end it’s just a 32 bit package.

So if i want to install this program i have to enable the multiarch and i have to add the “i386” arcgitecture to my system. The guide at the address http://wiki.debian.org/Multiarch is pretty useful in this sense.

So to enable the multiarch superpowers open up a terminal and type:

dpkg --add-architecture i386

Time to download skype:

 http://www.skype.com/en/download-skype/skype-for-linux/downloading/?type=debian32

You can install your new “multiarch” skype typing:

dpkg -i skype-debian_4.2.0.11-1_i386.deb

At this point your package manager will complain about unsatisfied dependencies, which you will resolve with

apt-get -f install

Have nice chats with your friends!

Giuseppe

(Visited 2,494 times, 1 visits today)

How to take a screenshot with Gnome in Debian Wheezy

gnome screenshot screenshotScreenshot in gnome is very easy, as there is a program called: Screenshot 🙂

This program should come with the default Gnome 3 installation with the Debian Wheezy installer. You can find it in the Debian Classic application menu as well as in the Gnome application menu (the cool one).

Continue reading “How to take a screenshot with Gnome in Debian Wheezy”

Incoming search terms:

  • cara membuka gnome pada debian 6 (1)
  • cara screenshot di debian 7 (1)
  • tirando screenshot debian (1)
(Visited 2,204 times, 1 visits today)

How to record your desktop on Debian using Gnome

recordmydesktop interface in gnomeRecording my desktop on Debian with RecordMyDesktop.

If you are using Debian or other debian derivatives, you can record your desktop session to a video using RecordMyDesktop. This program is available in the Wheezy repository and ad usual, you just need a command to install it:

sudo apt-get install recordmydesktop gtk-recordmydesktop

The program will be available in gnome menu and in the Debian applications menu: Continue reading “How to record your desktop on Debian using Gnome”

Incoming search terms:

  • debian (143)
  • debian desktop (35)
  • debian gnome (28)
  • cara rekam dekatop di debian (2)
  • screen recorder download raspberry (2)
  • gnome debian (2)
  • 라즈베리파이 recordmydesktop (2)
  • debian gnome etkinleştir (1)
  • Screen recorder in raspberry pi 3 (1)
  • debiab (1)
(Visited 13,322 times, 1 visits today)