`
itspace
  • 浏览: 984416 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

linux 划分文件系统

阅读更多
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.
0
0
分享到:
评论

相关推荐

    Linux 文件系统介绍

    - **分区和文件系统的关系**:在 Flash 芯片上,可以划分出多个分区,每个分区都可以采用不同的文件系统。此外,多块 Flash 芯片也可以组合成一个分区,并使用相同的文件系统。 #### JFFS2 JFFS2 是 Red Hat 公司...

    Linux虚拟文件系统对物理文件的管理

    对于Linux支持的物理文件系统,通常可以将其划分为以下四个部分: - **引导块**(Boot Block):用于存放启动加载器的信息。 - **超级块**(Super Block):包含整个文件系统的元数据信息,如文件系统的类型、块大小等...

    Linux文件系统结构分析

    Linux文件系统是Linux操作系统中用于存储、组织文件,并允许用户和程序访问这些文件的子系统。Linux系统支持多种不同的文件系统类型,其中EXT2和EXT3是目前最常用的文件系统类型。EXT2是专为Linux设计的扩展文件系统...

    linux文件系统分析与研究

    ### Linux文件系统分析与研究 #### 一、引言 Linux作为一款开源的操作系统,源自于Minix,并兼容POSIX标准。它不仅提供了全部源代码,还具备许多来自Unix System V和BSD 4.3的功能,能够在32位PC及其兼容机上运行...

    linux文件系统概念解释

    总之,Linux文件系统的设计充分体现了其开放性、灵活性和高效性,通过层次分明的文件类型划分、逻辑文件系统与虚拟文件系统的结合,以及索引节点的使用,构建了一个既强大又易于使用的文件管理框架。无论是对于...

    Linux文件系统分析

    对于ext2而言,磁盘被划分为若干个逻辑磁盘块,这些块按照特定的规则组织在一起,形成文件系统的基础框架。磁盘的组织方式直接影响了文件系统在磁盘上的布局,包括超级块、组描述符表、块位图、inode位图、inode表...

    Linux.文件系统精通指南

    ### Linux 文件系统精通指南 #### 一、引言 Linux 文件系统是用户与操作系统交互的主要方式之一,也是理解和掌握Linux操作系统的重要组成部分。本指南旨在帮助读者深入理解Linux文件系统的概念及其实际应用,包括...

    嵌入式Linux根文件系统的研究

    ### 嵌入式Linux根文件系统的研究 #### 摘要 在嵌入式Linux系统中,根文件系统作为构建整个系统的核心部分,扮演着至关重要的角色。它不仅是Linux/Unix系统的基础构件,还直接影响到系统的启动和运行效率。本文从...

    《Linux小文件系统》

    《Linux小文件系统》是一个专为课程设计而准备的学习资源,它涵盖了Linux操作系统中的文件系统基础知识,以及如何构建和理解一个简单的文件系统。这个压缩包包含文档和代码,旨在帮助学习者深入理解Linux内核中文件...

    linux文件系统详解

    Linux文件系统是一个非常核心且复杂的主题,涉及到存储介质的管理、文件的组织、存储空间的分配和回收、文件的读写操作以及系统数据的维护等多个方面。Linux拥有多种不同的文件系统格式,每种格式都有其特定的应用...

    Linux基础课件-- Linux文件系统.pptx

    Linux操作系统的基础之一是其独特的文件系统,这在“Linux基础课件-- Linux文件系统.pptx”中有所阐述。文件系统是操作系统的核心组成部分,它负责管理磁盘上的数据存储和检索,是用户与硬件存储设备之间的接口。在...

    Linux磁盘及文件系统管理详解

    ### Linux磁盘及文件系统管理详解 #### 一、硬盘物理结构及相关结构 在深入了解Linux磁盘及文件系统管理之前,我们先从物理层面来理解硬盘的基本构成。 **1. 硬盘内部视角实物图** 硬盘内部由一系列的盘片...

    Linux的虚拟文件系统.pdf

    根据实际操作的目标不同,可以将VFS支持的文件系统划分为三种主要类型: 1. **磁盘文件系统**:这类文件系统管理本地磁盘分区或可以作为磁盘设备的其他块设备,如USB闪存、NAND Flash等。包括Unix/Linux常用的Ext2...

    linux课件linux文件系统管理收集.pdf

    在Linux中,磁盘被划分为分区,每个分区可以拥有独立的文件系统。物理磁盘的逻辑结构由分区表描述,常见的分区工具如fdisk用于创建和管理这些分区。文件系统将数据组织成目录、文件和软链接等,存储在物理块设备上。...

    Linux系统的硬盘分区与文件系统.pdf

    Linux系统的硬盘分区与文件系统 Linux 系统的硬盘分区与文件系统是 Linux 操作系统中非常重要的一部分。硬盘分区是指在硬盘上建立多个硬盘分区,以便安装多个操作系统。Linux 系统支持多种硬盘分区方式,包括主分区...

    基于Linux的BLOB文件系统的设计.pdf

    BLOB文件系统在物理布局上将文件划分为一系列线性块,大部分块用于存储视频流数据,另一部分用于保存文件系统结构信息。为了优化I/O吞吐率并减少磁头定位次数,BLOB采用了4096字节的块大小,并使用"成组申请"算法来...

Global site tag (gtag.js) - Google Analytics