Ali cloud ECSLinux under mount disk system

Recently the company server always prompts insufficient disk space, because the former head of the Tomcat open the debug log and the log does not do polling, so the log is very large. When I did a poll found that after cutting the log disk is too small only 40G, supposedly to step outside the network server, how could such a low profile, so log on Ali cloud console to view, and she has not mounted disks, so with the following:

Ali cloud ECS, need to mount the current disk

Specific steps are as follows:

1, check whether they have allocated

[root@iZ2ze1tefvghtbgkdur3xfZ /]# fdisk -l

[root@iZ2ze1tefvghtbgkdur3xfZ server]# fdisk -l

Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0009e68a

Device Boot Start End Blocks Id System
/dev/vda1 * 2048 83884031 41940992 83 Linux

Disk /dev/vdb: 64.4 GB, 64424509440 bytes, 125829120 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

 

 

2, find the disk, the path is / dev / vdb. Then use the fdisk command to create the partition

[root@iZ2ze1tefvghtbgkdur3xfZ /]#fdisk /dev/vdb

fdisk命令如下:

 

 

命令(输入 m 获取帮助):m

命令操作

   a   toggle a bootable flag

   b   edit bsd disklabel

   c   toggle the dos compatibility flag

   d   delete a partition

   g   create a new empty GPT partition table

   G   create an IRIX (SGI) partition table

   l   list known partition types

   m   print this menu

   n   add a new partition

   o   create a new empty DOS partition table

   p   print the partition table

   q   quit without saving changes

   s   create a new empty Sun disklabel

   t   change a partition's system id

   u   change display/entry units

   v   verify the partition table

   w   write table to disk and exit

   x   extra functionality (experts only)

 

 

3, and then to create a new partition (here because I want to store a large database files are all so logical partition)

 

 

Command (input m to get help): n- 

the Partition type: 

   P Primary ( 0 Primary, 0 Extended, . 4  Free ) 

   E Extended 

the Select (default P): 

the Using Response P default 

partition number ( 1 - . 4 , default 1 ): 

Starting fan region ( 2048 - 3221225471 , default is 2048 ): 

the default value 2048 

Last sector + {sector size K + or, M, G} ( 2048 - 3221225471 , default 3221225471 ): 

the default value 3221225471 

partition 1 Linux has been set to the type, size is set1.5 tube

 

 

 

 

 

4, the last saved partition

Command (input m to get help): w 

at The Partition the Table has been the Altered ! 

 

Calling ioctl () to Re - the Read Partition the Table. 

Syncing disks.

 

5, using the fdisk -l command to see, there are already partitions

 

Disk / dev / SDB: 1649.3 GB, 1,649,267,441,664 bytes, 3221225472 sectors 

Units = sectors of . 1 * 512 = 512 bytes 

sector size (logical / physical): 512 bytes / 512 bytes of 

the I / O size (minimum / best): 512 byte / 512 byte 

disk label type: DOS 

disk identifier: 0xe0bc0098 

 

   apparatus the Start End Blocks Id the System the Boot

 / dev / sdb1             2048   3,221,225,471   1610611712    83   the Linux

 

 

 

6, built after the partition you want to format the partition, create a file system

 
[root@localhost home]# mkfs.ext4 /dev/vdb

meta-data=/dev/sdb1              isize=256    agcount=4, agsize=100663232 blks

         =                       sectsz=512   attr=2, projid32bit=1

         =                       crc=0        finobt=0

data     =                       bsize=4096   blocks=402652928, imaxpct=5

         =                       sunit=0      swidth=0 blks

naming   =version 2              bsize=4096   ascii-ci=0 ftype=0

log      =internal log           bsize=4096   blocks=196607, version=2

         =                       sectsz=512   sunit=0 blks, lazy-count=1

realtime =none                   extsz=4096   blocks=0, rtextents=0

 

 

 

7, so that the file system is built, and then select a mount point hanging on it, I mount the / server a

[root@localhost home]# mount /dev/vdb /server/

 

8, look at the success of the mount

[Home the root @ localhost] # DF -TH / Server 

file system type has been used with the available capacity % mount point

 / dev / sdb1 XFS    . 1 .7T 34M   . 1 .7T     . 1 % / Home / Data

 

9, modify the system configuration add the following line to / etc / fstab, the system automatically mount after the start, or they may fall

UUID=5392f2ec-3101-4c14-a817-a53ab48070ae /server       ext4 defaults,barrier=0 1 1

 

 

 

Guess you like

Origin www.cnblogs.com/FireLL/p/11611670.html