centos7雲主機系統下掛載磁碟

來源:互聯網
上載者:User

centos7雲主機系統下掛載磁碟

一、準備
centos7雲主機一台
50G雲硬碟
雲硬碟掛載到雲主機上

二、掛載磁碟
1.1查看新磁碟

[root@cgsl ]# fdisk –l

找到新添加的磁碟的編號為/dev/vdc

1.2硬碟分區 進入fdisk模式

[root@cgsl ]# /sbin/fdisk /dev/vdc

輸入n進行分區

[root@cgsl ]# Command (m for help): n

選擇分區類型

[root@cgsl ]# Select (default p): p

選擇分區個數

[root@cgsl ]# Partition number (1-4, default 1): 1

一直斷行符號,最後輸入q退出。

三、格式化分區 將新分區格式化為ext3檔案系統

[root@cgsl ]# mkfs -t ext3 /dev/vdc

四、掛載硬碟 1.建立掛載點,在根目錄下建立storage目錄

[root@cgsl ]# mkdir /storage

2.將/dev/vdc掛載到/storage下

[root@cgsl ]# mount /dev/vdc /storage

3.設定開機啟動自動掛載 新建立的分區不能開機自動掛載,每次重啟機器都要手動掛載。 設定開機自動掛載需要修改/etc/fstab檔案

#vi /etc/fstab 

在檔案的最後增加一行 /dev/vdc /storage ext3 defaults 1 2

注意要查詢一下自己的硬碟格式,用df -T查詢。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.