Linux 硬盘,格式化,分区 入门详解(2)

[root@linuxidc ~]# mkfs.ext2 /dev/sdb1
mke2fs 1.39 (29-May-2006)
 Filesystem label=
 OS type: Linux
 Block size=4096 (log=2)
 Fragment size=4096 (log=2)
 100576 inodes, 200804 blocks
 10040 blocks (5.00%) reserved for the super user
 First data block=0
 Maximum filesystem blocks=209715200
 7 block groups
 32768 blocks per group, 32768 fragments per group
 14368 inodes per group
 Superblock backups stored on blocks:
 32768, 98304, 163840

Writing inode tables: done
 Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 32 mounts or
 180 days, whichever comes first. Use tune2fs -c or -i to override.

在sdb6上建立ext3分区

[root@linuxidc ~]# mkfs.ext3 /dev/sdb6
 mke2fs 1.39 (29-May-2006)
 Filesystem label=
 OS type: Linux
 Block size=4096 (log=2)
 Fragment size=4096 (log=2)
 217280 inodes, 433747 blocks
 21687 blocks (5.00%) reserved for the super user
 First data block=0
 Maximum filesystem blocks=444596224
 14 block groups
 32768 blocks per group, 32768 fragments per group
 15520 inodes per group
 Superblock backups stored on blocks:
 32768, 98304, 163840, 229376, 294912

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

This filesystem will be automatically checked every 32 mounts or
 180 days, whichever comes first. Use tune2fs -c or -i to override.
 [root@linuxidc ~]#

建立两个目录/Oracle和/web,将新建好的两个分区挂载到系统

[root@linuxidc ~]# mkdir /oracle
 [root@linuxidc ~]# mkdir /web
 [root@linuxidc ~]# mount /dev/sdb1 /oracle
 [root@linuxidc ~]# mount /dev/sdb6 /web

查看分区挂载情况

[root@linuxidc ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/VolGroup00-LogVol00
 6.7G 2.8G 3.6G 44% /
 /dev/sda1 99M 12M 82M 13% /boot
 tmpfs 125M 0 125M 0% /dev/shm
/dev/sdb1 773M 808K 733M 1% /oracle
 /dev/sdb6 1.7G 35M 1.6G 3% /web

如果需要每次开机自动挂载则需要修改/etc/fstab文件,加入两行配置

[root@linuxidc ~]# vim /etc/fstab

/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
 LABEL=/boot /boot ext3 defaults 1 2
 tmpfs /dev/shm tmpfs defaults 0 0
 devpts /dev/pts devpts gid=5,mode=620 0 0
 sysfs /sys sysfs defaults 0 0
 proc /proc proc defaults 0 0
 /dev/VolGroup00/LogVol01 swap swap defaults 0 0
/dev/sdb1 /oracle ext2 defaults 0 0
 /dev/sdb6 /web ext3 defaults 0 0

Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/12637.html