Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux disk partition batch format mount script     - State and Linux nf_conntrack TCP disconnect time (Programming)

- Oracle Client Easy Connection error ORA-12154, TNS-03505 (Database)

- When Linux Detailed time zone and common function of time (Linux)

- Linux System Getting Started Learning: the curl set custom HTTP header (Linux)

- Install the Red Hat Container Development Kit on OSX (Server)

- ActiveMQ5.10.2 version configuration JMX (Linux)

- Use the dd command to the hard disk I / O performance test (Linux)

- Linux set to select the appropriate level of security of the network according to deployment (Linux)

- NFS-based services and service utilization Corosync DRBD high availability cluster configuration, respectively (Server)

- To install OwnCloud 7.0.4 under Ubuntu (Linux)

- Quickly locate the mistakes by gdb location (Programming)

- MySQL and MariaDB traditional master-slave cluster configuration (Database)

- HTTP and HTTPS request response process difference (Linux)

- Oracle 12c In-Memory Study (Database)

- MySQL 5.6.26 source install (Database)

- Python 3 for instructions encoded string conversion (Programming)

- About Python default character set (Linux)

- Linux learning portal: CentOS 6.4 system kernel upgrade (Linux)

- Spring multi data source configuration (Programming)

- Linux text processing tool of awk (Linux)

 
         
  Linux disk partition batch format mount script
     
  Add Date : 2018-11-21      
         
         
         
  Yesterday received a task, ten machines, and the need to mount the partition, each machine has six letters, if one of a manual operation, efficiency is not high, I get that done in one, trying to write a script, to achieve mass deployment! The following is a script to use

[Root @ Hadoop6 ~] # vim parted.sh

#! / Bin / bash
#
#
yum install -y parted
sleep 1s
yum install -y vim
sleep 1s
################################################## ###################
touch / root / test1
i = 0
b = 1
for disk in `fdisk -l | grep" / dev / vd * "| awk '{if ($ 2 ~ / vd / && $ 2 =" / dev / vda: "&& $ 2 =" / dev / vdb: "!!) print substr ($ 2,0,8)} ' `
do
        parted $ disk << EXIT
        mklabel gpt
        mkpart primary 0 -1
        ignore
        quit
EXIT
      mkfs.ext4 $ disk $ b
echo "/ n / n **************** $ disk_was Fdisked! Waithing For 10 second **** / n / n"
sleep 1s
        uuid = `blkid $ disk $ b | awk '{print $ 2}' | awk -F" \ "" '{print $ 2}' `
        mkdir / data $ {i}
        cat << EXIT > / root / test1
UUID = $ uuid / data $ {i} ext4 defaults 1 2
EXIT
        cat / root / test1 >> / etc / fstab
i = $ (($ i + 1))
done
  
################################################## ####################
mount -a

--------------------------------------Dividing line---------- ----------------------------

[Root @ hadoop6 ~] # df
Filesystem 1K-blocks Used Available Use% Mounted on
/ Dev / mapper / vg0-lv_root 12179756 2680964 8880092 24% /
tmpfs 16439788 0 16439788 0% / dev / shm
/ Dev / vda1 198337 28603 159494 16% / boot
/ Dev / vdc1 4227572676 198680 4012625684 1% / data0
/ Dev / vdd1 4227572676 198680 4012625684 1% / data1
/ Dev / vde1 4227572676 198680 4012625684 1% / data2
/ Dev / vdf1 4227572676 198680 4012625684 1% / data3
/ Dev / vdg1 4227572676 198680 4012625684 1% / data4
/ Dev / vdh1 4227572676 198680 4012625684 1% / data5

--------------------------------------Dividing line---------- ----------------------------

[Root @ hadoop6 ~] # vim / etc / fstab
 
#
# / Etc / fstab
# Created by anaconda on Wed Mar 5 14:32:01 2014
#
# Accessible filesystems, by reference, are maintained under '/ dev / disk'
# See man pages fstab (5), findfs (8), mount (8) and / or blkid (8) for more info
#
/ Dev / mapper / vg0-lv_root / ext4 defaults 1 1
UUID = 0a17f48d-f99b-4498-82a5-a0874f25f1e7 / boot ext4 defaults 1 2
/ Dev / vdb1 swap swap defaults 0 0
tmpfs / dev / shm tmpfs defaults 0 0
devpts / dev / pts devpts gid = 5, mode = 620 0 0
sysfs / sys sysfs defaults 0 0
proc / proc proc defaults 0 0
UUID = 9ff86747-384f-4a37-adab-1ac5abd98dff / data0 ext4 defaults 1 2
UUID = bd6103cf-9774-4e31-87bb-33df4fbea47e / data1 ext4 defaults 1 2
UUID = 81a1b153-279f-454c-b23c-07744203b65a / data2 ext4 defaults 1 2
UUID = ae66663e-0879-4622-bb68-94bb045f9719 / data3 ext4 defaults 1 2
UUID = aab4c3f0-344a-4309-8ec0-c87017b5179d / data4 ext4 defaults 1 2
UUID = 0d4a6b2f-99dd-4a87-9d48-6090c3863ba3 / data5 ext4 defaults 1 2
~
     
         
         
         
  More:      
 
- Oracle 11g can not export a variety of empty table solution (Database)
- Service manager OpenBSD on rccl (Server)
- Docker Basic and Advanced (Linux)
- Linux environment SSH login password instead of using the RSA Certificate (Linux)
- The execution order of Oracle WHERE condition is not from right to left (Database)
- Modify grub solve computer startup error: ERROR 17 (Linux)
- Apache Kafka: the next generation of distributed messaging system (Server)
- blecat: Bluetooth Gadgets (Linux)
- A custom implementation of the Android sidebar (Programming)
- ethtool implementation framework and application in Linux (Linux)
- systemd Power Management (Linux)
- Installed FFmpeg 2.6.3 on Ubuntu / Debian / Fedora system (Linux)
- Alien Magic: RPM and DEB Mutual Convert (Linux)
- Iptables in Ubuntu (Linux)
- MySQL performance comparison of large amounts of data storage (Database)
- MySQL Tutorial: About checkpoint mechanism (Database)
- Ubuntu and derived versions of the user how to install G Mic 1.5.8.5 (Linux)
- Java and C / C ++ data conversion when network communication (Programming)
- Design and implementation of environment sniffer running under Linux (Linux)
- B-tree - ideas and implementation of C language code (Programming)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.