Windows 7 backup issue: Error: “The system cannot find the file specified. (0×80070002)”

July 17th, 2010

I wanted to use Windows 7 Backup to backup my start partition and files to a second hard drive. I liked the idea of Windows 7 working with shadow copies, incremental backups, and both file and partition backups.

However, after some time, I suddenly received error messages “The system cannot find the file specified” and the backup was aborted. First thing that was strange is, that Windows never really notified me of this issue. I saw this just by luck when starting the backup and restore tool manually. The second strange thing is that Windows does not tell, which file is missing. A google search did not bring up a lot of solutions, but other people seem to have the same issue. So fixing this issue was not easy.

The solution, which at the end worked, was to assign a drive letter to the 100M Windows 7 start partition (via My Computer -> manage). In my case, I assigned drive letter Z: to the first partition. Windows still did not show this partition in the “My Computer” overview, but the backup works now.

Strange.

Change default editor of Debian from nano to vim

June 29th, 2010

After the installation of Debian, it always annoys me that after I have installed vim (my favourite editor), the system still invokes nano as the default editor. This is the case for example when using “crontab -e”, “svn ci” or “visudo”.

You can see the current editor when calling command
$ update-alternatives --display editor
editor - status is auto.
link currently points to /bin/nano
/bin/ed - priority -100
/bin/nano - priority 40
/usr/bin/vim.tiny - priority 10
/usr/bin/mcedit-debian - priority 25
/usr/bin/vim.basic - priority 30
Current `best' version is /bin/nano.

You can see the available alternatives for editor by calling:
jclbs3:~# update-alternatives --list editor
/bin/ed
/bin/nano
/usr/bin/vim.tiny
/usr/bin/mcedit-debian
/usr/bin/vim.basic

And finally, you can set a new default editor by calling:
jclbs3:~# update-alternatives --config editor

There are 5 alternatives which provide `editor'.

Selection Alternative
-----------------------------------------------
1 /bin/ed
*+ 2 /bin/nano
3 /usr/bin/vim.tiny
4 /usr/bin/mcedit-debian
5 /usr/bin/vim.basic

Press enter to keep the default[*], or type selection number: 5
Using '/usr/bin/vim.basic' to provide 'editor'.

Image Resizer Powertoy Clone for Windows

June 29th, 2010

You want to resize images quickly, by using a right-click (context menu)? For Windows XP, there was a Powertoy available for resizing, but not for Windows 7.

But – there is a great replacement for Windows 7, see here: Image Resizer Powertoy Clone for Windows

This is a clone of the Image Resizer Powertoy for Windows XP — a PowerToy that allows you to right-click on one or more image files in Windows Explorer to resize them. It was created to extend support to non-XP and 64-bit versions of Windows (including 2000, Vista & 7).

Home server with 100 MB/sec transfer speed for 220 EUR

June 18th, 2010

I have bought a new home server to store all my personal data on a separate system. I did not spend a lot of money, and I am absolutely surprised how great the server has become.

I have now transfer rates of about 100 MB/s download and 60-70 MB/s upload speed!. The server consumes around 70W and less then 1W in standby mode. The components cost were about 220 EUR only (without harddisks)!!

Here are all the details:
CPU: AMD Sempron 140 (can unlock the second core easily in BIOS)
Board: MSI 770-C45
Memory: Kingston ValueRAM DIMM 1 GB DDR3-1333
Graphic Card: Club 3D CGNX-GS846LCI (cheapest possible, as I use only text mode…)
Chassis: Cooler Master Elite 334
Power: Sharkoon RushPower M 400W
Second Chassis Fan: Sharkoon Silent Eagle 1000

Operating System: Debian GNU/Linux stable

I have three 1TB harddrives (Seagate ST31000520AS) installed as a software RAID (RAID level 5).

For the AMD Sempron 140 processor, it was possible with a simple BIOS setting to unlock a second core. It is then displayed as “AMD Athlon(tm) II X2 4400e Processor” with 2.7 GHz and 5417.69 bogomips per core. This is really amazing, as the CPU costs only 36 EUR – including CPU fan :-)

The board has 6 Serial ATA connectors, from which I am using only three at the moment. As you can see, I did not install a DVD drive. It’s not required, as it was easily possible to install Linux from a USB stick.

When I decided for the parts of the server system, I paid attention that it can include up to 6 SATA hard disks. This is possible now, the chassis, power supply and main board support up to 6 drives.
At the moment, with three drives and RAID5, I have a net capacity of 2 TB (real usable capacity is about 1.7 TB, by the way). So, I still have the possibility to increase the capacity up to 5 TB, without having to buy other hardware components.

Deleting a complete s3 bucket including all files

May 2nd, 2010

It seems to not be so easy to delete a complete s3 bucket including all files.

The only solution I found was to create an empty folder on my local Linux server and then “synchronize” the empty folder with the s3 bucket, therefore deleting any remote files. Only then, I could remove the bucket.

So it looks like this:

jomep@jcld1:~$ pwd
/home/jomep/empty_folder
jomep@jcld1:~$ mkdir empty_folder
jomep@jcld1:~$ s3cmd --delete-removed sync /home/jomep/empty_folder s3://jomep77-7H3LpA11-photos
Compiling list of local files...
Retrieving list of remote files...
Summary: 0 local files to upload, 6093 remote files to delete
deleted 's3://jomep77-7H3LpA11-photos/2008-06-07 Photos Test/059.JPG'
...

So, it takes a long time, but it works..

Do you know anything better?

Locate32 – locate for Windows

January 26th, 2010

Since several years I am using Locate32 to search files in Windows.

Locate32 is a free file finder which works by indexing all your files on your hard disk drive and thus is able to provide almost instant access to them. Therefore, it is very, very fast. You may know it from Linux installations, where you can enter “locate obama” to find all files containing the string “obama”. The same works with Locate32, but you have a nice small user interface where you enter the search string, and where you can limit your search by some additional parameters, such as file size and extensions.

Oh yes, after you have installed Locate32, you need to press F9 once in order to start indexing your hard drive. The first index can take several minutes, but all following indexes are much faster.

Give it a try!

Bash script to calculate the current cost of the Amazon S3 data

October 2nd, 2009

Again a post about s3cmd.

Based on s3cmd, I have created a small Linux script called s3infos to calculate the overall size of my S3 data and also the monthly costs for it. Strange, but it seems that such an easy tool does not exist yet. I use it since several months and it works perfectly fine for me.

s3infos will first read the list of buckets in your amazon s3 account and will then loop over each of these buckets to determine its size. At the end, the script shows the total size of your account and the monthly costs for the storage, based on 0,150 USD pro GB.

Example output of s3infos:
Determining buckets in your S3 storage...
6 buckets found.

Determining size of bucket s3://jomep-7H3LpA11-test...
-> Size: 0 bytes (0 MB)
Determining size of bucket s3://jomep77-7H3LpA11-backups...
-> Size: 13725589843 bytes (13089 MB)
Determining size of bucket s3://jomep77-7H3LpA11-jcld1-svn-backup...
-> Size: 9594797164 bytes (9150 MB)
Determining size of bucket s3://jomep77-7H3LpA11-photos...
-> Size: 20096649454 bytes (19165 MB)
Determining size of bucket s3://jomep77-7H3LpA11-test...
-> Size: 0 bytes (0 MB)

Total size of all 6 buckets: 43417036586 bytes (41405 MB)
Monthly costs for storage: 6.51 USD

I have scheduled the script in a cronjob, so the system sends me once a week an email with the current size of my s3 buckets and the total costs. See the following cron job entry:

# Send S3 info mail:
0 1 * * 0 /home/jomep/bin/s3infos | mail -s "S3 Infos"

Here the script for download:

  • s3infos (size: 1.2 kB, downloaded 349 times)
  • Note: you need to rename the file from s3infos.txt to s3infos and set file permissions correctly, for example: mv s3infos.txt s3infos; chmod +x s3infos

Linux tools for Amazon AWS S3

October 2nd, 2009

You probably know Amazon Simple Storage Service (Amazon S3). If not, it is an online storage web service offered by Amazon, providing unlimited storage. The price is very reasonable (0.15 US-$ per gigabyte and per month). They only disadvantage is that it is very difficult to use and to access – if you do not use any tools for doing so!

Under Linux I found that s3cmd suits best to my needs. It is very simple to use. If you call it the first time, you have to enter your key and secret key, and that’s all.

Now, if you call it again with the parameter “ls”, you can list the contents of your web service:

jomep@jcld1:~$ s3cmd ls
2009-07-17 21:32  s3://jets3t-53c2d2df01beff6cd244edbd8005c658
2009-07-10 23:07  s3://jomep-test
2008-11-09 12:52  s3://jomep77-backups
2009-07-24 23:57  s3://jomep77-jcld1-svn-backup
2009-07-17 21:48  s3://jomep77-photos
2009-07-10 23:07  s3://jomep77-test
jomep@jcld1:~$ s3cmd ls
2008-11-09 12:52  s3://jomep-7H3LpA11-backups
2009-07-24 23:57  s3://jomep-7H3LpA11-jcld1-svn-backup
2009-07-17 21:48  s3://jomep-7H3LpA11-photos
2009-07-10 23:07  s3://jomep-7H3LpA11-test

To determine the size of a bucket in bytes simply call:

jomep@jcld1:~$ s3cmd du s3://jomep-7H3LpA11-jcld1-svn-backup
3523030246 s3://jomep-7H3LpA11-jcld1-svn-backup/

Or, to get the size in human readable format:

jomep@jcld1:~$ s3cmd du s3://jomep-7H3LpA11-jcld1-svn-backup -H
3G       s3://jomep-7H3LpA11-jcld1-svn-backup/

The best usage is however the sync parameter. This is what I use, to make daily backups of my data:

s3cmd sync /srv/svn s3://jomep-7H3LpA11-jcld1-svn-backup/

If you use parameter “–delete-removed”, all files that exist on the destination but not (anymore) on the source are deleted.
I use Debian GNU/Linux and installed s3cmd by simply installing the package with the same name:

aptitude install s3cmd

The following commands are listed in the man page:

Commands:
  Make bucket
      s3cmd mb s3://BUCKET
  Remove bucket
      s3cmd rb s3://BUCKET
  List objects or buckets
      s3cmd ls [s3://BUCKET[/PREFIX]]
  List all object in all buckets
      s3cmd la
  Put file into bucket
      s3cmd put FILE [FILE...] s3://BUCKET[/PREFIX]
  Get file from bucket
      s3cmd get s3://BUCKET/OBJECT LOCAL_FILE
  Delete file from bucket
      s3cmd del s3://BUCKET/OBJECT
  Synchronize a directory tree to S3
      s3cmd sync LOCAL_DIR s3://BUCKET[/PREFIX] or s3://BUCKET[/PREFIX] LOCAL_DIR
  Disk usage by buckets
      s3cmd du [s3://BUCKET[/PREFIX]]
  Get various information about Buckets or Objects
      s3cmd info s3://BUCKET[/OBJECT]

For further information have a look on the amazon website at http://aws.amazon.com/s3/ or at the wikipedia article on http://en.wikipedia.org/wiki/Amazon_S3.

I found a good article about s3cmd here: http://s3tools.org/s3cmd.

Determine External IP of my local Linux Server

August 21st, 2009

I have a linux server in my local network, connected via a DSL router to the internet. The DSL router assigns a dynamic IP address to the server.
In order to determine the current external IP address (Internet IP address) of the router (under which I have set up a forward to the server), I have found a small python script which can be run directly in the linux shell:
jomep@jclbs1:~/bin$ cat showexternalip
#!/usr/bin/python
import urllib
import re
checkIP = urllib.urlopen("http://checkip.dyndns.org").read()
externalIP = checkIP.split()[-1].strip("")
externalIP = re.sub(r'<[^>]*?>', '', externalIP)
print "External IP from checkip.dyndns.org: " + externalIP

And when I call it, it displays the following:
jomep@jclbs1:~/bin$ ./showexternalip
External IP from checkip.dyndns.org: 77.181.32.194

This script was published simarly in the last issue of the German computer magazine c’t.

Here the script for download:

emailbackup

August 17th, 2009

I have created a page about emailbackup. ”emailbackup” is a small Linux tool packs a file or a folder into a compressed file and sends it via email.

See the following page: http://www.jomep.de/emailbackup/

Here the script for download:

checkdiskspace

August 16th, 2009

What I also use often is a script that reports if there is enough disk space left on a device. I called this script “checkdiskspace”. If it is run, it shows either:
jomep@jcld1:~/bin$ ./checkdiskspace
checkdiskspace: WARNING: Partition "simfs" on host jcld1.ljc.de is 88% full!

or:
jomep@vserver1:~$ checkdiskspace
checkdiskspace: Partitions on host vserver1.ljc.de are all not yet full.

It reports a warning, if the filesystem is more than 85% occupied (configurable in the script). I use it mainly during logon (bash logon script) and in a script which sends me server statistics weekly.

Here the link:

Note: If you download it and find it any useful, please leave a comment.

How to show the biggest 10 files

August 16th, 2009

How to show the biggest 10 files under the current directory in Linux:

jomep@vserver2:~/bin$ cat showbiggest15files
#!/bin/bash
du -a | sort -n -r | head -n 10

Deleting .svn subdirectories

August 16th, 2009

I sometimes have to delete all .svn subdirectories out of a folder and all subfolders. It is trivial, but to not always have to look at the find manual, I created the following bash script:

jomep@vserver2:~/bin$ cat rmsvnsubdirs
#!/bin/bash
echo "Deleting directories:"
find . -name '.svn' -type d
find . -name '.svn' -type d -exec rm -rf {} \;

Big developments so far

August 16th, 2009

These are the “big” developments (more than a few hours), which I have done so far. In the next time, I will post more information about each of these on this site:

  • TreeNotes
    A tool to save notes and files in a tree structure. Similar to a file system, but where also folders can contain text, with versioning and search, and all online
  • josipoga – Jomep’s Simple Photo Gallery
    I don’t know why, but I found no PHP photo gallery on the net that suits my requirements. It had to be simple, nice looking, and callable via a simple URL like: http://example.com/gallery.php?dir=/home/jomep/myphotos
  • uptimereport
    I use and like virtual servers  (vservers) a lot. I found out – unfortunately – that some vserver providers are not really reliable. Either the vserver is often offline or it unusable because the load is to high (too many vservers share the same hardware). Therefore I developed a tool which monitors the load of a server and the uptime, and displays a report
  • sreminder
    A tool written in C++, running under Windows and GNU/Linux to  send me emails when somebody has birthday or when an anniversary is due
  • emailbackup
    A small Linux tool which packs a file or a folder into a compressed file and sends it via email. I use this to make backups from for example the /etc directory once a week. If the compressed file big, it can be split into multiple emails
  • backup_other_hosts.sh
    Although it seems trivial,  I have created a big and very nice bash script to perform a backup from my remote servers on my local server. It is based on rsync, but very comfortable and stable. I use it for more than a year now

Weblog created

August 16th, 2009

Hi all,

in my freetime, I am doing a lot of things on the computer. During that time, I always try and discover new things, mainly on Windows, Linux and on programming. Often, I have to use Googe for a long time to find solutions to the issues I have and I am always glad that someone documented what he did to solve an issue.

So, this is a try to create a space also for me, to post things that come up during my research and may interest others.

Jomep