立即注冊 找回密碼

QQ登錄

只需一步,快速開始

查看: 3691|回復(fù): 0
打印 上一主題 下一主題

[Linux主機(jī)系統(tǒng)教程] linux下分區(qū)、格式化、掛載新硬盤的詳細(xì)教程

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
發(fā)表于 2015-5-24 19:34:18 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
道勤網(wǎng)-數(shù)據(jù)bmrsportswear.com

親注冊登錄道勤網(wǎng)-可以查看更多帖子內(nèi)容哦。ò蕡D片、文字詳情等)請您及時注冊登錄-bmrsportswear.com

您需要 登錄 才可以下載或查看,沒有賬號?立即注冊

x

1、# fdisk -l      查看當(dāng)前磁盤信息,就會發(fā)現(xiàn)最下面顯示新加入的硬盤不是有效分區(qū),如下:
Disk /dev/sdc: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdc doesn't contain a valid partition table

2、# fdisk /dev/sdc      對新硬盤分區(qū),并根據(jù)提示進(jìn)一步操作
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 182401.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): h      輸入h可查看幫助命令
h: unknown command
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   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)

Command (m for help): n      輸入n進(jìn)行分區(qū)
Command action
   e   extended
   p   primary partition (1-4)
p      輸入p為主分區(qū),e為邏輯分區(qū)
Partition number (1-4): 1      由于是新盤我們輸入1來分第一個主分區(qū),共可以分4個主分區(qū)
First cylinder (1-182401, default 1):      選擇該分區(qū)的起始磁盤數(shù),如無特殊需求強(qiáng)烈建議選擇默認(rèn),也就是1來分區(qū)(直接按回車)
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-182401, default 182401):      定義該分區(qū)的大小,如果按默認(rèn)(按回車)即是使用全部可用存儲額,如分一個1G的空間,輸入+1024m
Using default value 182401

Command (m for help): w      寫入分區(qū)
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

3、# fdisk -l      可以找到我們剛才分的一個分區(qū),內(nèi)容如下:
Disk /dev/sdc: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id System
/dev/sdc1               1      182401 1465136001   83 linux

4、# mkfs -t ext3 -c /dev/sdc1      對分區(qū)使用ext3格式化,如多個分區(qū)sdc2等以此類推,因為新硬盤加了-c參數(shù)要先檢測磁盤壞道,此過程萬分漫長(150G),等待。。。
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
183156736 inodes, 366284000 blocks
18314200 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
11179 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
        102400000, 214990848

Checking for bad blocks (read-only test): done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

5、# mkdir /var/samba      新建掛載目錄

6、# mount /dev/sdc1 /var/samba      掛載新硬盤

7、# df -hl      查看分區(qū)大小是否和我們預(yù)定的一樣:
文件系統(tǒng)               容量   已用 可用 已用% 掛載點
/dev/sda7             9.5G 3.2G 5.9G 35% /
/dev/sda6             9.5G 151M 8.9G   2% /tmp
/dev/sda5              19G 3.6G   15G 20% /usr
/dev/sda3              19G 719M   18G   4% /home
/dev/sda2             230G   23G 196G 11% /var
/dev/sda1              99M   25M   69M 27% /boot
/dev/sdb1             233G 156G   78G 67% /var/samba2
tmpfs                1008M     0 1008M   0% /dev/shm
/dev/sdc1             1.4T 198M 1.3T   1% /var/samba      此行為新硬盤

8、# vi /etc/fstab      設(shè)置系統(tǒng)自動掛載硬盤,加入一行:
/dev/sdc1               /var/samba2             ext3    defaults        0 0

9、重啟服務(wù)器,用步驟7檢查一下,一切正常掛載完成,祝好運~


道勤主機(jī)提供365天*24小時全年全天無休、實時在線、零等待的售后技術(shù)支持。竭力為您免費處理您在使用道勤主機(jī)過程中所遇到的一切問題! 如果您是道勤主機(jī)用戶,那么您可以通過QQ【792472177】、售后QQ【59133755】、旺旺【詮釋意念】、微信:q792472177免費電話、后臺提交工單這些方式聯(lián)系道勤主機(jī)客服! 如果您不是我們的客戶也沒問題,點擊頁面最右邊的企業(yè)QQ在線咨詢圖標(biāo)聯(lián)系我們并購買后,我們?yōu)槟赓M進(jìn)行無縫搬家服務(wù),讓您享受網(wǎng)站零訪問延遲的遷移到道勤主機(jī)的服務(wù)!
本內(nèi)容系 道勤團(tuán)隊 bmrsportswear.com 客服與技術(shù)人員研究整理的智慧結(jié)晶,轉(zhuǎn)載勿用于商業(yè)用途,并保留本文鏈接,侵權(quán)必究!
dsu_marcocopyright:copy_link 

【道勤網(wǎng)】- bmrsportswear.com 軟件視頻自學(xué)教程|免費教程|自學(xué)電腦|3D教程|平面教程|影視動畫教程|辦公教程|機(jī)械設(shè)計教程|網(wǎng)站設(shè)計教程!【道勤網(wǎng)】 - 論壇版權(quán)1、本主題所有言論和圖片純屬會員個人意見,與本論壇立場無關(guān)
2、本站所有主題由該帖子作者發(fā)表,該帖子作者與【道勤網(wǎng)】- bmrsportswear.com 軟件視頻自學(xué)教程|免費教程|自學(xué)電腦|3D教程|平面教程|影視動畫教程|辦公教程|機(jī)械設(shè)計教程|網(wǎng)站設(shè)計教程!【道勤網(wǎng)】享有帖子相關(guān)版權(quán)
3、其他單位或個人使用、轉(zhuǎn)載或引用本文時必須同時征得該帖子作者和【道勤網(wǎng)】- bmrsportswear.com 軟件視頻自學(xué)教程|免費教程|自學(xué)電腦|3D教程|平面教程|影視動畫教程|辦公教程|機(jī)械設(shè)計教程|網(wǎng)站設(shè)計教程!【道勤網(wǎng)】的同意
4、帖子作者須承擔(dān)一切因本文發(fā)表而直接或間接導(dǎo)致的民事或刑事法律責(zé)任
5、本帖部分內(nèi)容轉(zhuǎn)載自其它媒體,但并不代表本站贊同其觀點和對其真實性負(fù)責(zé)
6、如本帖侵犯到任何版權(quán)問題,請立即告知本站,本站將及時予與刪除并致以最深的歉意
7、【道勤網(wǎng)】- bmrsportswear.com 軟件視頻自學(xué)教程|免費教程|自學(xué)電腦|3D教程|平面教程|影視動畫教程|辦公教程|機(jī)械設(shè)計教程|網(wǎng)站設(shè)計教程!【道勤網(wǎng)】管理員和版主有權(quán)不事先通知發(fā)貼者而刪除本文

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

關(guān)閉

道勤網(wǎng)- 推薦內(nèi)容!上一條 /2 下一條

!jz_fbzt! !jz_sgzt! !jz_xgzt! 快速回復(fù) !jz_fhlb! !jz_lxwm! !jz_gfqqq!

關(guān)于我們|手機(jī)版|小黑屋|地圖|【道勤網(wǎng)】-bmrsportswear.com 軟件視頻自學(xué)教程|免費教程|自學(xué)電腦|3D教程|平面教程|影視動畫教程|辦公教程|機(jī)械設(shè)計教程|網(wǎng)站設(shè)計教程【道勤網(wǎng)】 ( 皖I(lǐng)CP備15000319號-1 )

GMT+8, 2024-10-23 09:35

Powered by DaoQin! X3.4 © 2016-2063 Dao Qin & 道勤科技

快速回復(fù) 返回頂部 返回列表