Two Mount Methods
Script that affects mounting external devices:/etc/fstab
Boot Script: The inittab contains some running commands.
User Script: login. defs limits the user's password modification time and id gid expiration time ..
Automatic mounting
Attach an image Disk
Virtual Machine --- VM --- settings --- CD/DVD --- specify the path of the scene file (the first disc )---
Device status: the first Device status is recommended.
Connected: As long as an external device is mounted, the system will identify
Connectedpower on: Identify once upon startup;
Open: Vi/etc/fstab
Syntax format:
Each row is a record.
6 fields
External Device Name |
Mount point |
File System Type |
Restrictions |
Power-on self-check |
Backup or not (priority) |
/Dev/cdrom |
/Mnt/ |
Ext3 |
Hardware Device (default: ults) |
0, 1 |
0, 1 |
Mount your external device by writing a new line of data in this format.
Command mount:
# Mount-t type External Device mount point
Note: mount point settings
It is not recommended to map directly to/mnt
Prevent/mnt from being mounted to other devices (one by one directory (create a directory under/mnt ))
Try to create a new directory for mounting
Detach a USB flash drive from an external device
Umount mobile device or mount point
Umount/dev/spd (/mnt/)
Schedule Tasks
1. Schedule Tasks (repetitive) cron
1) Note: One-time task at (which can be viewed on the fifth day of week 16th)
Cron is a task scheduling tool installed in the same rpm package.
Check whether the software has been installed
# Rpm-qa | grepcron
2) Enable the corresponding service
The system checks the corresponding script file every minute.
# Service crond start
# Vi/etc/crontab
Vi open the directory as follows:
[Root @ localhost cdrom] # cat/etc/crontab
SHELL =/bin/bash
PATH =/sbin:/bin:/usr/sbin:/usr/bin
MAILTO = root
HOME =/
Name = value definition variable
# Run-parts
01 *** root run-parts/etc/cron. hourly
02 4 *** root run-parts/etc/cron. daily
22 4 ** 0 root run-parts/etc/cron. weekly
42 4 1 ** root run-parts/etc/cron. monthly
42 4 1 ** rootrun-parts/etc/cron. hourly
Minute Hour Date month week user script
0-59 0-23 1-31 1-12 0-6
The first way to schedule tasks: compile files in a fixed directory
Replace "*" with the meaning of "every day" (every month .....)
For example, schedule the system to replicate every hour.
# Cd/etc/cron. hourly
# Touch filename
# Vi filename
Write the command you want to execute
42 4 1 ** command
Method 2: directly use crontab to edit the script
# Crontab-e the following task format is saved to/var/spool/cron by default.
-E edit
-L list
-R remove
-U zhy specifies a user to execute the task. By default, root is not written.
Root schedule task crontab-e
Root specifies the lisi execution task crontab-u lisi-e
Schedule Tasks:
Back up/etc to external devices at half past four P.M., January 1, December 25 every year
30 16 25 12 * cp-r/etc/mnt/cdrom
Back up/etc to external devices from four o'clock P.M. to half past six on January 1, December 25
30 4-6 25 12 * cp-r/etc/mnt/cdrom
Note:
Separate time points with spaces or tabs
The value range is 16-18.
Independent time (16, 18)
* Indicates any time point
Based on the above two ways of adding tasks, they have the same syntax for adding tasks.
Back up/etc to external devices from four o'clock P.M. to half past six on January 1, December 25
30 4-6 25 12 * cp-r/etc/mnt/cdrom
However, for the first type, the data is usually used less, and the second type has more data.
Add hard disk --
Step 1:
Steps for adding a hard disk
Disable the system: otherwise, only SCSI hard disks can be installed.
In the VM --- settings ---- HARD --- add --- next-IDE
Restart a VM
Open Terminal
# Fdisk-l
External hardware devices recognized by the detection system
There are two hard disk Connection Methods
IDE type
Hard Disk
/Etc/hda indicates the first hard disk
/Etc/hda0 --- the first primary partition on the first hard disk
/Etc/hda0 --- the first primary partition on the first hard disk
/Etc/hdb indicates the second Hard Disk
/Etc/hdb0 --- the first primary partition on the second Hard Disk
/Etc/hdb0 --- the first primary partition on the second Hard Disk
USB flash drive sda sdb
Scsi type
Hard Disk
/Etc/sda indicates the first hard disk
/Etc/sda0 --- the first primary partition on the first hard disk
/Etc/sda0 --- the first primary partition on the first hard disk
/Etc/sdb indicates the second Hard Disk
/Etc/sdb0 --- the first primary partition on the second Hard Disk
/Etc/sdb0 --- the first primary partition on the second Hard Disk
USB flash drive: sda sdb
From the column wjc19911118