Showing posts with label hardware. Show all posts
Showing posts with label hardware. Show all posts

24 May 2018

How to securely wipe an NVMe drive

NVMe drives are great: they are fast and they are huge. That huge size, however, can be a pain when it comes to securely erasing data. Old-school commands like wipe are simply not up to the task; and even if they were, they work on assumptions that do not map properly to a solid-state world. Writing random data over and over is going to dramatically reduce the lifespan of a solid-state drive, and it's pointless when all NVMe disks already have built-in tools that can take care of this task quickly and safely.

So what do you do when you want to wipe a NVMe drive?
  1. Download a recent Linux distribution. I would recommend Debian/Ubuntu or one of their smaller derivatives (like Knoppix). Burn it on a cdrom or USB drive and boot the system from it.
  2. Make sure your package manager is up-to-date (under Debian/Ubuntu, sudo apt-get update), then install nvme-cli (sudo apt-get install nvme-cli)
  3. If your drive is a Samsung, it now has to be put to sleep (you can do that with sudo systemctl suspend) and then woken up. This is a weird bug that Samsung doesn't seem in any hurry to fix.
  4. Now you can securely wipe the disk: sudo nvme format -s1 /dev/nvme0n1
For the curious: the -s option triggers Secure Erase mode, which can be set to 1 (wipe) or 2 (delete encryption keys for encrypted data). 1 looks like the safest option, because it will automatically do what 2 does if it detects that all data is encrypted. Reference here.

The latest NVMe specification adds other commands, to scrub every nook and cranny (bus caches etc), but as far as I know they have not been implemented yet.

18 December 2016

OWC 12-port Thunderbolt2 dock review

As you probably know, recently the Apple world has been rocked by the release of new MacBookPro models. One of the arguments of contention is the drastic switch to USB-C / Thunderbolt 3. Not by coincidence, I've recently decided to finally splurge for a Thunderbolt dock, although a TB2 one; my 2012 MBPr only supports TB1 (the port that looks like a MiniDisplayPort), so anything more would have been a waste of money. Here is a short review for people who might wonder whether this dock is worth the price.

I've dealt with my fair share of no-name Taiwanese stuff in my life, and I didn't want to risk it this time, so I turned to OWC - a very reliable supplier of Apple accessories. Their 12-port Thunderbolt2 hub got some good press, so I went for that. First impression was slightly disappointing - the unit is well built and feels pretty sturdy, but the one I received was scratched on top, and overall looked a bit like an ex-display or returned model. Let's not be "a typical Apple user", I thought, and see how it works before we knock it.

Sure enough, it works pretty well. I went from having all MBP ports occupied, to using one with even more attached devices than before. This is what I connected:

  • External Thunderbolt drive
  • External USB2 drive
  • 4k display (via HDMI)
  • Ethernet
  • headphones
  • two Amazon Kindle
  • gamepad controller

The hub is independently powered, so it can charge devices even when the laptop is shut down. However, it's not magic; there a few trade-offs you should probably be aware of.

The first is that attached Thunderbolt devices inevitably lose a little bit of performance, since bandwidth is shared. This is probably less noticeable if your laptop supports Thunderbolt2, which supports higher speeds, but it's definitely visible with TB1. My external drive saw a 20% loss of speed, from 360 to 300 MB/sec, which is inevitable: now that we're sharing one TB bus among 8 peripherals, the drive can't max it out on its own. It's still very respectable though, and likely a blip if you use TB2 throughout (i.e. MBPr models from 2013 onwards).

The second issue is more disappointing. Having both an HDMI port and one TB/DisplayPort available (the other is used for the actual connection to the laptop), the hub supposedly supports attaching two screens. I first connected my primary monitor to the hub HDMI port; HDMI is the only way to get 4k on the 2012 MBPr. This worked fine, exactly as it did on the actual laptop port. However, as soon as I attached a second screen to the TB port on the hub, the HDMI connection was downgraded to half the native resolution. This did not happen when I had both screens attached to the laptop, so it doesn't seem to be an issue with OSX; rather, the hub must be doing some internal processing over video streams, and must have some sort of ceiling in the amount of pixels it can push down the wire (or something to that effect). In short, I would recommend to only attach one monitor to the hub, if it is a high-res screen.

A similar behaviour appears if your HDMI screen happens to have speakers. Sound quality degrades so massively, it is simply unusable: lagging, skipping, terrible sound all around. It's weird, because the analog headphone jack works perfectly, so it must have something to do (again) with HDMI stream management.

The fourth issue, and the reason I wouldn't be surprised if it turned out this is indeed a returned model, is that the whole hub suffers something like a crash if you use the "high power USB" ports for more than a couple of hours. All attached devices suddenly stop working, and reconnecting the TB cable makes no difference. The couple of times it happened, I had to power-cycle the unit (which does not have a switch, so I had to unplug the mains cord) after disconnecting all non-essential devices, in order to get it back online. I've isolated the issue to the high-powered USB ports, which I used for two Kindle units: if I detach the cables after 20 or 30 minutes, all is fine, but if I leave them there for a few hours, inevitably I'll get a crash. To be on the safe side, I moved my precious TB drive back to the second TB port on the laptop (I simply cannot afford to corrupt that drive), and mostly stopped used those ports.

The last point is not a real problem, just a little gotcha. The headphone jack is analog, but it's not an automatic passthrough. In order to actually use it, you have to go to System Preferences / Sound / Output, and select "USB audio output" as your output device. Quality seems fine, but I'm not an audiophile so I will refrain from commenting further.

Overall, the hub seems to work more or less fine (bar the power-loss scare), and it's very convenient for my setup. Thunderbolt, even in its first incarnation, is an extremely powerful standard, just on the expensive side. I won't be buying a new MBP anytime soon (new models are just not as powerful as I'd like, the British Pound is moribund, and this 2012 model is still rocking), but if you do, you should find the power of TB3/USB-C outweighs the annoyance of migrating to yet another I/O standard.

14 November 2007

Hey Seagate, here's a business idea for you

The paper mountains will stay with us until such time as write-only media become as common as today's hard disks. We need storage sub-systems that never, ever delete anything. Storage systems that automatically - at hardware level - ensure that updates are stored as new versions and that delete operations are really archive operations. To be widely adopted, we need the confidence that only legal standing can bring to the evidential reliability of such devices.

Sean McGrath - Paper doesn't dance