// fdisk -l
[email protected]:/# fdisk -l
Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = 扇区 of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00071c40
设备 启动 起点 终点 块数 Id 系统
/dev/sda1 * 2048 3781251071 1890624512 83 Linux
/dev/sda2 3781253118 3907028991 62887937 5 扩展
/dev/sda5 3781253120 3907028991 62887936 82 Linux 交换 / Solaris
Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes
255 heads, 63 sectors/track, 364801 cylinders, total 5860533168 sectors
Units = 扇区 of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sdb doesn‘t contain a valid partition table
// fdisk /dev/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 with disk identifier 0x2c2a1fd8.
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: The size of this disk is 3.0 TB (3000592982016 bytes).
DOS partition table format can not be used on drives for volumes
larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID
partition table format (GPT).
命令(输入 m 获取帮助): p
Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes
255 heads, 63 sectors/track, 364801 cylinders, total 5860533168 sectors
Units = 扇区 of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2c2a1fd8
设备 启动 起点 终点 块数 Id 系统
命令(输入 m 获取帮助): d
No partition is defined yet!
命令(输入 m 获取帮助): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
分区号 (1-4,默认为 1): 1
起始 sector (2048-4294967295,默认为 2048):
将使用默认值 2048
Last sector, +扇区 or +size{K,M,G} (2048-4294967294,默认为 4294967294):
将使用默认值 4294967294
命令(输入 m 获取帮助): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[email protected]:/#
// mkfs.ext4 /dev/sdb1
[email protected]:/# mkfs.ext4 /dev/sdb1
mke2fs 1.42.9 (4-Feb-2014)
文件系统标签=
OS type: Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
134217728 inodes, 536870655 blocks
26843532 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=4294967296
16384 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, 71663616, 78675968,
102400000, 214990848, 512000000
Allocating group tables: 完成
正在写入inode表: 完成
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information: 完成
[email protected]:/#
// vi /etc/fstab
# this is another phy disk
/dev/sdb1 /mnt/data1 ext4 defaults 0 0
# swap was on /dev/sda5 during installation
UUID=8ea4b4d6-cc01-4bc5-be5d-045538cf0891 none swap sw 0 0