All posts by danman

DRBD quick cheat sheet

Creating volume

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


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


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


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

USB switch for 2 PC under Linux

Hi there!

As you can note from previous blogs, I love to buy strange devices directly from china :). This time I needed to connect one USB device to 2 computers (servers) so i fired up ebay and aliexpress and found this:IMG_20150529_180442
The description doesn’t say anything about Linux support, but I thougt: “Come on… how complicated can it be?” Continue reading USB switch for 2 PC under Linux