Linux磁盘分区、格式化和挂载
2018-01-30 17:51
344 查看
一、查看磁盘使用
二、查看磁盘分区
目前系统存在了两块磁盘,分别为“/dev/vda”和“/dev/vdb”;
“/dev/vda”已经存在了一个分区“/dev/vda1”;
“/dev/vda1”没有分区。
三、磁盘分区命令
四、执行分区操作
再次查看分区:
五、查看原有分区格式
为ext4格式。
六、格式化分区
七、挂载分区
八、开机自动挂载
修改/etc/fstab,添加记录即可。
[root@iZ88rvassw1Z ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/vda1 40G 2.3G 36G 7% / tmpfs 1.9G 0 1.9G 0% /dev/shm
二、查看磁盘分区
[root@iZ88rvassw1Z ~]# fdisk -l Disk /dev/vda: 42.9 GB, 42949672960 bytes 255 heads, 63 sectors/track, 5221 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: 0x00078f9c Device Boot Start End Blocks Id System /dev/vda1 * 1 5222 41940992 83 Linux Disk /dev/vdb: 1099.5 GB, 1099511627776 bytes 16 heads, 63 sectors/track, 2130440 cylinders Units = cylinders of 1008 * 512 = 516096 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000
目前系统存在了两块磁盘,分别为“/dev/vda”和“/dev/vdb”;
“/dev/vda”已经存在了一个分区“/dev/vda1”;
“/dev/vda1”没有分区。
三、磁盘分区命令
四、执行分区操作
[root@iZ88rvassw1Z ~]# fdisk /dev/vdb Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel with disk identifier 0x3d7d21d6. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u'). Command (m for help): p Disk /dev/vdb: 1099.5 GB, 1099511627776 bytes 16 heads, 63 sectors/track, 2130440 cylinders Units = cylinders of 1008 * 512 = 516096 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x3d7d21d6 Device Boot Start End Blocks Id System Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-2130440, default 1): Using default value 1 Last cylinder, +cylinders or +size{K,M,G} (1-2130440, default 2130440): Using default value 2130440 Command (m for help): p Disk /dev/vdb: 1099.5 GB, 1099511627776 bytes 16 heads, 63 sectors/track, 2130440 cylinders Units = cylinders of 1008 * 512 = 516096 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x3d7d21d6 Device Boot Start End Blocks Id System /dev/vdb1 1 2130440 1073741728+ 83 Linux Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 2 No free sectors available Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [root@iZ88rvassw1Z ~]#
再次查看分区:
五、查看原有分区格式
为ext4格式。
六、格式化分区
七、挂载分区
八、开机自动挂载
修改/etc/fstab,添加记录即可。
相关文章推荐
- Linux磁盘分区、格式化、自动挂载
- LINUX磁盘分区、格式化、挂载、卸载全程详解
- linux磁盘分区格式化与挂载
- Linux磁盘分区、格式化和挂载
- Linux磁盘分区,格式化,检查及挂载
- linux磁盘分区格式化、挂载及增加swap空间
- LINUX磁盘分区、格式化、挂载、卸载全程详解
- RedHat Linux磁盘分区、格式化、挂载、卸载
- linux磁盘分区格式化、挂载,文件系统
- LINUX磁盘分区、格式化、挂载、卸载详细过程
- linux下磁盘分区,格式化和挂载
- linux磁盘分区与挂载
- linux分区格式化挂载mount
- 新固态硬盘格式化,并在Ubuntu挂载ntfs格式硬盘
- linux下创建和挂载xfs文件系统,格式化xfs文件系统
- Linux系统的磁盘分区、格式化、挂载、卸载与清空磁盘数据
- linux磁盘空间不足 和 挂载新硬盘(含磁盘格式化、分区)方法
- linux 中挂载,格式化NTFS分区
- Linux添加新硬盘、分区、格式化、自动挂载
- 自动分区、格式化、挂载脚本