Author Archives: achim

Installing a hard drive with 4 TB on ubuntu server 14.04

Ubuntu 14.04 16.04 LTS Server (no GUI)
installing a harddisk with 4 TB
(in my case a Seagate ST4000VN000 NAS-Drive 4TB 3.5″)

Partitioning the disk with fdisk does not lead to the required result:
$ fdisk – l /dev/sda
shows the 4000 GB but partionning and formatting brings a result of 2,0TB only.
To be seen with
$ df -h

To format the disk with the whole 4000 GB using parted out of the packet gparted is a good choice.
If not yet installed:
$ sudo apt-get install gparted
installs the required program

Veryfy always to work on the desired drive, otherwise your backup will be neccessary to restore data!

With the packet comes also the command line version: parted
unmount the desired drive first, if it is mounted.
$ umount /dev/sda1
in my case.
$ sudo parted /dev/sda1
the parted prompt appears
shows the commands available.
use following two commands for the use of the whole disk:
# mklabel gpt
# mkpart primary 1mib 100%
parted displays the success.
now the disk can be formatted:
$ sudo mkfs.ext4 /dev/sda1

To edit the /etc/fstab file the UUID of the drive is neccessary. You can get it with
$ blkid
$ blkid | grep sda >> /etc/fstab
appends the UUID to the /etc/fstab file. This makes it easier to edit the strange number.
Be careful to use >> otherwise the contents of your
/etc/fstab will be lost!
(making a backuo before doing changes is always a good idea)
The line for this drive should look like this:
UUID=c51e5d77-2c8e-404c-879d-7d9dc758e9ea /drive4T ext4 defaults 0 2

$sudo mkdir /drive4T
$sudo mount -a

If there are no error messages:

$df -h
/dev/sda1  3.6TB
this is the size of a 4TB drive.

Thanks to information of:
These two pages helped me a lot to configure my system

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Finding the IP of my Raspberry Pi

With ssh configured the Raspi can be attached using putty after booting.
But how do I know about the IP the raspi got from DHCP? There are several possibilities to look:
1) If there is a screen attached at console the IP can be read there.
But I operate the raspi in different networks just with LAN and power connected only.
2.) In home networks the  web interface of the router (NetGear, FritzBox or whatever) can tell you the IP.
3) For Android users there is a very nice App called ‚fing‘. This app reports all devices on the local network, and the nice thing is, that it tells also which hardware is connected and tells ‚Raspberry Pi Foundation‘ in case of the raspi. I do not know what apps to use with other mobile equipment, but look in the apps store to find the solution.
4) It can also be usefull to operate with the hostname. From a windows PC there is an easy way to be able to call the raspi by name. Samba has to be configured. To use this service it is only neccessary to install and operate samba:

sudo apt-get install samba samba-common-bin
sudo /etc/init.d/samba start

Now with putty you need not to put in the ip it is also possible to enter the hostname.

The hostname can be changed by editing

sudo vim /etc/hosts
sudo vim /etc/hostname

and chage ‚raspberrypi‘ to ‚YourDesiredHostName‘. A short name can be very usefull.
If you want to know the IP address from the hostname open a cmd-Window (Dos-shell) and type
ping raspberrypi
Ping will tell you  the IP address it is pinging to.
5) If you are logged in you can display the IP address with:

hostname -i


VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)

First Start with Raspberry Pi

After unpacking starting is very easy. There is a lot information available online. Here a few tipps where to look and what to do.
A good choice is the raspberrypi homepage:
What you first need is software to run the device. What you need is the Win32Diskmanager and an image to load. I started with the Raspian „wheezy“. Download both and run the Win32Diskmanager to bring the software to the SD card. For details refer to the quick start guide for beginners linked from the download page of raspberry pi:
After that the raspi is ready for the first run. Connect a keyboard to a USB port a monitor to HDMI-port and power the device with a USB cable, After starting the config menu appears automatically.
To use the entire space of the SDcard select ‚expand_rootfs‘. A good idea is to change the password. ‚change_locale‘ and ‚change_timezone‘ should also be configured.
I prefer running the raspi through a console, so I need ssh to be enabled and I don’t need the desktop to be automatically loaded on boot. Finally update the raspi before leaving the menu.
Now the raspi should be rebooted. This will take a while because the root partition will be reconfigured.
The raspi configuration can be repeated any time with:
sudo raspi-config

The raspi is ready for the first use.

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)

Webseite elegant herunterladen

Manchmal sind interessante Informationen verteilt über viele Dateien einer Webseite. Praktisch herunterladen kann man so etwas mit wget. Die Links werden dabei automatisch korrigiert und php-/asp-generierte Seiten können automatisch als html abgespeichert werden:

wget -r -k -E 5 http://webseite.som/pfad

-r steht für rekursives Laden begrenzt durch die 5 (Tiefe in die in die Subdirectories geschaut wird)
-k besorgt das automatische Konvertieren der Links
-E benent die php/asp-generierten Seiten in html um

wget kann noch vieles mehr, einfach danach suchen!

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

grub reparieren nach Windows Installation

Windows möchte das System nicht teilen und schreibt nur sich selbst in den MS-Bootloader im MBR.
Die grub-Einstellung kann ubuntu reparieren.

Anleitung gemäß

Mitzugehöriger Ubuntu Live CD booten
Ein Terminal öffnen

sudo fdisk -l

Partitionen der Festplatte anzeigen.
Dier Linux-Partition mounten:

sudo mount /dev/sda1 /mnt

(sda1 mit der angezeigten Partition austauschen)

(Wenn Sytem mit separater Boot-Partition muss diese auch gemounted werden:

sudo mount /dev/sda2 /mnt/boot


sudo grub-install --root-directory=/mnt /dev/sda1

(sda1 wieder mit der angezeigten Partition austauschen)

Neustart und Test, dann

sudo update-grub

weitere Methoden auf:
VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)