歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux系統超過2T磁盤格式化

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

日期:2017/2/28 14:37:17   编辑:Linux教程

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


就可以了.

Copyright © Linux教程網 All Rights Reserved