Linux系統超過2T磁碟格式化

來源:互聯網
上載者:User

Linux系統超過2T磁碟格式化

查看系統資訊
[root@localhost ~]# cat /etc/RedHat-release
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
[root@localhost ~]# uname -r
2.6.18-194.el5
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:43 EDT 2010 i686 i686 i386 GNU/Linux
[root@localhost log]# uname -r
2.6.18-194.el5  //最小也的是2.6.18.24
查看磁碟情況
[root@localhost ~]# fdisk -l
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot  Start  End  Blocks  Id  System
/dev/sda1  *  1  65  522081  83  Linux
/dev/sda2  66  196  1052257+  82  Linux swap / Solaris
/dev/sda3  197  2610  19390455  83  Linux
Disk /dev/sdb: 2190.4 GB, 2190433320960 bytes  //已經是2T左右了
255 heads, 63 sectors/track, 266305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table
[root@localhost ~]# rpm -qf /sbin/parted //安裝工具包
parted-1.8.1-27.el5
[root@localhost ~]# parted /dev/sdb  //開始對大容量的磁碟操作
[root@localhost ~]# parted /dev/sdb
GNU Parted 1.8.1
使用/dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print free  //第一次是列印不了資訊的,因為沒有
錯誤:無法開啟/dev/sdb -無法識別的磁碟標籤。
(parted) help  //顯示協助資訊
check NUMBER  do a simple check on the file system
cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER  copy file system to another partition
help [COMMAND]  prints general help, or help on COMMAND
mklabel,mktable LABEL-TYPE  create a new disklabel (partition table)
mkfs NUMBER FS-TYPE make a FS-TYPE file system on partititon NUMBER
mkpart PART-TYPE [FS-TYPE] START END  make a partition
mkpartfs PART-TYPE FS-TYPE START END  make a partition with a file system
move NUMBER START END  move partition NUMBER
name NUMBER NAME  name partition NUMBER as NAME
print [free|NUMBER|all]  display the partition table, a partition, or all devices
quit  exit program
rescue START END  rescue a lost partition near START and END
resize NUMBER START END  resize partition NUMBER and its file system
rm NUMBER  delete partition NUMBER
select DEVICE choose the device to edit
set NUMBER FLAG STATE  change the FLAG on partition NUMBER
toggle [NUMBER [FLAG]]  toggle the state of FLAG on partition NUMBER
unit UNIT  set the default unit to UNIT
version  displays the current version of GNU Parted and copyright information
(parted) mklabel  //改變分區表的格式
新的磁碟標籤類型?gpt  //設定為gpt的分區格式
(parted) mkpart
分區名稱? []? /dev/sdb1  //填寫分區名稱
檔案系統類型? [ext2]? ext3  //填寫格式化類型
起始點?0//0代表是從第一個磁軌開始的
結束點?-1//-1是代表到最後一個磁軌
(parted) print free
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 2190GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt  //修改為gpt格式
Number  Start  End  Size  File system  Name 標誌
1  17.4kB  2190GB  2190GB  /dev/sdb1
(parted)quit  //退出
2.6.24
[root@localhost ~]# mkfs.ext3 -b 8192 /dev/sdb1
[root@localhost ~]# mkfs.ext3  -F /dev’sdb1
[root@localhost ~]# mount  -t ext3 /dev/sdb1 /01
-F是強制的意思
-b 8192(8M)是指定塊大小,8M只能支援到16TB的空間,如果還是比較大的話就多指定點就行了
格式化會很長時間
[root@localhost log]# mount -t ext3 /dev/sdb1 /01
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail  or so
[root@localhost log]# mkfs.ext3 -F /dev/sdb1  //添加-F參數就能解決這個問題
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
267386880 inodes, 534773751 blocks
26738687 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
16320 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, 512000000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@localhost log]#


[root@localhost log]# mount -t ext3 /dev/sdb1 /01


[root@localhost log]# df -h
檔案系統容量已用可用已用%掛載點
/dev/sda3  18G  3.8G  14G  23% /
/dev/sda1  494M  17M  453M  4% /boot
tmpfs  506M  0  506M  0% /dev/shm
/dev/sdb1  2.0T  199M  1.9T  1% /01


就可以了.

聯繫我們

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