建立分割區---》格式化---》掛載使用
1.建立分割區
[root@localhost ~]# fdisk -l 查看磁碟的分割區情況
[root@localhost ~]# fdisk /dev/sdb
Command (m for help): m 獲得幫助,查看具體可以使用那些命令
Command (m for help): n 新建分區
Command action
e extendeded
-4)p #主分區Partition number (1-4): 1 主分區的編號First cylinder (1-10443, default 1):Using default value 1%或 +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@2m化sdb1這個分割區mke2fs 1.41.12 (17-May-2010)Filesystem label=OS type: LinuxBlock size=4096 (OS type: LinuxBlock size=4096 (loglog=2) log
Stride=0 blocks, Stripe width=0 blocks
655776 inodes, 2622603 blocks
131130 blocks (5.00%) reservcks
131130 blocks (5.00%) reservcks
131130 blocks (5.00%) reservcks
131130 blocks (5.00%) reservcks
131130 blocks (5.00%) reservcks
131130 blocks (5.00%) reserved for the super 0%時候,root用戶還是可以進入系統的。
First data block=0
Maximum filesystem blocks=2688548864
81 block groups
32768 blocks per group, 32768 f block backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Writing inode tables: done
Creating journal (32768 錯誤):
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. /music 掛載使用新的分區5.開機實現自動echo "mount /dev/sdb1 /music" >>/etc/rc.local/etc/rc.local檔案的作用是,系統開機會自動執行這個檔案裡的指令