九色国产,午夜在线视频,新黄色网址,九九色综合,天天做夜夜做久久做狠狠,天天躁夜夜躁狠狠躁2021a,久久不卡一区二区三区

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
VMware Workstation 添加磁盤 掛載目錄(centos)

參考文檔: Linux命令大全

需求:測試環(huán)境虛擬機某個目錄下空間不足,準(zhǔn)備通過添加一塊磁盤,并將該目錄掛載到該磁盤

前面幾步在測試服務(wù)器上操作的,截圖困難,所以網(wǎng)上找了幾張設(shè)置圖

  1. 關(guān)閉虛擬機(沒測試過不關(guān)閉的情況)
  2. 虛擬機中添加一塊新的磁盤

  1. 選擇磁盤類型

  1. 創(chuàng)建新磁盤


  1. 設(shè)置大小、拆分方式

  1. 設(shè)定文件名(一般默認(rèn)即可)

  1. 確定(一定要確定,不然不會保存的)

  1. 重啟虛擬機

  1. fdisk觀察硬盤實體使用情況
[root@node3 ~]# fdisk -lDisk /dev/sda: 536.9 GB, 536870912000 bytes, 1048576000 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x000bd826   Device Boot      Start         End      Blocks   Id  System/dev/sda1   *        2048     2099199     1048576   83  Linux/dev/sda2         2099200  1048575999   523238400   8e  Linux LVM//新加的磁盤(100G)Disk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/centos-root: 53.7 GB, 53687091200 bytes, 104857600 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/centos-swap: 2147 MB, 2147483648 bytes, 4194304 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/centos-home: 480.0 GB, 479954206720 bytes, 937410560 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytes

  1. 選擇要進(jìn)行操作的磁盤
[root@node3 ~]# fdisk /dev/sdbWelcome 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 tableBuilding a new DOS disklabel with disk identifier 0x2890866a.

  1. 輸入m列出可以執(zhí)行的命令:
command (m for help): mCommand action   a   toggle a bootable flag   b   edit bsd disklabel   c   toggle the dos compatibility flag   d   delete a partition //刪除現(xiàn)有分區(qū)   l   list known partition types   m   print this menu   n   add a new partition //添加新的分區(qū)   o   create a new empty DOS partition table   p   print the partition table //查看分區(qū)情況   q   quit without saving changes   s   create a new empty Sun disklabel   t   change a partition's system id   u   change display/entry units   v   verify the partition table   w   write table to disk and exit   x   extra functionality (experts only)

  1. 輸入p列出磁盤目前的分區(qū)情況 (如果是新的磁盤 忽略步驟)
Command (m for help): pDisk /dev/sdb: 3221 MB, 3221225472 bytes255 heads, 63 sectors/track, 391 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System/dev/sdb1               1           1        8001   8e  Linux LVM/dev/sdb2               2          26      200812   83  Linux
  1. 刪除現(xiàn)有分區(qū)
Command (m for help): dPartition number (1-4): 1Command (m for help): dSelected partition 2

  1. 確認(rèn)分區(qū)已經(jīng)刪除
Command (m for help): pDisk /dev/sdb: 3221 MB, 3221225472 bytes255 heads, 63 sectors/track, 391 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  SystemCommand (m for help):

  1. 建立新的磁盤分區(qū)(兩個主磁盤分區(qū))
Command (m for help): nCommand action   e   extended   p   primary partition (1-4)p    //建立主分區(qū)Partition number (1-4): 1  //分區(qū)號First cylinder (1-391, default 1):  //分區(qū)起始位置Using default value 1last cylinder or  size or  sizeM or  sizeK (1-391, default 391): 100  //分區(qū)結(jié)束位置,單位為扇區(qū)(磁盤扇區(qū)默認(rèn)是512Byte)Command (m for help): n  //再建立一個分區(qū)Command action   e   extended   p   primary partition (1-4)p Partition number (1-4): 2  //分區(qū)號為2First cylinder (101-391, default 101):Using default value 101Last cylinder or  size or  sizeM or  sizeK (101-391, default 391):  200M  //分區(qū)結(jié)束位置,單位為M

  1. 建一個擴展分區(qū)
Command (m for help): nCommand action   e   extended   p   primary partition (1-4)e  //選擇擴展分區(qū)Partition number (1-4): 3First cylinder (126-391, default 126):Using default value 126Last cylinder or  size or  sizeM or  sizeK (126-391, default 391)://剩下的空間都用做擴展分區(qū)Using default value 391

  1. 查看擴展分區(qū)
Command (m for help): pDisk /dev/sdb: 3221 MB, 3221225472 bytes255 heads, 63 sectors/track, 391 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System/dev/sdb1               1         100      803218   83  Linux/dev/sdb2             101         125      200812   83  Linux/dev/sdb3             126         391     2136645    5  Extended

  1. 擴展分區(qū)上建立邏輯分區(qū)
Command (m for help): nCommand action   l   logical (5 or over)   p   primary partition (1-4)l //選擇邏輯分區(qū)First cylinder (126-391, default 126):Using default value 126Last cylinder or  size or  sizeM or  sizeK (126-391, default 391):  400M    Command (m for help): nCommand action   l   logical (5 or over)   p   primary partition (1-4)lFirst cylinder (176-391, default 176):Using default value 176Last cylinder or  size or  sizeM or  sizeK (176-391, default 391):Using default value 391

  1. 查看當(dāng)前分區(qū)情況
Command (m for help): pDisk /dev/sdb: 3221 MB, 3221225472 bytes255 heads, 63 sectors/track, 391 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System/dev/sdb1               1         100      803218   83  Linux/dev/sdb2             101         125      200812   83  Linux/dev/sdb3             126         391     2136645    5  Extended/dev/sdb5             126         175      401593   83  Linux/dev/sdb6             176         391     1734988   83  LinuxCommand (m for help):

從上面的結(jié)果我們可以看到,在硬盤sdb我們建立了2個主分區(qū)(sdb1,sdb2),1個擴展分區(qū)(sdb3),2個邏輯分區(qū)(sdb5,sdb6)

注意:主分區(qū)和擴展分區(qū)的磁盤號位1-4,也就是說最多有4個主分區(qū)或者擴展分區(qū),邏輯分區(qū)開始的磁盤號為5,因此在這個實驗中試沒有sdb4的。


  1. 保存分區(qū)操作
Command (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.

分區(qū)創(chuàng)建方式按照參考文檔的操作,但是我并沒有創(chuàng)建這么多分區(qū),100G全部創(chuàng)建了主分區(qū)即/dev/sdb1


  1. fdisk 查看硬盤分區(qū)情況
[root@node3 ~]# fdisk -lDisk /dev/sda: 536.9 GB, 536870912000 bytes, 1048576000 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x000bd826   Device Boot      Start         End      Blocks   Id  System/dev/sda1   *        2048     2099199     1048576   83  Linux/dev/sda2         2099200  1048575999   523238400   8e  Linux LVMDisk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x2890866a   Device Boot      Start         End      Blocks   Id  System/dev/sdb1            2048   209715199   104856576   83  Linux  //新的分區(qū)(sbd1:100G)Disk /dev/mapper/centos-root: 53.7 GB, 53687091200 bytes, 104857600 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/centos-swap: 2147 MB, 2147483648 bytes, 4194304 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/centos-home: 480.0 GB, 479954206720 bytes, 937410560 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytes

  1. cat /proc/partitions 查看磁盤文件信息
[root@node3 ~]# cat /proc/partitionsmajor minor  #blocks  name   8        0  524288000 sda   8        1    1048576 sda1   8        2  523238400 sda2   8       16  104857600 sdb   8       17  104856576 sdb1  11        0    1048575 sr0 253        0   52428800 dm-0 253        1    2097152 dm-1 253        2  468705280 dm-2

  1. mkfs -t ext3 /dev/sdb1格式化分區(qū)
[root@node3 ~]# mkfs -t ext3 /dev/sdb1mke2fs 1.42.9 (28-Dec-2013)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)Stride=0 blocks, Stripe width=0 blocks6553600 inodes, 26214144 blocks1310707 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=4294967296800 block groups32768 blocks per group, 32768 fragments per group8192 inodes per groupSuperblock backups stored on blocks:        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,        4096000, 7962624, 11239424, 20480000, 23887872Allocating group tables: doneWriting inode tables: doneCreating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: done
  1. mount /dev/sdb1 /guazai
#/usr/hdp/  目錄要先存在[root@node3 ~]# mount /dev/sdb1 /usr/hdp/
  1. 查看掛載情況
[root@node3 usr]# df -hFilesystem               Size  Used Avail Use% Mounted on/dev/mapper/centos-root   50G   50G   20K 100% /devtmpfs                 3.8G     0  3.8G   0% /devtmpfs                    3.9G     0  3.9G   0% /dev/shmtmpfs                    3.9G   12M  3.8G   1% /runtmpfs                    3.9G     0  3.9G   0% /sys/fs/cgroup/dev/sda1               1014M  142M  873M  14% /boot/dev/mapper/centos-home  447G 1018M  446G   1% /hometmpfs                    781M     0  781M   0% /run/user/0/dev/sdb1                 99G   60M   94G   1% /usr/hdp //掛載成功
  1. 取消掛載
[root@node3 /]# umount /dev/sdb1[root@node3 /]# df -kFilesystem              1K-blocks     Used Available Use% Mounted on/dev/mapper/centos-root  52403200 52403180        20 100% /devtmpfs                  3983896        0   3983896   0% /devtmpfs                     3996168        0   3996168   0% /dev/shmtmpfs                     3996168    11992   3984176   1% /runtmpfs                     3996168        0   3996168   0% /sys/fs/cgroup/dev/sda1                 1038336   145260    893076  14% /boot/dev/mapper/centos-home 468476420  1041428 467434992   1% /hometmpfs                      799236        0    799236   0% /run/user/0

取消掛載成功
還可以用umount /usr/hdp 取消掛載

來源:https://www.icode9.com/content-3-413051.html
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
linux 文件系統(tǒng)管理三部曲之一:磁盤分區(qū)
linux 磁盤分區(qū)表
CentOS7.6掛載硬盤
Linux磁盤系統(tǒng)基礎(chǔ)知識
Linux下磁盤掛載
Linux基礎(chǔ)命令介紹十二:磁盤與文件系統(tǒng)
更多類似文章 >>
生活服務(wù)
熱點新聞
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服