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
- 优惠 老鹰主机春季促销→虚拟主机低至 4 折 新加坡 达拉斯 纽约 VP全球[VPS测评]
- 促销 LosAngelesvps→2 核 2.5G 内存 35G SSD全球[VPS测评]
- 新商家慎重-凯特云→21 元 月 512MB 内存 10GB SSD 空虚拟空间(主机)
- Rainbow Cloud→$50 月 E3-12XX 16G 内存 1香港VPS[主机]
- 腾讯云秒杀→1C2G1M 年付 88 元三年 268 元 2C4G3M 全球[VPS测评]
- ThinkPHP5 数组查询条件中设置 or 或者 and 方法全球[VPS测评]
- racknerd 大带宽大流量美国 vps 低至 8 元 月起,1 核 美国VPS[主机]
- WordPress 网站自定义广告位占位/出租代码全球[VPS测评]
- V5 Server香港阿里云/荃湾服务器新客户首单七折终身优惠月付最低3香港VPS[主机]
- pacificrack便宜vps两折优惠,中国优化线路,1G内存年付10全球[VPS测评]
- 极光 KVM 双十一 美西 CN2 BGP 512M内存600G流量10全球[VPS测评]
- 如何在WordPress博客实现历史上的今天的小功能全球[VPS测评]
- Nusahost-4.67$月付 印尼 Windows系统VPS 1核2WINDOWS
- BGP与AS自治号查询全球[VPS测评]
- 快速云:vps云服务器的区别是什么?2022-08-1913:32来源:全球[VPS测评]
- 拼多多入局跨境电商平台,首站美国;奈雪的茶在上海建第二总部;pidan“美国VPS[主机]
- 狗云DogYun,香港cn2云服务器/优惠码/流量包,按小时计费云服务器香港VPS[主机]
- 言車新车|大阳VPS125混动踏板,长续航,代步通勤9980元起全球[VPS测评]
- 瓜云互联怎么样?香港/美国洛杉矶CN2高防vps 50G月付34元美国VPS[主机]
- 宏海数据9.9云服务器:香港VPS CN2线路1核1G 9.9/首月香港VPS[主机]
- kvmla,新加坡VPS、香港VPS、日本VPS,2核2G云主机仅425日本VPS[主机]
- 众创逸云:元旦优惠活动,香港美国CN2云服务器4核4G30M,仅售309美国VPS[主机]
- 跨境电商平台首选香港服务器香港VPS[主机]
- asiacloud怎么样?香港云服务器(cn2 gia),6折优惠,1GWINDOWS
- 为什么大家都选择香港服务器建站香港VPS[主机]
- 香港vps免费:青云互联,1核1G/50G硬盘/500GB流量/2M带宽香港VPS[主机]
- anyhk香港HKT商宽NAT VPS,1Gbps无限流量,终身8折¥3香港VPS[主机]
- 九零云怎么样?香港将军澳VPS,美国圣何塞VPS 2核1G10M 47/美国VPS[主机]
- 樊云:9折优惠,香港cn2 vps+(强制三网、50G高防);美国cn2美国VPS[主机]
- cmivps:香港vps终身7折,香港服务器终身9折,移动访问尤其优秀香港VPS[主机]
转载请注明原文地址:http://140.238.13.167:12355/read-78130.html











