September 2012
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930

Categories

September 2012
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930

Converting partitions from ext3 to ext4

The new features of ext4 over ext3 motivated me to migrate my ext3 partitions to the new file system. If you want to do the same, here’s the steps yo have to follow.

Converting from ext3 to ext4

Note: The following commands must be run on not mounted partitions. If you are planning to convert […]

Logical Volume Manager (LVM)

In the traditional disk partitioning scheme, administrators plan ahead the use of each partition. For instance, a laptop with 120 GB hard drive, 1 GB RAM can have the following partition scheme:

1 GB for swap (/dev/sda1), 12 GB for root (/dev/sda2), 107 GB for /home (/dev/sda3), meaning, the remaining space.

So far so […]

Job Control

View the currently running jobs:jobs

Place running foreground process into background:ctl-z #puts the job to sleepbg %1

Bring a background job into the foreground:fg %1

Kill a job:kill %1kill %1 -9

Find the PID of all jobsjobs -pjobs -pl

Bring a nohuped process to the foreground# note: I think you can only do this from […]

OpenSSL Usage

List available Ciphers: openssl ciphers -v openssl ciphers -v tls1 #only TLS ciphers openssl list-cypher-commands openssl ciphers -v ‘HIGH’ #only good ciphers

Test OpenSSL Speed: openssl speed openssl speed rsa #test only rsa

Generate self-signed cert: openssl req \ -x509 -nodes -days 365 \ -newkey rsa:1024 -keyout mycert.pem -out mycert.pem OR openssl req […]

SSH PKI

To create ssh keys:ssh-keygen -t dsa -d 2048Optionally leave the passphrase blankThis will create a ~/.ssh/id_dsa and ~/.ssh/id_dsa.pub file.

Check for validity:ssh-keygen -l -f ~/.ssh/id_dsa.pub

Copy the key to the remote server:cat ~/.ssh/id_dsa ssh remote_host ‘sh -c “cat – >>~/.ssh/authorized_keys”‘

Convert commercial (SECSH) ssh private / public key to OpenSSHssh-keygen -i -f id_dsa.pub > id_dsa_openssh.pub […]

GPG Management Commands

Generates key pair:gpg –gen-key

Lists public and private current keys:gpg –list-keysgpg –list-secret-keys

Exports public key / private key:gpg –armor –export jaz@example.comgpg –export-secret-key –armor “jaz@example.com” > private.key

Imports a public key / private key:gpg –import joe.cagpg –allow-secret-key-import –import private.key

Delete public / private key:gpg –delete-key “jaz@example.com”gpg –delete-secret-key “jaz@example.com”

Encrypt a document with someone’s public key:gpg –output […]

LVM Basics

Dependencies needed:Kernel module (version 2.6.9+):Device Drivers > Multi-device support (RAID and LVM) > Device Mapper Support (CONFIG_BLK_DEV_DM)Associated kernel module:dm_mod

Package:lvm2 – lvm toolslibdevmapper

Show LVM version:lvm version

Create the physical disks:pvcreate /dev/hdapvcreate /dev/hdbpvcreate /dev/hdc1pvcreate /dev/hdc2

Show allocated Physical volumes:pvscanpvdisplaylvm pvs

Setup a volume group:vgcreate vg_name /dev/hda /dev/hdb /dev/hdc1 /dev/hdc2

Display a volume group:vgdisplaylvm vgs

[…]

How to add LUN disk online under CentOS 6.2

Environment: CentOS 6.2 64bit with multipath connected to HP EVA storage, the LUN disk was LVM disk Objective: add a new LUN disk for server online and add into the existing LVM to make the partition size bigger scenario: LVM add new lun disk, increase the existing lvm lun disk, increase the existing partition disk […]

Adding and Removing SAN Disks from Linux Device Manager Multipath Systems

Add a new disk

This assumes you have created an array on the SAN and allocated space to a logical volume on it; you have mapped a LUN pointing that logical volume to that host, and that the host is correctly zoned to see the SAN in the fibre channel fabric.

Before anything, run multipath […]

Managing Physical and Logical Volumes

Contents

Introduction Create Logical Volumes Delete Logical Volumes

Introduction

The following article presents an overview of the commands used to manage physical and logical volumes for use with Logical Volume Manager (LVM) in Linux.

Before considering the various commands for LVM, lets first look at just what is meant by some of the terminology […]