中文字幕亚洲第一精品|精品国产免费一区二区|久久婷婷五月六月综合版|中文字幕熟妇久久久人妻|久久综合精品国产一区无码|国产成人精品永久免费视频|午夜亚洲国产精品理论片a级|久久精品一区二区三区无码护土

 訪問手機版  

Linux常用命令|Linux培訓(xùn)學(xué)習(xí)|考試認(rèn)證|工資待遇與招聘,認(rèn)準(zhǔn)超級網(wǎng)工!

招聘|合作 登陸|注冊

網(wǎng)絡(luò)工程師培訓(xùn)

當(dāng)前位置:網(wǎng)絡(luò)工程師 > 技術(shù)課程 > linux > 熱點關(guān)注 > linux常用命令

Linux常用命令-磁盤類

時間:2019-10-27

linux常用命令_linux常用shell命令_linux命令中的head命令

mount 設(shè)備目錄 掛載點 掛載文件系統(tǒng)

Linux系統(tǒng)下,所有設(shè)備必須掛載后才能使用;

掛載相當(dāng)于給一個孤立存在的設(shè)備設(shè)置一個接入口linux常用命令,所有用戶都需要通過該接口訪問該設(shè)備

這個接口稱之為掛載點

[root@aspen ~]# ls /dev/cdrom/ 
ls: cannot access /dev/cdrom/: Not a directory
[root@aspen ~]# mount /dev/cdrom /mnt/
mount: /dev/sr0 is write-protected, mounting read-only
[root@aspen ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        18G  1.9G   16G  11% /
devtmpfs        476M     0  476M   0% /dev
tmpfs           487M     0  487M   0% /dev/shm
tmpfs           487M  7.6M  479M   2% /run
tmpfs           487M     0  487M   0% /sys/fs/cgroup
/dev/sda1      1014M  127M  888M  13% /boot
tmpfs            98M     0   98M   0% /run/user/0
/dev/sr0        4.3G  4.3G     0 100% /mnt
[root@aspen ~]# ls /mnt/
CentOS_BuildTag  EULA  images    LiveOS    repodata              RPM-GPG-KEY-CentOS-Testing-7
EFI              GPL   isolinux  Packages  RPM-GPG-KEY-CentOS-7  TRANS.TBL

umount 卸載已掛載的文件系統(tǒng)

linux常用shell命令_linux命令中的head命令_linux常用命令

[root@aspen ~]# umount /mnt/ 
[root@aspen ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        18G  1.9G   16G  11% /
devtmpfs        476M     0  476M   0% /dev
tmpfs           487M     0  487M   0% /dev/shm
tmpfs           487M  7.6M  479M   2% /run
tmpfs           487M     0  487M   0% /sys/fs/cgroup
/dev/sda1      1014M  127M  888M  13% /boot
tmpfs            98M     0   98M   0% /run/user/0

fdisk 磁盤名 MBR分區(qū)表磁盤分區(qū)命令(僅支持2TB以下的磁盤分區(qū))

操作選項

p 顯示磁盤分區(qū)信息

n 創(chuàng)建磁盤分區(qū)

d 刪除磁盤分區(qū)

linux命令中的head命令_linux常用shell命令_linux常用命令

w 保存分區(qū)并退出命令

m 查看所有操作選項

parted 磁盤名 GPT分區(qū)表磁盤分區(qū)命令(常用于2TB以上的磁盤分區(qū))

[root@aspen ~]# fdisk -l
Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000c45ea
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      411647      204800   83  Linux
/dev/sda2          411648     2508799     1048576   82  Linux swap / Solaris
/dev/sda3         2508800   209715199   103603200   83  Linux
Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
[root@aspen ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x28e66d85.
Command (m for help): p
Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x28e66d85