磁碟格式化

来源:http://www.cnblogs.com/bass6/archive/2016/04/27/5439947.html
-Advertisement-
Play Games

在使用硬碟之前必須對其分區進行格式化,並掛載: ...


[root@r~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        20G  5.5G   14G  30% /
tmpfs           1.9G     0  1.9G   0% /dev/shm
[root@r ~]# fdisk -l

Disk /dev/vda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00078f9c

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *           1        2611    20970496   83  Linux

Disk /dev/vdb: 214.7 GB, 214748364800 bytes
16 heads, 63 sectors/track, 416101 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
[root@r ~]# fdisk /dev/vdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x1aed48fa.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): 

 

Command (m for help): p  #列印分區列表

Disk /dev/vdb: 214.7 GB, 214748364800 bytes
16 heads, 63 sectors/track, 416101 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1aed48fa

   Device Boot      Start         End      Blocks   Id  System
Command (m for help): m  #m查看幫助
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
Command action
   e   extended
   p   primary partition (1-4)
1
Invalid partition number for type `1'
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-416101, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-416101, default 416101): 
Using default value 416101

Command (m for help): w
The partition table has been altered!

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

 

[root@r ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        20G  5.5G   14G  30% /
tmpfs           1.9G     0  1.9G   0% /dev/shm
[root@r ~]# fdisk -l

Disk /dev/vda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00078f9c

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *           1        2611    20970496   83  Linux

Disk /dev/vdb: 214.7 GB, 214748364800 bytes
16 heads, 63 sectors/track, 416101 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1aed48fa

   Device Boot      Start         End      Blocks   Id  System
/dev/vdb1               1      416101   209714872+  83  Linux

  在使用硬碟之前必須對其分區進行格式化,並掛載:

[root@r ~]# mkfs.ext3 /dev/vdb1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
13107200 inodes, 52428718 blocks
2621435 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
1600 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000, 7962624, 11239424, 20480000, 23887872

Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

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

 

[root@r ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        20G  5.5G   14G  30% /
tmpfs           1.9G     0  1.9G   0% /dev/shm
[root@r ~]# mkdir /hdd1
[root@r ~]# mount /dev/vdb1 /hdd1
[root@r ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        20G  5.5G   14G  30% /
tmpfs           1.9G     0  1.9G   0% /dev/shm
/dev/vdb1       197G  188M  187G   1% /hdd1

 


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 培訓Spark架構開發! 從基礎到高級,一對一培訓![技術QQ:2937765541] 課程體系: 獲取視頻資料和培訓解答技術支持地址 課程展示(大數據技術很廣,一直線上為你培訓解答!): 獲取視頻資料和培訓解答技術支持地址 ...
  • 培訓大數據架構開發、挖掘分析! 從零基礎到高級,一對一培訓![技術QQ:2937765541] 課程體系: 獲取視頻資料和培訓解答技術支持地址 課程展示(大數據技術很廣,一直線上為你培訓解答!): 獲取視頻資料和培訓解答技術支持地址 ...
  • 首先,介紹一下Redis資料庫。Redis是一種面向“鍵/值”對數據類型的記憶體資料庫,可以滿足我們對海量數據的讀寫需求。 1)redis的鍵只能是字元串; 2)redis的值支持多種數據類型: a:字元串 string b:哈希 hash c:字元串列表 list d:字元串集合 set 不重覆,無 ...
  • 由於前一段時間胃痛,導致博客園博客都停更了一個月左右。近幾天,胃病終於稍微有所好轉,決定重新寫博文。 前幾天,有個朋友剛好問到本人有關 SQL 語句,大致是原表有兩列,分別為月份、月份銷售額,而需要一條 SQL 語句實現統計出每個月份以及當前月以前月份銷售額和。尼瑪,感覺還是沒有說清,下麵用圖表示。 ...
  • mysql copy表或表數據常用的語句整理彙總. 假如我們有以下這樣一個表: 1. 下麵這個語句會拷貝表結構到新表newadmin中。 (不會拷貝表中的數據) 2. 下麵這個語句會拷貝數據到新表中。 註意:這個語句其實只是把select語句的結果建一個表。所以newadmin這個表不會有主鍵,索引 ...
  • 查詢作業的執行情況sql: step:作業的第幾個步驟。其中0為結果。 step:對應步驟的名字。 即是查作業的歷史記錄。 ...
  • 嵌入式軟體開發中,雖然很多的開發工具已經支持C++的開發,但是因為有時考慮運行效率和編程習慣,還是有很多人喜歡用C來開發嵌入式軟體。Miro Samek說:“我在開發現場發現,很多嵌入式軟體開發者(絕大多數是電子工程師)都有工作背景而且他們常常不喜歡用C++。”【1】面向對象編程(OOP)是一種方法... ...
  • :介紹 在shell4.0之後支持普通數組和關聯數組,普通數組只能使用整數作為索引,關聯數組可以使用字元串作為索引。 普通數組 普通數組的定義方法有如下兩種,註意數組的索引是從0開始 方法1:值之間是使用空格隔開 array=(1 2 3 4 5) 方法2:直接定義索引-值的方法,其實該方法相當於是 ...
一周排行
    -Advertisement-
    Play Games
  • 示例項目結構 在 Visual Studio 中創建一個 WinForms 應用程式後,項目結構如下所示: MyWinFormsApp/ │ ├───Properties/ │ └───Settings.settings │ ├───bin/ │ ├───Debug/ │ └───Release/ ...
  • [STAThread] 特性用於需要與 COM 組件交互的應用程式,尤其是依賴單線程模型(如 Windows Forms 應用程式)的組件。在 STA 模式下,線程擁有自己的消息迴圈,這對於處理用戶界面和某些 COM 組件是必要的。 [STAThread] static void Main(stri ...
  • 在WinForm中使用全局異常捕獲處理 在WinForm應用程式中,全局異常捕獲是確保程式穩定性的關鍵。通過在Program類的Main方法中設置全局異常處理,可以有效地捕獲並處理未預見的異常,從而避免程式崩潰。 註冊全局異常事件 [STAThread] static void Main() { / ...
  • 前言 給大家推薦一款開源的 Winform 控制項庫,可以幫助我們開發更加美觀、漂亮的 WinForm 界面。 項目介紹 SunnyUI.NET 是一個基於 .NET Framework 4.0+、.NET 6、.NET 7 和 .NET 8 的 WinForm 開源控制項庫,同時也提供了工具類庫、擴展 ...
  • 說明 該文章是屬於OverallAuth2.0系列文章,每周更新一篇該系列文章(從0到1完成系統開發)。 該系統文章,我會儘量說的非常詳細,做到不管新手、老手都能看懂。 說明:OverallAuth2.0 是一個簡單、易懂、功能強大的許可權+可視化流程管理系統。 有興趣的朋友,請關註我吧(*^▽^*) ...
  • 一、下載安裝 1.下載git 必須先下載並安裝git,再TortoiseGit下載安裝 git安裝參考教程:https://blog.csdn.net/mukes/article/details/115693833 2.TortoiseGit下載與安裝 TortoiseGit,Git客戶端,32/6 ...
  • 前言 在項目開發過程中,理解數據結構和演算法如同掌握蓋房子的秘訣。演算法不僅能幫助我們編寫高效、優質的代碼,還能解決項目中遇到的各種難題。 給大家推薦一個支持C#的開源免費、新手友好的數據結構與演算法入門教程:Hello演算法。 項目介紹 《Hello Algo》是一本開源免費、新手友好的數據結構與演算法入門 ...
  • 1.生成單個Proto.bat內容 @rem Copyright 2016, Google Inc. @rem All rights reserved. @rem @rem Redistribution and use in source and binary forms, with or with ...
  • 一:背景 1. 講故事 前段時間有位朋友找到我,說他的窗體程式在客戶這邊出現了卡死,讓我幫忙看下怎麼回事?dump也生成了,既然有dump了那就上 windbg 分析吧。 二:WinDbg 分析 1. 為什麼會卡死 窗體程式的卡死,入口門檻很低,後續往下分析就不一定了,不管怎麼說先用 !clrsta ...
  • 前言 人工智慧時代,人臉識別技術已成為安全驗證、身份識別和用戶交互的關鍵工具。 給大家推薦一款.NET 開源提供了強大的人臉識別 API,工具不僅易於集成,還具備高效處理能力。 本文將介紹一款如何利用這些API,為我們的項目添加智能識別的亮點。 項目介紹 GitHub 上擁有 1.2k 星標的 C# ...