Page 2 of 6

Using dd to erase GUID Partition Tables (GPT)

Two disks that I had previously used on an mdadm mirrored raid were complaining about preexisting partition information and apparently thought they still belonged to a raid even though I had already zeroed out the superblocks.  These disks had also been formated with GPT. Mdadm alerted me to the remnants when trying to setup a new raid.

GPT stores its protective MBR, primary GPT header and primary GPT table within the first couple of logical sectors on a disk. Additionally a backup secondary GPT table and secondary GPT header are stored on the last few logical sectors .

Continue reading

Configure a RAID array using mdadm

Redundant Array of Independent Disks

Today we will  demonstrate how to create a mirrored raid using two identical 120GB hard drives. A quick lsblk will help us identify the devices that we will be working with.

lsblk
NAME    MAJ:MIN    RM    SIZE    RO    TYPE    MOUNTPOINT
sda       8:0       0    100G     0    disk
├─sda1    8:1       0     96G     0    part        /
├─sda2    8:2       0      1K     0    part
└─sda5    8:5       0      4G     0    part      [SWAP]
sdb       8:16      0    120G     0    disk
sdc       8:32      0    120G     0    disk
sr0       11:0      1   1024M     0     rom

As a best practice raw disks should be partitioned before creating an array. Additionally the partitions should be sized smaller than the max total size of the physical disk (a few megabytes will suffice). If the need arises to replace one of the disks in the future then this can prove to be useful since they may not be the exact same size and raid likes to deal with identical sizes.

Continue reading

Sorting with Linux

Lately I have been focused on e-mail archive migrations and often I find myself sifting through thousands of log files. The other day I needed to pull  entries from approximately  1500+ logs, roughly 8GB of data. Using grep I was able to pipe out the information that I was looking for into a file that I named execution_times.

grep -E -ron "Execution time:.{0,20}" > /media/RAMDISK-16GB/logs/execution_times

Continue reading

Creating a RAMdisk

RAMdisks are virtual partitions that reside in memory except all data is lost when power is removed from the system. Reads and writes are lighting fast in comparison to standard mechanical and NAND based storage. There can be real performance benefits when used correctly.

Today we will review how to create one on using a Debian-based distribution.

Continue reading

Run rkhunter from a crontab

Rootkit hunter is an open source Unix/Linux based tool that scans for backdoors, rootkits and local exploits on your systems. It scans for suspicious files and works like a file integrity checker.

The team behind rkhunter recommends installing same-class tools like Chkrootkit or OSSEC-HIDS which compliment the overall security of a system. On this entry today we are going to review:

  • How to install rkhunter
  • Create a bash script that can be executed from a crontab
  • Setup the crontab to run daily scans
  • How to prep rkhunter

Continue reading

© 2019 revelset

Theme by Anders NorénUp ↑