Wiping Disks

How fast can you wipe a complete disk? For this I dumped zeros to a MS Windows partition based on an SSD formatted with NTFS.

[root@i7 ~]# time dd if=/dev/zero of=/dev/sda1 bs=1M
dd: error writing '/dev/sda1': No space left on device
81920+0 records in
81919+0 records out
85898297344 bytes (86 GB, 80 GiB) copied, 182.699 s, 470 MB/s

real    3m2.703s
user    0m0.033s
sys     0m43.470s

It was a real pleasure to get rid of MS Windows after just 3 minutes 😉

Once more, second partition on SSD formatted with NTFS.

[root@i7 ~]# time dd if=/dev/zero of=/dev/sda2 bs=1M
dd: error writing '/dev/sda2': No space left on device
147015+0 records in
147014+0 records out
154155352064 bytes (154 GB, 144 GiB) copied, 326.108 s, 473 MB/s

real    5m26.110s
user    0m0.097s
sys     1m21.503s

Continue reading

Make USB Stick Bootable

In various forums one reads that one should use dd to copy a ISO image to an USB stick. Although this works, more often you do not want to use a ISO image but rather copy a Linux system at hand. First you mount the root filesystem of the new USB stick, then mount /boot within a chroot. Finally use grub commands. I.e., type

mount /dev/sdc2 /mnt/stick
arch-chroot /mnt/stick
mount /dev/sdc1 /boot           <--- /boot is local to chroot!
grub-install --target=i386-pc --boot-directory=/boot /dev/sdc
grub-mkconfig -o /boot/grub/grub.cfg
umount /boot                    <--- umount "local" /boot

Also see GRUB in the Arch Wiki.

Setting the bootable flag in the partition table one either uses gparted, a graphical tool, or, as the task at hand is so simple, one just uses parted.

parted /dev/sdc
set 1 boot on

Unrelated, but often useful. Just in case you changed something in the initial RAM disk, use

mkinitcpio -p linux

Switching from ext4 to btrfs

Hearing all these wonder stories about btrfs I decided to give btrfs a try. Additionally I encrypted my SSD using LUKS.

The relevant entries in the Arch WIKI are: Setting up LUKS and btrfs. Here is the list of commands I used.

1. I saved my data from SSD using tar and saved tar-file on hard-disk:

cd /
time tar cf /mnt/c/home/klm/ssd1.tar bin boot etc home opt root srv usr var

Alternatively one can use cp -a to copy directories with symbolic links. Option -a is the same as -dR --preserve=all.

2. I used gparted to partition the SSD, creating /boot and / (root). For /boot I directly enabled btrfs in gparted.

3. Encrypt the partition.

cryptsetup -y -v -s 512 luksFormat /dev/sdc2

Then open it and give it an arbitrary name:

cryptsetup luksOpen /dev/sdc2 cryptssd

4. Create filesystem using btrfs. This is the reason for all this effort. Although this is the easiest.

mkfs.btrfs /dev/mapper/cryptssd

5. Adapt /etc/fstab, e.g., with genfstab -U /mnt >> /mnt/etc/fstab

UUID=3b8bb70c-390a-4a9e-9245-ea19af509282       /       btrfs   rw,relatime     0 0
UUID=a8d6c185-0769-4ec5-9088-2c7087815346       /boot   ext4    rw,data=ordered,relatime        0 2

Check results with lsblk -if.

6. Chroot into new system using arch-chroot and put GRUB on it, as usual. Add required directories, first.

mkdir boot proc run sys tmp

Then edit the configuraton file for GRUB:

vi /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="cryptdevice=UUID=5a74247e-75e8-4c05-89a7-66454f96f974:cryptssd:allow-discards root=/dev/mapper/cryptssd"

grub-install --target=i386-pc /dev/sdb
grub-mkconfig -o /boot/grub/grub.cfg

Keyword :allow-discards after cryptssd is for SSD TRIM. For a mechanical hard drive this keyword should be omitted.

7. Install btrfs utilities and programs on new system if not already installed. Add the btrfs executable to the initial RAM disk, i.e., set the entry for BINARIES.

pacman -S btrfs-progs

vi /etc/mkinitcpio.conf
. . .
. . .
mkinitcpio -p linux

8. Extracting back from the tar-file.

time tar xf /mnt/c/home/klm/ssd1.tar

9. Adding TRIM for SSD:

systemctl status fstrim
systemctl enable fstrim.timer
systemctl start fstrim.timer

Show timers (like crontab -l):

systemctl --type=timer

10. A simple benchmark, as indicated by above time before tar, does not show any performance benefits so far. But performance was not the main motivator, but rather the added functionality, especially taking snapshots.

Downgrading PulseAudio with downgrade.sh

Just upgraded PulseAudio from 9.0-1 => 10.0-2, which was no good, as I was left with no sound.

The bash script downgrade.sh given in Github saved the day. Sound is back. The script is for Arch Linux.


downgrade.sh libpulse pulseaudio pulseaudio-bluetooth

From now on I have to use

pacman -Syu --ignore pulseaudio --ignore libpulse --ignore pulseaudio-bluetooth

to not lose the good version and getting the infected version again.

Victoria Kaspi Public Lecture: The Cosmic Gift of Neutron Stars

A very fine introduction by Prof. Dr. Victoria Kaspi to neutron stars, pulsars, magnetars, binary pulsars. Explaining their use in test for general relativity, and detection of gravitational waves.

She also mentions Einstein@Home.

Homepage of Prof. Kaspi is here. A recent (6-Jan-2017) observation by Prof. Kaspi was given by NASA. She was a pupil and Ph.D. candidate under Joseph Taylor (K1JT).

Arnold Heinrich Klausmeier

On 16-Dec-2016 my father died after a long and suffering disease.

Born on 28-Nov-1934, he witnessed World-War-II, 1939-1945, separation of Germany, Suez Crisis, 1956, Cuban Missile Crisis, 1962, Vietnam War, Chinese Cultural Revolution, 1966-1976, but also the German reunification, and the Euro.

As requested by my father we four children each held a funeral eulogy.

In school:

Continue reading

Cablesurf Channel Statistics

Cablesurf is a German internet-cable-provider. They deliver Technicolor modem and set-top boxes to the end customers.

My cable modem model is:

HW Revision       1.0            VENDOR           Technicolor
BOOT Revision     2.4.0          SW Revision      STDD.01.05
MODEL             TC7200.20      Software Version STDD.01.05
Serial Number     00997509604426		
Mta Serial Number 00997509604426

Software Build and Revision
Firmware Name         TC7200.20-DD.01.05-150924-F-1FF.bin
Firmware Build Time   11:45:59 Thu Sep 24 2015

Signal/Noise ratio for downstream is:

Channel	Lock     Modulation  Channel   Symbol   Freq  Power      SNR
        Status               ID        Rate
1       Locked   QAM256      145       6952000        4.1 dBmV   40.3 dB
2       Locked   QAM256      146       6952000        4.4 dBmV   40.4 dB
3       Locked   QAM256      147       6952000        4.8 dBmV   40.8 dB
4       Locked   QAM256      148       6952000        5.1 dBmV   40.8 dB
5       Locked   QAM256      149       6952000        5.2 dBmV   40.8 dB
6       Locked   QAM256      150       6952000        5.0 dBmV   40.8 dB
7       Locked   QAM256      151       6952000        4.7 dBmV   39.9 dB
8       Locked   QAM256      152       6952000        4.1 dBmV   40.3 dB

Signal/Noise ratio for upstream is:

Channel	Lock    Modulation   Channel   Symbol   Freq   Power
        Status               ID        Rate
1       Locked  QAM64        1         5120 Ksym/sec   45.5 dBmV
2       Locked  QAM64        2         5120 Ksym/sec   47.0 dBmV
3       Locked  QAM64        3         5120 Ksym/sec   47.0 dBmV
4       Locked  QAM64        4         5120 Ksym/sec   47.5 dBmV

I ordered 120MBit/s, but speed according T-Online speedtest is as follows:

I attribute the drop from the bought speed to peering between Telekom and Cablesurf.

Checking my Unitymedia connection with T-Online speedtest gives: