centos 挂载数据盘

 

[root@out2436-003 ~]# fdisk /dev/xvde
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 0x4206f0e1.

Command (m for help): m
Command action
   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 partitions system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): p

Disk /dev/xvde: 1610.6 GB, 1610612736000 bytes, 3145728000 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: 0x4206f0e1

    Device Boot      Start         End      Blocks   Id  System

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-3145727999, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-3145727999, default 3145727999): 
Using default value 3145727999
Partition 1 of type Linux and of size 1.5 TiB is set

Command (m for help): p        

Disk /dev/xvde: 1610.6 GB, 1610612736000 bytes, 3145728000 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: 0x4206f0e1

    Device Boot      Start         End      Blocks   Id  System
/dev/xvde1            2048  3145727999  1572862976   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
You have new mail in /var/spool/mail/root
[root@out2436-003 ~]# df -h
Filesystem                  Size  Used Avail Use% Mounted on
/dev/mapper/centos-lv_root   37G  7.8G   29G  22% /
devtmpfs                    3.8G     0  3.8G   0% /dev
tmpfs                       3.6G     0  3.6G   0% /dev/shm
tmpfs                       3.6G  386M  3.3G  11% /run
tmpfs                       3.6G     0  3.6G   0% /sys/fs/cgroup
/dev/xvda1                  497M  185M  312M  38% /boot
tmpfs                       730M     0  730M   0% /run/user/0
[root@out2436-003 ~]# fdisk -l

Disk /dev/xvda: 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: 0x000a7074

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *        2048     1026047      512000   83  Linux
/dev/xvda2         1026048    83804159    41389056   8e  Linux LVM

Disk /dev/mapper/centos-lv_root: 38.8 GB, 38751174656 bytes, 75685888 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 /dev/mapper/centos-lv_swap: 3623 MB, 3623878656 bytes, 7077888 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 /dev/xvde: 1610.6 GB, 1610612736000 bytes, 3145728000 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: 0x4206f0e1

    Device Boot      Start         End      Blocks   Id  System
/dev/xvde1            2048  3145727999  1572862976   83  Linux
[root@out2436-003 ~]# 
[root@out2436-003 ~]# 
[root@out2436-003 ~]# mkfs.xfs /dev/xvde1 
meta-data=/dev/xvde1             isize=256    agcount=4, agsize=98303936 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0
data     =                       bsize=4096   blocks=393215744, imaxpct=5
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal log           bsize=4096   blocks=191999, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@out2436-003 ~]# ll
total 4
-rw-------. 1 root root 1896 Jun 25  2018 anaconda-ks.cfg
[root@out2436-003 ~]# cd /
[root@out2436-003 /]# mkdir data
[root@out2436-003 /]# mount /dev/xvde1 /data
[root@out2436-003 /]# df -h
Filesystem                  Size  Used Avail Use% Mounted on
/dev/mapper/centos-lv_root   37G  7.8G   29G  22% /
devtmpfs                    3.8G     0  3.8G   0% /dev
tmpfs                       3.6G     0  3.6G   0% /dev/shm
tmpfs                       3.6G  386M  3.3G  11% /run
tmpfs                       3.6G     0  3.6G   0% /sys/fs/cgroup
/dev/xvda1                  497M  185M  312M  38% /boot
tmpfs                       730M     0  730M   0% /run/user/0
/dev/xvde1                  1.5T   33M  1.5T   1% /data
[root@out2436-003 /]# 
[root@out2436-003 /]# vim /etc/fstab

## 添加一行
/dev/xvde1 /data xfs defaults 0 0

 

 

 

 

你可能感兴趣的:(服务器)