Sunday, April 15, 2018

SSD or HDD on linux for (n) nodes

And if you need to know for all disks
lsblk -d -o name,rota

Going to use parallel ssh
  • SDA is my disk I want to check
  • 1 for hard disks and 0 for a SSD
  • pssh -i -h ./.pssh_hosts_file_all "cat /sys/block/sda/queue/rotational"
Output example:
[9] 19:22:21 [SUCCESS] pnode-1
0
[7] 19:22:21 [SUCCESS] pnode-2
0
[4] 19:22:21 [SUCCESS] pnode-3
0
[13] 19:22:21 [SUCCESS] pnode-4
0
[8] 19:22:21 [SUCCESS] pnode-5
0
[1] 19:22:21 [SUCCESS] pnode-6
0
[3] 19:22:21 [SUCCESS] pnode-7
0
[2] 19:22:21 [SUCCESS] pnode-8
0
[11] 19:22:21 [SUCCESS] pnode-9
1
[6] 19:22:21 [SUCCESS] pnode-10
1
[12] 19:22:21 [SUCCESS] pnode-11
1
[5] 19:22:21 [SUCCESS] pnode-12
1
[10] 19:22:21 [SUCCESS] pnode-13
1

Wednesday, August 16, 2017

Persistent virtual drive on Windows

I needed a persistent virtual drive on my Windows machine and came across this command:

reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices" /v d: /t REG_SZ /d "\??\d:\d_drive" /f

After a restart I found my newly created virtual drive mounted at d:\ with the contents of c:\d_drive. This seems to work better and more persistent than just using the subst command.

Friday, August 11, 2017

Collection of new boards

The ultimate I/O board?
https://grapeboard.com/

10GE Atom Switch/NAS appliance
http://us.axiomtek.com/Default.aspx?MenuId=Products&FunctionId=ProductView&ItemId=24082&upcat=232

Couple industrial boards
http://us.axiomtek.com/Default.aspx?MenuId=Products&FunctionId=ProductInfo&Cat=137&C=Pico-ITX+Embedded+Board

Networking boards
http://www.gateworks.com/product/item/newport-gw6300-single-board-computer

Another 4GB SBC
https://libre.computer/products/boards/roc-rk3328-cc/

Intel i7 on an SBC
https://www.kickstarter.com/projects/139108638/lattepanda-alpha-soul-of-a-macbook-in-a-pocket-siz

Board from Bulgaria?
https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXIno-LIME2/open-source-hardware

Piccocluster, no time to assemble arm clusters yourself?
https://www.picocluster.com/

Marvell MACCHIATObin, need 10GE network ports on a small ARM board?
https://www.solid-run.com/marvell-armada-family/armada-8040-community-board/

Espressobin, there are too many features! It may be the board you were looking for.
http://espressobin.net/

Rock960 comes with Rock Chip RK 3399, USB3, 4GB of Memory, 32GB of eMMC, PCIE supporting a M.2 SSD and other compatible cards! 6 cores, 2 x A73 & 4 x A53
https://www.96rocks.com

Rock64 comes with 4GB of memory, USB3 and eMMC support
https://www.pine64.org/?page_id=7147

Le Potato Single Board Computer
https://www.kickstarter.com/projects/librecomputer/libre-computer-board-next-gen-4k-sbc-dev-board-for

CrazyPI the best board for robot makers?
https://www.crazyou.net

NanoPi Neo Plus2, the NanoPi that has it all!
http://www.friendlyarm.com/index.php?route=product/product&product_id=196

After Asus now Gigabyte jumps into the SBC market also
http://www.gigabyte.us/Motherboard/GA-SBCAP3350-rev-10#ov

Banana Pi M2 Ultra
http://www.banana-pi.org/m2u.htm

Wednesday, May 31, 2017

Pictures of Gizmo 2 NAS

I was thinking to publish a few pictures of the final NAS built in http://xorinox.blogspot.com/2017/05/gizmo-2-becomes-my-fast-nas.html

Some preliminary and naive testing showed that I can read and write about 110MB/s from and to this NAS.











Sunday, May 7, 2017

Setting up Samba on my Gizmo 2

As described in my previous blog I have setup my Gizmo 2 to become my NAS. Now it is time to enable Samba so I can access the volumes with my Windows machines.

Installation
  • yum install -y samba samba-client

Security
  • useradd pi
  • passwd pi
  • smbpasswd -a pi
  • smbpasswd -L -e pi
  • groupadd fastvol
  • groupadd safevol
  • usermod -a -G fastvol pi
  • usermod -a -G safevol pi

Permissions
  • chown -R pi:fastvol /mnt/fastvol
  • chown -R pi:safevol /mnt/safevol
  • chmod -R 0777 /mnt/fastvol
  • chmod -R 0777 /mnt/safevol
  • chcon -t samba_share_t /mnt/fastvol
  • chcon -t samba_share_t /mnt/safevol

Configuration
  • vi /etc/samba/smb.conf
[fastvol]
        path = /mnt/fastvol
        valid users = @fastvol
        writable = yes
        read only = no
        browsable = yes
        guest ok = no
        create mode = 0777
        directory mode = 0777

[safevol]
        path = /mnt/safevol
        valid users = @safevol
        writable = yes
        read only = no
        browsable = yes
        guest ok = no
        create mode = 0777
        directory mode = 0777

Start & enable service
  • systemctl restart smb
  • systemctl restart nmb
  • systemctl enable smb
  • systemctl enable nmb

Sources Samba Setup

Gizmo 2 becomes my fast NAS

My Gizmo 2 has CentoOS 7 installed on a miniSATA disk from Samsung. Through USB3 I have connected 2 x NexStart MX 2.5" enclosures that each contain 2 x 1TB SSD 840 Evo from Samsung.

I will create two volumes, a really fast one and a very secure one. The enclosure comes with hardware RAID that is currently configured to RAID 1. So each enclose provides 1TB of disc space right now.

The fast volume will be made of 2 x 700GB and then secure one, for backups, utilizing the rest.


Keep the yum repos updated
  • yum install -y yum-cron
  • chkconfig yum-cron on

I need Vim enhanced

  • yum install -y vim-enhanced
  • echo "alias vi=vim" >> ~/.bashrc
  • source ~/.bashrc

A bunch of tools I always install

  • yum install -y bind-utils net-tools traceroute nmap dhclient 
  • yum install -y system-storage-manager
  • yum install -y nano bash-completion wget curl lsof deltarpm rpm-build yum-utils attr screen git
  • yum groupinstall -y "Development Tools"

Let's look at the USB drives

  • yum whatprovides lsusb
  • yum install -y usbutils libusb
    • libusb actually enabled the USB 3 ports

Install software RAID support
  • yum whatprovides mdadm
  • yum install -y mdadm

Check disk configuration
  • Using lsblk this is how I have all my disks configured
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0 111.8G  0 disk
├─sda1        8:1    0     1G  0 part /boot
└─sda2        8:2    0 110.8G  0 part
  ├─cl-root 253:0    0    50G  0 lvm  /
  ├─cl-swap 253:1    0   1.5G  0 lvm  [SWAP]
  └─cl-home 253:2    0  59.3G  0 lvm  /home
sdb           8:16   0 931.5G  0 disk
├─sdb1        8:17   0   700G  0 part
└─sdb2        8:18   0 231.4G  0 part
sdc           8:32   0 931.5G  0 disk
├─sdc1        8:33   0   700G  0 part
└─sdc2        8:34   0 231.4G  0 part


Configure RAID
  • Edit /etc/mdadm.conf
DEVICE /dev/sd[bc]1
ARRAY /dev/md0 devices=/dev/sdb1,/dev/sdc1

DEVICE /dev/sd[bc]2
ARRAY /dev/md1 devices=/dev/sdb2,/dev/sdc2
  • mdadm -C /dev/md0 --level=raid0 --raid-devices=2 /dev/sdb1 /dev/sdc1
  • mdadm -C /dev/md1 --level=raid1 --raid-devices=2 /dev/sdb2 /dev/sdc2

Formatting & mounting
  • mkfs.xfs /dev/md0
  • mkfs.xfs /dev/md1 -f
  • mkdir /mnt/fastvol
  • mkdir /mnt/safevol
  • added lines to /etc/fstab
/dev/md0     /mnt/fastvol                       xfs     defaults        0 0
/dev/md1     /mnt/safevol                       xfs     defaults        0 0
  • mount -a

Check disk configuration again
  • Using lsblk this is how I have all my disks configured
[root@giz-node-1 ~]# lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda           8:0    0 111.8G  0 disk
├─sda1        8:1    0     1G  0 part  /boot
└─sda2        8:2    0 110.8G  0 part
  ├─cl-root 253:0    0    50G  0 lvm   /
  ├─cl-swap 253:1    0   1.5G  0 lvm   [SWAP]
  └─cl-home 253:2    0  59.3G  0 lvm   /home
sdb           8:16   0 931.5G  0 disk
├─sdb1        8:17   0   700G  0 part
│ └─md0       9:0    0   1.4T  0 raid0 /mnt/fastvol
└─sdb2        8:18   0 231.4G  0 part
  └─md1       9:1    0 231.3G  0 raid1 /mnt/safevol
sdc           8:32   0 931.5G  0 disk
├─sdc1        8:33   0   700G  0 part
│ └─md0       9:0    0   1.4T  0 raid0 /mnt/fastvol
└─sdc2        8:34   0 231.4G  0 part
  └─md1       9:1    0 231.3G  0 raid1 /mnt/safevol




Saturday, May 6, 2017

Tools to burn images onto SD cards etc.


Windows

On my Khadas VIM I could not find the command "ping"


Funny, after installing Ubuntu Server on my Khadas VIM I could not find the command "ping". An approach to find commands that so far always helped me was to use apt-file.
  • apt-get install apt-file
  • apt-file update
  • apt-file find ping |grep utils
I also suspected it needed to be part of some kind of *utils*. 
  • apt-get install iputils-ping
And now I have "ping".

Sunday, April 30, 2017

For my MiQi Dev Board I needed to set my own MAC Address

I needed to set my own MAC address because for some reason it changed after each reboot.

vi /etc/network/interfaces

auto eth0
iface eth0 inet dhcp
hwaddress ether 22:b9:4d:5d:77:94

Sunday, April 23, 2017

Install Ansible on Asus Tinker Board


I found these steps necessary to install ansible on the Linux dist provided by Asus for my Tinker Board (TinkerOS_Debian V1.8 beta version)
  • apt-get install python-pip python-dev build-essential python-wheel libffi-dev
  • pip install --upgrade pip 
  • pip install --upgrade virtualenv 
  • pip install --upgrade setuptools
  • pip install ansible