linux常见分区格式,linux 分区格式

一、分区与格式化的原理

二、使用linux中的fdisk分区

三、使用mkfs创建文件系统

四、硬盘分区的挂载;

一、分区原理

1、主分区表(64byte):记录分区的起始与结束柱面、主分区个数。主分区大小有限,不能超过四个主分区

2、扩展分区:将一个主分区更改成扩展分区,扩展分区支持无限个分区(逻辑分区),逻辑分区的信息写在扩展分区表中。

二、格式化原理

也就是创建不同的文件系统,供数据的存储与读取。

常用的linux分区工具:fdisk,sfdisk,diskdruid

fdisk一般使用过程

1、运行命令:#fdisk /dev/hdX

2、添加/删除/修改分区

3、重新启动计算机(生效,由内核读取分区表信息的)

[root@server root]# fdisk /dev/hda

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

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): 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):

三、Linux的格式化工具

mkfs - 支持ext2、ext3(日志)、vfat、msdos、jfs、reiserfs等

用法1:mkfs -t

例:#mkfs -t ext3 /dev/hda1

用法2:mkfs.

例:#mkfs.vfat /dev/hda2

mke2fs - 支持ext2/ext3文件系统

用法:mke2fs [-j]

例:#mke2fs -j /dev/hdb2

四、硬盘分区的挂载

1、挂载命令:#mount  (临时挂载,重启系统无效)

例:#mount /dev/hda11 /mnt/d2

2、卸载命令:#umount

例:umount /dev/hda11

3、写入/etc/fstab(自动挂载,系统启动时)

/dev/hda11  /mnt/d2 /ext3 defaults 0 0

五、使用卷标挂载

1、添加卷标 —— e2label

例:#e2label /dev/hda10 test

2、根据卷标挂载

例:#mount LABEL=test /mnt/d1

3、写入/etc/fstab

LABEL=test /mnt/d1 /ext3 defaults 0 0

六、ext2/ext3挂载选项

1、ro/rw ——只读/读写

2、exec/noexec——允许/不允许可执行

3、dev/nodev——允许/不允许设备文件

4、suid,sgid/nosuid/nosgid——允许/不允许suid,sgid文件

5、atime/noatime——更新/不更新节点的访问时间

6、async/sync——异步/同步磁盘I/O

7、user/nouser——允许/不允许普通用户挂载磁盘,用于/etc/fstable文件中的选项

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值