Clone a directory tree without files

Sometimes you need to clone a whole directory tree but leave make it empty. This is useful if you’re purging out old files and just need to start from scratch. This can be done with:

rsync -vaA –progress -f”+ */” -f”- *” source/ destination/

I like the –progress flag so that I can see what it’s copying and the -A flag keeps ACLs, which can be important in shared environments.… Read the rest

Using a proxy in Linux

Often times you will run into machines that are on a restricted network and you have a proxy server that you can bounce through click over here now. To use a proxy in Linux, set the environment.

export http_proxy=http://server-ip:port/

References:

http://www.cyberciti.biz/faq/linux-unix-set-proxy-environment-variable/

(a) Representative image of AAV2 2 CBA transduced axons in the midsagittal plane from WT and hSOD1G93A in the cervical and lumbar CST.… Read the rest

Setting up new hard drives

Ensure the new drive is seen by the operating system by using any of the following:

tail -f /var/log/messages
ls /dev/sd*
lsscsi (need to install)
lshw (need to install)

Confirm that it is the correct drive:

fdisk -l /dev/sdf      -> You should see a drive w/o any partitions and the correct size

Make a partition on the drive

parted -a optimal /dev/sdf     --> aligns the partition to the nearest boundary.
Read the rest

Linux Software RAID

Create a software raid


Locate your disks:

ls /dev/sd*

Partition the disks:

 fdisk /dev/sdb
 'n' = New partition
 'p' = Primary
 '1'
 accept the defaults
 't' = Change filesystem type
 'fd' = Linux RAID Autodetect
 'w' = write the changes

Once the disk is installed create a partition of type ‘Linux raid autodetect’ (type fd) that is the same size as the remaining drives in the raid.Read the rest

Managing Logical Volumes

Managing Logical Volumes

Creating Volume Groups

Before we can start creating logical volumes, first we need to initialize some of the disks/partitions that we would like to use as storage and place them into a volume group.

pvcreate <physical devices>
vgcreate <volumeGroupName> <physical devices>

Creating Logical Volumes

Now we simply create logical volumes.

Read the rest