Houston we have a failure!

No Comments

I was working on my trusty and crusty (15 year old!) desktop Pyg which just got a recent Manjaro reinstall, when suddenly the LVM partitions disappeared. The only clue I had is that the 3 directories that I use to access the logical volumes started throwing Input/Output error. I rebooted and it went straight to the recovery console (which is not a good place to be). I tried manually mounting the LVM partitions and it gave this error:

This was a bit of a shock and no reboot or safe mode can restore the directories. I put it off for the night and took it up again today. I was thinking maybe it was a recent Manjaro system in-place upgrade so I tried booting to the latest Ubuntu livecd (using Ventoy, which is very good for creating a multi-system bootable drive) hoping it will show up my lost LVM partitions.

I booted up to the Ubuntu live desktop and I didnt see any LVM mapper entries either. I see the same 800++GB unallocated space at the tail end of the SSD. I launched a filesystem check which didn’t reveal anything and started searching on how to manually input the the LVM sectors in the GPT metadata.

I searched my Google keep for Pyg’s partition layout and then it hit me that all I am seeing is the SSD. There is a WD Blue mechanical drive in this machine before I upgraded to SSD and I used that for storage for files before they are backed up to either DVD or BlueRay. I checked the BIOS of the desktop and it confimred that the HDD is not showing up. Opening up Pyg seems to be my next weekend project.

Curiously enough, I am not feeling as much worry on losing the files as I remember the first time that my WD Green drive malfunctioned. Maybe those files in the LVM partitions (warehouse [files], limbo [multimedia] and arena [game files[) are really not worth that much in the grand scheme of things. If I can still recover them then thats fine but if not then…

We welcome our new overlords

No Comments

I heard in a Technology training that “It is hard to comprehend that there will come a time that Artificial Intelligence (AI) will get smarter than us humans but it may still be about 50 more years.”

I find that preposterous. AI by definition isnt going to be smarter than human intelligence. It doesnt need to be. Humans on the other hand will just grow dumber. Technology helps.

Ubuntu 15.04 hanging boot-up issue

No Comments

Last weekend I reinstalled my Linux system (and not because I want to rename it as Pyg!) which is a very bad decision as it is the same time that my pitiful internet connection fails to transmit any data beyond a few bytes. The new install to Ubuntu 15.04 (Vivid Verve) gave me the confidence to start using btrfs which is being touted as the next generation file system for linux systems. Bad move and very short-sighted on my part. 🙁

The btrfs is supposed to provide enhancements to ext4 file system since it (btrfs) is built from the ground up but with the useful features already present in ext4. The ext4 filesystem is basically being viewed as an aging hack on a hack since it builds on ext3 which is a tack-on improvement for ext2. Btrfs might be delivering on some of its promised features but those who use it should still be wary of it as it is still not considered as ready for “production” or real-world use[1]. I wish I knew this before I chose it as the filesystem for my home directory. 🙁

For those that will have the misfortune of encountering it, the gist of my predicament follows (which is based on how I remember it):

  • I upgraded my system using dist-upgrade.
  • I encountered a severe freeze which left me with no choice but to reach for the power button.
  • System bootup hangs. The last entry goes something like this:
  • A start job is running for /home… (10s /no limit)

  • Eventually the bootup hangs and it drops the control to an emergency shell.

It was unnerving for me since a reinstall means I would need to re-download the upgrade packages on my #@$@#$ Smart LTE connection. The light-bulb moment for me was that /home is the only partition in the sequence that is using btrfs. The working theory is something borked during the forced shutdown which should have been handled by the journalling features. Thanks to an alternate albeit slow alternative connection, I was able to google enough to do the following:

  • Boot the machine and press F12 after the BIOS/UEFI prompt.
  • Selected the menu option for Ubuntu Advance options.
  • Selected the option for “(recovery)”
  • Selected the “drop to root shell” option.
  • Remounted the root system in r/w mode. I dont think this is needed but this is what I have done and it won’t hurt anyhow.
  • # mount -o remount,rw /

  • Did a btrfs file system check on the home partition
  • # btrfsck /dev/sda4

  • When nothing popped out, I went for the repair option.
  • # btrfsck --repair /dev/sda4

The repair option is always accompanied by a cautionary warning as it can delete information so having a proper backup is recommended. In my situation that is like adding salt to the injury. When I ran the repair option it reported that the cache and super generation areas do not match and that it cleared the space cache. After doing so I ran another btrfsck on the partition and rebooted the system which thankfully landed me on a working system with no (identified) data loss.

The moral of the story is to select btrfs only for the filesystems that you can afford to lose data; or have a good backup scheme. Using it for /tmp is going to be an overkill but to each to his own. Now Im thinking if I want to convert my home partition back to ext4. 😀

ciao!

[1] https://www.wikivs.com/wiki/Btrfs_vs_ext4

MongoDB find vs findOne

No Comments

I got hit by this newbie bug. The exercise entails getting a specific record from the database, storing it in a variable, updating it a few times and saving it in the database after each update. Sounds simple, until I am perplexed that I cannot view the variable more than once. The second invocation is just showing or returning an empty string.


> var myobject = db.products.find({_id : ObjectId("507d95d5719dbef170f15c00")})
> myobject
{ "_id" : ObjectId("507d95d5719dbef170f15c00"), "name" : "Phone Service Family Plan", "type" : "service", "monthly_price" : 90, "limits" : { "voice" : { "units" : "minutes", "n" : 1200, "over_rate" : 0.05 }, "data" : { "n" : "unlimited", "over_rate" : 0 }, "sms" : { "n" : "unlimited", "over_rate" : 0 } }, "sales_tax" : true, "term_years" : 2 }
> myobject
>
> //why cant i display the object contents again?
>

It turned out that I should have used db.products.findOne instead. The findOne function returns an actual document record while the find function returns a cursor. Yes, the cursor moved the pointer on the next record after each read request which means that subsequent read calls to it are getting nothing since the cursor was already pointing to the “end of cursor” location after the first read, if I correlate that correctly with how cursors in relational databases work.

Great to know. I want my 15 minutes back. 🙂

ciao!

Running codeskulptor locally in Ubuntu

1 Comment

For the impatient, jump to the end of this post for the summary of the commands to be invoked. 😉

I have signed up again for a Coursera course for Interactive Python programming to improve my Python programming skills. I am going to sidestep the question if I am going to finish this course for the moment. 😉

The course professors have developed and are using CodeSkulptor to make it easier to create, submit, and grade the course. CodeSkulptor is basically a browser-based Python interpreter that implements a subset of Python 2.x. It absolves the students enrolled in the course from the requirement to install Python in their local machines plus it also allows them to continue working on their code while on different machines (provided they know their work’s randomly generated URL).

The abstraction provided by CodeSkulptor however renders some incompatibilities in running the code locally. This could be a disadvantage for people who wants to work offline, either by choice or by location. Coursera member Jimmy Delgado has provided good quick tutorial on how to run CodeSkulptor code locally. The post is in the Coursera forums but I am replicating it here and then augment it with the steps I have added to make it run on my Ubuntu 14.04 installation.

More

Smartbro Wimax sucks a little less tonight

No Comments

Instead of having no internet connection I have a very slow internet. How slow?

— cs62.adn.edgecastcdn.net ping statistics —
53 packets transmitted, 29 received, 45% packet loss, time 52000ms
rtt min/avg/max/mdev = 4908.713/18702.236/32208.306/7853.188 ms, pipe 33

Yes, that is 5-32 seconds latency! If the site is not familiar to you that is what is being resolved by “pldt.speedtest.net”. That abysmal speed is leagues better than having no internet connection, right? It is as savory as like having a view of the beach from the safety of your prison cell.

First RPi mishap

2 Comments

Yesterday pixie, my RPi serving as the torrent/dlna box, stopped responding. Rebooting it doesnt help as it eventually reverts to only having the red LED on which I have started to interpret as the system is not yet booted.

I pulled pixie out of its nook and hooked it to my monitor before rebooting it. It showed that the boot process is encountering errors when reading from the SD card. The process stopped while asking for the root password to start the file check maintenance, or Ctrl-D to continue the boot process. I plugged a keyboard and here lies the conundrum: this is a debian system and I have been administering it as the pi user. I have been relying on the sudo mechanism and never replaced the root password so I cant provide it. That realization blows.

No other recourse now but to pull out the SD card and have the partition checked on my desktop. A “sudo fsck /dev/sdb2 -y” command (because sdb2 is the partition assigned to it by udev) and ten minutes of automated fixing later pixie is back online serving its DLNA goodness.

rpi-fsck-in-progress

Now I made sure I have changed the root password so this can be fixed without booting the desktop. Come to think of it, I am doing it also on my Ubuntu desktop. 😉

ciao!

Raspberry Media Server is now online

2 Comments

Hectic schedule but I finally finished having my own TorrentBox/DLNA/UPnP server out of the Raspberry Pis. One concern that got answered is if the system is usable as a media streaming server as there has been reports of slow throughput since the Pi’s ethernet (network) and USB system share the same memory space. Early on the file I/O throughput on the SD card I am using as the BIOS and operating system is a little bit slow, and as a techie friend (named Gideon[1]) pointed out its the class of the card itself that is the bottleneck.

The instructions are all over the net so Ill just reference the articles I used and add the other stuff I did to make it work on Pixie (the name of this Pi).
More

Apparently a headache

No Comments

Thats the difference between 21 and 32 inches at 2 feet away. 🙂

Sounds great in theory but sucks a bit in actual use. 😐

ciao!

The RPis have landed

4 Comments

I had some difficulty in locally procuring Raspberry Pis because even if there is a local RS branch, they initially sold a single batch for almost twice the price. When we last checked they are no longer selling them unless we are ordering by the hundreds to make it their while to import it. They said we could order directly from the UK office. Bummer.

Then I heard that Filepp, a colleague from a previous project, is on a short-term assignment in UK. So we grabbed the chance to ask a favor to procure a couple of RPis for us and now they have landed and the cases were given as gifts. (Note: Thank you Filepp. I’ll try not to torture you too much if I get to work with you again. Crap, we know I cant keep that promise 😉 ).
More

Older Entries