Monthly Archives: October 2018

Valuable News – 2018/10/27

The Valuable News weekly series is dedicated to provide summary about news, articles and other interesting stuff mostly but not always related to the UNIX or BSD systems. Whenever I stumble upon something worth mentioning on the Internet I just put it here so someone else can

Today the amount information that we get using various information streams is at massive overload. Thus one needs to focus only on what is important without the need to grep(1) the Internet everyday. Hence the idea of providing such information ‘bulk’ as I already do that grep(1).

UNIX

FreeBSD 12.0-BETA1 Available.
https://lists.freebsd.org/pipermail/freebsd-stable/2018-October/089821.html

ZFS Replication Tool zrepl 0.1.0-rc2 Available.
https://github.com/zrepl/zrepl/releases/tag/0.1.0-rc2

In Other BSDs for 2018/10/20.
https://www.dragonflydigest.com/2018/10/20/21945.html

OpenBSD – How to fix a broken ACPI.
https://www.echinopsys.de/en/blog/fix-broken-acpi-on-openbsd.html

DNS over TLS in FreeBSD 12.
https://blog.des.no/2018/10/dns-over-tls-in-freebsd-12/

FreeBSD switch default PHP version from 7.1 to 7.2.
https://svnweb.freebsd.org/ports?view=revision&revision=482746

No more joy in FreeBSD.
https://twitter.com/pbiernacki/status/1054325671705669633
https://lists.freebsd.org/pipermail/svn-src-head/2018-October/119022.html

OpenBSD 6.4 with nested virtualization at gridscale.
https://hazardous.org/archive/blog/2018/10/21/openbsd64-nested-vt-gridscale

DragonFly BSD Performance – SMP Scaling (2018).
What FreeBSD always was suposed to be.
https://www.dragonflybsd.org/performance/

OpenBSD switched default linker on amd64 from GNU to LLVM lld.
https://twitter.com/openbsd/status/1054465364657168384
https://marc.info/?l=openbsd-ports&m=154023755628845&w=2

How to install FreeBSD 11 on Google Cloud Compute.
https://www.cyberciti.biz/faq/howto-deploying-freebsd11-unix-on-google-cloud/

VirtualBox 6.0 Beta 1 Released.
VirtualBox 6.0 will be a new minor release. Yes fuck logic.
https://forums.virtualbox.org/viewtopic.php?f=1&t=89946

FreeBSD commit to introduce /etc/src.conf knob to build userland with retpoline.
https://twitter.com/FreeBSDHelp/status/1053841202896764928
https://svnweb.freebsd.org/base?view=revision&revision=339511

OpenIndiana Hipster 2018.10 Available.
https://www.openindiana.org/2018/10/24/openindiana-hipster-2018-10-is-here/
https://wiki.openindiana.org/oi/2018.10+Release+notes
http://dlc.openindiana.org/

FreeBSD runs RISC-V in multiuser on lowRISC Nexys 4 DDR.
https://twitter.com/ed_maste/status/1054795743725268993

XigmaNAS 11.2.0.4.6154 Available.
https://sourceforge.net/projects/xigmanas/files/XigmaNAS-11.2.0.4/11.2.0.4.6154/

Barman 2.5 with Support for PostgreSQL 11.
https://www.postgresql.org/about/news/1897/

POWER9 Desktop.
https://twitter.com/hughhalf/status/1054642786727800833https://twitter.com/hughhalf/status/1054642786727800833

Installing Arcan on FreeBSD.
https://github.com/wolfspider/ArcanFreeBSDGuide

What I learned from porting my projects to FreeBSD.
https://github.com/shlomif/what-i-learned-from-porting-to-freebsd#what-i-learned-from-porting-my-projects-to-freebsd

GhostBSD 18.10 RC1/RC2 Available.
https://ghostbsd.org/18.10_RC1_release_announcement
https://ghostbsd.org/18.10_RC2_release_announcement

FreeBSD is not Linux distribution.
https://www.youtube.com/watch?v=ps67ECyh0sM

OpenBSD 0-day Xorg/Xenocara LPE via CVE-2018-14665.
https://twitter.com/hackerfantastic/status/1055568290112831490

Microsoft are services run by UNIX systems.
Hotmail on FreeBSD.
MSN using Apache on Solaris.
bCentral ad servers running on FreeBSD.
https://twitter.com/unix_byte/status/1053848882793181188

OpenBSD Foundation reached its 2018 fundraising goal.
https://www.openbsdfoundation.org/contributors.html

Hardware

AMD EPYC 3251 Benchmarks and Review the Challenger We Need.
https://www.servethehome.com/amd-epyc-3251-benchmarks-and-review/

ASRock DeskMini A300 STX Motherboard.
https://smallformfactor.net/forum/threads/possibility-of-amd-on-stx-form-factor.6798/page-6#post-119036

Supermicro CEO Letter Addressing Recent Article.
https://www.supermicro.com/en/news/CEO-letter

Intel kills off the 10nm process.
https://semiaccurate.com/2018/10/22/intel-kills-off-the-10nm-process/

Need modest ARM Cortex-A CPU? Just apply online with $125,000.
https://www.theregister.co.uk/2018/10/22/arm_cortex_a5_designstart/

Porting Coreboot to the 51NB ThinkPad X210 Mod.
https://mjg59.dreamwidth.org/50924.html

Thinkpad X62.
https://geoff.greer.fm/2017/07/16/thinkpad-x62/

How IBM ThinkPad Became Design Icon.
https://www.fastcompany.com/90145427/how-ibms-thinkpad-became-a-design-icon
https://news.ycombinator.com/item?id=18273305

HP Spectre 13.3 x360 – Quad-Core i7 with 22.5 Hour Battery Life.
https://www.anandtech.com/show/13509/hp-launches-ultra-thin-hp-spectre-13-x360

Life

Not exercising worse for your health than smoking, diabetes and heart disease, study reveals.
https://edition.cnn.com/2018/10/19/health/study-not-exercising-worse-than-smoking/index.html

Other

Warhol and the Amiga.
https://www.warhol.org/exhibition/warhol-and-the-amiga/

Soviet Tesla – Electric Lada from 30 Years Ago That Was Mass Produced.
http://englishrussia.com/2018/09/04/soviet-tesla-electric-lada-from-30-years-ago-that-was-mass-produced/

NASA finds perfectly rectangular iceberg in Antarctica as if it was deliberately cut.
https://www.physics-astronomy.org/2018/10/nasa-finds-perfectly-rectangular.html

Apple and Samsung fined for deliberately slowing down phones.
https://www.theguardian.com/technology/2018/oct/24/apple-samsung-fined-for-slowing-down-phones

EOF

Valuable News – 2018/10/20

The Valuable News weekly series is dedicated to provide summary about news, articles and other interesting stuff mostly but not always related to the UNIX or BSD systems. Whenever I stumble upon something worth mentioning on the Internet I just put it here so someone else can

Today the amount information that we get using various information streams is at massive overload. Thus one needs to focus only on what is important without the need to grep(1) the Internet everyday. Hence the idea of providing such information ‘bulk’ as I already do that grep(1).

UNIX

OpenBSD vmm(8) now runs CentOS 7 Linux.
https://twitter.com/l8n8dude/status/1050696721129504768

Freedesktop.org – Its Past and Its Future.
https://lwn.net/Articles/767258/

Linux elementary OS 5 Juno Available.
Still no desktop icons.
https://medium.com/elementaryos/elementary-os-5-juno-is-here-471dfdedc7b3

Unix in East Germany (GDR) from 1982.
https://groups.google.com/forum/m/#!topic/comp.unix.wizards/QX_dxElrVNs

FreeBSD 12.0-ALPHA10 Available.
https://lists.freebsd.org/pipermail/freebsd-snapshots/2018-October/000464.html

Oracle VM VirtualBox 5.2.20 Available.
https://blogs.oracle.com/virtualization/oracle-vm-virtualbox-5220-now-available

Arcan versus Xorg – Approaching Feature Parity.
Arcan versus Xorg – Approaching Feature Parity

Kubernetes with IBM AIX container technology.
https://twitter.com/cgibbo/status/1052650460585185280

Fonts on Unix.
Really great in depth guide to fonts on UNIX systems.
https://venam.nixers.net/blog/unix/2017/06/04/fonts-on-unix.html

OpenBSD 6.4 Released.
https://www.openbsd.org/64.html

PostgreSQL 11 Released.
https://www.postgresql.org/about/news/1894/

2ndQuadrant contributes major features to PostgreSQL 11.
https://www.2ndquadrant.com/en/about/news/2ndquadrant-contributes-major-features-postgresql-11/

OpenBSD Mail Smarthost Runbook.
https://paulgorman.org/technical/openbsd-smarthost-runbook.txt.html

Upgrading OpenBSD with Ansible.
https://chown.me/blog/upgrading-openbsd-with-ansible.html

FreeNAS 11.2-RC1 Available.
https://www.ixsystems.com/blog/library/freenas-11-2-rc1/

FreeBSD HEAD is now known as 13-CURRENT.
https://svnweb.freebsd.org/base?view=revision&revision=339436

FreeBSD has initial driver for ACPI NFIT enumerated NVDIMMs.
https://svnweb.freebsd.org/base?view=revision&revision=339391

CAM drivers in FreeBSD over time.
https://github.com/bsdimp/device-data/blob/master/cam.md

OpenBSD on the AMD Ryzen powered ThinkPad A485.
https://deftly.net/posts/2018-10-15-openbsd-on-lenovo-a485.html

Hardware

RISC-V: More Than Core.
https://semiengineering.com/risc-v-more-than-a-core/

Backblaze 2018 Q3 Hard Drive Stats: Less is More.
https://www.backblaze.com/blog/2018-hard-drive-failire-rates/

ODROID-H2 mini PC board with Celeron J4105.
https://liliputing.com/2018/10/odroid-h2-mini-pc-board-with-celeron-j4105-gemini-lake-cpu-coming-next-month.html

Zotac Zbox PI225 pico Mini PC Review.
https://www.tomsguide.com/us/zotac-zbox-pico-mini-pc,review-5857.html

Business card-sized Japanese phone bucks the giant-phone trend.
https://arstechnica.com/gadgets/2018/10/this-business-card-sized-japanese-phone-bucks-the-giant-phone-trend/

Life

It’s better to be born rich than gifted.
https://www.washingtonpost.com/business/2018/10/09/its-better-be-born-rich-than-talented/?noredirect=on&utm_term=.1283300b875f

Good Sleep, Good Learning, Good Life.
https://www.supermemo.com/en/articles/sleep.

Microplastics found in 90 percent of table salt.
https://www.nationalgeographic.com/environment/2018/10/microplastics-found-90-percent-table-salt-sea-salt/

Other

Ideas for scaling PostgreSQL to multi-terabyte and beyond.
https://www.cybertec-postgresql.com/en/ideas-for-scaling-postgresql-to-multi-terabyte-and-beyond/

Make Firefox Great Faster Again.
https://twitter.com/romanzolotarev/status/1053568896945569792

EOF

Valuable News – 2018/10/13

The Valuable News weekly series is dedicated to provide summary about news, articles and other interesting stuff mostly but not always related to the UNIX or BSD systems. Whenever I stumble upon something worth mentioning on the Internet I just put it here so someone else can

Today the amount information that we get using various information streams is at massive overload. Thus one needs to focus only on what is important without the need to grep(1) the Internet everyday. Hence the idea of providing such information ‘bulk’ as I already do that grep(1).

UNIX

XINUOS Releases New SCO OpenServer 5 Definitive 2018 based on FreeBSD.
http://www.prweb.com/releases/xinuos_releases_new_sco_openserver_5_definitive_2018/prweb15816407.htm
https://xinuos.com/menu-products/openserver-5-2018

Running FreeBSD on OSX using xhyve (bhyve port).
https://dan.langille.org/2018/10/02/running-freebsd-on-osx-using-xhyve-a-port-of-bhyve/

Proper way to update FreeBSD Jails between point releases.
https://orville.thebennettproject.com/articles/the-proper-way-to-update-freebsd-jails/

OpenBSD vmd(8) now supports qcow2 external snapshots which means read only base image with changes written to external files.
https://twitter.com/canadianbryan/status/1049354743573893120
https://marc.info/?l=openbsd-cvs&m=153901633011716&w=2

OmniOS Community Edition r151026w/r151024aw/r151022bu Available.
https://omniosce.org/article/releases-026w-024aw-022bu

FreeBSD 12 on my PINE64 Pinebook.
https://twitter.com/allanjude/status/1049498429301424128

Tanzanian Digital Library Initiative makes extensive use of FreeBSD and DragonFly BSD.
http://tandli.com/about-tdli/technologies/

Biscuit is monolithic POSIX-subset operating system kernel in Go for x86-64 CPUs.
It was written to study the performance trade-offs of using a high-level language with garbage collection to implement a kernel with a common style of architecture.
https://github.com/mit-pdos/biscuit

SoloBSD 11.2-STABLE-1009 from HardenedBSD 1100056.6 Available.
https://www.solobsd.org/index.php/2018/10/09/solobsd-11-2-stable-1009/

XFS vs EXT4 – Comparing MongoDB Performance on AWS EC2.
https://scalegrid.io/blog/xfs-vs-ext4-comparing-mongodb-performance-on-aws-ec2/

NVMM – NetBSD Virtual Machine Monitor provides hardware-accelerated virtualization support on NetBSD.
http://m00nbsd.net/4e0798b7f2620c965d0dd9d6a7a2f296.html

FreeBSD architectures over time based on http://dmesgd.nycbug.org collection.
https://twitter.com/bsdimp/status/1050045542632308738

FreeBSD 12.0-ALPHA9 Available.
https://lists.freebsd.org/pipermail/freebsd-snapshots/2018-October/000461.html

DragonFlyBSD 5.3 Offering Some Performance Improvements.
https://www.phoronix.com/scan.php?page=article&item=dragonfly-53-1280v5

How to check your data integrity?
https://dataswamp.org/~solene/2017-03-17-integrity.html

Step by Step: All in One Recovery Backup Appliance with FreeNAS 11.1 U6 Bhyve and Veeam.
https://forums.freenas.org/index.php?threads/step-by-step-all-in-one-recovery-backup-appliance-with-freenas-11-1u6-bhyve-and-veeam.70449/

BSD Now 267 – Absolute FreeBSD.
https://www.jupiterbroadcasting.com/127546/absolute-freebsd-bsd-now-267/

Learning Notes on FreeBSD Jails.
https://genneko.github.io/playing-with-bsd/system/learning-notes-on-jails/

MidnightBSD 1.0 Released.
https://midnightbsd.org/notes/

POWER9 functional simulator works on FreeBSD amd64.
https://twitter.com/kevinbowling1/status/1051009520346918913

Eleven bash Tips You Might Want to Know.
Eleven bash Tips You Might Want to Know

Laptop Recommendations for DragonFly BSD.
https://www.dragonflydigest.com/2018/10/12/21932.html

In Other BSDs for 2018/10/13.
https://www.dragonflydigest.com/2018/10/13/21906.html

HOWTO Bhyve (Windows and Linux) from viBSD.
https://www.youtube.com/playlist?list=PLoIdhcVxgUKTN6Y76OpdbrVAlqd8ZkxCf

FreeNAS 11.2-BETA2 Available.
https://www.ixsystems.com/blog/library/freenas-11-2-beta2/

Hardware

Raptor Computing Reveals More Details About Blackbird Low-Cost POWER9 Board.
https://www.phoronix.com/scan.php?page=news_item&px=Raptor-Blackbird-Details

Helios4 ARM Based Open Source NAS SBC For Linux/FreeBSD.
https://technewsone.net/helios4-arm-based-open-source-nas-sbc-for-linux-freebsd/

How Does an Intel Processor Boot?
https://binarydebt.wordpress.com/2018/10/06/how-does-an-x86-processor-boot/

Secure Partitions in ARM Trusted Firmware-A.
https://osfc.io/talks/secure-partitions-in-trusted-firmware-a

ARGON One – Most Versatile Raspberry Pi Mini Computer.
https://www.kickstarter.com/projects/argonforty/argon-one-the-most-versatile-raspberry-pi-mini-com

Libre GPU effort based on RISC-V/Rust/LLVM/Vulkan by developer of earth-friendly computer.
https://hub.packtpub.com/a-libre-gpu-effort-based-on-risc-v-rust-llvm-and-vulkan-by-the-developer-of-an-earth-friendly-computer/

ROG Strix GL702ZC is world’s first laptop with 8-core AMD Ryzen 7 1700 CPU.
https://www.asus.com/Laptops/ROG-Strix-GL702ZC/

IBM ThinkPad Laptop Power Series 850.
http://www.osnews.com/story/30782/IBM_ThinkPad_Power_Series_850
https://en.wikipedia.org/wiki/PowerPC_Reference_Platform

Rambus – No Need to Reinvent the Wheel – How Easy It Is to Build with RISC-V.
https://www.rambus.com/blogs/no-need-to-reinvent-the-wheel-how-easy-it-is-to-build-with-risc-v/

TSMC – First 7nm EUV Chips Taped Out and 5nm Risk Production in Q2 2019.
https://www.anandtech.com/show/13445/tsmc-first-7nm-euv-chips-taped-out-5nm-risk-in-q2

Raptor Computing Reveals More Details About Blackbird Low Cost POWER9 Board.
https://www.phoronix.com/scan.php?page=news_item&px=Raptor-Blackbird-Details

RAS Differentiates IBM Power Systems Platform.
http://ibmsystemsmag.com/power/businessstrategy/competitiveadvantage/ras-differentiates-ibm-power-systems/?platform=hootsuite

Life

What’s a senior engineer’s job?
https://jvns.ca/blog/senior-engineer/

How to Get Things Done When You Don’t Feel Like It.
https://queue.acm.org/detail.cfm?id=3280677

Other

These Magical Sunglasses Block All Screens Around You.
https://www.wired.com/story/irl-glasses-screen-blocking/

Firefox removes core product support for RSS/Atom feeds.
https://www.gijsk.com/blog/2018/10/firefox-removes-core-product-support-for-rss-atom-feeds/

Relative performance of C and Rust.
http://dtrace.org/blogs/bmc/2018/09/28/the-relative-performance-of-c-and-rust/

EOF

FreeBSD Desktop – Part 17 – Configuration – Automount Removable Media

In this article in the FreeBSD Desktop series I will introduce various methods to automatically (or not) mount external/removable devices such as USB or eSATA disks/pendrives or SD/microSD flash cards.

You may want to check other articles in the FreeBSD Desktop series on the FreeBSD Desktop – Global Page where you will find links to all episodes of the series along with table of contents for each episode’s contents.

One of the FreeBSD daemons is devd(8) – the device state change daemon that provides a way to have userland programs run when certain kernel events happen. Such events are when new block device appears/disappears from the /dev directory.

For this problem about 2013 I created a devd(8) based solution – the automount daemon. Its workflow is very simple. When new ada/da/mmcsd* device appears then it tries to detect the filesystems on these partitions/slices and mount them. It you remove such device (device disappears) then it forcefully unmounts it and cleans used mountpoint from the /media directory.

It is available on GitHub - https://github.com/vermaden/automount - and in the FreeBSD Ports as sysutils/automount port. You can also install it as pkg(8) package. Its 2018 and various other solutions appeared in the meantime. One is the included in the FreeBSD base system autofs(8)/automount(8) subsystem.

The other one is dsbmd/dsbmc – a media mounting daemon/automounter for FreeBSD with optional graphical GTK+ frontend. There is also FreeBSD base system solution called autofs(8) which I was not able to make work.

One has to also remember that to mount any FUSE based filesystem the FreeBSD FUSE kernel module needs to be loaded. To enable loading FUSE kernel module at boot add fuse_load=YES line to the /boot/loader.conf file and to load it on the running system just type the kldload fuseΒ command.

Below I will try to compare all their features, strengths and weaknesses.

  • sysutils/automount
    + can customize mount options for each filesystem type
    + written in POSIX /bin/sh script – easy to modify
    + can open selected file manager when device is inserted
    + provides /var/log/automount.log log file
    + supports MTP devices (Android phones for example)
    + supports XFS and HFS
    - does not support BTRFS (can be added)
  • sysutils/dsbmd
    + can customize mount options for each filesystem type
    + supports MTP devices (Android phones for example)
    + provides graphical fronted in GTK+ toolkit
    + can open selected file manager when device is inserted
    + supports BTRFS/HFS/XFS
    + provides /var/log/dsbmd.log log file
    - sometimes hangs at 100% cpu usage
  • autofs(8)
    + supports MTP devices (Android phones for example)
    + is available in the base system
    - does not allow custom mount options per filesystem
    - does not provide log file
    - does not support BTRFS/HFS/XFS (can be added)
    - mount being done only after interaction with /media/* dir
    - removed device is not unmounted automatically

Up to this day I used mine sysutils/automount exclusively as removable devices automount solution. For Android phones I used simple-mtpfs command within xterm(1) terminal. I tried sysutils/dsbmd along with sysutils/dsbmc-cli and GTK+ graphical sysutils/dsbmd frontend and I really liked it but it sometimes fails me with 100% cpu usage and requires restarting. That does not happen withΒ sysutils/automount which just works so I will stick to it but I will provide an update later with results after longer period of testing the sysutils/dsbmd daemon.

sysutils/automount

First I will describe daemon that I used since 2013. The sysutils/automount solution. Its installation and setup is very easy, just add the automount package using pkg(8). Nothing more is needed as the pkg(8) will restart devd(8) after adding new configuration files.

# pkg install automount

One of the nice features of sysutils/automount is /var/log/automount.log log file which has all details about mounted filesystems.

% tail /var/log/automount.log
2018-10-08 12:18:45 /dev/da0s1: mount (fat)
2018-10-08 12:19:23 /dev/da0: detach
2018-10-08 12:19:23 /dev/da0: mount point '/media/da0' removed
2018-10-08 12:19:23 /dev/da0s1: detach
2018-10-08 12:19:23 /dev/da0s1: mount point '/media/da0s1' removed
2018-10-09 11:38:14 /dev/da0: random wait for '0.1' seconds before 'attach' action
2018-10-09 11:38:14 /dev/da0: attach
2018-10-09 11:38:14 /dev/da0: mount (exfat)
2018-10-09 11:44:02 /dev/da0: detach
2018-10-09 11:44:02 /dev/da0: mount point '/media/da0' removed

The sysutils/automount comes with /usr/local/etc/automount.conf configuration file which has these options on my box.

% cat /usr/local/etc/automount.conf
USERUMOUNT=YES
ATIME=NO
REMOVEDIRS=YES
FM="caja --browser --no-desktop"
USER=vermaden
ENCODING=pl_PL.UTF-8
CODEPAGE=cp852

Besides not supporting (yet) MTP devices it just works. It is also very simple solution and being written in POSIX /bin/sh script it is very easy to modify it to one’s needs.

sysutils/dsbmd

The second option is the sysutils/dsbmd solution. Check the links below for more detailed description of this automounting daemon.

To install the dsbmd/dsbmc/dsbmc-cli trio just use pkg(8).

# pkg install dsbmc-cli dsbmc dsbmd

To configure dsbmd/dsbmc/dsbmc-cli trio these steps are needed.

1. Add dsbmd_enable=YES to your /etc/rc.conf file.

2. Install additional filesystems support depending on your needs:

  • fusefs-exfat
  • fusefs-gphotofs
  • fusefs-ntfs
  • fusefs-simple-mtpfs (MTP)
  • fusefs-ext2
  • fusefs-hfsfuse
  • fusefs-lkl

3. Add these lines below to your ~/.xinitrc file (or ~/.xsession).

# DSB AUTOMOUNTER
  dsbmc-cli -a &
  dsbmc &

You will then see the dsbmc icon in the system tray area.

dsbmc-tray

By default dsbmd will mount storage devices as regular user but You need to make sure that vfs.usermount=1 is in your /etc/sysctl.conf file and applied.

After I put the FAT32 or exFAT USB device it was automatically mounted.

/dev/da0 on /media/da0 (msdosfs, local, nosuid, mounted by vermaden)

The configuration file is available at /usr/local/etc/dsbmd.conf location. The dsbmd also comes with /var/log/dsbmd.log log file.

% tail /var/log/dsbmd.log
dsbmd: Killing blocking process 85421 ... on Thu Oct 11 16:48:10 2018
dsbmd: Sending SIGTERM to 85421 ... on Thu Oct 11 16:48:10 2018
dsbmd: Command /usr/local/sbin/mount.exfat ${DSBMD_DEVICE} "${DSBMD_MNTPT}" executed by UID 1000 failed with code 15: No error: 0 on Thu Oct 11 16:48:11 2018
dsbmd: Device /dev/da0 mounted on /media/GMS by UID 1000 on Thu Oct 11 16:48:12 2018
dsbmd: Device /dev/da0 unmounted from /media/GMS by UID 1000 on Thu Oct 11 16:49:09 2018
dsbmd: Device /dev/da0 mounted on /media/GMS by UID 1000 on Thu Oct 11 16:49:15 2018
dsbmd: Device /dev/da0 unmounted from /media/GMS by UID 1000 on Thu Oct 11 16:49:16 2018
dsbmd: Client with UID 1000 disconnected on Thu Oct 11 16:52:53 2018
dsbmd: Client with UID 1000 connected on Thu Oct 11 16:52:55 2018
dsbmd: Device /dev/da0 mounted on /media/GMS by UID 1000 on Thu Oct 11 16:58:22 2018

The dsbmd can also be configured with many useful options like mount(8) options for each filesystem type separately.

% grep _opts /usr/local/etc/dsbmd.conf | sed 's|\#\ ||g' | awk '{print $1}' | sort -u
cd9660_opts
exfat_opts
ext_opts
ext4_opts
msdosfs_opts
ntfs_opts
ufs_opts

The main GTK+ dsbmc window looks as follows.

dsbmc-prefs.jpg

You can also disable automatic mounting and can mount devices by hand with dsbmc tool.

dsbmc-mount.png

… or unmount them.

dsbmc-unmount.png

It is also a solution used in the NomadBSD portable distribution.

It sometimes fails with 100% cpu usage or with error message as this one:

dsbmc-error

autofs(8)

Last one is the FreeBSD base system solution.

To enable it one should do these steps:

  1. Add autofs_load=YES to your /boot/loader.conf file.
  2. Add autofs_enable=YES to your /etc/rc.conf file.
  3. Uncomment the /media -media -nosuid line in /etc/auto_master file.
  4. In the /etc/devd.conf file you need to add (or uncomment) the following content.
    notify 100 {
      match "system" "GEOM";
      match "subsystem" "DEV";
      action "/usr/sbin/automount -c";
    };
    
  5. To have MTP support you will also have to install sysutils/fusefs-simple-mtpfs and add the /mtp -simple-mtpfs -allow_other line to the /etc/auto_master file. Along with fuse_load=YES in the /boot/loader.conf file.

After doing all these I restarted the autofs(8) daemons.

# grep -r autofs_enable /etc
/etc/rc.d/automountd:rcvar="autofs_enable"
/etc/rc.d/autounmountd:rcvar="autofs_enable"
/etc/rc.d/automount:rcvar="autofs_enable"
/etc/defaults/rc.conf:autofs_enable="NO" # Run autofs daemons.
# /etc/rc.d/automountd onestop
# /etc/rc.d/autounmountd onestop
# /etc/rc.d/automount onestop
# /etc/rc.d/automountd onestart
# /etc/rc.d/autounmountd onestart
# /etc/rc.d/automount onestart

Now after attaching the USB drive the /var/log/messages file shows following information.

# tail /var/log/messages
Nov 21 13:37:42 t420s kernel: ugen2.4:  at usbus2
Nov 21 13:37:42 t420s kernel: umass0 on uhub4
Nov 21 13:37:42 t420s kernel: umass0:  on usbus2
Nov 21 13:37:42 t420s kernel: umass0:  SCSI over Bulk-Only; quirks = 0x8100
Nov 21 13:37:42 t420s kernel: umass0:4:0: Attached to scbus4
Nov 21 13:37:42 t420s kernel: da0 at umass-sim0 bus 0 scbus4 target 0 lun 0
Nov 21 13:37:42 t420s kernel: da0: {USB DISK 3.0 PMAP} Removable Direct Access SPC-4 SCSI device
Nov 21 13:37:42 t420s kernel: da0: Serial Number EC0068F1F89A7D02
Nov 21 13:37:42 t420s kernel: da0: 40.000MB/s transfers
Nov 21 13:37:42 t420s kernel: da0: 14786MB (30283008 512 byte sectors)
Nov 21 13:37:42 t420s kernel: da0: quirks=0x3

When you now check the contents of the /media directory it will contain the da0 dir.

# ls -l /media
total 1
drwxr-xr-x  3 root  wheel  512 2018.11.21 13:37 da0/

The drive/directory is not mounted yet, but when you will try to access that da0 dir (for example display its contents with ls(1) or try to enter it with cd(1) command) then it will get automatically mounted).

# mount | grep media
map -media on /media (autofs)
# ls /media/da0
NLUUG/  OTHER/
# mount | grep media
map -media on /media (autofs)
/dev/da0 on /media/da0 (msdosfs, asynchronous, local, noatime, nosuid, automounted)

After I removed the USB drive the /media/da0 directory remained mounted.

# tail /var/log/messages
Nov 21 13:52:48 t420s kernel: ugen2.4:  at usbus2 (disconnected)
Nov 21 13:52:48 t420s kernel: umass0: at uhub4, port 2, addr 4 (disconnected)
Nov 21 13:52:48 t420s kernel: da0 at umass-sim0 bus 0 scbus4 target 0 lun 0
Nov 21 13:52:48 t420s kernel: da0: {USB DISK 3.0 PMAP}  s/n EC0068F1F89A7D02 detached
Nov 21 13:52:48 t420s kernel: (da0:umass-sim0:0:0:0): Periph destroyed
Nov 21 13:52:48 t420s kernel: umass0: detached
Nov 21 13:52:49 t420s kernel: uhub_reattach_port: giving up port reset - device vanished

The autofs(8) subsystem did not unmounted it automatically.

# mount | grep media
map -media on /media (autofs)
/dev/da0 on /media/da0 (msdosfs, asynchronous, local, noatime, nosuid, automounted)

Of course manual unmounting by hand works (umount /media/da0) but its not what you expect from automounting daemon. It is not very suitable for the desktop usage because of the need to manually ‘access’ the created /media/* directory each time to make it mount.

History

Historically was also sysutils/am-utils – the Berkeley Automounter and Suite of Utilities – and sysutils/automounter which provides scripts to dynamically configure amd(8) daemon.

UPDATE 1 – Make autofs(8) Work

I have reworked the autofs(8) section to make it work. Thanks to the author of the autofs(8) subsystem – trasz – for showing me the source of the problem. The needed entry in the /etc/devd.conf file was missing in the original post. Now it works as advertised, at least for mounting. I am still not able to make it unmount the directory automatically after USB drive removal.

UPDATE 2 – The sysutils/automount 1.5.9 Update

Recently I implemented MTP support (Android phones for example) into the sysutils/automount script. I also added HFS and XFS support. Various fixes and other speed improvements were done (like removal of unneeded __random_wait() function or DELAY time reduction from 1 to just 0.1 second).

The new version is not yet available in the FreeBSD Ports (or packages). Grab it directly from the GitHub page available here:

The ‘manual’ installation is not hard, first built these Ports (or add as packages):

  • sysutils/exfat-utils (for exFAT support)
  • sysutils/fusefs-exfat (for exFAT support)
  • sysutils/fusefs-ntfs (for NTFS read write support)
  • sysutils/fusefs-ext4fuse (for EXT4 support)
  • sysutils/fusefs-simple-mtpfs (for MTP support)
  • sysutils/fusefs-hfsfuse (for HFS support)
  • sysutils/fusefs-lkl (for XFS support)

Then download automount/automount.conf/automount_devd.conf files from GitHub page. Put them into appropriate places and make automount executable. Then restart the devd(8) daemon.

# fetch https://raw.githubusercontent.com/vermaden/automount/master/automount
# fetch https://raw.githubusercontent.com/vermaden/automount/master/automount.conf
# fetch https://raw.githubusercontent.com/vermaden/automount/master/automount_devd.conf
# cp automount.conf      /usr/local/etc/automount.conf
# cp automount_devd.conf /usr/local/etc/devd/automount_devd.conf
# cp automount           /usr/local/sbin/automount
# chmod +x               /usr/local/sbin/automount
# /etc/rc.d/devd restart

Now plugin Your USB thumb drive and have fun πŸ˜‰

Also forgot one thing, it also requires x11/zenity port or package for MTP.

UPDATE 3 – The sysutils/automount 1.6.1 Update

A new version 1.6.1 of sysutils/automount is available with the following fixes:

  • Fix MBR/msdosfs partition unmount issue.

As its not yet available in the FreeBSD Ports please use manual procedure.

Download and unpack the automount-1.6.1.tar.gz file.

Then copy its files to appropriate places as shown below.

# cp automount.conf      /usr/local/etc/automount.conf
# cp automount_devd.conf /usr/local/etc/devd/automount_devd.conf
# cp automount           /usr/local/sbin/automount
# chmod +x               /usr/local/sbin/automount
# /etc/rc.d/devd restart

UPDATE 4 – Major sysutils/automount 1.7.0 Update

Thanks to Rozhuk Ivan who reworked some of sysutils/automount code the new 1.7.0 version is now ready and available.

The changelog is pretty impressive this time:

  • New options available in automount.conf config file.
  • Filesystem detection/mounting reworked totally with file(1)/dd(1)/fstyp(8) as backends.
  • Notifications are now possible with libnitify(8) library.
  • Automatic detection of DISPLAY variable.
  • New automatic wait for device appearance.
  • New detection if device is a block device.
  • Introduction of CD-ROM support.
  • Automatic detection of File Manager with exo-open(1).
  • Option REMOVEDIRS is deprecated now.
  • Handle ‘-o large’ option for FAT under FreeBSD 11.x and 12.x versions.

As its not yet available in the FreeBSD Ports please use manual procedure.

Download and unpack the automount-1.7.0.tar.gz file.

Then copy its files to appropriate places as shown below.

# cp automount.conf      /usr/local/etc/automount.conf
# cp automount_devd.conf /usr/local/etc/devd/automount_devd.conf
# cp automount           /usr/local/sbin/automount
# chmod +x               /usr/local/sbin/automount
# /etc/rc.d/devd restart

UPDATE 5 – Minor sysutils/automount 1.7.1 Update

The major rewrite of sysutils/automount 1.7.0 bring some limitations and problems. This is where 1.7.1 comes with small needed updates.

The changelog is quite small this time:

  • Fixed the mounts with USER option from config file.
  • Made MTP filesystem detection and mount better.
  • Add another check if filesystem is not already mounted.

I have already made a PR so it should be soon available in the FreeBSD Ports.
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242405

… but if you want to get it faster, then download and unpack the automount-1.7.1.tar.gz file.

Then copy its files to appropriate places as shown below.

# cp automount.conf      /usr/local/etc/automount.conf
# cp automount_devd.conf /usr/local/etc/devd/automount_devd.conf
# cp automount           /usr/local/sbin/automount
# chmod +x               /usr/local/sbin/automount
# /etc/rc.d/devd restart

Regards.

UPDATE 6 – Minor sysutils/automount 1.7.2 Update

Changelog for this release:

  • Phase out support for sysutils/fusefs-ext4fuse port.
  • Fix UMASK for exFAT filesystems.
  • Fix ISO9660 mount options.

It has already been committed to the FreeBSD Ports tree:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246026

… but if you want to get it faster, then download and unpack the automount-1.7.2.tar.gz file.

Then copy its files to appropriate places as shown below.

# cp automount.conf      /usr/local/etc/automount.conf
# cp automount_devd.conf /usr/local/etc/devd/automount_devd.conf
# cp automount           /usr/local/sbin/automount
# chmod +x               /usr/local/sbin/automount
# /etc/rc.d/devd restart

Regards.

EOF

Β 

Valuable News – 2018/10/07

The Valuable News weekly series is dedicated to provide summary about news, articles and other interesting stuff mostly but not always related to the UNIX or BSD systems. Whenever I stumble upon something worth mentioning on the Internet I just put it here so someone else can

Today the amount information that we get using various information streams is at massive overload. Thus one needs to focus only on what is important without the need to grep(1) the Internet everyday. Hence the idea of providing such information ‘bulk’ as I already do that grep(1).

UNIX

Using Dummynet for Traffic Shaping on FreeBSD.
https://www.hyperois.com/members/knowledgebase.php?action=displayarticle&id=1

HardenedBSD 1100056.6 Released.
https://hardenedbsd.org/article/op/2018-09-30/stable-release-hardenedbsd-stable-11-stable-v11000566

Cache Invalidation Bug in Linux Memory Management.
https://googleprojectzero.blogspot.com/2018/09/a-cache-invalidation-bug-in-linux.html

IBM is responsible for making \ the path separator instead of / in MS-DOS.
https://twitter.com/fahickman/status/1045809677827596288
https://github.com/Microsoft/MS-DOS/blob/master/v2.0/source/README.txt

State of Memory Safety in Linux.
https://blog.araj.me/state-of-memory-safety-in-linux/

Haiku R1/Beta1 Released.
http://www.osnews.com/story/30758/Haiku_R1_beta_1_released
https://www.haiku-os.org/get-haiku/release-notes/

FreshRSS – free self-hostable aggregator.
https://freshrss.org/

Miniflux is a minimalist and opinionated feed reader.
https://miniflux.app/

Using very old ZFS filesystem can give you kernel panic on Linux.
https://utcc.utoronto.ca/~cks/space/blog/linux/ZFSOldFilesystemPanic

OpenBSD vmd(8) now works out of the box on AMD Ryzen.
https://twitter.com/LeoUnglaub/status/1046058268555186176

The origin of the name POSIX.
https://stallman.org/articles/posix.html

PostgreSQL Per-Table Autovacuum Tuning.
https://www.keithf4.com/per-table-autovacuum-tuning/

Sequence Caching: Oracle vs. PostgreSQL.
https://seiler.us/2018-10-02-sequence-caching-oracle-vs-postgresql/

Polish BSD User Group.
https://oshogbo.vexillium.org/blog/55/

OpenSSH 2.3-7.4 Mass Username Enumeration (CVE-2018-15473).
https://github.com/trimstray/massh-enum

The POWER9 Desktop is Now Official!
https://twitter.com/PCzanik/status/1047782986660364290

If you were the Linus Torvalds of FreeBSD what would be the first thing you would change?
https://twitter.com/freebsdbytes/status/1047563491828277253

BSD Now 266 – File Type History.
https://www.jupiterbroadcasting.com/127441/file-type-history-bsd-now-266/

OpenBSD on the Desktop: some thoughts.
https://blog.gsora.xyz/openbsd-on-the-desktop-some-thoughts/

Installing Gophernicus in OpenBSD.
http://gopher.solobsd.org/gophernicus.html?utm_source=discoverbsd

FreeBSD finally updates GNOME port to 3.28 version.
https://twitter.com/wezm/status/1047990697838563329
https://svnweb.freebsd.org/ports?view=revision&revision=480951
https://help.gnome.org/misc/release-notes/3.28/

FreeBSD – FCP-0101 – Deprecating Most 10/100 Ethernet Drivers.
https://lists.freebsd.org/pipermail/freebsd-stable/2018-October/089717.html

In Other BSDs for 2018/10/06.
https://www.dragonflydigest.com/2018/10/06/21880.html

DTrace is coming to Windows. Already available on FreeBSD/macOs/Illumos. The only holdout is Linux.
https://twitter.com/TheGlasspelican/status/1048405923318943744
https://youtu.be/tG8R5SQGPck?t=732

Announcing pkgsrc-2018Q3 Release.
https://mail-index.netbsd.org/tech-pkg/2018/10/05/msg020326.html?utm_source=discoverbsd

Migrating OmniOS VM from KVM to bhyve.
https://omniosce.org/info/bhyve_migrate

FreeBSD diskinfo -wS (synchronous writes) bandwidth limits on Optane devices.
https://twitter.com/nickprincipe/status/1048251974532124673

First SmartOS snapshot with bhyve support as alternative hypervisor to QEMU/KVM.
https://bsd.network/@sehnsucht/100843128594097501
http://us-east.manta.joyent.com/Joyent_Dev/public/SmartOS/smartos.html#20180315T080815Z
https://github.com/joyent/smartos-live/commit/48cb3c49e1a9c4cf204a59bed8312b0096f6209e

FreeBSD amd64: make memset less slow with mov.
https://svnweb.freebsd.org/base?view=revision&revision=339205

Hardware

AMD 12-core (2970WX) and 24-core (2920X) Threadripper 2 CPUs on 29th October.
https://www.anandtech.com/show/13443/amd-announces-availability-of-12-and-24core-threadripper-2-cpus-coming-late-october

RISC-V Inches Toward The Center.
https://semiengineering.com/risc-v-inches-toward-the-center/

Lenovo ThinkPad X1 Extreme / 6-core / 64 GB RAM / GTX 1050 Ti / under 4 pounds.
https://arstechnica.com/gadgets/2018/08/lenovos-thinkpad-x1-extreme-hex-core-gtx-1050-ti-64gb-ram-under-4-pounds/

ARM Partners with Xilinx to Bring Cortex-M Processors to FPGAs.
https://blog.hackster.io/arm-partners-with-xilinx-to-bring-cortex-m-processors-to-fpga-be60b4c77b1a

iDRACula Vulnerability Impacts Millions of Legacy Dell EMC Servers.
https://www.servethehome.com/idracula-vulnerability-impacts-millions-of-legacy-dell-emc-servers/

Wi-Fi Alliance Introduces Wi-Fi 6 (802.11ax) Technology.
Wi-Fi 5 to identify devices that support 802.11ac technology.
Wi-Fi 4 to identify devices that support 802.11n technology
https://www.wi-fi.org/news-events/newsroom/wi-fi-alliance-introduces-wi-fi-6

MicroZed Chronicles: XDF & Versal.
https://blog.hackster.io/microzed-chronicles-xdf-versal-b5a04cd0f973

Intel Customized SoC for HP: Amber Lake-Y with On-Package LTE Modem.
https://www.anandtech.com/show/13434/intel-custom-amber-lake-y-with-lte-modem

High resolution photos of the motherboard that looks almost the same in Bloomberg.
https://twitter.com/1kevin335200/status/1047960097937346566

Life

Insufficient Sleep Associated with Risky Teen Behavior.
https://neurosciencenews.com/sleep-teen-behavior-9938/

Annoying habits of highly effective people.
https://www.economist.com/business/2018/09/29/the-annoying-habits-of-highly-effective-people

Your IQ Matters Less Than You Think.
http://nautil.us/issue/65/in-plain-sight/your-iq-matters-less-than-you-think

Other

World’s Oldest Torrent Still Alive After 15 Years.
https://torrentfreak.com/worlds-oldest-torrent-still-alive-after-15-years-180929/

After Seeing These 15 Maps You’ll Never Look At The World The Same.
http://www.physics-astronomy.org/2018/05/after-seeing-these-15-maps-youll-never.html

EOF