linux硬碟格式化和建立swap分區

來源:互聯網
上載者:User
# 格式化分區[root@localhost /]# mkfs.ext3 /dev/sda5 mke2fs 1.39 (29-May-2006)Filesystem label=OS type: LinuxBlock size=1024 (log=0)Fragment size=1024 (log=0)26104 inodes, 104388 blocks5219 blocks (5.00%) reserved for the super userFirst data block=1Maximum filesystem blocks=6737100813 block groups8192 blocks per group, 8192 fragments per group2008 inodes per groupSuperblock backups stored on blocks:         8193, 24577, 40961, 57345, 73729Writing inode tables: done                            Creating journal (4096 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 33 mounts or180 days, whichever comes first.  Use tune2fs -c or -i to override.[root@localhost /]# # 將分區轉換成交換分區#1、格式化交換分區[mkswap][root@localhost /]# mkswap /dev/sda5 Setting up swapspace version 1, size = 106889 kB[root@localhost /]# free             total       used       free     shared    buffers     cachedMem:       1026816     577392     449424          0      29772     343960-/+ buffers/cache:     203660     823156Swap:      2064344          0    2064344#2、啟用交換分區[swapon][root@localhost /]# swapon /dev/sda5 [root@localhost /]# free             total       used       free     shared    buffers     cachedMem:       1026816     577448     449368          0      29792     343960-/+ buffers/cache:     203696     823120Swap:      2168724          0    2168724[root@localhost /]# # 將交換分區轉換成EXT3格式#1、關閉交換分區[swapoff][root@localhost ~]# swapoff /dev/sda5#2、重新格式化分區[mkfs.ext3][root@localhost ~]# mkfs.ext3 /dev/sda5 mke2fs 1.39 (29-May-2006)Filesystem label=OS type: LinuxBlock size=1024 (log=0)Fragment size=1024 (log=0)26104 inodes, 104388 blocks5219 blocks (5.00%) reserved for the super userFirst data block=1Maximum filesystem blocks=6737100813 block groups8192 blocks per group, 8192 fragments per group2008 inodes per groupSuperblock backups stored on blocks:         8193, 24577, 40961, 57345, 73729Writing inode tables: done                            Creating journal (4096 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 39 mounts or180 days, whichever comes first.  Use tune2fs -c or -i to override.[root@localhost ~]# # 設定磁碟巻標[root@localhost auto]# e2label /dev/sda5 sky# 查看巻標[root@localhost auto]# e2label /dev/sda5sky# 根據巻標查看硬碟[root@localhost auto]# findfs LABEL=skyfindfs: Unable to resolve 'LABEL=sky'# 添加開機以後掛載[root@www auto]# vim /etc/rc.local [root@www auto]# 

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.