Monday, January 30, 2012

How to Enlarge Data Partitions without losing data after Raid expansion in Linux


Scenario : Customer needs to expand Data volume after expanding array size in Linux.
Possibilities : only Last Partitions can be expanded through Resize2fs
Recommendation : Please ask customer to take backup of File systems/system.

Step to be followed: 

Suppose you have a Partition called c0d0p7 in last cylinder and mounted as a ext3.
#df -h
Filesystem                  Size   Used     Avail   Use%       Mounted on 

/dev/cciss/c0d0p2       15G       4.5G     9.3G    33%        /
/dev/cciss/c0d0p1       99M      12M     83M     12%       /boot
None                          4.0G      0          4.0G     0%        /dev/shm
/dev/cciss/c0d0p6       46G      85M     44G      1%        /name1
/dev/cciss/c0d0p7       46G      103M   44G      1%        /name2

1) Un mount  that file system/Mount point
2) Now you have to remove Journal feature ( if it is ext3 file system) from the file system
# tune2fs -O ^has_journal /dev/cciss/c0d0p7 # tune2fs 1.35 (Date)
Now you have to run e2fsck command to check file systems.
3) root@ff13manish /]# e2fsck -f -y /dev/cciss/c0d0p7 
e2fsck 1.35 (Date) Pass
Pass 1: Checking inodes, blocks, and sizes Pass
Pass 2: Checking directory structure Pass
Pass 3: Checking directory connectivity Pass
Pass 4: Checking reference counts Pass
Pass 5: Checking group summary information
/Name2: 16/6111232 files (6.3% non-contiguous), 209772/12209392 blocks
4) Execute the fdisk -l command 
Disk /dev/cciss/c0d0: 220.1 GB, 220122071040 bytes
255 heads, 63 sectors/track, 26761 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Devic Boot                         Start       End              Blocks           Id        System
System /dev/cciss/c0d0p1      1            13              104391            83       linux
/dev/cciss/c0d0p2                14           1925           15358140        83       linux
Linux /dev/cciss/c0d0p3       1926       3455           12289725        82      linux swap
/dev/cciss/c0d0p4               3456         26761       187205445      5         Extended
/dev/cciss/c0d0p5               3456         9535         48837568+      83       Linux
/dev/cciss/c0d0p6              9536          15615       48837568+       83      Linux
/dev/cciss/c0d0p7             15616        21695         48837568+       83    Linux Original Cylinder size with 46GB

Command (m for help): quit 

“Delete the Last partition and create it again”.

5) [root@ff13manish /]# fdisk /dev/cciss/c0d0

The number of cylinders for this disk is set to 26761. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with:

a.Software that runs at boot time (e.g., old versions of LILO)
b.Booting and partitioning software from other OS’s (e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): d
Partition number (1-7): 7

“Don’t Quit here  with save option , you have to continue without coming out from fdisk Menu”
Command (m for help): n
First cylinder (15616-26761, default 15616)
Using default value 15616
Last cylinder or +size or +sizeM or +sizeK (15616-26761, default 26761)

Using default value 26761
Command (m for help): p 
Disk /dev/cciss/c0d0: 220.1 GB, 220122071040 bytes
255 heads, 63 sectors/track, 26761 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot                   Start        End        Blocks            Id     System
/dev/cciss/c0d0p1 *           1             13        104391             83     linux
/dev/cciss/c0d0p2             14           1925     15358140         83     Linux
/dev/cciss/c0d0p3             1926       3455     12289725         82     Linux swap
/dev/cciss/c0d0p4             3456       26761   187205445       5      Extended
/dev/cciss/c0d0p5             3456       9535     48837568+      83     Linux
/dev/cciss/c0d0p6             9536      15615    48837568+      83     Linux
/dev/cciss/c0d0p7             15616    26761    89530213+      83     Linux (Now Size moves to 89 GB)


Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at the next reboot. Syncing disks.
6) Execute Partprobe command 
# partprobe
7) Execute Reszie2fs command
[root@ff13manish /]# resize2fs /dev/cciss/c0d0p7
resize2fs 1.35 (Date)
Resizing the filesystem on /dev/cciss/c0d0p7 to 22382553 (4k) blocks
The filesystem on /dev/cciss/c0d0p7 is now 22382553 blocks long.

8) Now enable ext3 feature in filesystems
tune2fs -j /dev/cciss/c0d0p7
tune2fs 1.35 (Date)
Creating  journal inode: done
This filesystem will be automatically checked every 22 mounts or 180 days, whichever comes first.
Use tune2fs -c or -i to override.
Now check by mounting the filesystems
[root@ff13manish /]# mount  -t ext3 /dev/cciss/c0d0p7  /Name2
[root@ff13manish /]# df -h
Filesystem               Size         Used     Avail     Use%     Mounted on 

/dev/cciss/c0d0p2        15G      4.5G    9.3G        33%          /
/dev/cciss/c0d0p1        99M      12M     83M      12%         /boot
None                             4.0G     0       4.0G        0%          /dev/shm
/dev/cciss/c0d0p6        46G      85M     44G       1%          /Name1
/dev/cciss/c0d0p7        85G      107M    83G      1%         /Name2

Check your data :
[root@ff13vel /]# cd /name2
[root@ff13vel name2]# ls
lost+found  report-4b79378d-0000265d-00000003.zip  RHEL 4 AS UTILITY FOR LINUX
[root@ff13vel name2]# ls -al            
total 104
drwxr-xr-x   4 root root  4096 Feb 17 11:27 .
drwxr-xr-x  29 root root  4096 Feb 17 10:08 ..
drwx------2 root root 16384 Feb 16 17:01 lost+found
-rw-r--r--1 root root 67517 Feb 15 18:27 report-4b79378d-0000265d-00000003.zip
drwxr-xr-x   2 root root  4096 Feb 15 16:57 RHEL 4 AS UTILITY FOR LIN

Sunday, January 29, 2012

Procedure to remove Khatra.exe virus manually

1. Go to task manager and select regsvr.exe(if found), gHost.exe , khatra.exe , Xplorer.exe rt click and select end process tree. press WIN+r or start>RUN

2.type cmd and hit enter
3.GO to the the drive where your OS is installed
4.In the command prompt make sure you get the command line as c:\ or d:\ (this can be achieved by the command "cd .." without quotes)
5.Type attrib -s -h -r khatra.exe Repeat the same process for the location c:\windows\system32
6.type del khatra.exe
7.Follow the same process for gHost.exe & Xplorer.exe as they are also part of the virus. To make sure that the virus is out of you pc ,
check your registry
1.win+R type regedit
2.ctrl+F type in search one by 1 the names of the
3.processes i.e khatra,gHost,Xplorer
4.search the entire registry n go-on deleting the values you find.

Tuesday, January 24, 2012

Maintenance Best Practices for Adaptec RAID Solutions

RAID is the most common method of data protection and most companies rely on the redundancy provided by RAID at various levels to protect them from disk drive failures. RAID’s ability to protect data has become increasingly challenging with the exponential increase in drive capacities and the increased use of less reliable drives.RAID cannot protect data against virus attack, human error, data deletion, or natural or unnatural disaster. RAID cannot protect data beyond its advertised disk drive redundancy (for RAID-1, RAID-10, and RAID-5 one drive failure, for RAID-6 two drive failures, for example). Adaptec Technical Support often sees cases where an array is in a degraded state for a longer period of time and data loss then occurs when a further drive finally fails. The best RAID controller cannot help in this situation. In addition to timely maintenance, periodic backup still remains one of the most critical practices in data operations

THE EFFECT OF MODERN LARGER DISK SIZES AND DRIVE QUALITY ISSUES ON RAID

Hard drive media defects and other drive quality issues have steadily improved over time, even as drive sizes have grown substantially. However, hard drives are not expected to be totally free of flaws. In addition, normal wear on a drive may result in an increase in media defects, or “grown defects,” over time. The data block containing the defect becomes unusable and must be “remapped” to another location on the drive. If a bad block is encountered during a normal write operation, the controller marks that block as bad and the block is added to the “grown defects list” in the drive’s NVRAM. That write operation is not complete until the data is properly written in a remapped location. When a bad block is encountered during a normal read operation, the controller will reconstruct the missing data from parity operations and remap the data to the new location. A condition known as a double fault (“bad stripe”) occurs when a RAID controller encounters a bad block on a drive in a RAID volume and then encounters an additional bad block on another hard drive in the same data stripe. This double fault scenario can also occur while rebuilding a degraded array, leaving the controller with insufficient parity information to reconstruct the data stripe. The end result is a rebuild failure with the loss of any data in that stripe, assuming the stripe is in the user data area.
Today, hard drive capacities have increased remarkably, and the likelihood has grown that one or more media defects will occur over the lifespan of the drive. In addition, large arrays take longer to rebuild than small arrays, thus increasing the amount of time the array is not redundant

OVERVIEW OF STEPS THAT CAN BE TAKEN IN KEEPING WITH RAID BEST PRACTICES 
Perform all recommended driver, controller firmware, and Storage Management application (Adaptec Storage Manager) updates

Install Adaptec Storage Manager:
 Adaptec Storage Manager helps you to monitor and maintain Adaptec RAID controllers, enclosures, and disk drives in your storage space from a single location. When Adaptec Storage Manager is installed on a system, the Adaptec Storage Manager Agent is also installed automatically as a service. It’s designed to run in the background, without user intervention, and its job is to monitor and manage system health, event notifications, tasks schedules, and other on-going processes on that system. It sends notices when tasks are completed successfully, and sounds an alarm when errors or failures occur on that system.

Run regular consistency checks on the system: 
Verification is designed to proactively detect hard disk media defects while the array is online and redundant. A RAID-5 or RAID-6 array is inconsistent when the data and parity do not match. Likewise, a RAID-1 array is inconsistent when the data and mirror do not match.
The verification process issues commands to each drive in the array to test all sectors. When a bad sector is found, the RAID controller instructs the hard drive to reassign the bad sector, and then reconstructs the data using the other drives. The affected hard drive then writes data to the newly assigned good sector. These operations continue so that all sectors of each configured drive are checked, including hot spares. As a result, bad sectors can be remapped before data loss occurs.

Two run modes are available to help enhance flexibility and data protection 
1. Background Consistency Check (auto mode): In this mode, the tool is always on. Adaptec Storage Manager continually and automatically checks your logical drives once they’re in use. Once Background Consistency Check has checked all sectors of the array, it repeats this check indefinitely. As its name indicates, Background Consistency Check is always a background or secondary process. Data I/O remains the highest priority for the RAID subsystem.
Note: With this feature enabled, there may be an impact to performance. To enable Background Consistency Check using Adaptec Storage Manager:
• In the Enterprise View, right-click the controller.
• Select Background Consistency Check and then click Enable

Once enabled, the Background Consistency Check period can be adjusted: 
• In the Enterprise view, right-click the controller.
• Click on Background Consistency Check, then select Change period. The Change Background Consistency Check period window opens.
• Adjust the slider control from Very Slow (365 days) to Fast (10 days). Alternatively, in the New Period field, use the arrow keys to increase or decrease the setting.
• Click OK.

 2. Verify with fix (manual mode):
 This mode is used to perform a single, quick check of the array. After the verification process has checked all sectors of the array, it stops and will not start again until started manually by the administrator. In manual mode, the verification process commands are given a higher priority than in Auto mode so that the check completes significantly faster.
Verify with fix is a data-level check and requires more controller resources to read and compare data. Also, because of the additional resources required, verify with fix is not designed to run continuously. Rather, it should be scheduled to run at a regular interval, preferably during periods of low drive activity, or during system maintenance.

To verify and fix a logical drive using Adaptec Storage Manager:
• In the Logical Devices View, right-click the logical drive.
• Select Verify with fix and confirm that you want to verify
• To begin the verification immediately, click Yes. To schedule the verification, click Schedule, and then set the date and time. You can also choose to set the verification as a recurring task. While the verification is in progress,
the logical drive is shown as an animated icon to indicate that the task is in progress. When the verification is complete, an event notice is generated in the local system’s event log.

Monitor Storage Manager Event Logs: You can see status information and messages about the activity (or events) occurring on your storage space by checking component properties and looking at the Event Viewer and status icons in Adaptec Storage Manager. To open a full-screen version of the event log, click the Events button in the tool bar The event log lists activity occurring in your storage space, with the most recent event listed at the top. Double-click any event to open the Configuration Event Detail window to see more information in an easier-to-read format. Adaptec Storage Manager can be configured to send email messages (or notifications) about events on a system in your storage space. We recommend doing this if your storage space is not managed by a dedicated person, or if that particular system is off-site or not connected to a monitor. Email notifications can help you monitor activity on your entire storage space from any location, and are especially useful in storage spaces that include multiple systems running the Adaptec Storage Manager Agent only.
To set up email notifications:
1.In the Configure menu (on the tool bar), select the system you want, and then select Email Notifications. 2.The Email Notifications window opens. The SMTP Server Settings window opens if you haven’t set up email notifications previously.
3.Enter the address of your SMTP server and the “From” address to appear in email notifications. If an email recipient will be replying to email notifications, be sure that the “From” address belongs to a system that is actively monitored.
4.Click OK to save the settings.
5.In the Email Notifications window tool bar, click Add email recipient. The Add Email Recipient window opens.
6.Enter the recipient’s email address, select the level of events for which the recipient will receive an email, and then click Add. Repeat this Step to add more email recipients. Click Cancel to close the window.

You can also set Adaptec Storage Manager to send status alerts about a specified system to all users who are logged into your storage space. When you set Adaptec Storage Manager to broadcast event alerts, all logged-in users receive messages about all types of events. In Windows, these alerts appear as pop-up messages; in all other operating systems, these alerts appear as console messages

Note:Replace drives that have either failed completely, or are starting to show signs of failing (medium errors, S.M.A.R.T. errors, etc.) immediately

Install Windows Recovery Console in Windows Boot Menu

If you want to repair Windows installation but can’t get into the Recovery Console of the CD Rom as was the problem of one of our readers, then here is way to install the Recovery Console directly inside the Windows Boot Menu

if you want to access the recovery console but you can do this directly from your drive and not CD, so that you don’t have to search the CD in case of a Windows Failure this will be a good procedure
Steps:
1. Insert the Windows XP CD in the CD Drive but make sure that both the service pack in the CD and the one installed are same.
2. Now open Run Box, and type the command X:\i386\winnt32.exe /cmdcons where X is your CD drive letter.
3. A Windows Setup box will come up, click Yes to proceed

4. Another dialog box will come up reading “Windows Recovery Console has been successfully installed”.

Just restart the computer to start using the Recovery Console directly in the computer without the CD

Monday, January 23, 2012

Hide or Show ‘Safely Remove Hardware’ icon from Taskbar

A small informative post for today that lets you know (in case you don’t already know), how to remove and show the “Safely Remove Hardware” icon from Taskbar.
Hiding or removing the icon is not that difficult and if you want to clear your task bar of the green icon then following are the steps
Steps:
1. Right click on the Task Bar and select properties 
2. Now click on the Customize button and in case if it is greyed out then check the box “Hide Inactive Icons” 3. In the list of the Current Items, change the behavior of “safely Remove Hardware” from Hide when Inactive to Always Hide
This is it; the icon will not appear again. Reverse process will make the icon to appear again

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More