Wednesday, January 23, 2013
Live System Rescue Environments. CD / USB Stick
Live Rescue CD / USB Stick.
We all know the Situation...
You reboot a system and surprise its not booting anymore.
Or you get a call from someone and he is asking for your help.
Maybe its an HDD Failure or a Virus or Just to reset a Windows Password.
There are some great projects that focus on System Rescue Environments.
And its always nice to have a USB Stick with all your tools to save the day :)
2 good rescue environments i use...
You can boot them from CD or USB..
even create a multi boot USB Stick with both of them and bunch of Linux Distros
Multi boot USB creator
http://www.pendrivelinux.com/
i used http://www.pendrivelinux.com/yumi-multib...b-creator/
Trinity Rescue Kit or TRK
http://trinityhome.org
Trinity Rescue Kit or TRK is a free live Linux distribution that aims specifically at recovery and repair operations on Windows machines, but is equally usable for Linux recovery issues. Since version 3.4 it has an easy to use scrollable text menu that allows anyone who masters a keyboard and some English to perform maintenance and repair on a computer, ranging from password resetting over disk cleanup to virus scanning
SystemRescueCd
http://www.sysresccd.org/SystemRescueCd_Homepage
Description: SystemRescueCd is a Linux system rescue disk available as a bootable CD-ROM or USB stick for administrating or repairing your system and data after a crash. It aims to provide an easy way to carry out admin tasks on your computer, such as creating and editing the hard disk partitions. It comes with a lot of linux software such as system tools (parted, partimage, fstools, ...) and basic tools (editors, midnight commander, network tools). It can be used for both Linux and windows computers, and on desktops as well as servers. This rescue system requires no installation as it can be booted from a CD/DVD drive or USB stick, but it can be installed on the hard disk if you wish. The kernel supports all important file systems (ext2/ext3/ext4, reiserfs, btrfs, xfs, jfs, vfat, ntfs), as well as network filesystems (samba and nfs).
Thursday, December 20, 2012
3 TB HDD + Raid 5 + LVM
So i got my new HP Microserver N40L :) and 3x HDDs WD30EFRX.
If you ask your self how to setup a mdadm raid 5 and LVM here is a quick Howto...
My Setup:
1x 4BG USB Stick for the OS Centos 6.3 64 bit.
1x HDD 160GB for temporary HDD work. so i don't have to start the idle raid every time...
3x 3TB HDDs for Raid 5.
Here are the commands i used for the partitioning + Raid 5 + LVM Setup.
Note 1: Do not use "fdisk" if i remember right it does not work with partitions larger then 2TB...
Note 2: Check your system and replace the below commands with your setup... (sdx, sdy).
Note 3: repeat Partitioning steps 2 - 7 for all your Raid Members.
Partitioning:
Raid Setup:
If you ask your self how to setup a mdadm raid 5 and LVM here is a quick Howto...
My Setup:
1x 4BG USB Stick for the OS Centos 6.3 64 bit.
1x HDD 160GB for temporary HDD work. so i don't have to start the idle raid every time...
3x 3TB HDDs for Raid 5.
Here are the commands i used for the partitioning + Raid 5 + LVM Setup.
Note 1: Do not use "fdisk" if i remember right it does not work with partitions larger then 2TB...
Note 2: Check your system and replace the below commands with your setup... (sdx, sdy).
Note 3: repeat Partitioning steps 2 - 7 for all your Raid Members.
Partitioning:
- yum install parted
- parted /dev/sda (see note 2)
- (parted) mklabel gpt
- (parted) unit TB
- (parted) mkpart primary 0.00TB 3.00TB
- (parted) print
- (parted) quit
Raid Setup:
- yum install mdadm
- mdadm --create /dev/md0 --level=raid5 --raid-devices=3 /dev/sda1 /dev/sdb1 /dev/sdc1
- cat /proc/mdstat (you will see that 1 drive is rebuilding. thats normal...)
- yum install lvm2.x86_64
- pvcreate /dev/md0
- vgcreate vgdata1 /dev/md0
- lvcreate --name lvdata1 -l 100%FREE vgdata1
- mkfs.ex4 /dev/vgdata1/lvdata1
Linux Performance Tools To Troubleshoot Problems.
Find your bottlenecks.
What tools or commands are recommended to troubleshoot performance related problems?
Sometimes you need to check HW bottlenecks. the easiest is to use "top" and "iostat" or "dstat"
If you have the time to Setup a "Munin" Server. This is perfect. It will help you analyze Performance and also bottlenecks with nice to view graphs.
basic or essential tools that every Linux or UNIX System Admin should be aware of:
Command Line Tools
top
htop
sar
dstat
vmstat
iostat
free
Web Tools
Munin http://munin-monitoring.org/
Cacti http://www.cacti.net/
Here are some examples
Top - Command
top provides a real time view of a running system.
Sar - Command
sar Collect, report, or save system activity information. It can generate report and email them to sys admin.
CPU and Queue
Disk I/O
Swap and Memory
CPU interrupts, Networking and more...
Iostat - Command
iostat Device Utilization Report and more...
What tools or commands are recommended to troubleshoot performance related problems?
Sometimes you need to check HW bottlenecks. the easiest is to use "top" and "iostat" or "dstat"
If you have the time to Setup a "Munin" Server. This is perfect. It will help you analyze Performance and also bottlenecks with nice to view graphs.
basic or essential tools that every Linux or UNIX System Admin should be aware of:
Command Line Tools
top
htop
sar
dstat
vmstat
iostat
free
Web Tools
Munin http://munin-monitoring.org/
Cacti http://www.cacti.net/
Here are some examples
Top - Command
top provides a real time view of a running system.
Sar - Command
sar Collect, report, or save system activity information. It can generate report and email them to sys admin.
CPU and Queue
Disk I/O
Swap and Memory
CPU interrupts, Networking and more...
Iostat - Command
iostat Device Utilization Report and more...
Wednesday, December 19, 2012
Hard Drives and Smart.
Some Time ago i found a very interesting article from google about HDD's.
I was very surprised from some of the information i found in that document.
for example:
How smart is SMART?
Not very, as Google found, and many in the industry already knew. SMART (Self-Monitoring, Analysis, and Reporting Technology) captures drive error data to predict failure far enough in advance so you can back up. Yet SMART focuses on mechanical failures, while a good deal of a disk drive is electronic, so SMART misses many sudden drive failure modes, like power component failure. The Google team found that 36% of the failed drives did not exhibit a single SMART-monitored failure. They concluded that SMART data is almost useless for predicting the failure of a single drive.
So while your disk drive might crash without warning at any time, they did find that there are four SMART parameters where errors are strongly correlated with drive failure:
The bottom line: SMART can warn you about some problems, but miss others, so you can’t rely on it. So don’t. Back up regularly, and if you do get one of these errors, get a new drive.
If you would like to read your S.M.A.R.T Infos just install "smartmontools".
"yum install smartmontools"
Will give you the information.
google HDD Study: Google HDD Research
I was very surprised from some of the information i found in that document.
for example:
How smart is SMART?
Not very, as Google found, and many in the industry already knew. SMART (Self-Monitoring, Analysis, and Reporting Technology) captures drive error data to predict failure far enough in advance so you can back up. Yet SMART focuses on mechanical failures, while a good deal of a disk drive is electronic, so SMART misses many sudden drive failure modes, like power component failure. The Google team found that 36% of the failed drives did not exhibit a single SMART-monitored failure. They concluded that SMART data is almost useless for predicting the failure of a single drive.
So while your disk drive might crash without warning at any time, they did find that there are four SMART parameters where errors are strongly correlated with drive failure:
- scan errors
- reallocation count
- offline reallocation
- probational count
The bottom line: SMART can warn you about some problems, but miss others, so you can’t rely on it. So don’t. Back up regularly, and if you do get one of these errors, get a new drive.
If you would like to read your S.M.A.R.T Infos just install "smartmontools".
"yum install smartmontools"
# smartctl -a /dev/sda
...
...
...
Will give you the information.
google HDD Study: Google HDD Research
Is hyper-threading enabled on a Linux system
Is hyper-threading enabled on a Linux system ?
When you need to know whether hyper-threading is enabled without the luxury to reboot the system,you can simply look at the output of /proc/cpuinfo and compare the siblings with the cpu cores fields.
The most common answer was to check the values of 'cpu cores' and 'siblings' in /proc/cpuinfo.
When Hyper-Threading is enabled, those values should be different for each logical processor:
# egrep 'siblings|cpu cores' /proc/cpuinfo | head -2
siblings : 12
cpu cores : 6
As you can see on my test System HT is enabled.
Thursday, June 10, 2010
Linux VLAN configuration
here is a small Howto configure VLAN on a linux system.
the required VLAN ID i have to configure is "15". copy the file
/etc/sysconfig/network-scripts/ifcfg-eth0 to /etc/sysconfig/network-scripts/ifcfg-eth0.15
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.15
now we have to edit the new virtual interface ifcfg-eth0.15
vi /etc/sysconfig/network-scripts/ifcfg-eth0.15
replace DEVICE= with your VLAN ID
DEVICE=eth0.15
also add a line VLAN=yes
DEVICE=eth0.15
VLAN=yes
don't forget to set your IP address ;-) also remove gateway entries...
the gateway entries should be only at /etc/sysconfig/network
-- Yaniv
the required VLAN ID i have to configure is "15". copy the file
/etc/sysconfig/network-scripts/ifcfg-eth0 to /etc/sysconfig/network-scripts/ifcfg-eth0.15
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.15
now we have to edit the new virtual interface ifcfg-eth0.15
vi /etc/sysconfig/network-scripts/ifcfg-eth0.15
replace DEVICE= with your VLAN ID
DEVICE=eth0.15
also add a line VLAN=yes
DEVICE=eth0.15
VLAN=yes
don't forget to set your IP address ;-) also remove gateway entries...
the gateway entries should be only at /etc/sysconfig/network
-- Yaniv
Friday, June 4, 2010
QEMU-IMG
the qemu-img command for creating and manipulating disc images.
Creating an image
qemu-img create -f qcow2 your_image_name.qcow2 50GB
will create a new blank image with 50GB in the qcow2 format.
also the qemu-img program can be used to convert images from one format to another. or add compression or encryption to an image.
convert an image
qemu-img convert -O qcow2 test.vmdk testqcow2
get information about an image
qemu-img info your_image
Creating an image
qemu-img create -f qcow2 your_image_name.qcow2 50GB
will create a new blank image with 50GB in the qcow2 format.
also the qemu-img program can be used to convert images from one format to another. or add compression or encryption to an image.
convert an image
qemu-img convert -O qcow2 test.vmdk testqcow2
get information about an image
qemu-img info your_image
Subscribe to:
Posts (Atom)