Linux 磁盘分区并格式化

磁盘分区并格式化
概念明晰:分区,对暂时不需要的容量可以留待今后继续分区使用。
操作顺序是:磁盘分区--对分区格式化---对分区进行挂载

---------对磁盘分区
[root@dbcl grid]# fdisk /dev/xvde

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): 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): d
Selected partition 1

Command (m for help): 1
1: unknown command
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)
p
Partition number (1-4): 1
First cylinder (1-104433, default 1):    
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-104433, default 104433): +600G

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): n
Command action
   e   extended
   p   primary partition (1-4)
e
Partition number (1-4): 2
First cylinder (78327-104433, default 78327): 
Using default value 78327
Last cylinder, +cylinders or +size{K,M,G} (78327-104433, default 104433): 
Using default value 104433

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@dbcl grid]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_ecistest-lv_root
                       43G  3.8G   37G  10% /
tmpfs                  32G  220K   32G   1% /dev/shm
/dev/xvda1            477M   49M  403M  11% /boot
/dev/mapper/vg_ecistest-lv_home
                      3.9G  104M  3.6G   3% /home
/dev/xvdg1             99G  8.3G   86G   9% /u01
.6.31:/backup    3.0T  2.4T  696G  78% /backup
[root@dbcl grid]# fdisk -l

Disk /dev/xvda: 64.4 GB, 64424509440 bytes
255 heads, 63 sectors/track, 7832 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: 0x0008dd17

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/xvda2              64        7833    62401536   8e  Linux LVM

Disk /dev/xvde: 859.0 GB, 858993459200 bytes
255 heads, 63 sectors/track, 104433 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: 0xbea03e2c

    Device Boot      Start         End      Blocks   Id  System
/dev/xvde1               1       78326   629153563+  83  Linux
/dev/xvde2           78327      104433   209704477+   5  Extended

Disk /dev/xvdg: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 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: 0x51287eb5

    Device Boot      Start         End      Blocks   Id  System
/dev/xvdg1               1       13054   104856223+  83  Linux

Disk /dev/mapper/vg_ecistest-lv_root: 46.9 GB, 46892318720 bytes
255 heads, 63 sectors/track, 5700 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: 0x00000000


Disk /dev/mapper/vg_ecistest-lv_swap: 12.7 GB, 12733906944 bytes
255 heads, 63 sectors/track, 1548 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: 0x00000000


Disk /dev/mapper/vg_ecistest-lv_home: 4269 MB, 4269801472 bytes
255 heads, 63 sectors/track, 519 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: 0x00000000


[root@dbcl /]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_ecistest-lv_root
                       43G  3.8G   37G  10% /
tmpfs                  32G  220K   32G   1% /dev/shm
/dev/xvda1            477M   49M  403M  11% /boot
/dev/mapper/vg_ecistest-lv_home
                      3.9G  104M  3.6G   3% /home
/dev/xvdg1             99G  8.3G   86G   9% /u01
.6.31:/backup    3.0T  2.4T  696G  78% /backup

-----对分区进行格式化
[root@dbcl /]# mkfs -t ext3 /dev/xvde1
mke2fs 1.41.12 (17-May-2010)
文件系统标签=
操作系统:Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
39329792 inodes, 157288390 blocks
7864419 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=4294967296
4801 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

正在写入inode表: 完成                            
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information: 
完成

This filesystem will be automatically checked every 25 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@dbcl /]# mount /dev/xvde1 /oradata    /*****挂载到系统
[root@dbcl /]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_ecistest-lv_root
                       43G  3.8G   37G  10% /
tmpfs                  32G  220K   32G   1% /dev/shm
/dev/xvda1            477M   49M  403M  11% /boot
/dev/mapper/vg_ecistest-lv_home
                      3.9G  104M  3.6G   3% /home
/dev/xvdg1             99G  8.3G   86G   9% /u01
.6.31:/backup    3.0T  2.4T  696G  78% /backup
/dev/xvde1            591G  198M  561G   1% /oradata

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值