Add logical partitions and mounts under Linux (Manual and Automatic)

Source: Internet
Author: User
Tags uuid

First, view the new disk
[Email protected] desktop]# FDISK-CUL/DEV/SDC

disk/dev/sdc:21.5 GB, 21474836480 bytes
255 heads, Sectors/track, 2610 cylinders, total 41943040 sectors
Units = sectors of 1 * MB = bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00000000
Two Add logical partitions
[Email protected] desktop]# FDISK-CU/DEV/SDC
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF Disklabel
Building a new DOS disklabel with disk identifier 0X740491C5.
Changes'll remain in memory only, until the decide to write them.
After that, of course, the previous content won ' t is recoverable.


Warning:invalid flag 0x0000 of partition Table 4 would be a corrected by W (rite)


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
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)


Command (M for help): N
Command Action
E Extended
P primary partition (1-4)
E---------------) Select an extended partition
Partition number (1-4): 2
First sector (2048-41943039, default 2048):
Using Default Value 2048
Last sector, +sectors or +size{k,m,g} (2048-41943039, default 41943039): 10G
Value out of range.
Last sector, +sectors or +size{k,m,g} (2048-41943039, default 41943039): +10g


Command (M for help): N
Command Action
L logical (5 or over)
P primary partition (1-4)
L-----------------) Select logical Partition
First sector (4096-20973567, default 4096):
Using Default value 4096
Last sector, +sectors or +size{k,m,g} (4096-20973567, default 20973567): +5g


Command (M for help): N
Command Action
L logical (5 or over)
P primary partition (1-4)
L-------------------) Select logical Partition
First sector (10491904-20973567, default 10491904):
Using Default Value 10491904
Last sector, +sectors or +size{k,m,g} (10491904-20973567, default 20973567): +5g
Value out of range.
Last sector, +sectors or +size{k,m,g} (10491904-20973567, default 20973567):
Using Default Value 20973567


Command (M for help): P---------------> Print partition list


disk/dev/sdc:21.5 GB, 21474836480 bytes
255 heads, Sectors/track, 2610 cylinders, total 41943040 sectors
Units = sectors of 1 * MB = bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x740491c5


Device Boot Start End Blocks Id System
/DEV/SDC2 2048 20973567 10485760 5 Extended
/DEV/SDC5 4096 10489855 5242880-up Linux
/DEV/SDC6 10491904 20973566 5240831+-up Linux
The auto-named logical partition is: SDC5 sdc6
Command (M for help): W------------------> Save exit
The partition table has been altered!


Calling IOCTL () to re-read partition table.
Syncing disks.
[Email protected] desktop]# part
Parted Partprobe Partx
[Email protected] desktop]# partx-a/DEV/SDC
Blkpg:device or resource busy
Error adding partition 2
Blkpg:device or resource busy
Error adding partition 5
Blkpg:device or resource busy
Error adding partition 6
Third, view the new partition
[Email protected] desktop]# FDISK-CU/DEV/SDC


Command (M for help): P


disk/dev/sdc:21.5 GB, 21474836480 bytes
139 heads, Sectors/track, 6158 cylinders, total 41943040 sectors
Units = sectors of 1 * MB = bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x740491c5


Device Boot Start End Blocks Id System
/DEV/SDC2 2048 20973567 10485760 5 Extended
/DEV/SDC5 4096 10489855 5242880-up Linux
/DEV/SDC6 10491904 20973566 5240831+-up Linux


Command (M for help): Q
Iv. Formatting partitions
1sdc5
[Email protected] desktop]# MKFS.EXT4/DEV/SDC5
MKE2FS 1.41.12 (17-may-2010)
Filesystem label=
OS Type:linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
327680 inodes, 1310720 blocks
65536 blocks (5.00%) reserved for the Super user
First Data block=0
Maximum filesystem blocks=1342177280
Groups block
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736


Writing Inode Tables:done
Creating Journal (32768 blocks): Done
Writing superblocks and filesystem accounting Information:done


This filesystem would be automatically checked every mounts or
Whichever comes first. Use Tune2fs-c or-i to override.
2sdc6
[Email protected] desktop]# MKFS.EXT4/DEV/SDC6
MKE2FS 1.41.12 (17-may-2010)
Filesystem label=
OS Type:linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
327680 inodes, 1310207 blocks
65510 blocks (5.00%) reserved for the Super user
First Data block=0
Maximum filesystem blocks=1342177280
Groups block
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736


Writing Inode Tables:done
Creating Journal (32768 blocks): Done
Writing superblocks and filesystem accounting Information:done


This filesystem would be automatically checked every mounts or
Whichever comes first. Use Tune2fs-c or-i to override.
V. New MOUNT Directory
[Email protected] desktop]# cd/mnt/
[[email protected] mnt]# ls
Hgfs
[[email protected] mnt]# mkdir sdc{5,6}
[[email protected] mnt]# ls
Hgfs SDC5 SDC6
[Email protected] mnt]# pwd
/mnt
Six, automatically mount Sdc5, sdc6 to/MNT/SDC5,/MNT/SDC6
[Email protected] mnt]# MOUNT/DEV/SDC5/MNT/SDC5
[Email protected] mnt]# MOUNT/DEV/SDC6/MNT/SDC6
Vii. whether the check can be mounted successfully
[email protected] mnt]# mount
/dev/mapper/vol0-root on/type ext4 (rw)
Proc On/proc type proc (rw)
Sysfs On/sys type SYSFS (rw)
Devpts on/dev/pts type devpts (rw,gid=5,mode=620)
Tmpfs on/dev/shm type Tmpfs (rw,rootcontext= "System_u:object_r:tmpfs_t:s0")
/DEV/SDA1 on/boot type EXT4 (rw)
/dev/mapper/vol0-home on/home type EXT4 (rw)
/DEV/SDB5 ON/TMP/SDB5 type EXT4 (rw)
/DEV/SDB6 ON/TMP/SDB6 type EXT4 (rw)
None On/proc/sys/fs/binfmt_misc type Binfmt_misc (rw)
Vmware-vmblock on/var/run/vmblock-fuse type Fuse.vmware-vmblock (rw,nosuid,nodev,default_permissions,allow_other)
Sunrpc on/var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
Gvfs-fuse-daemon ON/ROOT/.GVFS type Fuse.gvfs-fuse-daemon (Rw,nosuid,nodev)
/DEV/SDC5 ON/MNT/SDC5 type EXT4 (rw)
/DEV/SDC6 on/mnt/sdc6 type EXT4 (rw)
Nine, unloading sdc5 sdc6
[Email protected] mnt]# UMOUNT/DEV/SDC5
[Email protected] mnt]# UMOUNT/DEV/SDC6
[email protected] mnt]# mount
/dev/mapper/vol0-root on/type ext4 (rw)
Proc On/proc type proc (rw)
Sysfs On/sys type SYSFS (rw)
Devpts on/dev/pts type devpts (rw,gid=5,mode=620)
Tmpfs on/dev/shm type Tmpfs (rw,rootcontext= "System_u:object_r:tmpfs_t:s0")
/DEV/SDA1 on/boot type EXT4 (rw)
/dev/mapper/vol0-home on/home type EXT4 (rw)
/DEV/SDB5 ON/TMP/SDB5 type EXT4 (rw)
/DEV/SDB6 ON/TMP/SDB6 type EXT4 (rw)
None On/proc/sys/fs/binfmt_misc type Binfmt_misc (rw)
Vmware-vmblock on/var/run/vmblock-fuse type Fuse.vmware-vmblock (rw,nosuid,nodev,default_permissions,allow_other)
Sunrpc on/var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
Gvfs-fuse-daemon ON/ROOT/.GVFS type Fuse.gvfs-fuse-daemon (Rw,nosuid,nodev)
Ten, hand-mounted
1. Check the UUID of SDB5
[[email protected] mnt] #blkid/DEV/SDB5
2, hand-mounted SDB5, SDB6
[Email protected] mnt]# cd/etc
[Email protected] etc]# VI fstab


#
#/etc/fstab
# Created by Anaconda on Fri APR 11 00:49:26 2014
#
# Accessible filesystems, by reference, is maintained under '/dev/disk '
# See mans Pages Fstab (5), Findfs (8), mount (8) and/or Blkid (8) for more info
#
/DEV/MAPPER/VOL0-ROOT/EXT4 Defaults 1 1
Uuid=9353a628-e49f-4675-abf4-b0fe76b38fbc/boot EXT4 Defaults 1 2
/dev/mapper/vol0-home/home EXT4 Defaults 1 2
uuid=f3d4a81c-f2d6-48d8-be1a-35647cd74615 swap swap defaults 0 0
TMPFS/DEV/SHM TMPFS Defaults 0 0
Devpts/dev/pts devpts gid=5,mode=620 0 0
Sysfs/sys Sysfs Defaults 0 0
PROC/PROC proc Defaults 0 0
UUID=DFA6E086-E5BE-4856-9E8D-9565D52B82E6/MNT/SDC5 EXT4 Defaults 0 0
/DEV/SDC6/MNT/SDC6 EXT4 Defaults 0 0
Way has through the partition name and UUID
Xi. Viewing Mount Results
[[email protected] etc]# mount-a------------------Refresh Mount
[email protected] etc]# mount
/dev/mapper/vol0-root on/type ext4 (rw)
Proc On/proc type proc (rw)
Sysfs On/sys type SYSFS (rw)
Devpts on/dev/pts type devpts (rw,gid=5,mode=620)
Tmpfs on/dev/shm type Tmpfs (rw,rootcontext= "System_u:object_r:tmpfs_t:s0")
/DEV/SDA1 on/boot type EXT4 (rw)
/dev/mapper/vol0-home on/home type EXT4 (rw)
/DEV/SDB5 ON/TMP/SDB5 type EXT4 (rw)
/DEV/SDB6 ON/TMP/SDB6 type EXT4 (rw)
None On/proc/sys/fs/binfmt_misc type Binfmt_misc (rw)
Vmware-vmblock on/var/run/vmblock-fuse type Fuse.vmware-vmblock (rw,nosuid,nodev,default_permissions,allow_other)
Sunrpc on/var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
Gvfs-fuse-daemon ON/ROOT/.GVFS type Fuse.gvfs-fuse-daemon (Rw,nosuid,nodev)
/DEV/SDC5 ON/MNT/SDC5 type EXT4 (rw)
/DEV/SDC6 on/mnt/sdc6 type EXT4 (rw)
[Email protected] etc]#

Add logical partitions and mounts under Linux (Manual and Automatic)

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.