Linux VPS New Hard disk partition with Mount tutorial

Source: Internet
Author: User
Tags vps

With Fdisk-l we can see that the/DEV/XVDB (this name varies by system) has 23.6G capacity, and there are no partitions,
Next we partition and mount it (the red Word is the part that needs to be entered, the black Word is the system display part)

1.fdisk-l
[Email protected] ~]# fdisk-l
disk/dev/xvda:8589 MB, 8589934592 bytes
255 heads, Sectors/track, 1044 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Device Boot Start End Blocks Id System
/DEV/XVDA1 * 1 104391 Linux
/dev/xvda2 1044 8281507+ 8e Linux LVM
disk/dev/xvdb:23.6 GB, 23622320128 bytes
255 heads, Sectors/track, 2871 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Device Boot Start End Blocks Id System

2. Partition the/dev/xvdb (this name varies by system):
[Email protected] ~]# Fdisk/dev/sdb
The number of cylinders for this disk was set to 2871.
There is nothing wrong with the, 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 the other OSs
(e.g., DOS fdisk, OS/2 fdisk)
Enter n New partition
Command (M for help): N
Command Action
E Extended
P primary partition (1-4)
P
1th Partition in/dev/xvdb
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
Enter W Save to exit
Command (M for help): W
The partition table has been altered!
Calling IOCTL () to re-read partition table.
Syncing disks.

3. Format the new partition XVDB1 (this name varies from system) to EXT3 format
 [[email protected] ~]# mkfs-t ext3/dev/sdb1
 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
& nbsp 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:
 3 2768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
 4096000
 writing inode tables:do NE
 creating Journal (32768 blocks): Done
 writing superblocks and filesystem accounting Information: Done
 this filesystem would be automatically checked every for mounts or
 180 days, whichever comes first. U Se tune2fs-c or-i to override.

4. We demonstrate mounting the new partition XVDB1 to the directory/home
[Email protected] ~]# Mount/dev/sdb1/home
You can also create a new directory/home1, mount the home1 directory, create a new directory command Mkdir/home and then Mount/dev/xvdb1/home

5. After completion we can see through Df-hal that the new partition has been mounted on the directory/home1
[Email protected] ~]# 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

6. Add boot automatically mount: [[email protected] ~]# echo "/dev/sdb1/home ext3 defaults 1 2" >>/etc/fstab

Note: To verify that the connection is successful, the server needs to be restarted and if it is able to connect, it will fail. Restart command "reboot"

7. Handling after my.vpsks.com panel reload
[Email protected] ~]# mkdir/home1
[Email protected] ~]# Mount/dev/sdb1/home
Finally, add the auto mount again:
[[email protected] ~]# echo "/dev/sdb1/home ext3 defaults 1 2" >>/etc/fstab

Linux VPS New Hard disk partition with Mount tutorial

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.