Operating System - HP-UX
1833867 Members
2054 Online
110063 Solutions
New Discussion

How to delete the content of a raw device

 

How to delete the content of a raw device

Hi, I have running Oracle 9iRAC, and I have some control files in some raw device, I need to find a way to release the content of the raw device without lvremove, because I can't deactivate de VG.

Thnaks
6 REPLIES 6
Karthik S S
Honored Contributor

Re: How to delete the content of a raw device

dd if=/dev/zero of=/dev/vg_name/lv_name

-Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
steven Burgess_2
Honored Contributor

Re: How to delete the content of a raw device

Hi

What about copying /dev/null to it ?

dd if=/dev/null of=/dev/vg#/rlvol#

HTH

Steve
take your time and think things through
Karthik S S
Honored Contributor

Re: How to delete the content of a raw device

Sorry, it should read ..

dd if=/dev/zero of=/dev/vg_name/lv_name bs=1024k

-Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Florian Heigl (new acc)
Honored Contributor

Re: How to delete the content of a raw device

copying /dev/null will only overwrite the very first block.

/dev/zero is the healthier way, but is only available/supported on 11i++ (OTOH a mknod takes care of the 'available' part.)

You should be able to do the lvreduce without deactivating the VG, unless there is a ServiceGuard-related issue I don't know about.

Good luck,
Florian
yesterday I stood at the edge. Today I'm one step ahead.
Heiner E. Lennackers
Respected Contributor

Re: How to delete the content of a raw device

# dd if=/dev/zero of=/dev/vgNN/rlvolN bs=1024k
is a good choice. If you are running HP-UX 11.00 you can create the /dev/zero with
# mknod /dev/zero c 3 0x000004
# chmod 666 /dev/zero

But you can take any source of data to overwrite it, e.g.

# yes | dd of=/dev/vgNN/rlvolN obs=1024k





if this makes any sense to you, you have a BIG problem
Jannik
Honored Contributor

Re: How to delete the content of a raw device

mediainit will format you disk look at the man pages.
jaton