How to fix ‘$MFTMirr does not match $MFT (record 0)’ error

From time to time hard disks with NTFS filesystem get a ‘$MFTMirr does not match $MFT (record 0)’ error when user try to mount or read/write.

This error can be easily fixed running the ntfsfix command as seen below.

root@artemis:~# ntfsfix /dev/sdf1
Mounting volume… $MFTMirr does not match $MFT (record 0).
FAILED
Attempting to correct errors…
Processing $MFT and $MFTMirr…
Reading $MFT… OK
Reading $MFTMirr… OK
Comparing $MFTMirr to $MFT… FAILED
Correcting differences in $MFTMirr record 0…OK
Processing of $MFT and $MFTMirr completed successfully.
Setting required flags on partition… OK
Going to empty the journal ($LogFile)… OK
Checking the alternate boot sector… OK
NTFS volume version is 3.1.
NTFS partition /dev/sdf1 was processed successfully.

User can then mount the drive and proceed with read/write operations.

Allow-Request in Bind

Recently i figured out that using Openvpn on my Android phone failed to properly query DNS using my Bind9 service.
Following entries appeared in syslog in my attempts to access http sites:

client 74.125.189.18#38921: query (cache) ‘ns1.domain2.com/A/IN’ denied

I had to do the following to make it work.

Add following line in /etc/bind/named.conf.local

// Managing acls
acl internals { 127.0.0.0/8; 192.168.1.0/24; 10.8.0.0/24; };

and

// Allow recursive queries to the local hosts
allow-recursion { internals; };

in /etc/bind/named.conf.options

And it worked!

Revoke OpenVpn Certificate

First step is to navigate to /etc/openvpn/easy-rsa where keys and certificates are stored.

After that we should run source ./vars and then ./revoke-full CertificateName. The latter should be only the name without the extension.

Index.txt file inside keys folder should write R in front of each certificate revoked before.

Print Server using CUPS in Linux

CUPS (www.cups.org) is an open source printing system developed by Apple for UNIX-like operating systems and OSX.

Implementing a print server with CUPS could be simple or very complicated if integration with AD, LDAP is needed.

Here we will take a look on how we can share a simple USB printer across our network.
Συνέχεια

TLS/SSL FTP Server and Ubuntu 12.04 Filezilla don’t go together

It may seem strange but you cannot use TLS/SSL FTP servers with Filezilla in Ubuntu 12.04.

And that’s just the tip of the iceberg. Actually the problem lies with GnuTLS which Filezilla uses.
So for now just use your FTP client in Windows which statically link GnuTLS.

OpenVPN – Adding a new client without having to ./clean-all

When you try to add a new client in OpenVPN you are instructed to ./clean-all with the after-effect to start transferring again all the keys to the clients.

That’s not desirable at all…

You can do the following to bypass this:

chmod +x vars
./vars
source ./vars
./build-key clientname

How to increase the size of a virtual disk in Virtualbox

Miscalculation in storage needs it’s common.

In Virtualbox you can fix this quick and easy with a command-line tool VBoxManage.

For example if you like to grow the disk to 40GB you just have to run the following command:

VBoxManage modifyhd mylinuxdisk.vdi --resize 40000

Of course you have to expand the hard drive inside the Guest OS. So if you have a virtualized Linux you can accomplish that from Gparted and if you have a Windows OS from the Computer Management

Recovering Grub After Installing Windows

It is a usual effect when installing Windows on a dual-boot system to loose Grub.

An easy way to fix it is the following:

Boot with a Ubuntu Live-CD.

Let’s assume that the linux system resides on /dev/sda2.

sudo mount /dev/sda2 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc

Συνέχεια

Shut down in Gnome 3 got missing?

Gnome 3 is rather new and some flaws or changes in direction are expected.

On that path there is no shut down option unless you press the Alt key.

There it is 🙂

Openvpn configuration – Ubuntu Oneiric

For a bit of time now i was struggling to make Openvpn work as i wanted on a Ubuntu Server 11.10.

And the day has come to share my configuration.

Install OpenVPN

Update APT and install Openvpn package

apt-get update

apt-get install openvpn

OpenVPN Scripts

OpenVPN provides some scripts located by default in the /usr/share/doc/openvpn/examples/easy-rsa/ directory. In order to work properly we have to copy these scripts to /etc/openvpn directory.

Συνέχεια