Skip to content. | Skip to navigation

Personal tools
Log in
You are here: Home - Blog

SSD booting slower than rotary HD? You might have a ghost disk reference

Posted by admin |

I changed to an SSD, re-installed Ubuntu 16.04LTS and my boot times slowed to a crawl. Turned out the installation script had put in an imaginary swap drive in  my /etc/fstab. Systemd then waited for it, for a minute or so while booting. In the logs (which you reach with journalctl on systemd) it looked something like this:

sep 15 23:25:33 hostname NetworkManager[2733]: <info>  [1473974733.3738] WWAN hardware radio set enabled
sep 15 23:26:09 hostname systemd[1]: Starting Stop ureadahead data collection...

Or like this:

sep 16 00:54:40 hostname kernel: nouveau 0000:01:00.0: DRM: suspending kernel object tree...
sep 16 00:56:03 hostname systemd[1]: dev-disk-by\x2duuid-7553704f\x2d1ffd\x2d490b\x2db12b\x2d5174b3464643.device: Job dev-disk-by\x2duuid-7553704f\x2d1ffd\x2d490b\x2db12b
sep 16 00:56:03 hostname systemd[1]: Timed out waiting for device dev-disk-by\x2duuid-7553704f\x2d1ffd\x2d490b\x2db12b\x2d5174b3464643.device.

In the second one I could use gparted to find out what disk ids were and weren't present on my system. The comments in fstab indicated the wrong one, that is the existing swap was preceded by the comment:

# swap was on /dev/sdb2 during installation

While that one is on /dev/sda5 actually, and the non-existing one was marked up with:

# swap was on /dev/sda5 during installation


Sep 16, 2016 09:25

I built some password boosters with Arduino

Posted by admin |

One Arduino micro clone from Kjell & Company and one Pololu  A-Star 32U4 Micro  (the small one) from Lawicel.

Sep 15, 2016 11:25

Making a USB compatible casing for a teensy or Arduino micro

Posted by admin |

Trying to figure out how to make a casing for these small USB-enabled boards. One way would be to encase it in some clear resin, such as in epoxy or polyurethane or silicone. Another is to use heat shrink tubing. Here is what I have learned so far:

Heat shrink tubing works fine. The little fellow below is wrapped in three layers of it, first a red tube fitted from the back, then two strands of black tubing fitted from the sides, and finally black tubing fitted from the back again.

I've read that:

  • Silicone may emit acids as it is curing. This may not be good for electronics
  • Epoxies may change volume as it is curing and put permanent massive stress on components

I'll post more as I figure things out.

Sep 14, 2016 02:05

Using a different sleep (suspend) and hibernate on Ubuntu 16.04

Posted by admin |

Suddenly suspend and hibernate stopped working on,  my laptop which has a self encrypted SSD disk. Probably it isdue to some graphics cards shenaningans and not the SSD, but here goes:


sudo apt-get install uswsusp

For sleep, issue:

sudo s2ram -f -a 1

For hibernate issue:

sudo s2disk

Haven't manged to get it working with the Gnome power manager, so I use separate icons for the above commands.

linux - LinuxMint15: Suspend to RAM not working - Unix & Linux Stack Exchange

Uswsusp - ArchWiki

Ubuntu Manpage: uswsusp.conf - Config file for the s2disk program



Sep 14, 2016 01:55

How to switch between Intel & Nvidia graphics cards on Ubuntu

Posted by admin |

Warning: This borked my machine, I had to boot into recovery mode, drop into a root shell and issue:

mount -o remount, rw / order to remount the file system in read-write mode.

Then I did

apt-get purge nvidia*

Anyways, here how i borked up:

This is the important invocation:


Read more: Link - How To Switch Between Intel and Nvidia Graphics Card on Ubuntu

Sep 13, 2016 12:20

How to encrypt your Linux machine & session, with a self encrypting disk

Posted by admin |

This is tested by me and I am typing this from a machine that now has a password-encrypted SSD where also the swap area holding the hibernated state of the machine, is encrypted automatically.

Update: Do note that setting a disk password in BIOS may be enough for some drives. That method is a lot easier than what is described below, however you may not know exactly what the BIOS did which may affect both recoverability and security.

Update II: I had to switch to a different suspend and hibernate manager eventually. Read more at the bottom of this post.

There is a standard for hardware encryption for hard disks, called Opal (Wikipedia). The Samsung EVO 850 SSD, and I guess most other current SSDs supports the standard. These drives actually usually are encrypted by default, it's just that the area where the encryption key is stored is by default usable without decrypting it. What we are doing below is protecting access to the key with a password.

There is a project: Drive-Trust-Alliance/sedutil: DTA sedutil Self encrypting drive software that allows you to install a loader on Ubuntu Linux (and Windows, and other Linuxes) that prompts for a password to unlock the Opal encrypted hard disk, and then chain-loads your operating system. It is available both for UEFI and Bios booting. However for UEFI, secure boot must be turned off for it to work.

The password prompt will also happen after hibernate which from the computer's perspective is an upstart. In this way you can have your computer fully encrypted but still have the state of your desktop session immediately come up on waking from hibernate. Do note that you cannot prepare your drive with sedutil if it runs on USB.


Enable hibernate

First, you need to get hibernate working on your machine. For Ubuntu this guide worked for me: How do I hibernate my computer?

If the pm-hibernate command does not work, try restarting the machine and then retry, it may have been that you were in the middle of a kernel update. My machine was.

Enable sedutil to work by enabling allow_tpm

you need to enable TPM:


...must be added to your Grub's parameters

in /etc/default/grub that means that there should be a line that says something like this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash libata.allow_tpm=1"

Then update grub and reboot.

Get an Opal hard disk, or check that your current one supports Opal, and encrypt

Secondly, you need a hard disk that supports Opal. The command line program in sedutil will tell you. Follow the instructions on this page: Encrypting your drive · Drive-Trust-Alliance/sedutil Wiki

 I had problems copying and pasting the commands from there, it is better to re-type them. You have to do sudo or be root.

How good is the encryption in practice?

I don't know. I guess the algorithms (I believe in  the evo 850 case 256 bit AES) are good, but I do not know how many attempts to break the password you can do per second, for example, for brute-forcing the password that protects the key. It may also be that the encryption hardware is backdoored, and then it would be the question if the thief knows about those backdoors.

Further reading

ArchWiki has a good page on self-encrypting hard drives. In fact Archwiki has a lot of good information on Linux, even if you do not run the Arch Linux distribution specifically.

Self-Encrypting Drives - ArchWiki

See also:

According to the last link above, a simple BIOS password should also work with the Samsung SSD drives, in which case you do need to do the sedutil dance, just set a password in BIOS. However some people on the web express fears that different BIOSes do this differently. But if you do not need recoverbility to another machine (that is, the disk floats and sinks with your machine), then BIOS password seems like a lot easier.

Disclaimer: It is quite easy to mess things up by mistake, so be careful to have everything backed up. In triplicate.

Switching suspend and hibernate programs

Not sure if this is related to turning on encryption, or more likely to some chaneg in graphics drivers, but here is how I got sleep (suspend) and hibernate working again: Using a different sleep (suspend) and hibernate on Ubuntu 16.04

Sep 05, 2016 09:40

The Dough - a short Sci-Fi story from the near future

Posted by admin |

A short story highlighting what our future may look like: "The dough". Written by Jorgen Modin July 25-26, 2016.

This piece also published at

Jeff was OK. He was a loner but he had been to the weekly cook-outs and he invited the elders to his place once a month and during those meetings he opened up and showed who he really was. So nobody was worried anymore about his weird sleeping habits, and all the weird technical gear he ordered.

Other loners had not been as forthcoming, but they were not part any more of the borough. The risk of single individuals fomenting bitterness and hate and then taking it out in terrorist attacks had just become too big. The Internet empowered people in all directions, and an unfortunate few were using this empowerment to learn destructive behavior and to be coached by hate groups that worked almost on a consultancy basis to bring the worst out of people in an as most efficient way as possible.

"It's a pity that they're going after us introverts", Mary said. "Well, the extroverts are so much easier to disrupt, they chat too much", John interrupted while polishing his boots. "Any terrorist group with more than three members, you can count on one being a mole".

"Yes, but we're the good people" Mary continued. "And that mole is usually an introvert, the good one" John pointed out while pushing the boots under the stool they kept in the entrance in the cramped apartment, which was right under Jeff's.

Mary crossed her arms in front of her body and turned away from John. It was unconscious, but the feeling she had, that John had once again just missed the point and turned the conversation around, was most certainly consciously felt by her.

John furrowed his eyebrows. He had never understood Mary's idealization of people that she thought were like her in some respect.

"When will Sue come" asked Mary in a flat tone revealing that she thought she was putting the conversation back on track. John looked down and avoided replying.

950 meters away Sue was walking along the waterfront. To the left of her was the barrier that makes sure kids do not fall into the water. She remembered the advice that life vests for children aren't just for use while on boats, rafts and other watercraft, but should be carried by the little ones any time they are close to water while still being on firm land.

The sensors and small drones that were placed every 4 meters on one meter high stands to her right suddenly made a whizz, which scared the beejezus out of Sue. She had seen what they can do, mobbing and killing an unfortunate duck that got stuck as it tried to mate with a Russian intruder drone, the second last one of 6'000 intruder drones that the mini-drone defense annihilated during a flash attack two years ago. The Russian drone had been the obvious target and not the duck, it was just collateral damage. The drones would not have collaterally killed a human in the same situation, the prime directive prevented them from that but the directive did not extend to ducks.

However Sue instinctively felt like a sitting duck as the defense drones now powered up. She knew it happened a lot and was almost always just a brief whir that didn't lead to any of the drones actually taking off, and her friends did not understand why that start-up sound scared her so much.

Sue had had trouble getting on a flight to Bostham with the stuff she had brought. Jeff whom she knew from a previous job had vowed for her and that put her above 0.6954, which is the current threshold for trustworthy people that the airline accepts carrying funky goods they do not understand what it is. She had a few data points, or shall we say unfortunate events, on her permanent record on the blockchain that had risen suspicion with the AI screeners. Now the AI screeners were a bunch of power trippers, prejudiced by big data which had led to weird correlations, such as birth weight starting with an odd number combined with certain credit scores raising flags of suspicion. It was bullshit, Sue thought.

She was happy it was an intra continental flight, a flight connecting to points on the same continent. The intercontinental flights were limited to 25'000 per continent and year, and also had long screening and quarantine periods for each traveler. After the Zikburg virus almost wiped out one continent (or so the models said it would had it not been contained), virtual presence was how you saw other continents, although the sensor/actuator lag sucked big time.

"You're sitting in a chair. In the sky!" Sue exclaimed to herself, skipping and hopping a few steps while citing one of the elders. She had brought something special for Jeff, something he couldn't procure himself.

"That drone you saw wasn't Russian" Jeff said, while trying to pull a greenish gray mass out of Sue's backpack. "It was", Sue retorted. "No it wasn't" countered Jeff, "I heard it was Turkish". "Have you checked your trust network?" Sue asked. "No, is that necessary really?" Jeff asked back.

They were in Mary's and John's apartment, still stuck in the hall, sat on wooden stools. Mary and John had gone into the kitchen to get some aeroponically grown food they were very proud of but they took their time coming back, still arguing over what exactly to bring back to the guests. "Oh gosh", Jeff said, "Yeah my trust network ranks the out-of-Russia theory as 0.98! It even has signed primary sources backing it up and just three degrees from me! Always check the blockchain, as they say" he said while smiling coyly at Sue. Sue did not know if that was a flirt or just a spark of life in his eyes from the intellectual stimulation. She remembered she had had the same problem reading him at the workplace they had shared.

"Jeff, do you want some lima beans?" Mary asked. She still felt uneasy with him but since he had helped getting Sue into Bostham sector VI, where Mary John and Jeff lived, she felt she had no choice but to invite him. John had thought it not necessary but he was an idiot in this respect, Mary thought. "Just, Lima beans?" Jeff asked.

"No of course not, you can get beer, wine, vodka!" Mary said triumphantly, although she felt very defensive. Jeff and Mary now stared at each other, jaws dropped, trying to figure out if the other person was truly, truly weird. The staring stopped first when John threw himself across their mutual line of sight, flailing his arms around as if to erase a giant whiteboard of disbelief and confusion, saying "Jeff! Craft beer! Sausage! Pinball!". "Alright!" said Jeff approvingly and high fived John as they walked into the living room. Mary stayed in the hall thinking it was more of a high-tail than a high five. She then turned to Sue who was still perched on a stool, giving Sue that kind of bonding smile that only women can exchange. And Sue smiled back. Sue knew John better than Mary but she connected with Mary very deeply, very quickly. Mary knew the secrets of womanhood and humanity she felt, and she already trusted her 100%.

"Look" said Sue, "I've got something for you, and possibly John". She was interrupted by a ring on the doorbell. It was Klameerathxgleth, a girl that had just moved in and whom Mary suspected was even weirder than Jeff, and she was the final guest arriving for the evening. Actually Mary opened the door with some trepidation. As soon as she saw Klameerathxgleth she relaxed. Klameerathxgleth was young, no more than fifteen Mary thought, but there was an air of clarity and calm around her, as if she was moving through the world without disturbing anything in her wake. "As if she left no wake" Mary thought, and was intrigued.

"You're living in the year 2010" Klameerathxgleth explained as the group now huddled in the kitchen drinking tea from earless cups. "What do you mean?" said John, "We have all the new technology..", "Yes, technically you have" Klameerathxgleth continued "and living the 2010 credo is not bad" she pointed out. "It's just the credo. Every borough, every town has a unifying principle, where they showed their colors, made a sacrifice. Yours was Amnesty International. You fought and freed. Other boroughs are stuck in religions with ritual sacrifices. That is their skin in the game, I'd say you made a good choice and hence got a good deal".

John thought about that both he and Mary had been in Cuban prisons. Or actually jails, and only for one night. That was how the Cuban secret police discouraged foreign activists from advocating free speech on the island in the early twenty hundreds, as the activists traveled around pretending to be tourists. The security police did not dare to keep them locked up longer at the time, due to the threat of international political complications. And it was true that that experience, even if John had it two years before Mary, formed an important part of John's and Mary's bond.

"Come on, you're what, fifteen years old?" Mary asked Klameerathxgleth. "I'm nineteen" Klameerathxgleth replied. "Why do you think drugs are completely illegal in some places and found anywhere in other places?" Klameerathxgleth continued. "Why do some places accept anyone on the content of their character while others are xenophobic and more so for every day? Why are some laid-back on religion while others mandate you do all the rites, or you're out?". "It's about the faith" Mary commented. "No it's about the rites" Klameerathxgleth insisted.

"I call bullshit!". Jeff had been quiet for a long time and as often happens, such a person gets all the attention once they decide to speak. "I have been to 200 boroughs in different city states and it is pretty much all the same in those places".

John looked at Jeff then at Klameerathxgleth. John knew that Jeff was right, but there was something to what Klameerathxgleth had said. Klameerathxgleth had said many weird things during the evening so far, and John was fascinated how right she often were in summarizing a situation or giving an overview, while at the same time being totally hapless about facts.

A brief moment of silence occured before Sue turned to Klameerathxgleth and said: "But Klamaa, Klamee, . What exactly was your name again?".

"You can call me Claire" Klameerathxgleth replied, "Klameerathxgleth was a failed name". "What do you mean failed?" John asked, thinking she was failing at logic again.

"Well my parents were role players in a Sci-Fi universe, the Khlargeeth". The others nodded in recognition, that role playing game had been huge about a dozen years ago. "Well they formed a community because they thought they had all the ingredients of a happy life in the details of those adventures, and they changed my name to Klameerathxgleth" Claire continued.". "Yeah, that could totally work!" interrupted Jeff enthusiastically. "No it doesn't" Claire said. "It collapsed and that is why I'm moving here. Does anyone of you guys have books on the history of Amnesty international?"

"So where is it?" Jeff asked. He and Sue were in Jeff's apartment, with Jeff holding the 8 kilogram gray greenish blob of dough-like matter that Sue had brought him. Sue had had a good night's sleep and slipped up to Jeff in the morning with the goods before she would go with Mary and John to the exhibition.

"Do you mind if i switch on the EMP?" Jeff asked. "That is fine" sue replied. "Do you have electronics?" he continued. "No I am all natural" Sue replied. "You are all natural?" Jeff asked back in a surprised voice. "Oh, no of course I'm not, I mean I am all biological", Sue clarified. "No pacemaker?" Jeff asked. "No pacemaker".

An EMP pulse filled the room and would be fired again and fry any electronics in the air if anything fishy was detected. It was mainly used to clear the room of any eavesdropping drones. Now, evidence obtained from eavesdropping was inadmissible as evidence in a court of law, but that does not help much if responses from eavesdropping can be fully automated, with speech recognition coupled to the exchange trading units and lots of other stuff that made up the artificial nervous system of Bostham sector VI, private or public. So it was better to use EMP.

Jeff knew that some poor people could not afford EMP. Those people would be incredibly boring in what they said, and then suddenly break out into innuendo that bordered on and often was well into, incoherency, as they tried to wink and nudge their real thoughts across. They were indistinguishable from schizophrenics, Jeff thought. Although schizophrenics were rare these days, he pondered. Treatments had cured most of them, but some stubborn cases remained. In those stubborn cases electronics were usually fitted to cater for their basic needs: You could see such an afflicted person ramble about space ships making only balconies safe, while taking in a perfectly nutritious meal with suspiciously healthy ingredients, and then the brain embedded electronics would wash and bathe him, and put him soundly asleep, with him still mumbling incoherently.

"Dave said it would be in a corner", Jeff specified about something in the blob, as the light fell in through the ceiling window onto the blob. Jeff had been fascinated by something called "ego death" that he had read about on the Internet. One way of reaching it according to what he read was through psychedelics. However all such drugs were strictly illegal in Bostham sector VI. Now the authorities wouldn't chop your head off for it, but you would lose your ratings and that could be bad enough. Where Sue came from, many drugs were legal, but you could be sentenced on an individual basis to be barred from using them. "Well I screwed up" Sue admitted. "I put the dose in during kneading...". "So it is everywhere then?" Jeff asked. "Actually no, the soluble container survives the kneading phase. It is just later it dissolves and places the dose." Sue clarified. "So it is in one place in that blob, we just don't know where" Sue continued. "What is this blob anyway, is it edible?" Jeff asked. "Of course it is edible, it is a nutritious mass that gives you all the vitamins and minerals. It is a bit high in vitamin A" Sue replied. "So I'll just eat it all over a few days" Jeff concluded smiling. "It is a bit high in vitamin A" Sue repeated.

"What do you mean?" Jeff asked. "Well it wouldn't be safe to eat too much of it in one go". "What would be safe then?" Jeff asked, with a facial expression of total submission. "I did the numbers, it, it would actually take you two years to eat through that" Sue explained. "And I wouldn't know which day it would hit me?" Jeff asked, feigning a surprised expression since he already had figured that out. "Yeah, sorry about that, I truly am". Sue did not understand why Jeff wanted to try it. Sue had all the imagination she needed, thank you very much, and felt no need to muck with the well oiled machine she regarded her mind to be.

After the exhibition Sue, Mary and John parted from Claire and relaxed with tea at Mary's and John's place again. Jeff had been invited down although Mary didn't really know why she did that. John seemed happy enough though.

"Well, interesting yesterday with Klarry, Kleer.." Jeff concluded.

"Claire. Her name is Claire now. She said things but I can't remember what they were", Mary summarized.

Jul 26, 2016 02:25 | Comments (1)