0

Original Code that I saw

I want to do the same thing but need to make sure i dont delete hdisk0 since this is my OS.

photo of drives being deleted.

Jakekq
  • 3

1 Answers1

0

If the hdisk0 is in use the system wont delete it. it will error out

"smitty->devices ->fixed disk-> remove" don't have the option to select multiple. if you want to remove multiple disks use the following for loop.

it will remove all disks but hdisk0.

for i in `lspv |grep -v hdisk0|awk '{print $1}'`;do rmdev -dl $i; done

if you want to remove all defined disk:

for i in `lsdev -Cc disk |grep Defined|awk '{print $1}'`; do rmdev -dl $i; done

the -d in rmdev command removes the device definition.