linux教程#Linux VPS新硬盘分区与挂载教程#面板重装不丢失数据#
![]() | ![]() | ![]() | ![]() |
| 【性价之王】 | 【线路之王】 | 【价格之王】 | 【配置之王】 |
| 【免费之王】 | 【香港首推】 | 【梯子之王】 | 【独服之王】 |

不管怎么样,方法都是很简单的,多掌握一点是好的。
通过fdisk -l我们可以看到/dev/xvdb(此名称因系统而异)容量有23.6G,而且没有分区,接下来我们对它进行分区和挂载
[root@MyVPS ~]# fdisk -l
Disk /dev/xvda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
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
对/dev/xvdb(此名称因系统而异)进行分区:
[root@MyVPS ~]# fdisk /dev/xvdb
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新建分区
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
/dev/xvdb中第1个分区
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.
将新分区xvdb1(此名称因系统而异)格式化为ext3格式
mkfs -t ext3 /dev/xvdb1[root@MyVPS ~]# mkfs -t ext3 /dev/xvdb1
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.
我们示范将新分区xvdb1挂载到目录/home1
新建目录/home1,然后挂载
完成后我们通过df -hal可以看到,新分区已经挂载到目录/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% /home1
最后添加开机自动挂载:
echo “/dev/xvdb1 /home1 ext3 defaults 1 2″ >> /etc/fstab这样就完成了!
通过面板重装后的处理| 重新建立目录/home1,然后重新挂载,xvdb1的文件内容不受影响 mkdir /home1mount /dev/xvdb1 /home1 最后,重新添加自动挂载即可: echo “/dev/xvdb1 /home1 ext3 defaults 1 2″ >> /etc/fstab |
[linux教程]历史优惠活动内容
猜你可能想看的VPS
- 六六云→28 月 1GB 内存 20GB SSD 空间 不限流量 5Mb虚拟空间(主机)
- 磐石云拉新活动→美国云主机低至 27.5 元 福州高防云主机最低 110美国VPS[主机]
- 新商家慎重-伏羲主机(6le)香港 cera 机房便宜 VPS 主机 1香港VPS[主机]
- 优惠 ZJI→香港云地机房多 IP 站群服务器 8 折优惠 273 个 站群服务器[IP]
- QN 机房-SmartHost→$6.95 月 4 核 8GB 内存 4虚拟空间(主机)
- 搬瓦工 DC6 限量版补货,最便宜的美国 cn2vps,优质稳定靠谱的三美国VPS[主机]
- 我爱水煮鱼WordPress SEO 宝典:怎么才能让你的博客流量增长1全球[VPS测评]
- 恒创科技 香港、美国 CN2 云服务器318元/年,物理裸机480元秒杀美国VPS[主机]
- 代码实现类似大前端DUX WordPress主题评论列表显示楼层全球[VPS测评]
- JagoanHosting-印尼新加坡1C1G20GB 300Mbps 全球[VPS测评]
- [优惠]CloudCone 1810 闪购全球[VPS测评]
- V.PS -欧洲 9929 VPS 优惠后33.96欧元起全球[VPS测评]
- 详细介绍vps云服务器及其作用全球[VPS测评]
- WordPress去掉分类链接中category目录的两种方法全球[VPS测评]
- 2.45亿、成都公安(大数据基座-服务器)采购:神码、虹信、海康、超聚变全球[VPS测评]
- 如何设置指定路径跳转指定域名?全球[VPS测评]
- 租用美国服务器有哪些安全方案美国VPS[主机]
- 恒创科技:国庆中秋双节同庆,香港1核2G云服务器,年付378元香港VPS[主机]
- 如何设置必应api 自动推送网站全球[VPS测评]
- 个人如何做跨境电商?全球[VPS测评]
- 云计算拯救互联网巨头:谁抢跑,谁追赶?全球[VPS测评]
- 企鹅小屋:香港VPS限时3折优惠,香港沙田CN2,原生IP,年付486.香港VPS[主机]
- 数据中心助力光纤光缆行业发展全球[VPS测评]
- 锤子云:香港CN2云服务器15元/月,三网CN2线路回程,建站vps专属香港VPS[主机]
- 青果云:香港云主机2核1G3M30G,香港vps仅售59元/月香港VPS[主机]
- 原创解析:云计算含义及定义全球[VPS测评]
- 云米科技:庆祝愚人节活动,香港CN2 GIA/美国CERA VPS全场9美国VPS[主机]
- PQhosting:香港HE/乌克兰/俄罗斯/荷兰/摩尔多瓦vps主机/香港VPS[主机]
- 云群网络怎么样?香港云服务器高端弹性云2核2G2M带宽,仅588元/年香港VPS[主机]
- 香港vps免费:青云互联,1核1G/50G硬盘/500GB流量/2M带宽香港VPS[主机]
转载请注明原文地址:http://140.238.13.167:12355/read-78130.html











