usbip-utils 2.0 on Ubuntu

Ubuntu 15.10 contains usbip package too old to work with usbip v2.0 server (e.g. latest raspbian on RasPI) so you need to compile usbip tool from kernel sources.

UPDATE 19. 04. 2016:

You don’t need to go through compiling from source. You may just install package linux-tools-generic:

$ apt-get install linux-tools-generic

This will install precompiled usbip tools into /usr/lib/linux-tools/`uname -r`/:

$ /usr/lib/linux-tools/4.2.0-35-generic/usbip version
usbip (usbip-utils 2.0)

Non-working usbip installed from usbip package

$ sudo usbip -l 192.168.1.83
- 192.168.1.83
usbip err: usbip_network.c: 119 (usbip_recv_op_common) recv op_common, -1
usbip err: vhci_attach.c: 202 (query_exported_devices) recv op_common
usbip err: vhci_attach.c: 417 (show_exported_devices) query
$ usbip -v

** (process:30826): WARNING **: running non-root?
usbip 0.1.7 ($Id: vhci_attach.c 42 2007-09-07 12:07:51Z hirofuchi $)

Continue reading usbip-utils 2.0 on Ubuntu

DRBD quick cheat sheet

Creating volume

/etc/drbd.d/raid10.res
resource raid10 {

  protocol B;

  on hostname1 {
    device    /dev/drbd1;
    disk      /dev/raid10_vg/drbd;
    address   [localIP]:7789;
    meta-disk internal;
  }
  on hostname2 {
    device    /dev/drbd1;
    disk      /dev/raid10-vg/drbd;
    address   [localIP]:7789;
    meta-disk internal;
  }
}

Both nodes:

drbdadm create-md [resource]
drbdadm up [resource]

Primary node:

drbdadm primary --force [resource]

cat /proc/drbd
version: 8.4.3 (api:1/proto:86-101)
srcversion: 6551AD2C98F533733BE558C

 1: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent B r-----
    ns:7552704 nr:0 dw:0 dr:7552936 al:0 bm:460 lo:47 pe:12 ua:47 ap:0 ep:1 wo:f oos:97303516
    [>...................] sync'ed:  7.3% (95020/102396)Mfinish: 0:15:29 speed: 104,672 (96,804) K/sec

Resize

Both nodes:

lvresize /dev/raid10-vg/drbd -L+100G
  Extending logical volume drbd to 200.00 GiB
  Logical volume drbd successfully resized

resize with resync:

drbdadm resize [resource]

resize without resync (added clean space):

drbdadm -- --assume-clean resize [resource]

Resize filesystem:

resize2fs /dev/drbd1

Fix splitbrain

slave:

drbdadm secondary all
drbdadm connect --discard-my-data all

master:

drbdadm connect all

CH341A USB serial EEPROM reader under Linux

I nprogrammereeded to backup original firmware of my favorite Chinese wireless router but I didn’t want to spend much time with hacking the embedded Linux. So I have ordered this cheap USB serial EEPROM programmer on ebay. You can easily find the original utility & driver for Windows on the Internet but the chip manufacturer doesn’t provide software for Linux. Continue reading CH341A USB serial EEPROM reader under Linux