Some tips for linux system maintenance, including how to mount a new disk to the system! Favorite !, Linux mounting
Here we will publish some tips that we usually use, but they will not be much, but will be updated continuously ....
1. Create a hard link ln for history.
Back up hard links
Ln/etc/xxx/home/xxx
2. the root user cannot remotely
/Etc/ssh/sshd_config
PermitRootLogin no
AllowUsers XXX
3. synchronous Software Clock
Date MMDDhhmmCCYY. ss
Hwclock -- set -- date = "16:45:05"
4. SSH service restart and switch
Ubuntu 14.04:/etc/init. d/ssh stop/start/restart
Centos7: service sshd restart
5. The command for viewing IP addresses after centos7.0 is changed
Ip addr iplink ip-s link
You can use ifconfig to view the network status after installing net-tools.
*6. After adding a hard disk in linux, you need to create a partition and set the mount.
1. Create a partition
Use fdisk-l to view all disks and partitions.
Disk/dev/xvdb: 100.0 GB, 10022154265402 bytes is your unpartitioned Hard Disk
The command sequence for partitioning operations using fdisk/dev/xvdb is n, p, 1, press ENTER twice, and wq
Next, use mkfs. ext4/dev/xvdb1 to format the partition in the ext4 file system.
2. Mount the drive letter below
Format: mount/dev/xvdb1 (hard drive letter)/etc/abc (mounted destination folder)
Now it is only temporary mounting. If the hard disk configuration disappears after the computer is powered off or restarted, You need to edit the partition file/etc/fstab and write the hard disk information to the automatic mounting location of the system.
Format: UUID = af414adB-46cd-af414adB-46cd (hard disk serial number or replace "UUID = XXXX" with "/dev/xvdb1 ")
/Etc/abc (mount path) ext4 (File System Format) defaults (the parameter that can be used during mount) 0 (the flag that the system needs to back up when dumping, 0 does not need to be backed up 1 need to be backed up) 1 (does filesystem need to be started for self-check, 0 does not self-check, 1 and 2 are self-check, note that the root partition here must be set to 1, set other partitions to 2 .)