linux 超过2TB分区

大纲

1.添加一块超过2TB硬盘

2.尝试fdisk 对超过2TB分区

3.使用parted分区

1.可以看到添加一块硬盘超过2T

[[email protected] ~]# 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          13      104391   83  Linux
/dev/sda2              14         274     2096482+  82  Linux swap / Solaris
/dev/sda3             275        2610    18763920   83  Linux

Disk /dev/sdb: 3221.2 GB, 3221225472000 bytes
255 heads, 63 sectors/track, 391625 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn‘t contain a valid partition table

2.尝试用fdisk 对sdb进行分区

[[email protected] ~]# fdisk /dev/sdb
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 391625.
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: The size of this disk is 3.2 TB (3221225472000 bytes).
DOS partition table format can not be used on drives for volumes
larger than 2.2 TB (2199023255040 bytes). Use parted(1) and GUID
partition table format (GPT).

说明fdisk不支持超过2TB分区

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

Command (m for help): 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): q

[[email protected] ~]# uname -r
2.6.18-371.el5
[[email protected] ~]# cat /etc/redhat-release
CentOS release 5.10 (Final)

3.用parted 分区
[[email protected] ~]# parted /dev/sdb
GNU Parted 1.8.1
Using /dev/sdb
Welcome to GNU Parted! Type ‘help‘ to view a list of commands.
(parted) mklabel gpt           --将MBR磁盘格式化为GPT                                           
(parted) print                       #打印当前分区

Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 3221GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start  End  Size  File system  Name  Flags

(parted) mkpart primary 0 3.2TB           ---# 分一个3.2T的主分区                            
(parted) print

Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 3221GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
 1      17.4kB  3221GB  3221GB               primary

(parted) quit                                                            
Information: Don‘t forget to update /etc/fstab, if necessary.

4.然后格式化成ext3

[[email protected] ~]# mkfs.ext3 /dev/sdb1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
393216000 inodes, 786431991 blocks
39321599 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
24000 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, 550731776, 644972544

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

This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[[email protected] ~]#

5.接着用mount挂载分区

[[email protected] ~]# mkdir /gpt
[[email protected] ~]# mount /dev/sdb1 /gpt
[[email protected] ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              18G  2.3G   15G  14% /
/dev/sda1              99M   12M   82M  13% /boot
tmpfs                1005M     0 1005M   0% /dev/shm
/dev/sdb1             2.9T  200M  2.8T   1% /gpt

6.最后修改/etc/fstab,添加如下两行,让其开机自动挂载.

/dev/sdb1       /gpt         ext3           defaults,noatime       1 2

linux 超过2TB分区

时间: 2024-08-04 22:22:36

linux 超过2TB分区的相关文章

7.linux磁盘管理 分区 建立文件系统 挂载使用

一.磁盘管理 分区  建立文件系统  挂载使用   逻辑卷建立  磁盘阵列的建立  磁盘配额设定 fdisk -l       查看磁盘信息 df -Th        查看硬盘对应的目录 /dev/sdb/ 20G     1. 文件类型介绍 ext4 扩展型文件系统   特点   支持单个文件上 EB 支持日志功能 NTFS 文件    和   fat32        不支持单个文件上4G swap 交换分区 虚拟内存 8G  8G  4G 1.5倍 mbr 分区表方式  :支持4个主分区

Linux系统安装时分区的选择(转)

原文地址:http://www.cnblogs.com/gylei/archive/2011/12/04/2275987.html 前言: 以前初识Linux时,对Linux系统安装时分区的选择,一点都不了解,导致几次没法进行下一步安装,因此就静下心来,专门拿出时间研究了研究这方面的知识: 以下内容就是以前通过研究Linux安装过程中分区的知识总结出来的一些知识:贴上来,做个备份,也希望对Linux初学者有一些帮助. 正文: 一般来说,在linux系统中都有最少两个挂载点,分别是/ (根目录)及

Linux系统安装时分区的选择(推荐)

前言: 以前初识Linux时,对Linux系统安装时分区的选择,一点都不了解,导致几次没法进行下一步安装,因此就静下心来,专门拿出时间研究了研究这方面的知识: 以下内容就是以前通过研究Linux安装过程中分区的知识总结出来的一些知识:贴上来,做个备份,也希望对Linux初学者有一些帮助. 正文: 一般来说,在linux系统中都有最少两个挂载点,分别是/ (根目录)及 swap(交换分区),其中,/ 是必须的: 详细内容见下文: 建议挂载的几大目录: /-------根目录,唯一必须挂载的目录.不

(转)Linux系统安装时分区的选择

场景:对于Linux系统的分区总是迷迷茫茫的,还是实践少,基础不牢. 以前初识Linux时,对Linux系统安装时分区的选择,一点都不了解,导致几次没法进行下一步安装,因此就静下心来,专门拿出时间研究了研究这方面的知识: 以下内容就是以前通过研究Linux安装过程中分区的知识总结出来的一些知识:贴上来,做个备份,也希望对Linux初学者有一些帮助. 1 直奔主题 一般来说,在linux系统中都有最少两个挂载点,分别是/ (根目录)及 swap(交换分区),其中,/ 是必须的: 详细内容见下文:

linux基础内容学习一:linux下的分区及安装

linux看系统版本信息 uname -a 如果显示为i386,i686则为32位系统,如果为x86_64则为64位 一块硬盘最多可以有四个主分区其中一个主分区可以用一个扩展分区替换,在这个扩展分区中可以有多个逻辑分区 一块硬盘最多只能一个扩展分区,扩展分区不能直接使用,必须在扩展分区中建立逻辑分区以后格式化后才能装系统或者存数据 扩展分区最多有一个,可以没有扩展分区 linux下的分区方案 五个分区 1p+1e(4个l) p1 l5 l6 l7 l8 2p+1e(3l) p1 p2 l5 l6

linux的磁盘分区, 挂载命令

|--分区基础知识 说明: |--1.linux无论有几个分区,分给那一目录使用, 只有一个根目录,一个独立且唯一的文件结构 linux中每个分区都是用来组成整个文件系统的一部分 |--2.linux采用一种叫"载入"的处理方式,它的整个文件系统 中包含一个整套的文件和目录,且将一个分区和一个目录 联系起来,这时要载入的一个分区将使它的存储空间 在一个目录下获得|--分区的方式 |--1.mbr分区 |--最多支持四个主分区 |--系统只能安装在主分区 |--扩展分区要占一个主分区 |

Linux系统磁盘分区及挂载 - fdisk

Linux系统磁盘分区及挂载 - fdisk 文本关键字:文件系统,磁盘分区,格式化,挂载 一.文件系统 1. 文件系统的作用 当我们拿到一块新的硬盘时,他所能够支持的最大空间只是代表硬件上的一个参数,我们要想让他能够正常的工作起来,必须要有相应的文件系统.文件系统决定了文件存储和管理时的方式和数据结构,也就是如何管理磁盘上的文件和文件夹.不同的文件系统拥有不同的特点,这也就是为什么我们在进行格式化操作必须要选定一种文件系统的原因.当在一个操作系统(Windows.Linux.MacOS)中使用

linux系统硬盘分区

linux系统硬盘分区 首先我们需要了解一下linux中设备文件的命名: hda一般是指IDE接口的硬盘,hda一般指第一块硬盘,类似的有hdb,hdc! sda一般是指SATA接口的硬盘,sda一般指第一块硬盘,类似的有sdb,sdc! 第一步:-----利用fdisk进入硬盘操作 进入命令行: #fdisk /dev/sda  (SDA指的是第一块硬盘)   //第一步 然后敲入m 可以得到输入提示! 这里我们用到的命令主要有: d: 删除一个分区 n:创建一个分区 t:改变分区的类型 p:

Linux 添加新分区

Linux系统由于数据累计增长.前期存储规划不合理等诸多因素,出现存储不够用的情况时,此时就需要扩展逻辑分区或添加新的逻辑分区.下面介绍一下通过使用fdsik添加新的逻辑分区. 首先使用df命令检查文件系统的磁盘空间占用情况 [[email protected]~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-sda3 30G 2.4G 26G 9% / /dev/sda1 99M 23M 71