AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
Expand all | Collapse all

chdev command for all devices on a host

  • 1.  chdev command for all devices on a host

    Posted Tue October 13, 2009 02:22 AM

    Originally posted by: SystemAdmin


    Hello,

    Is there a way to run the chdev command for all disk devices on a host,
    instead of running for individual devices.

    For eg,
    chdev -l hdiskx -a reserve_policy=no_reserve

    changes the reserve_policy for hdiskx to no_reserve.

    Can I use a single command to change the reserve_policy of two or more disk devices to no_reserve?

    Thanks,
    Kannan


  • 2.  Re: chdev command for all devices on a host

    Posted Tue October 13, 2009 02:32 AM

    Originally posted by: SystemAdmin


    I dont think there is a single command to achieve this. Maybe you can try this:

    for i in `lspv | awk '{ print $1 }'`
    do
    chdev -l $i -a reserve_policy=no_reserve
    done

    This would change the attribute for all the disk drives. Maybe with a little grepping you could filter out a bit.

    r/
    R