apt get life

Life around technology

  • Technology
    • Guides
    • Linux
    • Development
      • Laravel
    • Misc
    • Raspberry Pi
  • Writing
  • Crafts
    • Crochet
    • Model Making
    • Painting
  • Privacy Policy
You are here: Home / Archives for ubuntu

Setting up Display Link drivers on Ubuntu 20.04

2020/06/23 by sudo Leave a Comment

I’ve purchased a Dell “universal” USB 3/USB C docking station featuring Display Link, essentially allowing you to use it to drive external displays with the intention of using it for my laptop when sat at a desk with external monitor, mouse and keyboard. Since I run Ubuntu or Linux Mint as my primary operating system, some extra steps were required to install the Display Link drivers.

The first thing you need to do is download the Display Link drivers from the official website: https://www.displaylink.com/downloads/ubuntu

Once downloaded, it’s a reasonably straight forward process to install the drivers. First thing that’s required is to install pre-requisites

sudo apt-get install dkms libdrm-dev

Next run the downloaded file replacing the version number with whatever the one you downloaded is. (Note, this command assumes you’re in the appropriate directory already):

sudo ./displaylink-driver-5.3.1.34.run

Once finished you should have a message asking if you are running xorg and if you want to reboot. It’s actually best to reboot regardless of your display driver, so select Y for yes and let your machine reboot. Then you should be able to plug in your USB dock and your external devices with them all working.

For more information, the Display Link website actually has some good resources. Checkout their Ubuntu setup guide here: https://support.displaylink.com/knowledgebase/articles/684649

Share this:

  • Twitter
  • Facebook
  • Reddit
  • Tumblr
  • Pinterest

Filed Under: Guides, Linux, Technology Tagged With: DisplayLink, ubuntu, ubuntu 20.04

Setting up a bond and a bridge in Netplan on Ubuntu Server 20.04

2020/06/03 by sudo 1 Comment

I’m in the process of updating my KVM servers from Ubuntu 18.04 to Ubuntu 20.04. Along with the new version of Ubuntu there’s been some changes in netplan.

What I’ve done is edit the default file created after the Ubuntu Server installation /etc/netplan/00-installer-config.yaml and setup the following:

network:
  bonds:
    bond0:
      interfaces:
      - eno1
      - eno2
      parameters:
        mode: active-backup
  ethernets:
    eno1: {}
    eno2: {}
  version: 2
  bridges:
    br0:
      dhcp4: true
      interfaces:
        - bond0
      mtu: 1500
      parameters:
        stp: false
        forward-delay: 4

This has my two interfaces eno1 and eno2 and created bond0 as an active backup. There’s a few different networking modes you can chose from:

Bond ModeDescription
balance-rrRound robin network configuration. Packets are send in sequential order from the first connection listed, going down the chain
active-backupOnly the first connection is used, unless it fails, in which case another connection is used
balance-xorThis uses a transmission policy to route between interfaces and provides both load balancing and fault tolerance
broadcastNot sure why you’d use this – sends data on all interfaces
802.3adThis is an IEEE standard. It does require switches to support the same protocol. This mode aggregates the connection to provide the benefit of bandwidth from all configured interfaces.
balance-tlbManages load between the the network adapters based on demand and availability
balance-albIncludes both transmission load balancing (balance-tlb) and receive load balancing.

Then, the bridge br0 connects to bond0. This is where you configure the network type – DHCP or static IP. In this case I’m using DHCP as the firewall I have in place manages IP address assignments and it has the server set to a static address. If you want to specify a static IP address in this configuration file, you can do it like below:

network:
  bonds:
    bond0:
      interfaces:
      - eno1
      - eno2
      parameters:
        mode: active-backup
  ethernets:
    eno1: {}
    eno2: {}
  version: 2
  bridges:
    br0:
      addresses:
        - 192.168.10.30/24
      dhcp4: false
      gateway4: 192.168.10.1
      nameservers:
        addresses:
          - 192.168.10.1
          - 192.168.10.2
        search: []
      interfaces:
        - bond0

You can find out more information here:
https://netplan.io/examples

There’s a version of this post for 18.04 here (see the comments with suggested fixes):
https://www.aptgetlife.co.uk/setting-up-a-bond-and-bridge-in-netplan-on-ubuntu-18-04/

Share this:

  • Twitter
  • Facebook
  • Reddit
  • Tumblr
  • Pinterest

Filed Under: Guides, Linux, Technology Tagged With: networking, ubuntu, ubuntu 20.04, ubuntu server

mount disk image created with dd using ubuntu

2017/03/05 by sudo

If you’ve cloned a whole drive using dd and you need to access one of the partitions on it here are some steps to follow in order to gain access:

Find the partition start sectors using fdisk -b512 -l. Note that you’re explicitly setting the sector size to 512 bytes and you’ll need to change your command to match your own image file.

fdisk -b512 -l backup_sata.img

You should get output similar to this (note I’ve truncated it to only show the appropriate output):

Device         Boot     Start       End   Sectors   Size Id Type
backup_sata.img1 *         2048    206847    204800   100M  7 HPFS/NTFS/exFAT
backup_sata.img2         206848 237185023 236978176   113G  7 HPFS/NTFS/exFAT
backup_sata.img3      237185024 588070911 350885888 167.3G  f W95 Ext'd (LBA)
backup_sata.img4      588070912 625137663  37066752  17.7G 27 Hidden NTFS WinRE
backup_sata.img5      237187072 588070911 350883840 167.3G  7 HPFS/NTFS/exFAT

Normally sector are 512 bytes, so you can calculate the offset you need in the next command with:

start * 512 = offset

So if you want to mount backup_sata.img5 (partition 5 of the backup image) you’d run 237187072×512=121439780864:

mount -o ro,loop,offset=121439780864 backup_sata.img /backup_sata

Remember to have created /backup_sata or whatever directory you’re mounting to first!

Share this:

  • Twitter
  • Facebook
  • Reddit
  • Tumblr
  • Pinterest

Filed Under: Linux, Technology Tagged With: dd, drive image, mounting images, ubuntu

Checking a hard drive’s SMART status from the Linux command line

2014/06/07 by sudo

SMART (Self-Monitoring Analysis and Reporting Technology) allows you to gather and assess if a hard drive has or is near failure. On Debian and Ubuntu based systems (including both flavors of Mint) the smartmontools package contains everything you need to check your drives.

It’s usually a good idea to make sure your Linux distrobution’s repositories are up to date:

sudo apt-get update

Start by installing the smartmontools package to give you access to the utilities to check your hard drive from the command line:

sudo apt-get install smartmontools

Once the package is installed, you can start checking your hard drives. It’s a good idea to run a short test first. To do this type the command below, replacing /dev/sda with your hard drive.

smartctl --test=short /dev/sda

The command will tell you how long it is going to take to test the drive. Normally this is only a few minutes for a short test but can be hours for a longer one:

=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: “Execute SMART Short self-test routine immediately in off-line mode”.
Drive command “Execute SMART Short self-test routine immediately in off-line mode” successful.
Testing has begun.
Please wait 2 minutes for test to complete.

Once you’ve waited for the drive test to finish you can check the health status of your hard drive. Your first option is a summary telling you if it’s passed or failed:

smartctl -H /dev/sda

If you want more information on the status of your hard drive you can run the following command:

smartctl -a /dev/sda

In the event you find anything you’d consider to be suspicious or your hard drive has been acting strangely you can run a longer test, but this usually takes a few hours to complete:

smartctl --test=long /dev/sda

It’s important to note that a SMART test is only one indication of a failing hard drive. You could test a drive and it pass but still fail the following day. Clicking noises are a good indication of a hard drive that has or is about to fail. You should always have a good backup of all of your data. If your hard drive does fail your disk provider may have tools available on their website to allow you to check them or require you to provide information for an RMA.

Share this:

  • Twitter
  • Facebook
  • Reddit
  • Tumblr
  • Pinterest

Filed Under: Linux, Technology Tagged With: debian, hard drive health, Linux, mint, SMART, smartctl, smartmontools, ubuntu

Recent Posts

  • Solving Error on statfs() system call with cAdvisor and Docker
  • MySQL in Docker for Local Development
  • Laravel Docker Development Environment With PHP7
  • Docker WordPress Increase PHP Max File Size
  • Injecting inbound request headers with Traefik v2

Tags

7zip API auditing Courier MTA crochet data recovery debian debudding development Dingo API docker email Getting started with Laravel 5 & Dingo API hard drive health KVM Laravel larvel 5 lenovo Linux Mail Quota Minion mint netgear nas networking network shares php PHP development Postfix samba security SMART smartctl smartmontools smb smbfs testing traefik ubuntu ubuntu 18.04 ubuntu 20.04 ubuntu server vagrant Virtual machines xdebug xubuntu

© Copyright 2015 apt get life