Linux storage experiment 1: Create a file system on a hard disk

Source: Internet
Author: User
Linux storage experiment 1: Create a file system on a hard disk the entire experiment consists of seven experiments, respectively: www.2cto.com experiment 1: Create a file system on the hard disk Experiment 2: RAID and LVM operation Experiment 3: iSCSItarget configuration experiment 4: NFS configuration and operation experiment 5: SAMBA operation implementation... linux storage experiment 1: Create a file system on a hard disk

The entire experiment consists of seven experiments:
Www.2cto.com
Experiment 1: Create a file system on a hard disk
Tutorial 2: RAID and LVM operations
Tutorial 3: Configure iSCSI target
Tutorial 4: NFS configuration and operations
Experiment 5: SAMBA operations
Experiment 6: performance testing
Experiment 7: Openfiler environment setup and basic operations
Purpose:
1> understand the storage service functions of Linux
2> understand Linux file system operations
3> master the storage management operation www.2cto.com
Test environment:
Virtual Machine: Red Hat Enterprise Linux Server release 6.2
Statement:
Each experiment will be updated within two weeks. please stay tuned...
Experiment 1: Create a file system on a hard disk
Step 1: Add a 1 GB hard disk to the VM
 
Settings ----> hard disk ----> add ---->... -----> increase by 1G
Reboot can see the attached hard disk (note: This is an operation under the virtual machine. it can be seen only after reboot. it can be automatically identified by inserting the hard disk under the physical machine without restarting)
Step 2. hard disk partitioning
See the newly added disk sdb under/dev/. before partitioning, let's talk about the concept of primary partition, extended partition, and logical partition.
Remember: 1> primary partition + extended partition <= 4
2> extended partition <= 1 means there can be no extended partition, but there can only be one
3> primary partition> = 1 at least one primary partition
4> logical partition number> = 5
Relationship diagram:
 
Logical partitions are created in extended partitions and occupy the size of extended partitions. based on the above principles, we believe that you can clearly understand the relationship between them.
 
At this time, a primary partition and an extended partition have been created, and a logical partition (occupying the size of the extended partition) is also created. sdb5 is the logical partition and starts from 5 by default.
The final result is:
 

Step 3: Create a file system on a hard disk partition
Mkfs. ext3/dev/sdb1 mkfs. ext3/dev/sdb5 note: the objects to be mounted and formatted can only be primary partitions and logical partitions. you cannot perform this operation on extended partitions.
Step 4: Mount the file system
Mount the primary partition: Create a Mount Directory: mkdir/mnt/mydev. main
Mount: mount/dev/sdb1/mnt/mydev. main
Mount logical partitions: mkdir/mnt/mydev. logical
Mount/dev/sdb5/mnt/mydev. logical
Step 5: create a file and directory under the mount point (omitted ...)
Step 6: view the directory and file content (omitted ...)
Step 7: uninstall the file system
Umount/dev/sdb1
Umount/dev/sdb5
Lab ended:
1. fdisk-l view all devices
2. df-h: View all mounted devices
Related Article

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.