背景:之前在AWS申請(qǐng)的linux服務(wù)器脆诉,磁盤(pán)容量太小宠纯,已經(jīng)被服務(wù)占用一大部分空間,此時(shí)需要加載一個(gè)ip2location離線包(一般1-2G大惺呕邸),故在aws上申請(qǐng)的磁盤(pán)并掛載啄糙。具體操作如下:
1笛臣、查看磁盤(pán):
????lsblk
????NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
????xvda 202:0 0 40G 0 disk
????└─xvda1 202:1 0 40G 0 part /
????xvdf 202:80 0 4G 0 disk
2、查看磁盤(pán)文件類型:
?? ?file -s /dev/xvdf
3隧饼、格式化磁盤(pán):
?? ?mkfs -t ext4 /dev/xvdf
4沈堡、創(chuàng)建掛載點(diǎn):
?? ?mkdir /ip2location
5、掛載:將磁盤(pán)/dev/xvdf掛載到/ip2location目錄下
?? ?mount /dev/xvdf /ip2location
6燕雁、添加開(kāi)機(jī)掛載:(注意先備份:cp /etc/fstab /etc/fstab.bak)
?? ?vi /etc/fstab
?? ?#不建議使用uuid
?? ?/dev/xvdf /ip2location ext4 defaults,nofail 0 2
7诞丽、檢查掛載:
?? ?mount -a
8鲸拥、卸載磁盤(pán):
?? ?umount -d /dev/xvdf
參考鏈接:aws
[http://docs.aws.amazon.com/zh_cn/AWSEC2/latest/UserGuide/ebs-using-volumes.html](http://docs.aws.amazon.com/zh_cn/AWSEC2/latest/UserGuide/ebs-using-volumes.html)