Menu

VirtualBox - Shrink VDI

Had I known that a product from Oracle would be so inefficient, I would probably have not used it (what tempted me to use the product was really the graphical user interface).

With that being said, these VDIs seem to grow incredibly large even though the data inside of it can be only 25% of what is reported on the host node. We need to try to shrink it so the host node keeps some space.

Two things must be done and most people who have posted about this aren't intelligent. They suggest that you unmounth the drive before zerofilling it - this is a terrible suggestion if you do this to an OS partition! So here's what you can do. Boot your VM up and then zerofill it (but alter this command to suit your needs). What I did was df -h and looked at how much remaining space was in the partition, I then subtracted 10G to ensure zerofill would not take up all the space.

dd if=/dev/zero of=zerofillfile bs=1G count=10

Change the above count=10 to whatever is the remaining size of the partition and make sure to run this on the correct partition. This will create a zerofillfile and it takes a while to do.

Once completed, delete this file and then shutdown the VM.

Next, go to your host machine that is running Oracle VirtualBox, then go to the directory that contains the VDI file and then run the following. Note, this can take hours (in my case since I had a 270GB vdi file). YOU MUST SHUTDOWN THE VM BEFORE DOING THIS! SO BASICALLY DOWNTIME (THIS IS WHY I HATE VIRTUALBOX)!

vboxmanage modifymedium --compact file.vdi

Replace the file.vdi above with the correct vdi file name.

Once this has completed, check to see if your VDI has shrinked and you can restart the VM.

Enjoy!

Wow, WordPress mobile admin is actually admin friendly!

So I stopped writing blog posts on Drupal because I (as have most other people) browse the internet via our phones more now than we used to before. So writing a post via Drupal interface while on mobile was just not fun. Lately though, I javelin converted back to WordPress and I just realized how mobile friendly the admin interface is to write again - this is simple and easy to do. I plan to post more here now and less on Facebook - that platform is becoming the next Twitter or maybe it's just that 90% of the people on my friends list are just non caring human beings.

Windows 11 - I love it!

So I waited a bit before testing it out. Finally got my Ryzen 5600G in and NVMe drive and decided to fearfully give it a go as my main OS and boy was I pleasantly surprised. The things that stand out to me are the new windows organizational management features and it's like they literally thought about everything because with the 3 screens I've set up in a triangular format, the mouse is now smart enough to jump to a screen that doesn't fit all the edges. Absolutely amazing! I should have done this a little early!

Some clown decided to name it a daemon (demon)

So I always wondered how to pronoun daemon (a background process in linux). Low and behold I googled the term to realize that some guy who clearly didn't have enough entertainment in his life thought it was nice to name this after the word demon. Like seriously - what a way to force people to use that term.

This is the except I read from Wikipedia: https://en.wikipedia.org/wiki/Daemon_(computing)

I failed today...

Tonight, after a failure I had migrating a database, I was reminded of an incident that occurred in one of my past jobs. I had recently awarded a new job with about 33% more pay. It was really nice to be able to receive a better salary and I hoped that the work environment would have been better.

Anyways, so one day I come to work and you know people talk. Some of it true, some of it not so true. Anyways I thought I was okay with the administrative staff at the time and one of them decided to share that someone high up in management mentioned that they weren't sure if I knew what I was doing.

It really got me but I think I understood why. I had received higher level jobs at a young age and you must understand that when you're not aged, it's really difficult to get older people to respect you as an experienced person - they can respect you for being a good person but not necessarily experienced.

The thing about IT is that people think that everything is understood. I suppose now that I think about it, I always think that medical science knows everything related to health - but if we think about it - I guess that isn't really true right? Same goes with the most experienced IT personnel out there.

You'll find a lot of professionals that stick to best practices but I realize that best practices is supposed to be for doing something properly yet it also gives the impression to the person hiring you that you know what you are doing. But sometimes, there's no best practice for venturing into a new territory. So you just have to try and hope for success or you try and fail and try and fail unto you find where the failure is coming from - then you get wisdom and then you can make a best practice based on success or experience.

Today was a day like that. Working with a 2TB database is far different from a small wordpress website like this one. In fact, the database today was 2.1 TB database and the VM disk was exactly 2.0 TB. There's a whole 100 G of data that just couldn't fit. This sounds like a foolish thing but I was so focused on trying to get that db unto the test server, I made the assumption that postgres was reporting the correct size - it probably was EXCEPT there were a few additional databases in there that I didn't cater for. So during the copy of the actual database files - it ended up being 2.1 TB.

It absolutely sucks to miss something so small yet important. It absolutely sucks when you're afraid of losing the confidence of your boss and colleagues when you make a mistake. And I know it's not the end of the world in this case, but I serious hate failing at things.