电信云主机挂载磁盘

上一篇 / 下一篇  2020-01-17 10:39:38 / 个人分类:Linux

[root@ecs-6902-0116090 test]# 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: 0x000a9cf3

 

   Device Boot      Start         End      Blocks   Id  System

/dev/vda1            2048     8390655     4194304   82  Linux swap / Solaris

/dev/vda2   *     8390656    83886079    37747712   83  Linux

 

Disk /dev/vdb: 1073.7 GB, 1073741824000 bytes, 2097152000 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

 

[root@ecs-6902-0116090 test]# fdisk /dev/vdb

Welcome to fdisk (util-linux 2.23.2).

 

Changes will remain in memory only, until you decide to write them.

Be careful before using the write command.

 

Device does not contain a recognized partition table

Building a new DOS disklabel with disk identifier 0x82608d98.

 

Command (m for help):n

Partition type:

   p   primary (0 primary, 0 extended, 4 free)

   e   extended

Select (default p):p

Partition number (1-4, default 1):1

First sector (2048-2097151999, default 2048):

Using default value 2048

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

Using default value 2097151999

Partition 1 of type Linux and of size 1000 GiB is set

 

Command (m for help):w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

Syncing disks.

[root@ecs-6902-0116090 test]#mkfs.ext4 /dev/vdb1

mke2fs 1.42.9 (28-Dec-2013)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

Stride=0 blocks, Stripe width=0 blocks

65536000 inodes, 262143744 blocks

13107187 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=2409627648

8000 block groups

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, 11239424, 20480000, 23887872, 71663616, 78675968,

        102400000, 214990848

 

Allocating group tables: done                            

Writing inode tables: done                            

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done    

 

[root@ecs-6902-0116090 test]#mkdir /data

[root@ecs-6902-0116090 test]# mount /dev/vdb1 /data

[root@ecs-6902-0116090 test]# df -h

Filesystem      Size  Used Avail Use% Mounted on

/dev/vdb1        36G  3.6G   30G  11% /

devtmpfs         63G     0   63G   0% /dev

tmpfs            63G     0   63G   0% /dev/shm

tmpfs            63G   17M   63G   1% /run

tmpfs            63G     0   63G   0% /sys/fs/cgroup

tmpfs            13G     0   13G   0% /run/user/0

/dev/vdb1       985G   77M  935G   1% /data

 

 

[root@ecs-6902-0116090 test]#vi /etc/fstab

#

# /etc/fstab

# Created by anaconda on Wed Feb 15 09:40:26 2017

#

# Accessible filesystems, by reference, are maintained under '/dev/disk'

# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info

#

UUID=0bdf1908-f065-4045-b6db-4b55e990cd0a /                       ext3    defaults        1 1

UUID=4a6701cf-4ad5-4011-b7c2-73d40a757a1d swap                    swap    defaults        0 0

/dev/vdb1 /data ext4 defaults 0 0


注:此处最好写uuid

uuid查询方法:ls -l /dev/disk/by-uuid


~

~

~~

~

"/etc/fstab" 11L, 437C written


TAG:

 

评分:0

我来说两句

Open Toolbar