国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 服務(wù)器 > Web服務(wù)器 > 正文

centos 6.4 fdisk分區(qū)、格式化、掛載新硬盤

2024-09-01 13:47:42
字體:
供稿:網(wǎng)友
1、# fdisk -l
查看當(dāng)前磁盤信息,就會(huì)發(fā)現(xiàn)最下面顯示新加入的硬盤不是有效分區(qū),如下:
 
 
  1. [root@localhost /]# fdisk -l 
  2.  
  3. Disk /dev/xvdb: 429.5 GB, 429496729600 bytes 
  4. 255 heads, 63 sectors/track, 52216 cylinders 
  5. Units = cylinders of 16065 * 512 = 8225280 bytes 
  6. Sector size (logical/physical): 512 bytes / 512 bytes 
  7. I/O size (minimum/optimal): 512 bytes / 512 bytes 
  8. Disk identifier: 0x00000000 
2、# fdisk /dev/xvdb
對(duì)新硬盤分區(qū),并根據(jù)提示進(jìn)一步操作:
 
  1. [root@localhost /]# fdisk /dev/xvdb 
  2. Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel 
  3. Building a new DOS disklabel with disk identifier 0x7f095069. 
  4. Changes will remain in memory only, until you decide to write them. 
  5. After that, of course, the previous content won't be recoverable. 
  6.  
  7. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) 
  8.  
  9. WARNING: DOS-compatible mode is deprecated. It's strongly recommended to 
  10.          switch off the mode (command 'c') and change display units to 
  11.          sectors (command 'u'). 
  12.  
  13. Command (m for help): n 輸入n進(jìn)行分區(qū) 
  14. Command action 
  15. e extended 
  16. p primary partition (1-4) 
  17. p 輸入p為主分區(qū),e為邏輯分區(qū) 
  18. Partition number (1-4): 1 (由于是新盤我們輸入1來分第一個(gè)主分區(qū),共可以分4個(gè)主分區(qū)) 
  19. First cylinder (1-52216, default 1): 1 (選擇該分區(qū)的起始磁盤數(shù),如無特殊需求強(qiáng)烈建議選擇默認(rèn),也就是1來分區(qū)(可直接按回車)) 
  20.  
  21. Last cylinder or +size or +sizeM or +sizeK (1-52216, default 52216): 
  22. 定義該分區(qū)的大小,如果按默認(rèn)(按回車)即是使用全部可用存儲(chǔ)額,如分一個(gè)1G的空間,輸入+1024m 
  23. Using default value 52216 
  24.  
  25. Command (m for help): w 寫入分區(qū) 
  26. The partition table has been altered! 
  27.  
  28. Calling ioctl() to re-read partition table. 
  29. Syncing disks. 
3、# fdisk -l
可以找到我們剛才分的一個(gè)分區(qū),內(nèi)容如下:
 
  1. [root@localhost /]#  
  2. fdisk -l 
  3.  
  4. Disk /dev/xvdb: 429.5 GB, 429496729600 bytes 
  5. 255 heads, 63 sectors/track, 52216 cylinders 
  6. Units = cylinders of 16065 * 512 = 8225280 bytes 
  7. Sector size (logical/physical): 512 bytes / 512 bytes 
  8. I/O size (minimum/optimal): 512 bytes / 512 bytes 
  9. Disk identifier: 0x90b7ee49 
  10.  
  11.     Device Boot      Start         End      Blocks   Id  System 
  12. /dev/xvdb1               1       52216   419424988+  83  Linux 
4、# mkfs -t ext4 -c /dev/xvdb1
對(duì)分區(qū)使用ext3格式化,-c參數(shù)要先檢測(cè)磁盤壞道
......
5、# mkdir /data2
新建掛載目錄
......
6、# mount -t ext4 /dev/xvdb1 /data2
掛載新硬盤
......
7、# df -l
查看分區(qū)大小是否和我們預(yù)定的一樣
......
8、最后也是很容易漏掉的一步
[/shell]
echo "/dev/xvdb1 /data2 ext4 defaults 0 0" >> /etc/fstab
[/shell]
如果忘了將這個(gè)寫入配置文件的話,服務(wù)器如果重啟,硬盤將不會(huì)自動(dòng)掛載,將找不到掛載的文件夾。
這時(shí)候要再一直mount 掛載一遍。。。

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 禄丰县| 安徽省| 东台市| 利津县| 四子王旗| 恩平市| 阳朔县| 水城县| 浦城县| 盐亭县| 大安市| 包头市| 沂南县| 永德县| 化隆| 大埔区| 榆中县| 康马县| 张家界市| 红原县| 深圳市| 禄劝| 昌江| 仙居县| 蓝田县| 鄄城县| 应用必备| 土默特右旗| 眉山市| 林西县| 乳源| 五台县| 浑源县| 平遥县| 克什克腾旗| 金湖县| 万载县| 新密市| 嵩明县| 北川| 安西县|