挂载新盘符

来源:互联网 发布:郑州轻工业网络教学 编辑:程序博客网 时间:2024/06/07 23:04

查看磁盘信息

[root@iZ94sj7i2pjZ opt]# fdisk -lDisk /dev/vda: 42.9 GB, 42949672960 bytes255 heads, 63 sectors/track, 5221 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00078f9c   Device Boot      Start         End      Blocks   Id  System/dev/vda1   *           1        5222    41940992   83  LinuxDisk /dev/vdb: 21.5 GB, 21474836480 bytes16 heads, 63 sectors/track, 41610 cylindersUnits = cylinders of 1008 * 512 = 516096 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000

进行分区(包含设置为主分区、定义分区大小用默认值即可、写入分区并退出)

[root@iZ94sj7i2pjZ opt]# fdisk /dev/vdbDevice contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel with disk identifier 0x26fbdaa6.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: 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): mCommand 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): nCommand action   e   extended   p   primary partition (1-4)pPartition number (1-4): 1First cylinder (1-41610, default 1): 1Last cylinder, +cylinders or +size{K,M,G} (1-41610, default 41610): 41610Command (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.

查看磁盘
[root@iZ94sj7i2pjZ opt]# fdisk -l

Disk /dev/vda: 42.9 GB, 42949672960 bytes255 heads, 63 sectors/track, 5221 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00078f9c   Device Boot      Start         End      Blocks   Id  System/dev/vda1   *           1        5222    41940992   83  LinuxDisk /dev/vdb: 21.5 GB, 21474836480 bytes16 heads, 63 sectors/track, 41610 cylindersUnits = cylinders of 1008 * 512 = 516096 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x26fbdaa6   Device Boot      Start         End      Blocks   Id  System/dev/vdb1               1       41610    20971408+  83  Linux

格式化

[root@iZ94sj7i2pjZ opt]# mkfs.ext3 /dev/vdb1mke2fs 1.41.12 (17-May-2010)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)Stride=0 blocks, Stripe width=0 blocks1310720 inodes, 5242852 blocks262142 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=4294967296160 block groups32768 blocks per group, 32768 fragments per group8192 inodes per groupSuperblock backups stored on blocks:         32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,         4096000Writing inode tables: done                            Creating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 22 mounts or180 days, whichever comes first.  Use tune2fs -c or -i to override.

挂载并查看

[root@iZ94sj7i2pjZ opt]# mount -t ext3 /dev/vdb1 test[root@iZ94sj7i2pjZ opt]# df -hFilesystem      Size  Used Avail Use% Mounted on/dev/vda1        40G  1.9G   36G   6% /tmpfs           1.9G     0  1.9G   0% /dev/shm/dev/vdb1        20G  173M   19G   1% /opt/test
0 0
原创粉丝点击