Linux下的分区工具

[root@localhost linuxidc]#Disk /dev/sda: 8589 MB, 8589934592 bytes255 heads, 63 sectors/track, 1044 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDiskThe partition table has been altered!Calling ioctl() to re-read partition table.WARNING: Re-reading the partition table failed with error 16: 设备或资源忙.The kernel still uses the old table.The new table will be used at the next reboot.Syncing disks.[root@localhost linuxidc]#df -Th#因为这个时候还没有挂载,所以在df命令下并不能看到新的分区文件系统 类型 容量已用 可用 已用% 挂载点/dev/sda1 ext3 2.9G2.2G505M82% //dev/sda2 ext3 965M 22M894M 3% /hometmpfs tmpfs 345M 12K345M 1% /dev/shm[root@localhost linuxidc]#/sbin/mkfs.ext3 /dev/sda5#在挂载之前应该先格式化,比如ext2,ext3格式#还可以使用/sbin/mkfs –t ext3 /dev/sda5#其实我们已经看到在fdisk命令中已经自动将其格式化为ext3格式了mke2fs 1.40.2 (12-Jul-2007)warning: 107 blocks unused.Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)410400 inodes, 819200 blocks40965 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=83886080025 block groups32768 blocks per group, 32768 fragments per group16416 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912Writing inode tables: done Creating journal (16384 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 35 mounts or180 days, whichever comes first.Use tune2fs -c or -i to override.[root@localhost linuxidc]#/sbin/e2label /dev/sda5 backup#给新分区添加一个标签[root@localhost linuxidc]#mkdir /mnt/bak#创建目录[root@localhost linuxidc]#mount /dev/sda5 /mnt/bak#将新分区挂载到指定目录上[root@localhost linuxidc]#df -Th#这时候就可以看到挂载上了文件系统 类型 容量已用 可用 已用% 挂载点/dev/sda1 ext3 2.9G2.2G505M82% //dev/sda2 ext3 965M 22M894M 3% /hometmpfs tmpfs 345M 12K345M 1% /dev/shm/dev/sda5 ext3 3.1G 69M2.9G 3% /mnt/bak[root@localhost linuxidc]#vim /etc/fstab#添加一行到/etc/fstab中开机自动挂载#其实不用设置,系统也可以开机自动挂载的,因为它的格式跟linux系统格式是一样的[root@localhost linuxidc]#cat /etc/fstabLABEL=/ / ext3 defaults 1 1LABEL=/home /home ext3 defaults 1 2tmpfs /dev/shm tmpfs defaults 0 0devpts /dev/pts devptsgid=5,mode=6200 0sysfs /sys sysfs defaults 0 0proc /proc proc defaults 0 0LABEL=SWAP-sda3 swap swap defaults 0 0LABEL=backup /mnt/bak ext3 defaults 1 2

,不要惧怕黑暗,人间没有永恒的夜晚;不要担心严寒,

Linux下的分区工具

相关文章:

你感兴趣的文章:

标签云: