You are not logged in.

#1 2013-12-04 22:42:42

axl
Member
From: Munich/Germany
Registered: 2008-06-30
Posts: 20

any known issues with USB sticks as system drives? esp. with LUKS

Dear forum,

after having tried and tested Arch for quite some time now I decided to switch all my machines to this distribution. However, several installation attempts turned out to be extremely frustrating. I'm having difficulties in finding the reasons for my problems at all, and can't help but think about hardware related issues causing the troubles.

My recent goal is to set up a file server that boots off a USB stick. For security this should be encrypted, using LUKS.

The first couple of installation attempts went nowhere, and the only explanation I can come up with is that the mainboard I used for these tests (Asus E35M1-M Pro) seems to be completely unable to boot from USB sticks. Multiple installations did not start up on this board, but worked on other machines.

Right now I'm trying to make things work on an Asrock 960GM/U3S3. It boots from USB sticks, but I'm getting weird error messages and timeouts from cryptsetup. Currently I'm not in front of that machine, I can post these error messages tomorrow.

Setup number 1:

/dev/sda1 as /boot, 192 MB ext4 and /dev/sda2 encrypted via LUKS, 3,6 GB ext4; BIOS boot, bootloader syslinux

Initially this booted and I was able to key in the passphrase, despite numerous USB related error messages.

After installing zfs (following the Wiki guide for third party repos) and adding a zfs hook to mkinitcpio booting did not work any longer and I ended in the rootfs rescue system. Is this just a coincidence or can there be a relation between the zfs hook and the failed boot sequence?

I lean towards a coincidence, because booting still didn't work after I removed the zfs hook from mkinitcpio.conf (and rebuilt the ramdisk again of course).

Setup number 2:

Unencrypted / and only /home encrypted with LUKS ended in similar problems: Entering the passphrase was not possible, the system fell back to a rescue shell.

An older installation on a 2,5" SATA hdd that worked on the E35M1-M Pro also boots with the 960GM. And this installation has only a small /boot and an encrypted root partition, similar to Setup numer 1 mentioned above! It seems that my installation on spindle drives work every time, while similar installations on USB sticks refuse to work.

I'm close to buying another hdd or small ssd to use it as a system drive, giving up on the USB stick idea completely. However, before I do this I am interested to know if there are installations out there that routinely run desktop or server hosts from USB sticks as system drives. This is described as viable usage scenario, if I'm not mistaken. But it does not work for me. Am I missing anything?

Thank you for your time and input!
Axel

Offline

#2 2013-12-29 16:48:33

andreius
Member
Registered: 2013-12-28
Posts: 2

Re: any known issues with USB sticks as system drives? esp. with LUKS

Axel,
I'm afraid a new SSD won't be different from your bad USB stick. I had similar issues over USB with both a (no-brand) stick and TWO 64gb Kingston SSDNow's (running Kubuntu 12.04 with Kernel 3.11, ia_64): it all runs exceptionally well (wanna know how it feels like booting in 5 sec?) for a few days - then suddenly you find yourself facing that dreaded (initramfs) prompt. You ask yourself: why? Did I upgrade grub lately? Did I upgrade the Kernel? I don't recall so. Ok, let's fix this... insert favorite live cd, boot, fsck...what???? THOUSANDS of errors??? Hundreds of files and directories corrupted, and the system is unusable - Reinstall everything from scratch onto another drive.

Rinse and repeat: did this 3 times. Then I found this analysis:

http://lkcl.net/reports/ssd_analysis.html

I also suspect USB power interrupts more abruptly than SATA power, at shutdown - basically aggravating any power interruption damages. So now I'm going to:
- buy an Intel S3500!
- add commit=1 to my mount options in /etc/fstab
- edit shutdown procedure to add a 5-10 sec pause after unmounting drives.

Just my two cents.
Andrea

Last edited by andreius (2013-12-29 16:51:04)

Offline

#3 2013-12-29 19:26:13

NVS
Member
Registered: 2007-12-30
Posts: 29

Re: any known issues with USB sticks as system drives? esp. with LUKS

I've run setups off USB drives. The computer I'm on has /boot on one. I've run root on others. The only thing I'd be concerned with running off a USB drive is the number of writes to the device. Hence why I mount read-only, in order to preserve the longevity of the device, until I need to update anything.

As far as using the 'zfs' hook, if you are not using ZFS as your root filesystem you do not need the hook at all. Having it there when you don't need it will mess things up. You can happily use ZFS without the hook.

Offline

#4 2014-01-09 23:14:17

andreius
Member
Registered: 2013-12-28
Posts: 2

Re: any known issues with USB sticks as system drives? esp. with LUKS

Update:
I added commit=1 to my fstab (I regret I didn't try adding 'discard' though); I placed a 5-second delay in the shutdown script - just before the final halt. However it didn't help, as the disk went corrupted once more.

This time the partition type became 'unknown', it shrinked somewhat in size, and lost the boot flag! Definitely NOT a matter of unsaved buffers. If it wasn't for rsync backing up my system twice a day...

However, my new Intel S3500 SSD has just arrived, so hopefully my troubles are finished...

NVS: I've also run a 3-disk RAID1 setup with mdadm a couple years ago, with two 30gb partitions on regular 160gb hard disks (which also hosted a RAID1 swap array), and a 32gb usb key with the "write-mostly" mdadm flag (the key was very slow compared to the hard drives). It ran flawlessly.

Offline

#5 2014-01-16 19:48:42

sandy8925
Member
Registered: 2013-06-25
Posts: 22

Re: any known issues with USB sticks as system drives? esp. with LUKS

My $0.02 is that USB drives are slow in my experience, and you'd be better off using USB hard drives or SSD.

But, it should be possible.

Offline

Board footer

Powered by FluxBB