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 debian

Solving Debian 8 Jessie resolv.conf update issues

2015/06/18 by sudo

With Debian Jessie, resolv.conf, which stores the name servers for the computer to use when looking up DNS requests, seems to automatically reset every so often. This results in the DNS lookup time for each request sent through the proxy to take longer if the name servers listed are not accurate or fast. For example, my resolv.conf file contained the following by default:

nameserver 192.168.0.1

The IP address listed is that of the router, which for some reason was taking an age to actually respond to requests. Originally I tried to edit this file by hand but it kept clearing itself back to default. This seems to be a particular issue in Debian Jessie.

To resolve the problem, I installed resolvconf, which is a program which has been designed to update the systems information about name servers.

apt-get install resolvconf

Once installed it’s easy enough to add the new name servers to the configuration file. I chose Google’s as a test, since they’re likely to be fast.

nano /etc/resolvconf/resolv.conf.d/head

In the file I added the two IP v4 name servers for google so that it looked like this:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 8.8.4.4

Now that is in there, and of course you can change the name servers as you see fit, it’s just a case of running the update to resolvconf

resolvconf -u

Now your /etc/resolv.conf file should have your two lines prepended to it. Since the file works in top down priority your new requests will be sent to 8.8.8.8 by default. After implementing this Squid increased in speed significantly.

 

You may also be interested in reading alternative solutions on this particular thread at unix.stackexchagne.com.

 

 

Filed Under: Guides, Linux Tagged With: debian, debian jessie, nameservers, resolv.conf

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.

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

Recent Posts

  • System Hang on Ubuntu 24.04 “e1000_print_hw_hang”
  • Disable iLO on HP Microserver Gen8
  • Ubuntu Desktop 24.04 Change Wallpaper Settings
  • Customising Ubuntu Desktop 24.04
  • Remove domains from Let’s Encrypt using Certbot

Tags

API auditing crochet data recovery debian debudding development Dingo API docker email Getting started with Laravel 5 & Dingo API hard drive health HP Microserver KVM Laravel larvel 5 lenovo Linux Minion mint netgear nas networking network shares php PHP development Postfix raspberry pi review samba security SMART smartctl smartmontools smb testing traefik ubuntu ubuntu 18.04 ubuntu 20.04 ubuntu 22.04 ubuntu server vagrant Virtual machines xdebug xubuntu

© Copyright 2015 apt get life