linux掛載硬碟

來源:互聯網
上載者:User

最近有個生產機由於緩衝問題,硬碟不太夠用,所以就載入了一塊硬碟,下面把掛載硬碟的過程記錄下,供大家參考,有問題歡迎留言!

 

fdisk –l

----------------------------------------------------------------------------
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000af383

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1244 9992398+ 83 Linux
/dev/sda2 1245 1305 489982+ 5 Extended
/dev/sda5 1245 1305 489951 82 Linux swap / Solaris

Disk /dev/sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table
----------------------------------------------------------------------------
1

看到新增加的硬碟是/deb/sdb,但是還沒有分區表

 

3. 分區

fdisk /dev/sdb

這時有很多選項,選擇m

然後選擇n

然後選擇p

然後選擇1

之後還有兩個選項

1
2
First Cylinder(1-1014,default 1):
Last cylindet or +siza or +sizeM or +sizeK:
我均選擇了預設,然後輸入w,儲存,退出

 

4. 格式化分區

1
sudo mkfs -t ext3 /dev/sdb1

5. 掛載分區

1
2
3
sudo mkdir /www // 建立新的掛載點,裝matlab用
sudo mount /dev/sdb1 /www
sudo df

6. 開機自動掛載

1
vi /etc/fstab // 修改這個檔案,或者用gedit都行

然後添加到末尾

1
dev/sdb1 /www ext3 defaults 1 2

這樣開機,就可以掛載了www了,OK妥活!

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.