Linux system, add hard disk and mount to the example of the operating system shell scripts

#!/bin/sh

# Mount newly added hard disk to the operating system

pvcreate / dev / sdb / / add new hard drives are generally recognized as sdb, of course, not necessarily to specific conditions.
vgcreate datavg / dev / sdb // vgcreate [vgname] [device name]
lvcreate -L 1700000 datavg // lvcreate -L + expansion to a size (typically with M or G or T units, M is the default) [] vgname
lvrename datavg lvol0 datalv // lv change the name, the default is lvol0
mkdir -p / data // Create the mount directory.
mkfs.xfs / dev / datavg / datalv // Format
mount / dev / datavg / datalv / data // mount
echo "/ dev / datavg / datalv / data xfs defaults 0 0" >> / etc / fstab // to write the configuration system configuration file will be automatically mounted at boot time.
 

Guess you like

Origin www.cnblogs.com/changankaifazhe/p/11102534.html