Operating System - HP-UX
1753336 Members
4784 Online
108792 Solutions
New Discussion юеВ

Re: data on disk???---> how to check data resides on disk or not?

 
ln_unix
Frequent Advisor

data on disk???---> how to check data resides on disk or not?

Hello All,

I need to check that data resides on disk or not? what methods i can use for this?

Waiting for your answers?

Thanks in advance.

Regards,
LN
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: data on disk???---> how to check data resides on disk or not?

Hi:

Define "data". Ultimately whether or not you have something of value boils down to *documentation* about the physical device.

You might have a LVM VGID or maybe just a PVID. You might have a logical volume and a filesystem. If you have the later, answering the question of "data" becomes a bit more meaningful if you have files and directories when you mount the filesystem.

What about *raw* volumes?

What if you 'vgexport'ed a volume group, and wrote all zeros to the first 5-10K blocks of the physical disk to erase any LVM metadata. The remainder of the disk might contain salvageable "data" whose bit patterns have meaning.

Good documentation is key.

Regards!

...JRF...
chris huys_4
Honored Contributor

Re: data on disk???---> how to check data resides on disk or not?

Hi LN,

You could configure vxvm on the host. ;)

I would only "configure" vxvm on a "LVM only" system, for the above purpose, if vxvm 4.1 or a more recent version of vxvm is installed. VxVM 4.1 or a more recent version is available from HP-UX 11.11 onwards.

NOTE: The problem with configuring "earlier then vxvm 4.1 versions", i.e. vxvm 3.2 and vxvm 3.5, is that these versions, required at least 1 lun to be configured as a vxvm lun as part of the "configure process", which could seem to be a bit to intrusive on a "lvm only production system".

procedure.

1. check if vxvm 4.1 or more recent vxvm version is installed.

titanvp1:/:uname -a
HP-UX titanvp1 B.11.23 U ia64 2146251420 unlimited-user license

titanvp1:/:swlist
[..]
Base-VXVM B.04.10.011 Base VERITAS Volume Manager Bundle 4.1 for HP-UX

>> CONCLUSION -- vxvm 4.1 is installed..

2. check if vxvm is allready configured

titanvp1:/:vxdctl mode
mode: not-running

>> CONCLUSION -- vxdctl mode gives as mode not-running, so the vxconfigd is not active on the system.. so vxvm is still not configured..

3. configure vxvm

titanvp1:/:vxinstall
[..]
Are you prepared to enter a license key [y,n,q] (default: n) n

Do you want to use enclosure based names for all disks ?
[y,n,q,?] (default: n) n


>> CONCLUSION -- give default answers on first 2 questions..

Do you want to setup a system wide default disk group?
[y,n,q,?] (default: y) n

>> CONCLUSION -- but the n(o) answer, on the question about setting a system wide default diskgroup

#

4. check if vxinstall "configured" vxvm

titanvp1:/:vxdctl mode
mode: enabled
titanvp1:/:ps -ef|grep vxconfigd
root 16810 1 0 21:03:05 ? 0:00 vxconfigd -k -m enable

>> CONCLUSION -- yes.. vxdctl mode says enabled and vxconfigd is running..

5. check status of system..

6. update OS/vxvm, through "ioscan -fn/insf -e -v/vxconfigd -km enable"

# ioscan -fn
[..]
disk 0 0/0/0/3/0.6.0 sdisk CLAIMED DEVICE HP 36.4GST33675
4LC
/dev/dsk/c0t6d0 /dev/rdsk/c0t6d0
/dev/dsk/c0t6d0s1 /dev/rdsk/c0t6d0s1
/dev/dsk/c0t6d0s2 /dev/rdsk/c0t6d0s2
/dev/dsk/c0t6d0s3 /dev/rdsk/c0t6d0s3
[..]

# insf -e -v

# vxconfigd -km enable

7. check system

titanvp1:/:vxdisk -o alldgs list
DEVICE TYPE DISK GROUP STATUS
c0t6d0s2 auto:LVM - - LVM

>> CONCLUSION -- host has only 1 lun.. and its a LVM boot lun.. (boot because of the s2 thing in the device name.. LVM because of STATUS=LVM, which means the lun was pvcreate'd)

NOTE: luns that are not pvcreated by LVM/vxdisksetup'd by vxvm, would have the status "online invalid" and thus could be "free luns"

8. crosscheck with checking lvmtab file..

titanvp1:/:strings /etc/lvmtab
/dev/vg00
H_^#
/dev/dsk/c0t6d0s2

9. other interesting things..

titanvp1:/:vxdisk list c0t6d0s2
Device: c0t6d0s2
devicetag: c0t6d0s2
type: auto
info: format=LVM
flags: LVM online error private autoconfig
errno: Disk is not useable, bad format
Multipathing information:
numpaths: 1
c0t6d0s2 state=enabled

>> CONCLUSION -- vxvm only found 1 path to this lun... (which also corresponds with strings /etc/lvmtab output)

titanvp1:/:vxdmpadm listctlr all
CTLR-NAME ENCLR-TYPE STATE ENCLR-NAME
=====================================================
c0 Disk ENABLED Disk

>> CONCLUSION -- 'vxdmpadm listctlr all shows" that the lun is part of a jbod/is a internal disk.. (as it else would show a diskarray type if the lun would be part of a diskarray)

NOTE: If diskarrays are connected to the system, seperate asl/asm might need to be installed, to get all paths for a specific lun, be "recognized" correctly by vxvm..

NOTE2: Deconfiguring vxvm can always be done by doing a "vxdctl stop" to stop vxconfigd from running and "touch /etc/vx/reconfig.d/state.d/install-db" to make sure that after a reboot, vxconfigd doesnt startup.

The above output, will not be the "be all/end all" of all info that is needed to know if data is on a disk or not, but for not to much configuration, its a good start for documenting a system. ;)

Greetz,
Chris
Kapil Jha
Honored Contributor

Re: data on disk???---> how to check data resides on disk or not?

hmmmm almost all disks have data in the on the disk, except the very new one :), and the one which smbody erased it manually with dd or smother thing.

Now ur question is I suppose if the VG data is there.

you can check from
#pvdisplay command if this disk was added in a vg, if you get some output that means it has the data.

in vxvm,

you can use vxprivutil list /dev/rdsk/cdt

it would show you same thing which dg this disk belong and may ne from here you can get an idea.

BR,
Kapil+
I am in this small bowl, I wane see the real world......
ln_unix
Frequent Advisor

Re: data on disk???---> how to check data resides on disk or not?

Hello All,

Heartiest thanks for your replies ....

Presently , I need to know in case of LVM ...

Is there any other alternate besides KAPIL's reply???? (just above-replied by KAPIL)

Thanks to all for your support....

Best Regards,
LN
Steven E. Protter
Exalted Contributor

Re: data on disk???---> how to check data resides on disk or not?

Shalom,

dd is a good general utility.

dd if=/dev/dsk/c1t1d0 (use a real disk) of=/var/diskdump.txt

Take a look at the diskdump.txt file with strings or OS utility.

That will give you an idea if there is some kind of data on the disk.

sEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com