您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
免费发信息

linux下磁盘分区

2024/4/26 15:42:38发布6次查看
创建分区---》格式化---》挂载使用
1.创建分区
[root@localhost ~]# fdisk -l 查看磁盘的分区情况
[root@localhost ~]# fdisk /dev/sdb
command (m for help): m 获得帮助,查看具体可以使用那些命令
command (m for help): n 新建分区
command action
e extended
p primary partition (1-4)
p #主分区
partition number (1-4): 1 主分区的编号
first cylinder (1-10443, default 1):
using default value 1
last cylinder, +cylinders or +size{k,m,g} (1-10443, default 10443): +10g #指定分区的大小
command (m for help): p 输出
command (m for help): w 退出并且保存
the partition table has been altered!
calling ioctl() to re-read partition table.
syncing disks.
2.格式化
[root@localhost ~]# mkfs.ext4 /dev/sdb1 格式化sdb1这个分区
mke2fs 1.41.12 (17-may-2010)
filesystem label=
os type: linux
block size=4096 (log=2)
fragment size=4096 (log=2)
stride=0 blocks, stripe width=0 blocks
655776 inodes, 2622603 blocks
131130 blocks (5.00%) reserved for the super user 预留5%的空间给超级用户使用,当磁盘使用率100%的时候,root用户还是可以进入系统的。
first data block=0
maximum filesystem blocks=2688548864
81 block groups
32768 blocks per group, 32768 fragments per group
8096 inodes per group
superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
writing inode tables: done
creating journal (32768 blocks): done
writing superblocks and filesystem accounting information: done
this filesystem will be automatically checked every 32 mounts or
180 days, whichever comes first. use tune2fs -c or -i to override.
3.新建挂载目录
mkdir /music 新建挂载目录
4.挂载使用
mount /dev/sdb1 /music 挂载使用新的分区
5.开机实现自动
echo mount /dev/sdb1 /music >>/etc/rc.local
/etc/rc.local文件的作用是,系统开机会自动执行这个文件里的命令
安装系统的时候,到底分多少个分区。
/ 尽可能大
swap 内存的两倍
/home
/boot 200m足够
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录