Sei sulla pagina 1di 5

Hi Guys,this is my first posting on to this joinforce tech forum,hope you will find intersting with

this..

Is it possible to mount a submirror ,while the submirror is attched to the mirror ?

If you said no ,you are wrong ..we can able to mount the submirror while its in attached
state..Sounds intersting right!! But this is possible.Yes ofcourse , it creates lot of problems.

I think you might started thinking what is the use of this ,absolutely you are right ,there might be
no use ,but we can came to know that we should be very much careful while designing the
solutions in SVM .

First we wil see how to perform this ..

Mounting submirror :

/dev/md/dsk/d0 14367 1041 11890 9% /mnt_mirrord0

# metastat -p

d0 -m d10 d20 1

d10 1 1 c2t0d0s0

d20 1 1 c2t1d0s0

created the filesystem on d0 and mounted on /mnt_mmirrord0.

Now created file named test_mirror of size 8mb .

# mkfile 8m test_mirror

# cd /mnt_mirrord0

# ls -ltr

total 16416

drwx------ 2 root root 8192 Dec 5 00:04 lost+found

-rw------T 1 root root 8388608 Dec 5 00:07 test_mirror

Now trying to mount the attached submirror d20 .

# mount /dev/md/dsk/d20 /mnt_submirrord20

mount: /dev/md/dsk/d20 write-protected


So as it is write protected tried to mount as read only.

# mount -r /dev/md/dsk/d20 /mnt_submirrord20

its mounted

/dev/md/dsk/d0 14367 9241 3690 72% /mnt_mirrord0

/dev/md/dsk/d20 14367 9241 3690 72% /mnt_submirrord20

#cd /mnt_submirrord20

# ls -ltr

total 16416

drwx------ 2 root root 8192 Dec 5 00:04 lost+found

-rw------T 1 root root 8388608 Dec 5 00:07 test_mirror

But want to mount this d20 to perform write operations also on d20. then use remount option
,then it will mount the read only filesystem as read write filesystem.

# mount -o remount /dev/md/dsk/d20 /mnt_submirrord20

# df -k /mnt_submirrord20

Filesystem kbytes used avail capacity Mounted on

/dev/md/dsk/d20 14367 9241 3690 72% /mnt_submirrord20

# cd /mnt_submirrord20

# ls -ltr

total 16416

drwx------ 2 root root 8192 Dec 5 00:04 lost+found

-rw------T 1 root root 8388608 Dec 5 00:07 test_mirror

Now tried to create a file on d20 ie on the mount point /mnt_submirrord20.

# mkfile 2m test1_submirrord20

/dev/md/dsk/d0 14367 9241 3690 72% /mnt_mirrord0


/dev/md/dsk/d20 14367 11297 1634 88% /mnt_submirrord20

So Finally we have achieved that the above statement .. "able to mount the submirror while
attached and perfoming the write operations".

Consequences if we done the above case :

Yep,we succesfully mounted the submirror and we are able to write the data (with
or without having conscious that this using as submirror). Now we will see the consequence for
this.

Now created the file called test1_mirrord0 in /mnt_mirrord0.

# cd /mnt_mirrord0

# ls -ltr

total 6176

drwx------ 2 root root 8192 Dec 5 00:04 lost+found

-rw------T 1 root root 3145728 Dec 5 01:21 test1_mirrord0

and now switch to the directory /mnt_submirrord20

# cd /mnt_submirrord20

# ls -ltr

total 6176

drwx------ 2 root root 8192 Dec 5 00:04 lost+found

-rw------T 1 root root 3145728 Dec 5 01:21 test1_mirrord0

then remove the test1_mirrord0 from /mnt_submirrord20 .

Again unmount and mount the d0. Now we will get the below I/o error

# ls -ltr

./test1_mirrord0: I/O error

total 16

drwx------ 2 root root 8192 Dec 5 00:04 lost+found

This is due to inconsistences in d0 and d20.And hence SVM checks there is no syn between these
volumes and hence it throws I/O error.
Assume at this situation we will reboot the box and this do is in vfstab entry ,In this situation
while booting the system will ask for fsck on d0 ,if you performed that fsck,there might be the
data loss on this d0.In worst case if teh backup is not availble then the data will be lost.Consider
this sitauion in production environment which will cause very high impact.

After reboot

# cd /mnt_mirrord0

# ls -ltr

total 16

drwx------ 2 root root 8192 Dec 5 00:04 lost+found

Note : In the above case it is assuming that system administartor dont have the idea that the d20
is separelty mounted.So asusal when d0 asks for fsck at the time of boot he will run the fsck on
d0 which causes the dataloss on d0 .

Source: The same situation is happend in our environment.Hence simulated the same .

Lesson learnt :
need to check the mount points from df -k before rebooting / performing any
changes :-)

Additional Info :

Solaris-10# fsck /dev/md/rdsk/d0

/dev/md/dsk/d0 IS CURRENTLY MOUNTED READ/WRITE.

CONTINUE? y

** /dev/md/dsk/d0

** Currently Mounted on /mnt_mirrord0

** Phase 1 - Check Blocks and Sizes

PARTIALLY TRUNCATED INODE I=4

SALVAGE? y

** Phase 2 - Check Pathnames

UNALLOCATED I=6 OWNER=root MODE=0


SIZE=0 MTIME=Dec 5 01:26 2009

NAME=/test1_mirrord0

REMOVE DIRECTORY ENTRY FROM I=2? y

** Phase 3a - Check Connectivity

** Phase 3b - Verify Shadows/ACLs

** Phase 4 - Check Reference Counts

UNREF FILE I=4 OWNER=root MODE=101600

SIZE=8388608 MTIME=Dec 5 00:07 2009

RECONNECT? y

** Phase 5 - Check Cylinder Groups

CORRECT BAD CG SUMMARIES FOR CG 0? y

CORRECTED SUPERBLOCK SUMMARIES FOR CG 0

CORRECTED SUMMARIES FOR CG 0

FILE BITMAP WRONG

FIX? y

FRAG BITMAP WRONG (CORRECTED)

FILESYSTEM MAY STILL BE INCONSISTENT.

4 files, 8313 used, 1942 free (14 frags, 241 blocks, 0.1% fragmentation)

***** FILE SYSTEM WAS MODIFIED *****

***** PLEASE RERUN FSCK ON UNMOUNTED FILE SYSTEM *****

***** REBOOT NOW *****

VSolaris-10#

Potrebbero piacerti anche