Saturday, September 29, 2012

TestDisk and PhotoRec are two mostly used data recovery software in Linux. Both the software are available for Windows as well. Primarily, these software designed to recover lost partition and make non bootable disks bootable again. Partition table recovery using TestDisk is really very easy.

Test Disk and PhotoRec are open source software. So, you can easily get source code of these and change it as per your requirement.

TestDisk software having following capabilities:

·Recover deleted partition

·Recover FAT32/NTFS boot sector from its backup.

·Locate ext2/ext3/ext4 backup Super Block. (In short, superblock is the block which first loads in memory while reading any file.i.e. first block of file)

PhotoRec is software, which is developed to recover lost files including video, lost pictures, documents and archives from hard disks. PhotoRec ignores the file system while recovering files, So it can work even your file system is severely damaged.

For Security purpose, PhotoRec having read only access to media or Disk. If you have accidently deleted files from your drive then don't write any data on this drive or partition till recovering process completes otherwise your deleted files will be overwrite there with new file. One more thing to take care while using PhotoRec, Don't save recovered files on same partition where you are going to run this software.

PhotoRec supports following file system:

·FAT, NTFS, exFAT, ext2/ext3/ext4 and HFS+.

PhotoRec supports following Operating Systems:

·DOS/Windows NT4/2003/XP/7/Vista

·Linux, all BSD OS, Sun Solaris.

More than 390 extensions supports the PhotoRec for recovering purpose. Some of them are zip, office, pdf, html, jpeg and various graphic file formats. PhotoRec works with hard disks, CD-ROMs, memory cards, USB memory drives, DD raw image.

It works same as TestDisk i.e. when we delete any file from partition, it will not delete from partition, just its information like file name, date/time, and link to the superblock deletes. This file will be overwrite if you create or copy data to this partition. PhotoRec only find the superblock of the deleted files and whole file will be recovered.

Wednesday, September 19, 2012

Sometimes, If logs are coming in one in LVM partition and you can't stop application or delete logs. So there is only one way to extend the LVM partition. i.e. Extend Logical Volume. But for extending the logical volume, there is need of enough space (our needed free space) in respective Volume group of that logical volume. Following are the simple steps to extend the Volume Group:

Step1: Check the Volume Group details and free space in that. We have 96MB free space in Volume group (MyVolume). But we need more 500MB space in same Volume Group.

[root@server92 ~]#

[root@server92 ~]# vgs

VG #PV #LV #SN Attr VSize VFree

MyVolume 1 1 0 wz--n- 496.00m 96.00m

vgsrv 1 3 0 wz--n- 4.47g 384.00m

[root@server92 ~]#

[root@server92 ~]#

Step2: We will create a new LVM partition of 500MB in hard disk in which free space is available and then we will create its Physical Volume.

Tuesday, September 18, 2012

If
you know about Logical Volume Concept in Linux, it will be
easier to understand the following steps of creation of logical volume. Before
running the following commands need to understand the concept of Physical
Volume, Volume Group and Logical Volume.

Step 1: Check the free space in hard disk.

[root@server92 ~]# parted

GNU Parted 2.1

Using /dev/sda

Welcome to GNU Parted! Type 'help' to
view a list of commands.

(parted) print free

Model: VMware Virtual disk (scsi)

Disk /dev/sda: 42.9GB

Sector size (logical/physical):
512B/512B

Partition Table: msdos

Number Start
End Size
Type File system Flags

32.3kB 1049kB
1016kB Free Space

1
1049kB 269MB 268MB primary
ext4 boot

2
269MB 5076MB 4807MB
primary
lvm

5076MB 42.9GB
37.9GB Free Space

(parted) ^C

(parted) q

[root@server92 ~]#

Step2: Create a new partition in Hard disk in which free space is
available. Currently, we have free space of 37.9 GB and it is in /dev/sda hard
disk. You can select last sector as it is or give your value like +1G or
+500M .

Step4: Save the changes in Linux kernel and check the kernel
updated changes or not. Some times , this new created partition is not
reflecting in kernel. So, need to run one command and check kernel partition
file.

Step5: Still, changes are not reflected in kernel then reboot the
system.

[root@server92 ~]# reboot

Step6:Now, Create a Physical Volume of new partition i.e.
/dev/sda5.

[root@server92 ~]#

[root@server92 ~]# pvcreate /dev/sda5

Physical volume
"/dev/sda5" successfully created

[root@server92 ~]#

[root@server92 ~]# pvdisplay

--- Physical volume ---

"/dev/sda5" is a new physical
volume of "499.00 MiB"

--- NEW Physical volume ---

PV
Name
/dev/sda5

VG Name

PV Size
499.00 MiB

Allocatable NO

PE
Size
0

Total PE
0

Free
PE
0

Allocated
PE 0

PV
UUID
86hSVL-pfhS-K4B1-x1i3-RAV0-ywef-Bhcq9Z

Step7: If there are more than two physical volumes then you can
give both the partition names in command. Create a Volume group of new
partition i.e. /dev/sda5. I have created Volume group is MyVolume.