linux基礎學習(十一) 時間的同步 設備的掛載

                                                                ###時間的同步###

  1. 服務端

yum install chrony -y            ##安裝服務


vim /etc/chrony.conf            ##主配置文件

21    #Allow NTP client access from local network.

22    allow 172.25.0.0/24     ##允許誰去同步我的時間

27    #Serve time even if not synchronized to any NET server

28    local stratum 10            ##不去同步任何人的時間,時間同步服務器級別


systemctl restart chronyd

systemctl stop firewalld


2.客戶端

vim /etc/chrony.conf

3    server 0.rhel.pool.ntp.org iburst

4    server 1.rhel.pool.ntp.org iburst=======>server ntpserverip iburst

5    server 2.rhel.pool.ntp.org iburst=======>

6    server 3.rhel.pool.ntp.org iburst


systemctl restart chronyd

wKiom1gYVdyzVek4AAWJ6hZjrTk655.png-wh_50


###timedatectl命令

timedatectl            status                ##顯示當前時間信息

                              set-time           ##設定當前時間

                              list-timezones  ##列出所有時區

                              set-timezone    ##設定當前時區

                              set-local-rtc 0|1   ##設定是否使用utc時間


####設備識別

串口硬盤  sata  sda

並口硬盤  sda   hda


/dev/xdxn            ##硬盤設備/dev/sda1

/dev/cdrom          ##光驅

/dev/mapper/*     ##虛擬設備


#####設備的發現

fdisk -1                    ##查看真實存在的設備

cat /proc/partitions   ##查看系統能夠識別的設備

blkid                          ##系統能夠掛載使用的設備id

df                               ##查看設備被系統使用的情況


####設備的使用

  1. 設備的掛載

mount                            設備                        掛載點

mount                            /dev/sdb1                /mnt                ##把電腦第二塊硬盤的第一個分區掛載到/mnt下


2.卸載設備

umount                        設備|掛載點


如果在卸載設備時出現 target is busy.的錯誤,解決方法如下:

fuser -kvm            設備|掛載點            ##-k kill     -v顯示詳細信息        -m 掃描設備


#####軟硬連接

軟鏈接:多個節點對應一個數據塊

硬鏈接:一個節點對應多個數據塊

ls -i                            ##查看文件節點號

ln -s /file / file1            ##軟鏈接

ln  /file /file1                 ##硬鏈接

###文件查找

  1. locate filename       ##在文件數據庫中搜索信息

  2. updatedb                ##更新數據庫


find   查找位置     -條件       條件值

                              -name

                              -user

                              -group

                              -size

                              -not


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章