VirtualBox: Snapshots filling up disk, what to do

So this has happened to me again. I didn’t pay attention to VirtualBox snapshots filling up my “vm” partition. Yesterday, less than 2 GB were left, so I eventually thought of deleting snapshots.

vbox-snapshotsIn VirtualBox (VBox), deleting a snapshot means merging it with the originally created virtual disk image (VDI) file (in my case, Suse13.vdi). But that works only if there’s enough space on the partition for that operation. As I found, to merge a 10 GB snapshot file into a 15 GB original VDI file, you need at least 5 GB free space for the temporary files that VBox creates. Unfortunately, there’s no way to instruct VBox to use space on another partition for those temporary files.

What I found after a lot of googling was that most people revert to cloning the virtual machine (VM), then discarding the original VM (that is, deleting the original VDI file and all the snapshot files), then creating a new VM using the cloned VDI. Similar problem here, since there’s no way to tell VBox to create the VDI clone on a different partition, you’re stuck when there’s not enough space on your disk. For that reason, you can’t use the graphical VBox interface, but you can use the command-line interface. On Linux, that would be a command like this:

vboxmanage clonevdi linux/Suse13.vdi /mnt/goobay1/Suse13clone.vdi

For me, that created a VDI clone on another partition — so far, so good. Unfortunately, that clone wouldn’t boot. Not sure if that could be fixed — I gave up fiddling to get it working after half an hour.

Eventually, I found a solution on the Net that was too obvious to find out myself: Simply move the snapshot files to another partition, create symbolic links in the original location, then merge the snapshot files. D’uh. It goes like this (on Unix-style operating systems):

(1) Find where the snapshot files are. They’re normally near your VDI file, in a folder called Snapshots.

(2) Move the snapshot files with commands like this:

Atlas/vm/linux/Suse13/Snapshots> mv {eadb26a3-df2b-4481-be35-abbc5fdc27a4}.vdi /mnt/goobay1/MyLinuxSnapshotsNew/

(3) Create symbolic links:

Atlas/vm/linux/Suse13/Snapshots> ln -s /mnt/goobay1/MyLinuxSnapshotsNew/\{eadb26a3-df2b-4481-be35-abbc5fdc27a4\}.vdi .

In the example above, that “shrunk” the file size from 9 GB to 75 bytes, thus freeing up 9 GB on the VM’s partition. I did likewise for another snapshot file, which together freed up 25 GB, more than enough to eventually delete (merge) the snapshot files. (After a successful merge, VBox will delete what it thinks is the snapshot file, but that’s actually the symbolic link. To free up space on your “remote” partition, you’ll then manually have to delete the snapshot file.)

Important: Make sure your VM is shut down properly. Don’t suspend it or even leave it running!

Important: Before deleting (merging) the snapshots from the VBox graphical interface, make sure your VM is happy with the symbolic links, and still starts up. If it doesn’t, you can still remove the symbolic link, and move back the original snapshot file. (This won’t solve the problem of not having enough disk space, but at least it will leave your VM working.) Starting up the VM when one or more snapshot files are on a “remote” partition may take a little longer than usual; don’t worry, that’s expected.

Takeaway: Don’t use VBox snapshots, unless you know what you’re doing (which I obviously didn’t). From now, what I do is to simply copy the VDI file from time to time, which gives me a backup in case the VDI file gets borked for some reason.

Good luck!

2015/01/08 at 09:01

Happy New Year, and happy new Free Software Foundation video

Happy New Year, Frohes Neues Jahr!

The FSF (Free Software Foundation) released a video called User Liberation just before 2014 was over, but I’ve only just had a look. It’s sweet and short, have a look!

http://static.fsf.org/nosvn/FSF30-video/FSF_30_720p.webm

2015/01/03 at 16:09

Minecraft-Server bei Nitrado

nitrado-webinterfaceAuf meinen letzten Artikel über Probleme mit dem Gameserver-Provider sprang gleich jemand von Nitrado an, freundlicher Weise mit einem Gutschein-Code für einen kostenlosen Testserver für 30 Tage (4 Slots, 1024 MB RAM, was die Minimalkonfiguration darstellt).

Anmeldung und Aufladen des Prepaid-Kontos gingen schnell (das “Aufladen” bestand im Eintragen des Gutschein-Codes). Aber auch beim anderen Provider ging dieser Schritt schnell, also war ich verständlicherweise skeptisch.

Dann also gleich mal einen Gameserver anlegen. Grundkonfiguration in allen Punkten bestätigt, dann warten … “Server wird installiert”. Nach 6 bis 7 Minuten war die Installation fertig, und wir legten gleich mal eine Subdomain an (gamemc.minecraft.to, wenn jemand meine Jungs besuchen möchte :-)). Der Vanilla-Server wurde natürlich umgehend ausprobiert — die Jungs sind mit der Performance vollauf zufrieden.

Als nächstes rein ins Webinterface, wo man den Server verwalten kann (Ausschnitt siehe Bildschirmfoto). Sieht wirklich gut aus. Von Vanilla-Server auf Bukkit-Server umstellen ging schnell und schmerzlos. Es gibt ein Upload-Tool, mit dem man seinen eigenen world-Ordner, seine Mods usw. hochladen kann, so dass man für kleinere Aufgaben dieser Art nicht mal FTP benötigt.

Den FTP-Zugang habe ich wegen der schlechten Erfahrungen beim vorherigen Provider natürlich trotzdem sofort ausprobiert. Er ist richtig schnell. Also alles gut.

Meine Jungs hat es gefreut zu sehen, dass einer der bekannteren deutschen Minecraft-Helden, Gronkh, seine Server ebenfalls bei Nitrado hostet.

2014/12/05 at 20:08

Minecraft-Server bei Host Unlimited

Meine Erfahrung mit Host Unlimited in aller Kürze. Für meine Kinder habe ich einen Account bei diesem Gameserver-Vermieter angelegt. Ein Minecraft-Server kostet 5,70 € im Monat, also mal 12 € per Paypal an Host Unlimited schicken, dann gleich den Server anlegen.

Hm, klappt nicht. Also Support-Ticket eröffnet. Am nächsten Tag keine Rückmeldung. Na dann rufen wir doch mal an. Nach mehrfachen Versuchen hatte ich dann jemanden an der Strippe, der mich  minutenlang zuhören ließ, wie er sich bemühte, den Server zum Laufen zu kriegen. Letztlich löschte er ihn und legte einen neuen an. Und der lief dann sogar! :-) Der FTP-Zugang funktionierte ebenfalls, aber nicht für lange.

Plötzlich war Ende, “falsche Benutzerdaten”. Also wieder Support-Ticket eröffnet. Dann erst mal nichts, nach zwei Tagen die Antwort: “Ich weiß auch nicht, warum die FTP-Zugänge manchmal nicht mehr gehen, legen Sie einfach einen neuen an.” Das geht in der Benutzeroberfläche sehr einfach.

Nur dass der neu angelegte Zugang ebenfalls nicht funktioniert. Das habe ich ins Support-Ticket geschrieben. Radio Silence. Nach zwei Tagen noch mal nachgefragt. Nichts. Am Telefon erreiche ich auch niemanden mehr. Hier ist der Stand von heute, also nach 7 Tagen ohne FTP-Zugang:

host-unlimited-support-ticket

Mit anderen Worten, ein schlechter Witz.

2014/12/01 at 18:07 2 Kommentare

Changing PDF Titles With pdftk

Have you ever noticed that many PDF converters, or scanning programs, create PDF titles that are anything but meaningful? I’m using XSane for scanning, and all the PDF files get this title:

XSane scanned image

That’s totally meaningless. Others create PDF from Microsoft Word, and many of those PDF files have Microsoft Word in the title — in most cases, the title even begins with Microsoft Word, which makes it hard to identify the document you’re looking for in the window bar when you have several of them open.

With pdftk (PDF Toolkit), you can fix this easily. I’ve used it only on Linux, but apparently it’s available for other major platforms, too. Be warned that this is a command-line program.

So here’s what I do to change a PDF title.

Here’s a typical “Microsoft Word” PDF file:

Atlas~/private/stefan> l neugier_handout.pdf
 -rw-r--r-- 1 stefan users 531831 25. Okt 2012  neugier_handout.pdf

1. First step is to dump the PDF metadata to a file which I call report.txt:

Atlas~/private/stefan> pdftk neugier_handout.pdf dump_data output report.txt

Here’s what’s in the PDF metadata:

 Atlas~/private/stefan> cat report.txt
 InfoBegin
 InfoKey: ModDate
 InfoValue: D:20081229161229+01'00'
 InfoBegin
 InfoKey: CreationDate
 InfoValue: D:20081229161229+01'00'
 InfoBegin
 InfoKey: Author
 InfoValue: Charakterstärke
 InfoBegin
 InfoKey: Title
 InfoValue: Microsoft Word - Neugier_Handout.doc
 InfoBegin
 InfoKey: Creator
 InfoValue: Word
 InfoBegin
 InfoKey: Producer
 InfoValue: Mac OS X 10.4.11 Quartz PDFContext
 PdfID0: 911d0c6f06613f3690fa270fad39d33b
 PdfID1: 911d0c6f06613f3690fa270fad39d33b
 NumberOfPages: 4

2. Second step is to edit the metadata file:

 Atlas~/private/stefan> vi report.txt

Here’s what I’ve changed. Note that I’ve used ASCII-7, because pdftk doesn’t seem to be able to properly handle UFT-8 and friends:

Atlas~/private/stefan> grep Neugier report.txt
 InfoValue: Neugier - Staerkentraining

3. Third step is to update the metadata in the PDF file. Note that the output must be written to another file — pdftk refuses to overwrite the original file:

 Atlas~/private/stefan> pdftk neugier_handout.pdf update_info report.txt output neugier_handout.pdf.copy

4. Last step is to make the copied PDF file the original PDF file:

 Atlas~/private/stefan> mv neugier_handout.pdf.copy neugier_handout.pdf

And done. Verify that the title meets your expectations in the PDF viewer of your choice:

 Atlas~/private/stefan> okular neugier_handout.pdf

The steps are easily scriptable if you’re so inclined.

2014/11/26 at 11:00

Firefox Tab Sync Issues

Firefox again. Whenever I have time to waste, I try to configure its features to make working with a browser more productive. Incrementally, I’m getting there — by the year 2100 I should have reached optimum productivity. :-)

When I recently installed openSuse 13.2 on my laptop (fresh installation, except that the /home directory was preserved), and then opened Firefox (33.0) for the first time, it synchronized the tabs from my work computer (a desktop computer). All those tabs were pinned tabs, since I rarely have regular tabs open in the browser. (When I do, it’s mostly for searches, or for ebay which cannot handle pinned tabs well.) Anyway, looks I’ve been lucky with that pristine Firefox from the fresh installation. Normally, there seems to be no way of keeping tabs in sync across devices. Meh.

At least there’s a semi-automatic way of syncing tabs, but it’s well hidden in Firefox. From googling, I found that there must have been an option in the History sidebar (CTRL+H) at some point (2012 or so), labeled something like “tabs from other devices”. That would be nice to have, but apparently they removed it in newer Firefox versions. These days, what you do is open a new tab, then type about:sync-tabs in the address bar. Quite intuitive, I would say. :-)

firefox-sync-tabs

The prerequisite of seeing something here is that you’ve enabled Firefox Sync on your various devices. If that’s the case, Firefox will list the tabs from your other computers, tablets, or smartphones, grouped by device. Note that it will list only the tabs that aren’t already open on your current device. Also note that Firefox has its own ideas about what “open” is — any pinned tabs on your current machine are disregarded. In other words, if a page is open in a pinned tab, Firefox will still show it in the tabs from other devices list. However, Firefox will show pinned tabs from your other devices, which is kind of inconsistent, but helpful nevertheless.

Now you can double-click on the gray boxes, and they’ll be opened in a new tab. At the same time, they’ll disappear from the list.

Right-clicking on the sync-tabs page lets you refresh the open tabs list. If you mark a gray box with a left-click, then right-click on it, you get an additional option, which is to add it as a bookmark.

So, very limited functionality, and limited use.

I tried grouping tabs, too, but that’s a feature I’d consider not working properly, or at least it has a flawed design. It doesn’t work at all with pinned tabs (they appear in every tab group, no matter what you do), so you’re forced to use regular tabs. Also, tab groups are supposed to close tabs from other groups when you open them, but they don’t behave that way in my browsers (on Linux). And if I dare to manually close those other tabs that were opened from another tab group, guess what happens? The tab group is empty then. Oh boy. That’s usability spelled backwards.

Comments are welcome, but please don’t advice to switch to Chrome. While I do use Chrome when working with add-ons in Google Docs (because add-ons only work in Chrome), I have a pretty good idea how this world would look like if everyone consolidated on Chrome. I bite my tongue not to end this article with a little rant, so let me just say that I deem a properly working Firefox an important thing to have these days. Thanks for reading, and agreeing. :-)

2014/11/21 at 13:26

MediaWiki toolbar missing after DSM update

Meh. Synology updated quite a few built-in components when updating the DSM (basically the “operating system” of the Synology NAS boxes) from DSM 5.0 to DSM 5.1. Look at my previous articles to see what stuff broke, and how I fixed it, or at least how I found a suitable workaround for broken functionality. Let me make it clear that I’m not blaming Synology for the issues I’ve been facing; but having to fix stuff in the aftermath is a nuisance, anyway.

Okay, so here’s the most recent issue I found, and how I fixed it. When editing a page in the MediaWiki on one of my NAS boxes (“zeus”), I found the toolbar was missing. Not a deal-breaker, but an inconvenience.synology-mediawiki-toolbar

In one of the articles I found by googling for “mediawiki toolbar missing” someone suggested to turn on the Firefox web console (formerly: JavaScript console, if I remember correctly), and see if there were any JavaScript errors when editing a page. So I turned it on (CTRL+Shift+K), and indeed, an error showed up (marked in the screenshot below):

synology-mediawiki-debug-GetVersion

Googling for that error message, I found a short article pointing out that the “mw.loader.version” function had been removed in a recent MediaWiki update. Thanks very much for that! :-) Fortunately, the article also had a link to the respective bug, and to the fix, which is here:

https://gerrit.wikimedia.org/r/#/c/114094/1/modules/jquery.wikiEditor.js,unified

Here’s how I applied the fix:

  1. Get on the command line, as root.
  2. In the directory where the MediaWiki is installed (/volume1/web/MediaWiki by default), either grep for “mw.loader.version”, or simply believe me that the file you need to edit is under extensions/WikiEditor/modules. So change directory there.
  3. Make a copy of the file (cp jquery.wikiEditor.js jquery.wikiEditor.js.ORIG).
  4. Edit jquery.wikiEditor.js — I’m using vi for this.
  5. Locate the line that contains the wrong function (in vi, press / and type mw.loader.version, then press Return).
  6. Change mw.loader.version to mw.loader.getVersion.
  7. Save the file, and quit the editor (in vi, this is :wq).
root@zeus:/volume1/web/MediaWiki/extensions/WikiEditor/modules> ls -l jquery.wikiEditor.js*
-rw-r--r--    1 http     http         21440 Nov 19 09:04 jquery.wikiEditor.js
-rw-r--r--    1 root     root         21437 Nov 19 08:40 jquery.wikiEditor.js.ORIG

When done, edit a Wiki page in Firefox. You might have to forcibly reload the page in Edit mode, because Firefox loves to load pages from cache. Now, the JavaScript error should be gone, and the toolbar should be back.

2014/11/19 at 09:21

Ältere Beiträge


September 2015
M D M D F S S
« Jan    
 123456
78910111213
14151617181920
21222324252627
282930  

Aktuelle Beiträge

Enter your email address to follow this blog and receive notifications of new posts by email.

Schließe dich 295 Followern an

Face


Folgen

Erhalte jeden neuen Beitrag in deinen Posteingang.

Schließe dich 295 Followern an