1834297 Members
1793 Online
110066 Solutions
New Discussion

Re: Map File

 
SOLVED
Go to solution

Map File

Hi,
I have a hard disk on ServerA configured with VG02.I take the Hard disk to serverB and Detect teh Hardisk, Without Doing a vgexport (To Create a map).

Just Coz I didnt have the Map file. I created a file with these entries in it.
"1. LVOL1
2. LVOL2
3. lvol3"

Now when I import the VG giving teh refernce of this file as MAP file. Iwas able to import the VG and Access the File.....

IS THIS ACTUALLY POSSIBLE... if Yes then Is it not a security Threat on my data.

I always though If the VG ID is not correct in the map file and the Lvol names not correct in it.. It would not import...
But strangly with a ffalse map file which I created it. WORKED..
Could any one reason this please
8 REPLIES 8
Pete Randall
Outstanding Contributor

Re: Map File

Simple - you don't need a mapfile to import. From the man page on vgimport (in the -m section):

If this
option is not specified, logical volume names are
created using the default naming convention lvolnn
where nn is the logical volume minor number.


Pete

Pete
Helen French
Honored Contributor
Solution

Re: Map File

Instead of importing it with a map file, I will just do:
1) vgscan
2) mkdir /dev/vgXX
3) mknod /dev/vgxx/group c 64 0x0?0000
4) vgimport /dev/vgxx /dev/dsk/cxtycz (disk's device file)
5) vgchange -a y /dev/vgxx
6) vgdisplay -v /dev/vgxx
7) mkdir /test_fs
8) mount lv_name /test_fs (mount all file systems).

This way will be easy, supported and accurate. You don't need to worry about security. In your case, the vgimport worked just because it found the LVs as exactly specified in your map file. The VGID DOES matters, when you have multiple disks on the same VG (the VG which you are imporitng).
Life is a promise, fulfill it!

Re: Map File

Yes Shiju U R right But My Lvols actually are of Different names. than Waht I had specified.

Y i was worried is some one can easily plug my HDD and Use it and replace it.
Sridhar Bhaskarla
Honored Contributor

Re: Map File

Hi,

Yes it is actually possible. Which way are you thinking it is a security threat?.

VGID will be in there only if you run vgexport with -s option. Without -s option, the map file will always be like you created. There were instances where I created map files with VGID by getting it from one of the disks.

As long as you didn't customize your logical volumes, you can create your own map files though it is not suggested. Instead of the default names if you created them with meaningful names, then you need to know the mapping of the sequence to the names.

I would not suggest creating map files manually as missing or adding extra lines may cause errors. You can simply import a volume group even without a map file by specifying the disk.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Ravi_8
Honored Contributor

Re: Map File

Hi,

vgimport assumes that the volume group information has already been created on the physical volumes.
when the mapfile is not specified, logical volume names are created using the default naming convention lvolnn
never give up
Robert-Jan Goossens
Honored Contributor

Re: Map File

Hi,

Well man vgimport says,
-m mapfile
Specify the name of the file from which logical volume names and numbers are to be read.This option is optional when used as in the first
command line format of the SYNOPSIS.If this option is not specified, logical volume names are created using the default naming convention lvolnn where nn is the logical volume minor number.

Robert-Jan.

Re: Map File

Hey Guys,
Thanx for the Prompt Reply.
Definetly it made my concept verry clear.

Raghu
Helen French
Honored Contributor

Re: Map File

Again, the LV_name doesn't matter. vgimport will pick the one you specified. If not specified in the map file, it will take the default names (lvol1, lvol2 etc). Now, if you did have map files, it will preserve the lvolnames when you vgimport, just becuase you have the names on the map file. You will get a clear idea by reading the man pages:
# man vgimport

Also about the security, it's your duty to have your data (disks) to be kept in a secure location from un authorized physical access.
Life is a promise, fulfill it!