1833709 Members
2650 Online
110063 Solutions
New Discussion

disk unmount

 
SOLVED
Go to solution
Sunil_47
Occasional Advisor

disk unmount

Hi All,

Could someone tell what will typically require a disk to be removed? I have a requirement where some disks should not be used and removed to keep in a safe place. Is there a way we can keep the disks on the system unharmed. Could something like unmount be used? If at all the disks have to be removed, are there any things that should be taken care of? Could you suggest a link?
10 REPLIES 10
Matthew_50
Valued Contributor
Solution

Re: disk unmount

Hi, Sunil

First of all, you have to make sure there is no application/database will access this area. Before actually remove this disk from your system, make a backup copy of the data if there have in this disk.

Second, you have umount the mount point, I suggest check your system's root or security policies, why 'someone' can uses those disks without inform the system administrator.
Joseph Loo
Honored Contributor

Re: disk unmount

hi sunil,

there is no guarantee that a disks left unharmed will not meet its doom at any stage of its lifespan. so a guarantee (at least some) would be to backup data from these disks.

also, r u asking what r the steps/procedure involve in removing a disks?

regards.
what you do not see does not mean you should not believe
Sunil_47
Occasional Advisor

Re: disk unmount

Thank you both. We are planning to remove some disks from the system. My questions are 1. Is there something that I could do to avoid removing the disks physically from the system using something like unmount (in other words make sure the disks are safe and nothing is accessing the disks but the disks doesn't have to be removed from the system) 2. If I am required to remove the disks, is there a procedure?
Colin Gomes
Advisor

Re: disk unmount

hey sunil , first u got to unmount the filesystem .The command is umount, not "unmount". The command uses the block
device file or mount-point directory.Then u could remove the disk.Shutdown the system before doing it .Always unmount all mounted file systems before bringing the system down or you may cause corruption to the file systems. The umount -a command will unmount all the mounted file
systems. The shutdown script unmounts all file systems before bringing the system down.
hope it helps , bye.
Naveej.K.A
Honored Contributor

Re: disk unmount

Sunil,

After umounting the filesystems, I recommend to do a vgexport (if the disks to be removed are the only disks in the VG) so that next time the system boots, the system doesn't throw any error while activating the VGs.

If the disks are a part of the VG, unmount (umount) the filesystems which are on that hard disk, and then do a vgreduce to remove the PV from the VG.

if the disks are non hot swappable disks, you have to shutdown the server to remove the disks. Otherwise, you may pull out the disks and execute rmsf -H hardware path to remove the device files.

1. Unmount the filesystems.
2. vgexport -m /tmp/mapefile -p /dev/vgxx
3.
vgexport /dev/vgxx (if all the disks are in the same VG)
vgreduce /dev/vgxx /dev/dsk/cxtydz
4.
Shutdown the system and remove the disk (non hot swappable disks)
Pull out the disk and execute rmsf -H hardware to remove the device files.

With best wishes,
Naveej
practice makes a man perfect!!!
Joseph Loo
Honored Contributor

Re: disk unmount

hi,

to un-mount filesystem and safekeep data but not remove in the system, do this:

# umount
# vgchange -a -n
# vgexport -m /tmp/your_mapfile -s -v
# vi /etc/fstab
-> comment off all volume group related to the disks

to remove disk physically, if hot swappable, just pull out and run "rmsf -H " but if not, a shutdown of the server is obviously needed. if disks r still on maintenance, u may like to approach the vendor to do it.

regards.
what you do not see does not mean you should not believe
Sunil_47
Occasional Advisor

Re: disk unmount

Hi,

We will be doing the vgexport before this operation. /dev/vg01 has one lv /dev/vg01/lvol1. It has two disks ( two mirors. Actually I will have to remove 14 disks (for 7 VGs -- two disks each VG) .. So, can I follow the below approach?

Example: Remove all disks ...

1. Unmount all the filesystems for all disks.
2. vgreduce /dev/vgxx /dev/dsk/cxtydz

QUESTION -- How should I do vgreduce on both the mirrors for a vg? Currently we have /dev/dsk/c0t1d0 /dev/dsk/c1t1d0 for vg01
I will repeat this step for all vgs

3. Shutdown the system and remove the disks (non hot swappable disks)
4. Pull out the disk and execute rmsf -H hardware to remove the device files.


Could you also tell the steps after I plug in all the disks back?

Thanks in advance.
Sunil_47
Occasional Advisor

Re: disk unmount

Hello Any ideas?
Naveej.K.A
Honored Contributor

Re: disk unmount

Sunil,

Follow these steps.

1. Unmount all the filesystems.
2. Remove the entries from /etc/fstab and from /etc/exports (if any) for these filesystems
3. You can delete the mountpoints (otherwise any program referencing these filesystems will fill up the root directory)
4. Create a map file before doing lvreduce and vgreduce
vgexport -m /tmp/before_vg01 -p /dev/vg01
5. lvreduce -m 0 /dev/vg01/lvol1 /dev/dsk/c0t1d0
6. vgreduce /dev/vg01 /dev/dsk/c0t1d0
7. vgexport -m /tmp/after_vg01 -p /dev/vg01
8. vgchange -a n /dev/vg01
9. vgexport /dev/vg01

Repeat the steps for all the VGs.

Shutdown the system and remove the disks. If possible label it from where you have taken and don't forgot to save those map files...i.e. after_vg0* and before_vg0*

Regards,
Naveej
practice makes a man perfect!!!
Sunil_47
Occasional Advisor

Re: disk unmount

Naveej,

Thanks a lot for answering it. I've assembled all the steps as follows. Summary: I am removing all disks and reinstallaing them. Performing vgexport, vgimport as well as mirroring. Please confirm this is good. Thank you again.

1. Unmount all the filesystems first
2. Remove the entries from /etc/fstab and from /etc/exports (if any) for these filesystems
3. Delete the mountpoints
4. vgexport -m /tmp/before_vg01 -p /dev/vg01 -- create map1
5. ftp the map1 to the new system
6. lvreduce -m 0 /dev/vg01/lvol1 /dev/dsk/c0t1d0
7. vgreduce /dev/vg01 /dev/dsk/c0t1d0
8. vgexport -m /tmp/after_vg01 -p /dev/vg01 -- create map2
9. ftp the map2 to the new system
10. vgchange -a n /dev/vg01
11. vgexport /dev/vg01

Repeat the above steps for all VGS.


12. Place labels before removing the disks
13. Shutdown the system and remove all non-VG00 disks.
14. Perform the activity
15. Shutdown the system and reinsert all non-VG00 disks.
16. mkdir /dev/vg01
17. mknod /dev/vg01/group c 64 MINOR
18. vgimport -m /tmp/vg01map /dev/vg01 /dev/dsk/c0t1d0 /dev/dsk/c1t1d0
19. vgchange -a y /dev/vg01
20. vgcfgbackup vg01
21. Repeat steps 16-20 for all other VGs
22. create entries in /etc/fstab
23. Mount all the filesystems

Questions:

1) At Step 11. I am performing a vgexport. Should that be complemented by a vgimport (without using mapfile)?

2) At step 18. should I use map2?

Any other comments from anyone will be appreciated