Linux system mounts Aliyun "redundant" data disk steps

Source: Internet
Author: User
Tags uuid aliyun

The Little devil has just come back from a field trip. Also finally can restore the update ~ today and you share is how to Mount Aliyun's "Data Hard Disk" (Aliyun opened after the default only mount the "system disk"), to this so-called "data disk", because the micro-demon belongs to the early users of Aliyun, Once in the previous promotions to order this extra data plate (40G), but has not been mounted, unfortunately this data disk once ordered can not be canceled (even if not mounted can not be canceled!) , this problem for small users such as micro-magic is undoubtedly a great waste (especially the waste of money ...). If you can't cancel it, then here Zeanzi. Next, I'll share with you the method of mounting the data disk.

In addition to a message, Aliyun on April 29 on the line of the Beijing Data Center, which is also following the Hangzhou, Qingdao, after the third data center, as we have been looking forward to the Hong Kong room, has been in the spoilers, but has not been achieved ...

1. Use the command "df-h" to see if you have the available data disk, if present, return the following,

disk/dev/xvda:21.5 GB, 21474836480 bytes
224 heads, Sectors/track, 3343 cylinders
Units = Cylinders of 12544 * 6422528 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x992cadc0

Device Boot Start End Blocks Id System
/DEV/XVDA1 * 1 3343 20967268 Linux

disk/dev/xvdb:42.9 GB, 42949672960 bytes
255 heads, Sectors/track, 5221 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00000000

Disk/dev/xvdb doesn ' t contain a valid partition table

2. Partition the data disk using the following command

Fdisk-s 56/dev/xvdb

then enter "n"-> "P"-> "1"-> "carriage return"-> "carriage return"-> "Wq"

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF Disklabel
Building a new DOS disklabel with disk identifier 0XC3137CF3.
Changes'll remain in memory only, until you decide to write them.
After this, the course, the previous content won ' t be recoverable.

Warning:invalid flag 0x0000 of partition table 4 is corrected by W (rite)

Warning:dos-compatible mode is deprecated. It ' s strongly recommended to
Switch off "mode" (Command ' C ') and change display units to
Sectors (Command ' u ').

Command (M for help): N
Command Action
E Extended
P primary partition (1-4)
P
Partition number (1-4): 1
The cylinder (1-5874, default 1):
Using Default value 1
Last cylinder, +cylinders or +size{k,m,g} (1-5874, default 5874):
Using Default Value 5874

Command (M for help): Wq
The partition table has been altered!

Calling IOCTL () to re-read partition table.
Syncing disks.

3. Use the "fdisk-l" command to see the new partition XVDB1.

disk/dev/xvda:21.5 GB, 21474836480 bytes
224 heads, Sectors/track, 3343 cylinders
Units = Cylinders of 12544 * 6422528 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x992cadc0

Device Boot Start End Blocks Id System
/DEV/XVDA1 * 1 3343 20967268 Linux

disk/dev/xvdb:42.9 GB, 42949672960 bytes
255 heads, Sectors/track, 5874 cylinders
Units = Cylinders of 14280 * 7311360 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk IDENTIFIER:0XC3137CF3

Device Boot Start End Blocks Id System
/DEV/XVDB1 1 5874 41940332 Linux

4. Format partitions using the following command

Mkfs.ext4/dev/xvdb1
root@ay121002102934f589042:~# MKFS.EXT4/DEV/XVDB1
MKE2FS 1.41.12 (17-may-2010)
FileSystem label=
OS Type:linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, stripe width=0 blocks
2621440 inodes, 10485083 blocks
524254 blocks (5.00%) reserved for the Super user
The Data block=0
Maximum filesystem blocks=4294967296
Groups block
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624

Writing Inode Tables:done
Creating journal (32768 blocks): Done
Writing superblocks and filesystem accounting Information:done

This filesystem would be automatically checked every mounts or
180 days, whichever comes. Use Tune2fs-c or-i to override.
5. Use the following command, add the partition information (the data disk mount in the/mnt, you can modify it)

Echo '/dev/xvdb1/mnt ext4 defaults 0 0 ' >>/etc/fstab

6. View mounted partitions using the following command

Cat/etc/fstab
#/etc/fstab:static File System information.
#
# use ' Blkid ' to print the universally unique identifier for a
# device; This May is used with uuid= as a and robust way to name devices
# that works even if disks are added and removed. Fstab (5).
#
#
PROC/PROC proc Defaults 0 0
#/was on/dev/xvda1 during installation
UUID=34E4B8C4-016A-4003-8B4D-92AEB3CDC3C5/EXT3 Errors=remount-ro 0 1
/dev/scd0/media/cdrom0 udf,iso9660 User,noauto 0 0
Xenfs/proc/xen Xenfs Defaults 0 0
/dev/xvdb1/mnt EXT4 Defaults 0 0

7. Use the "mount-a" command to mount the new partition and view it with the "df-h" command, and the following information appears to prove successful

FileSystem Size Used Avail use% mounted on
/DEV/XVDA1 20G 4.2G 16G 22%/
Tmpfs 501M 0 501M 0%/LIB/INIT/RW
Udev 497M 116K 496M 1%/dev
Tmpfs 501M 0 501M 0%/dev/shm
/DEV/XVDB1 40G 176M 38G 1%/mnt

After reloading the system, the system disk will be cleared, but the data on this data disk is unaffected, just need to be mounted again, directly using the following command,

Echo '/dev/xvdb1 /mnt ext4    defaults    0  0 ' >>/etc/fstab
Mount-a

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.