1)、MSDOS磁盘分区 特点:分区类型的主要分区、扩展分区、逻辑分区 主分区+扩展分区<=4 扩展分区<=1 不支持超过2TB的磁盘 主分区和扩展分区的设备1-->4 逻辑分区从5开始 2)、GPT磁盘分区 注意:目前的BIOS不能支持GPT引导,只有UEFI才能引导GPT启动分区 3)、1.划分磁盘分区大小首先要考虑业务的大小。 2.磁盘划分需要格式化 3.需要挂载磁盘数据才能读入进去 #fdisk /dev/磁盘设备名 Command (m for help): n Command action e extended 扩展分区 p primary partition (1-4) 主分区 p Partition number (1-4): 1 从第一个1开始分区 First cylinder (1-1305, default 1): 分区的大小从什么位置开始,一般选择默认 Using default value 1 一般选择默认 Last cylinder, +cylinders or +size{K,M,G} (1-1305, default 1305): +4G 选择分区的大小 Command (m for help): w 保存 (1)划分msdos分区 # parted /dev/sdc (parted) help (parted) mklabel msdos (parted) mkpart primary 0GB 4GB 新建分区 (parted) mkpart extended 4GB 100% (parted) mkpart logical 4GB 60% (parted) mkpart logical 60% 100% (parted) print Model: VMware, VMware Virtual S (scsi) Disk /dev/sdc: 16.1GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system 标志 1 1049kB 4000MB 3999MB primary 2 4000MB 16.1GB 12.1GB extended lba 5 4001MB 9664MB 5662MB logical 6 9665MB 16.1GB 6441MB logical (parted) mklabel gpt 警告: The existing disk label on /dev/sdc will be destroyed and all data on this disk will be lost. Do you want to continue? 是/Yes/否/No? Yes (parted) mkpart system 0% 30% (parted) mkpart application 30% 60% (parted) mkpart movie 60% 100% (parted) print Model: VMware, VMware Virtual S (scsi) Disk /dev/sdc: 16.1GB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name 标志 1 1049kB 4832MB 4831MB system 2 4832MB 9664MB 4832MB application 3 9664MB 16.1GB 6441MB movie Command (m for help): t Partition number (1-4): 2 Hex code (type L to list codes): b Changed system type of partition 2 to b (W95 FAT32) Command (m for help): p Disk /dev/sdb: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x87eec63a Device Boot Start End Blocks Id System /dev/sdb1 1 132 1060258+ 83 Linux /dev/sdb2 133 263 1048576 b W95 FAT32 Partition 2 does not end on cylinder boundary. mount 需挂载的设备 挂载的目录 配置/etc/fstab /root/Downloads/rhel-server-6.5-x86_64-dvd.iso /mnt/cdrom iso9660 defaults 0 0 /root/Downloads/rhel-server-6.5-x86_64-dvd.iso 需要挂载的设备 /mnt/cdrom 设备挂载点 iso9660 文件类型 ext2 ext4 swap iso9660 vfat defaults 挂载选项 async: 异步 auto :自动(mount -a)发现没有挂载的回自动挂载上sync :同步 noauto :非自动 exce 可执行 ro / rw :可读可写 noexec :不可执行 0 是否支持dump备份,0 代表不做备份,1 代表每天进行dump备份,2 代表不定期备份 0 是否用fsck 命令检测文件系统,0 代表不要检测,非0 代表需要检测,数字越小优先级越高 rpm -a autofs 查看工具是否安装 #/etc/auto.master 主配置文件 /misc /etc/auto.misc --timeout=10(以秒为单位) 一级挂载点 二级挂点子配置文件 10秒之后自动卸载 #/etc/auto.misc 子配置文件 /U01 ext4 挂载的设备 二级挂载点,名字可以随意 文件类型 #service autofs restart 启动服务就ok 环境:挂载10.1.1.254机器的目录(/dada/share/notes)到自己目录(/uplook/ule) 1、修改主配置文件 /etc/auto.master /uplook /etc/auto.ule 2、创建子配置文件 vim /etc/auto.ule ule -ro,nfs 10.1.1.254:/data/share/notes 3、重启服务 service autofs restart 4、测试验证 cd /uplook/ule 二级挂载点第一次使用时看不见
磁盘划分和挂载
原创jkz62642330 ©著作权
©著作权归作者所有:来自51CTO博客作者jkz62642330的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Linux 永久挂载磁盘
linux 目录挂载
重启 根目录 -
存储结构与磁盘划分。
存储结构与磁盘划分。
1.1.13 磁盘划分