linux划分文件系统
创始人
2024-06-18 02:40:48
0

linux版本为

[root@hzmc ~]# uname -a

Linux hzmc 2.6.18-53.el5xen #1 SMP Mon Nov 12 03:26:12 EST 2007 i686 i686 i386 GNU/Linux

1、查看主机硬盘划分情况,我们需要在/dev/sdb划分一文件系统,大小在80G左右。

[root@hzmc bin]# fdisk -l

Disk /dev/sda: 154.7 GB, 154750418432 bytes

255 heads, 63 sectors/track, 18814 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1         255     2048256   83  Linux

/dev/sda2             256        5992    46082452+  83  Linux

/dev/sda3            5993        8542    20482875   83  Linux

/dev/sda4            8543       18814    82509840    5  Extended

/dev/sda5            8543       11092    20482843+  83  Linux

/dev/sda6           11093       12367    10241406   83  Linux

/dev/sda7           12368       13642    10241406   83  Linux

/dev/sda8           13643       14662     8193118+  83  Linux

/dev/sda9           14663       15044     3068383+  83  Linux

/dev/sda10          15045       15426     3068383+  83  Linux

/dev/sda11          15427       15808     3068383+  83  Linux

/dev/sda12          15809       16063     2048256   82  Linux swap / Solaris

/dev/sda13          16064       16254     1534176   83  Linux

/dev/sda14          16255       16267      104391   83  Linux

/dev/sda15          16268       18814    20458746   8e  Linux LVM

Disk /dev/sdb: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1        2433    19543041   83  Linux

/dev/sdb2            2434        3679    10008495   83  Linux

/dev/sdb3            3680        3804     1004062+  83  Linux

/dev/sdb4            3805       60801   457828402+   5  Extended

/dev/sdb5            3805        7452    29302528+  83  Linux

/dev/sdb6            7453        7577     1004031   83  Linux

2、在/dev/sdb上划分文件系统

[root@hzmc bin]# fdisk /dev/sdb

The number of cylinders for this disk is set to 60801.

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)

Command (m for help): n

First cylinder (7578-60801, default 7578):

Using default value 7578

Last cylinder or +size or +sizeM or +sizeK (7578-60801, default 60801): +81920M

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

注意系统提示“Device or resource busy.”,当出现这一提示时,需要手工通知操作系统分区表已经作了改动

[root@hzmc bin]# partprobe /dev/sdb

3、将/dev/sdb7格式化成ext3文件系统

[root@hzmc bin]# mkfs -t ext3 /dev/sdb7

mke2fs 1.39 (29-May-2006)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

10010624 inodes, 20002925 blocks

1000146 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=0

611 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

Writing inode tables: done

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 23 mounts or

180 days, whichever comes first.  Use tune2fs -c or -i to override.

You have new mail in /var/spool/mail/root

[root@hzmc bin]# mkdir /siqi

[root@hzmc bin]# mount /dev/sdb7 /siqi

4、将文件系统信息添加到fstab文件中,随系统自启动

/dev/sdb7               /siqi                   ext3    defaults        0 0

这里注意第4,5,6列数字含义

The 4th column uses the default options that are rw, suid, dev, exec, auto, nouser, and async.

The 5th column in /etc/fstab is the dump option. Dump checks it and uses the number to decide if a filesystem should be backed up. If it's zero, dump will ignore that filesystem. If you take a look at the example fstab, you'll notice that the 5th column is zero in most cases.

The 6th column is a fsck option. fsck looks at the number in the 6th column to determine in which order the filesystems should be checked. If it's zero, fsck won't check the filesystem.
 

【编辑推荐】

  1. 深入讲述Linux uevent属性文件系统
  2. 简单讲述Linux文件系统分区了解
  3. Linux文件系统限制及特点

相关内容

热门资讯

如何允许远程连接到MySQL数... [[277004]]【51CTO.com快译】默认情况下,MySQL服务器仅侦听来自localhos...
如何利用交换机和端口设置来管理... 在网络管理中,总是有些人让管理员头疼。下面我们就将介绍一下一个网管员利用交换机以及端口设置等来进行D...
施耐德电气数据中心整体解决方案... 近日,全球能效管理专家施耐德电气正式启动大型体验活动“能效中国行——2012卡车巡展”,作为该活动的...
Windows恶意软件20年“... 在Windows的早期年代,病毒游走于系统之间,偶尔删除文件(但被删除的文件几乎都是可恢复的),并弹...
20个非常棒的扁平设计免费资源 Apple设备的平面图标PSD免费平板UI 平板UI套件24平图标Freen平板UI套件PSD径向平...
德国电信门户网站可实时显示全球... 德国电信周三推出一个门户网站,直观地实时提供其安装在全球各地的传感器网络检测到的网络攻击状况。该网站...
着眼MAC地址,解救无法享受D... 在安装了DHCP服务器的局域网环境中,每一台工作站在上网之前,都要先从DHCP服务器那里享受到地址动...
为啥国人偏爱 Mybatis,... 关于 SQL 和 ORM 的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行...