Linux disk mount and Mount sharing

Source: Internet
Author: User

 

For Linux Server disk mount mount and share do simple instructions:

1. View the Used disk condition

Df–h

2. View all disks

Fdisk–l

3. View the partition of the specified disk "/dev/xvde"

Fdisk-l/dev/xvde

You can see that the disk is not partitioned

4. We now need to mount the/dev/xvde disk mount to the/OPT/HUIYY directory on the file system,

first the disk "/dev/xvde" Partition (here we use 1 partitions)

Command Fdisk/dev/xvde Enter, as follows:

Input W Write

Use Fdisk–l to view the disk number you just assigned

5. Format the disk

Command Mkfs-t Ext3/dev/xvde1

-t specifies that the file system type of the formatted disk is EXT3 and is not specified by default as ext2 (Linux old file system type)

followed by the partition number "/dev/xvde1" that you just created

6. Mount the disk

A) Create a disk Mount destination folder

Command Mkdir/opt/huiyy

b) Mount the disk

Command Mount/dev/xvde1/opt/huiyy

c) Log into the/ext/fstab file (prevent mount loss after reboot)

Command Vi/etc/fstab

Now that the disk is mounted, we can write the file to/opt/huiyy and the file will be written to our mounted disk.

7. Configuration Sharing

Shared directory "/opt/huiyy/resource" and "/opt/huiyy/log" Permissions "Rw,sync,no_root_squash"

Command Vi/etc/exports after editing content: Wq Save exit

Shared view command for More/etc/exports

8. Client Mount this directory

We have configured the server for the shared directory above as Server A, and we are now preparing the server for Mount shared directory as Server B

A) log on to Server B

b) Mount Directory "/opt/huiyy/log" (where 61.132.254.160 is Server a)

Mount-t nfs-orw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,vers=3,timeo=600,actimeo=061.132.254.160:/opt/huiyy/ Log/opt/huiyy/log

/opt/huiyy/log is a directory attached to this machine and can be defined by itself.

c) Save mount Mount configuration to/etc/fstab (prevent mount loss after server restart)

Command Vi/etc/fstab Edit

Command Cat/etc/fstab View Configuration

Both server B and File source Server A can now create files and directories under directory "/opt/huiyy/log".

End


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Linux disk mount and Mount sharing

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.