tw_cli is the CLI for monitoring and maintaining 3ware RAID controllers. It can be used for all maintenance operations that can be performed through the 3dmd daemon or the system BIOS.
info c1 u2
info c1 p2
maint remove c1 p2
It varies based on your version of tw_cli.
rescan c1 OR maint rescan c1 OR maint add c1 p2
maint rebuild c1 u2 p2
maint createunit c1 rraid1 p2:3
maint createunit c1 rraid5 p0:1:2:3:4:5:6
maint createunit c1 rspare p2