Linux添加硬盘(硬盘没有充分使用问题)

在Linux系统中,通过fdisk查看到硬盘/dev/sda存在未使用的空间。尝试新增分区,但提示无免费扇区可用。接着对sda5分区进行格式化为ext3类型,并成功创建文件系统。最后将/dev/sda5挂载到/data,通过df -k和df -h确认已充分利用了硬盘空间。

[root@localhost ~]# fdisk -l

Disk /dev/sda: 536.8 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        2624    20972857+  83  Linux
/dev/sda3            2625        3929    10482412+  82  Linux swap / Solaris
/dev/sda4            3930       65270   492721582+   5  Extended
/dev/sda5            3930       65270   492721551   83  Linux
[root@localhost ~]# fdisk /dev/sda

The number of cylinders for this disk is set to 65270.
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): n
No free sectors available

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): n
No free sectors available

Command (m for help): q

[root@localhost ~]# mkfs -t ext3 /dev/sda5       //格式化sda5分区
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
61603840 inodes, 123180387 blocks
6159019 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
3760 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
      32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
      4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
      102400000

Writing inode tables: done                           
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
done

This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@localhost ~]# done
-bash: syntax error near unexpected token `done'
[root@localhost ~]# ls
anaconda-ks.cfg  index.html    index.html.2  index_p.jsp  install.log.syslog
Desktop          index.html.1  index.html.3  install.log  szxx_09.gif
[root@localhost ~]# mount /dev/sda5 /data       //重新挂载分区,如果要挂载新文件名要先创建文件系统
[root@localhost ~]# df-k
-bash: df-k: command not found
[root@localhost ~]# df -k
驿欢绯荤?              1K-?       宸茬?    瀵绋 宸茬? 骅浇绻
/dev/sda2             20315844   4980560  14286644  26% /
/dev/sda1               101086     11956     83911  13% /boot
tmpfs                  8218456         0   8218456   0% /dev/shm
/dev/sda5            484988756    202800 460149880   1% /data
[root@localhost ~]# df -h
驿欢绯荤?             瀹归  宸茬?瀵绋 宸茬? 骅浇绻
/dev/sda2              20G  4.8G   14G  26% /
/dev/sda1              99M   12M   82M  13% /boot
tmpfs                 7.9G     0  7.9G   0% /dev/shm
/dev/sda5             463G  199M  439G   1% /data   原来只用了49G,现在充分利用上了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值