1752583 Members
4981 Online
108788 Solutions
New Discussion юеВ

2 harddisk in one system

 
SOLVED
Go to solution
Henry Chua
Super Advisor

2 harddisk in one system

Hi Guys,

I discover I have 2 harddisks in my server.. how can I be sure which directories belong to which harddisk.. and which one is a common drive for all the servers?

THANK YOU FOR YOUR ANSWERS!!
8 REPLIES 8
Victor BERRIDGE
Honored Contributor

Re: 2 harddisk in one system

Hi,
For a start you can use pvdisplay /dev/dsk/
to see what filesystem are on them


All the best
Victor
Victor BERRIDGE
Honored Contributor

Re: 2 harddisk in one system

oops; I ment pvdisplay -v...

Apologies
Victor
Pete Randall
Outstanding Contributor

Re: 2 harddisk in one system

Start with pvdisplay to discover which volume group the disks belong to:

$ pvdisplay /dev/dsk/c3t5d0
--- Physical volumes ---
PV Name /dev/dsk/c3t5d0
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 2
PE Size (Mbytes) 4
Total PE 2169
Free PE 1250
Allocated PE 919
Stale PE 0
IO Timeout (Seconds) default
Autoswitch On

Then look at your bdf output to determine which logical volumes and file systems are on
each disk. You may also need to look at lvdisplay if both disks are in the same vg to determine exactly which extents of which lv are on which disk:

bdf -l |grep vg00
/dev/vg00/lvol3 200 115 85 58% /
/dev/vg00/lvol1 288 56 203 22% /stand
/dev/vg00/lvol8 3000 349 2631 12% /var
/dev/vg00/lvol7 3000 1063 1923 36% /usr
/dev/vg00/lvol6 200 17 182 9% /tmp
/dev/vg00/lvol5 2000 1676 321 84% /opt
/dev/vg00/lvol4 1600 375 1217 24% /home


Pete

Pete
Sundar_7
Honored Contributor

Re: 2 harddisk in one system

Does your filesystem span across more than one disk ? - If yes then you need to execute more than a couple of commands to figure out the disk.

# lvdisplay -v /dev/vgXX/lvolXX

and let us know if the LV spans more than one PV, I will post you the procedure for finding the disk a file is on.
Learn What to do ,How to do and more importantly When to do ?
Henry Chua
Super Advisor

Re: 2 harddisk in one system

HI all, thanks for your advises...

I have checked and confirm that one of my LV is straddling on 2 PVs. How shall I proceeds?

THANK Q!!
George Petrides_1
Honored Contributor

Re: 2 harddisk in one system

How can you proceed to do what?
Gregory Fruth
Esteemed Contributor

Re: 2 harddisk in one system

Why do you care which physical volume the
directory is on?

If you're trying to restore data from a
tape backup you need to restore the entire
logical volume anyway. Unless your backup
software has some special provision for
handling physical volumes instead of logical
volumes?

Furthermore, even if you could find out what
disk a directory is on, I don't think that
guarantees that the files in that directory
are on the same disk. And I think
individual files and directories can also
span more than one disk if their LV does.
Bill Hassell
Honored Contributor
Solution

Re: 2 harddisk in one system

The design of LVM to usde volume groups is to remove the physical nature of individual disks and create a storage pool. These two disks are not independent anymore. The volume group treats the two disks as one space and if either is unavailable or has errors, the contents of both disks can be affected. Now each logical volume may be mapped to see where it is stored. Use lvdisplay -v to see each logical volume. Or to see which logical volumes exist on a specific disk, use pvdisplay -v.

But within a mountpoint (a filesystem inside a logical volume), the directory structure knows nothing about physical disks, just addresses within the logical volume so there is no practical way to map files to a physical disk. Even with such a map, there is no value because data cannot usually be recovered without both disks intact. If your question is about performance, you can look at the logical volume maps and use pvmove to transfer extents from one disk to another.


Bill Hassell, sysadmin