久久久精品2019免费观看_亚洲国产精品成人久久久_69国产成人综合久久精品91_国产精品久久精品视

新開Linux VPS新硬盤分區(qū)與掛載教程

新開了一個Linux VPS,把探針安裝好后發(fā)現(xiàn),本來買的VPSS硬盤有100G,可是顯示的卻只有20G,上網(wǎng)一查才發(fā)下是因為沒有掛載的原因,如果你的VPS上探針顯示與實際不符,你不防用下面的方法試試 (紅色字為需要輸入的部分,黑色字為系統(tǒng)顯示部分,紅色括號里的字是根據(jù)不同VPS需要修改的輸入)

?1.fdisk -l
?[root@MyVPS ~]# fdisk -l
?Disk /dev/xvda: 8589 MB, 8589934592 bytes
?255 heads, 63 sectors/track, 1044 cylinders
?Un

?Device Boot Start End Blocks Id System
?/dev/xvda1 * 1 13 104391 83 Linux
?/dev/xvda2 14 1044 8281507+ 8e Linux LVM
?Disk /dev/xvdb: 23.6 GB, 23622320128 bytes
?255 heads, 63 sectors/track, 2871 cylinders
?Units = cylinders of 16065 * 512 = 8225280 bytes
?Device Boot Start End Blocks Id System
2.對/dev/xvdb(此名稱因系統(tǒng)而異,有的時/dev/vdb)進行分區(qū):
?[root@MyVPS ~]# fdisk /dev/sdb【如果是/dev/vdb,執(zhí)行的代碼就是fdisk /dev/vdb】
?The number of cylinders for this disk is set to 2871.
?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)
?輸入n新建分區(qū)
?Command (m for help): n
?Command action
?e extended
?p primary partition (1-4)
?p
?/dev/xvdb中第1個分區(qū)
?Partition number (1-4): 1
?First cylinder (1-2871, default 1):(兩次回車)
?Using default value 1
?Last cylinder or +size or +sizeM or +sizeK (1-2871, default 2871):
?Using default value 2871
?輸入W保存退出
?Command (m for help): w
?The partition table has been altered!
?Calling ioctl() to re-read partition table.
?Syncing disks.
3.將新分區(qū)xvdb1(此名稱因系統(tǒng)而異)格式化為ext3格式
?[root@MyVPS ~]# mkfs -t ext3 /dev/sdb1【如果是/dev/vdb,執(zhí)行的代碼就是mkfs -t ext3 /dev/vdb1】
?mke2fs 1.39 (29-May-2006)
?Filesystem label=
?OS type: Linux
?Block size=4096 (log=2)
?Fragment size=4096 (log=2)
?2883584 inodes, 5765319 blocks
?288265 blocks (5.00%) reserved for the super user
?First data block=0
?Maximum filesystem blocks=4294967296
?176 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
?Writing inode tables: done
?Creating journal (32768 blocks): done
?Writing superblocks and filesystem accounting information: done
?This filesystem will be automatically checked every 24 mounts or
?180 days, whichever comes first. Use tune2fs -c or -i to override.
?3.我們示范將新分區(qū)xvdb1掛載到目錄/home
?[root@MyVPS ~]# mount /dev/sdb1 /home【如果是/dev/vdb,執(zhí)行的代碼就是mount /dev/vdb1 /home】
也可以新建目錄/home1,然后掛載home1目錄,新建目錄命令mkdir /home 然后 mount /dev/xvdb1 /home1
4.完成后我們通過df -hal可以看到,新分區(qū)已經(jīng)掛載到目錄/home1上了
?[root@MyVPS ~]# df -hal
?Filesystem Size Used Avail Use% Mounted on
?/dev/mapper/VolGroup00-LogVol00
?5.7G 1.4G 4.1G 25% /
?proc 0 0 0 – /proc
?sysfs 0 0 0 – /sys
?devpts 0 0 0 – /dev/pts
?/dev/xvda1 99M 28M 67M 30% /boot
?tmpfs 256M 0 256M 0% /dev/shm
?none 0 0 0 – /proc/sys/fs/binfmt_misc
?sunrpc 0 0 0 – /var/lib/nfs/rpc_pipefs
?/dev/xvdb1 22G 173M 21G 1% /home
5.最后添加開機自動掛載:
?[root@MyVPS ~]# echo “/dev/sdb1 /home ext3 defaults 1 2” >> /etc/fstab【如果是/dev/vdb,執(zhí)行的代碼就是echo “/dev/vdb1 /home ext3 defaults 1 2” >> /etc/fstab】
注意:檢驗是否掛盤成功,需要重啟服務(wù)器,如果能夠連接則成功,不能則失敗。重啟命令“reboot”

未經(jīng)允許不得轉(zhuǎn)載:445IT之家 » 新開Linux VPS新硬盤分區(qū)與掛載教程

贊 (0) 打賞

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

微信掃一掃打賞