Remotely format a hard disk on another host
Usage options
[[email protected] ~]# ansible-doc -s filesystemless 436copyright (C) 1984-2009 mark nudelmanless comes with no warranty, to the extent permitted by law. for information about the terms of redistribution,see the file Named readme in the less distribution. Homepage: http://www.greenwoodsoftware.com/less- name: makes file system on block device action: filesystem dev= # target block device. force # If yes, allows To create new filesystem on devices that already has filesystem. fstype= # file system type to be created. opts # list of options to be passed to mkfs command. resizefs # if yes, if the block device and filessytem size differ, grow the filesystem into the space. Note, xfs will only grow if mounted.
Options:
Dev: target block device
Force: Forces the creation on a device that already has a file system
Fstype: type of File system
OPTs: Options passed to the MKFS command
To view the hard drive type on the remote host is/DEV/SDB
650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M00/7F/A4/wKioL1cnXeSjwyQcAAOvf2tzqc8144.jpg "title=" 20.jpg "alt=" Wkiol1cnxesjwyqcaaovf2tzqc8144.jpg "/>
Format, Mount. and writes the Fstab file:
650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M00/7F/A6/wKiom1cnYgvg-cBaAAMArzXu1nI867.jpg "title=" 21.jpg "alt=" Wkiom1cnygvg-cbaaamarzxu1ni867.jpg "/>
View Fstab File
650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M01/7F/A4/wKioL1cnY1SBPDI2AAL4YAWVk2c112.jpg "title=" 22.jpg "alt=" Wkiol1cny1sbpdi2aal4yawvk2c112.jpg "/>
Mount usage options, use ansible-doc-s mount to see more methods. Let's do it first. Go to sleep.
This article is from the "Village Boys" blog, please make sure to keep this source http://noodle.blog.51cto.com/2925423/1769547
Ansible's filesystem and Mount modules