Friday, December 26, 2008

WORKING WITH TAPE DRIVES


Naming of SCSI tape device

The st driver provides the interface to a variety of SCSI tape devices under Linux.

  • First (auto rewind) SCSI tape device name: /dev/st0
  • Second (auto rewind) SCSI tape device name: /dev/st1
  • First the non-rewind SCSI tape devices: /dev/nst0
  • Second the non-rewind SCSI tape devices: /dev/nst1


Naming of IDE tape device

The ht driver provides the interface to a variety of IDE tape devices under Linux.

  • First (auto rewind) IDE tape device name: /dev/ht0
  • Second (auto rewind) IDE tape device name: /dev/ht1
  • First the non-rewind IDE tape devices: /dev/nht0
  • Second the non-rewind IDE tape devices: /dev/nht1

 

Find out at which block you are with mt command:

 

# mt -f /dev/st0 tell

 

 

Check if tape drive is online: # mt -f /dev/st0 status

OUTPUT :

SCSI 2 tape drive:

File number=0, block number=0, partition=0.

Tape block size 0 bytes. Density code 0x40 (DLT1 40 GB, or Ultrium).

Soft error count since last status=0

General status bits on (41010000):

BOT ONLINE IM_REP_EN

 

Rewind tape drive:# mt -f /dev/st0 rewind

 

Erase tape drive: # mt -f /dev/st0 erase

Copy some content to a tape drive : # tar -cvf /dev/st0 /content_path/content.archive

List files on a tape
: # tar -tvf /dev/st0

Restore from the tape: # tar -xvf /dev/st0

Restore an specific archive: # tar xvf /dev/st0 /folder/archive.dmp

 

Backup directory /www and /home with tar command (z - compressed):

# tar -czf /dev/st0 /www /home

 

Restore /www directory:

# cd /
# mt -f /dev/st0 rewind
# tar -xzf /dev/st0 www

 

Unload the tape:

# mt -f /dev/st0 offline

 

You can go BACKWARD or FORWARD on tape with mt command itself:
Go to end of data:# mt -f /dev/nst0 eod

Goto previous record:# mt -f /dev/nst0 bsfm 1

Forward record:# mt -f /dev/nst0 fsf 1

 

tar backup on tape through ssh

# tar -cvzf /www | ssh root@station.domain.com "cat > /backup/www.tar.gz"

OR

# tar zcvf - /www | ssh root@192.168.1.101 "cat > /backup/www.tar.gz"

Output:

tar: Removing leading `/' from member names
/www/
/www/n/xx.in/
/www/c/zasx.asd/
....
..
 

You can also use dd command for clarity purpose:

# tar cvzf - /www | ssh root@192.168.1.101 "dd of=/backup/www.tar.gz"

It is also possible to dump backup to remote tape device:

# tar cvzf - /www | ssh ssh root@192.168.1.101 "cat > /dev/st0"

OR

you can use mt to rewind tape and then dump it using cat command:

# tar cvzf - /www | ssh ssh root@192.168.1.101 $(mt -f /dev/st0 rewind; cat > /dev/st0)$

You can restore tar backup over ssh session:

# ssh root@192.168.1.101 "cat /backup/www.tar.gz" | tar zxvf - 

Thursday, December 4, 2008

How To Create LVM Partition

Hello Friends,

 

My friend asked me a query regarding the LVM Creation with a new harddisk. So i thought that it might be helpfull to all my friends using LVM on Linux.

 

To create LVM partition when we have a new hard disk installed on our server/system.

 

STEP 1. fdisk /dev/hdb    // create a partition in second HD

 

Now show the partition table on your system using p command.

 

Command (m for help): p          // show partition table


OUTPUT
Disk /dev/hdb: ---.- GB, xxxxxxxxxx bytes
xxxx heads, xx sectors/track, xxxxxx cylinders
Units = cylinders of xxxxx * xxx = xxxxxxxx bytes
 
Device Boot   Start   End   Blocks   Id   System     
 

// nothing

 

Create a new partition using n option

 

Command (m for help): n     // create partition

Command action
  e    extended
  p    primary partition (1-4)

p    // primary

Partition number (1-4): 1   // partition number


First cylinder (x-xxxxx, default 1):   // First cylinder


Using default value 1  Last cylinder or +size or +sizeM or +sizeK (x-xxxxx, default xxxxx):    // Last cylinder


Using default value xxxxx

 

After creation of new partition we need to see our partition table.

 

Command (m for help):  p   // show partition table

 

OUTPUT
Disk /dev/hdb: xxx.x GB, xxxxxxxxxxxx bytes
xxx heads, xx sectors/track, xxxxx cylinders
Units = cylinders of xxxxxxx * xxx = xxxxxxx bytes
 
   Device Boot Start End      Blocks   Id  System 
  /dev/hdb1      x   xxxxx  xxxxxxxxxx 83  Linux     // created

 

Command (m for help): t      // change partition type

Selected partition 1    // number

Hex code (type L to list codes): L    // show list of type

 

Hex code (type L to list codes): 8e    // Linux LVM


Changed system type of partition 1 to 8e (Linux LVM)
 
Command (m for help): p    // show partition table

 

OUTPUT
Disk /dev/hdb: xxx.x GB, xxxxxxxxxxx bytes
xxx heads, xx sectors/track, xxxxx cylinders
Units = cylinders of xxxxx * xxx = xxxxxxxxx bytes
 
Device Boot Start  End       Blocks         Id      System

/dev/hdb1     x     xxxxx    xxxxxxxx   8e   Linux LVM    // changed

 
Command (m for help):  w    // save and exit

 


STEP 2. fdisk -l /dev/hdb // show status

 

 

STEP 3. Now we need to create Physical Volume

 

pvcreate /dev/hdb1      // create Physical Volume

 

If we need to specify partition size, use command as below

 

pvcreate --setphysicalvolumesize 100G /dev/hdb1

 

 

To display status of Physical volume (Optional)

 

pvdisplay /dev/hdb1        // display status

 

STEP 4. We can change the volume size of Physical volume (Optional)

 

pvresize --setphysicalvolumesize 100G /dev/hdb1

 

STEP 5. To show the physical volume

pvs /dev/hdb1

 

STEP 6.  To Scan the Physical volume

pvscan  /dev/hdb1

 

 

Now we can create Logical Volume, using the following steps.

 

1.     lvcreate –L 10G –n lvm1 vg0

2.     lvdisplay // to display the logical volumes.

3.     lvextend –L 20G /dev/vg0/lvm1

4.      resize2fs /dev/vg0/lvm1   //Most important thing to do in last 

 


Note: Here i have used xxx for any number, depands on the size of the harddisk.

Wednesday, November 26, 2008

IE 8.0 shook the Market Share

Hello Friends,


I got good news for Internet Explorer users while I was searching about market share of web browsers. Internet Explorer 8.0 usage share long jumped after its beta2 release. Within three days of its release, usage share was already 500% above the peak beta 1 usage share.

 
As all of us know that beta 1 was primarily a developer's preview, beta 2 is the first release to have the new features intended for the final release. These features include a much improved address bar, private mode browsing, better tabs and improved navigation.

 

As Internet Explorer beta2 version is adding some new features including WebSlices and Activities. In the second beta release, Activities are renamed to Accelerators.

 

Some of the features and changes for the Beta 2 compared to Beta 1.

§                     InPrivate

§                     Delete Browsing History

§                     Search Suggestions

§                     User Preference Protection

§                     Caret Browsing

§                      Accelerators (previously known as Activities)

§                     Web Slices (previously known as WebSlices)

§                     Suggested Sites

§                     Tab Color Grouping

§                     Automatic Crash Recovery

§                     SmartScreen Filter (previously known as the Safety Filter)

§                     Tab isolation

 

Removed features

§                     Inline AutoComplete

§                     The option to delete files and settings stored by addons or ActiveX controls.

§                     CSS Expressions are no longer supported in Internet Explorer 8 Standards mode

 

Reference: http://marketshare.hitslink.com/report.aspx?sample=19&qprid=34&qpcustom=Microsoft+Internet+Explorer+8.0

http://en.wikipedia.org/wiki/Internet_explorer_8

Thursday, November 20, 2008

Windows Data Backup on Linux Server (SyncBack Details)

Hello Friends,

As I have posted my earlier post regarding Windows Data Backup on Linux Server, after reading the comments, I came to know the curiosity my friends to know more about this. As a blogger it becomes my responsibility to give more n more details to my friends.


I am feeling pleasure to give the details. Its completely one time installation and become tension free of your data backup.


Benefits :
1. Modes – Easy/Expert
2. Backup
3. Synchronization
4. Restoration
5. Finding your files (On Source & Destination)
6. Backup Scheduling

Friends, SyncBack works in two modes that are Easy & Expert modes. In Easy mode, we can take and restore backup from one device to another while in Expert mode, we can take and restore backup on remote machines/devices.

SyncBack can be used for Backup of data from Source to Destination and also supports synchronization i.e. compares the files on both source and destination.


Restoration can be done from Destination to Source but Running a restore operation is not reversible. So always be sure of data before restoration.



Data Selection on source and place for data store on destination is very simple. Data can be stored on FTP Server and Samba Server in Expert mode only.


SyncBackSE will run on the following Windows operating systems:
SyncBackSE requires Windows 2000, Windows XP, or Windows 2003


For more details, I think this site is good : http://www.2brightsparks.com/tutorials/tutorials-hub.html. (It will give you lot of help)

Tuesday, November 18, 2008

How to configure Yum Server & Client Configuration

Few days back, We were creating a network for an institute. I had installed a Linux workstation on LAN but after installation I need to install some more packages as per the requirement of client. Though I need to copy packages from CD’s again n again and due to unavailability of Internet, I was unable to use yum update/install from internet.

It was a repeated task for me to do on all workstations, so I made my own YUM SERVER which was very helpful for me to install workstation and update any package through my YUM Server.

Then I thought to share my experience with all my friends who are using Linux and face same kind of conditions and waste our time in installing dependencies n all.

This is the quickest and short method to finish our work in time.

Yum Configuration

For making YUM SERVER

First copy to cd/dvd in the directory /var/ftp/pub

#mount /dev/cdrom /mnt
#cp -rvf /mnt/* /var/ftp/pub
#cd /var/ftp/pub
#cp Server/repodata/……… .xml Server
#cp VT/repodata/………….xml VT
#cp Cluster/repodata/……….xml Cluster
#cp ClusterStorage/repodata/……….xml ClusterStorage
#
#rpm -ivh createrepo.......................
#createrepo -vg ………….xml Server
#createrepo -vg ………….xml VT
#createrepo -vg ………….xml Cluster
#createrepo -vg ………….xml ClusterStorage

#cd /etc/yum.repos.d
#vi server.repo
[Server]
name= Yum Server Repository
baseurl=file:///var/ftp/pub/Server
gpgcheck=0

[VT]
name=Yum VT Server
baseurl=file:///var/ftp/pub/Server
gpgcheck=0

[Cluster]
name=Yum Cluster Server
baseurl=file:///var/ftp/pub/Cluster
gpgcheck=0

[ClusterStorage]
name=Yum ClusterStorage Server
baseurl=file:///var/ftp/pub/ClusterStorage
gpgcheck=0

#yum clean all
#yum list
#yum grouplist

Now here you can see your yum is working.

OK.

Now u test it so install any package.

#yum install system-config-kickstart*

If you want to install a group

#yum groupinstall “Virtualization”

if u want to remove it then

#yum remove system-config-kickstart*

Now Server configurations are done.

Its time to configure on client machine


For making CLIENT

#chkconfig vsftpd on

make a repository file
#cd /etc/repos.d

#vi client.repo

[Server]
name=client server yum
baseurl=ftp://x.x.x.x/pub/Server
gpgcheck=0

[VT]
name=client server yum
baseurl=ftp://x.x.x.x/pub/VT
gpgcheck=0

[Cluster]
name=client server yum
baseurl=ftp://x.x.x.x/pub/Cluster
gpgcheck=0

[ClusterStorage]
name=client server yum
baseurl=ftp://x.x.x.x/pub/ClusterStorage
gpgcheck=0

#yum list




Now u install any package or you go to GUI and see add remove program its working fine and package option are coming that means ok. But note it client should be connected to server in LAN.

Hope, you will also got help from my experience. In case you need any kind of help, please mail me on gaur.vibhor@gmail.com.

Saturday, November 15, 2008

Windows Data Backup on Linux Server

I had a work to take backup of Windows Data Server on my Linux based backup server.

As a user, i never tried for such kind of things specially merging the data of two different platforms. Mostly services offered by the Windows are different from Linux. In Win XP, could not find a suitable service to backup and synchronization of data on live server.

I tried many Open Source utilities like Cygwin, Amanda Backup etc. These are very hectic and needs a lot of hardware involvement and requires a lot of settings.

One of my friends suggested me to try SyncBack at least once.



Its amazing, all the things which i needed found and works, in a very simple graphical settings.

For further queries, please contact me on mail id gaur.vibhor@gmail.com.