[[email protected] ~] # fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xa360fa76.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won‘t be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
WARNING: DOS-compatible mode is deprecated. It‘s strongly recommended to
switch off the mode ( command ‘c‘ ) and change display units to
sectors ( command ‘u‘ ).
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-6527, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-6527, default 6527): +10G
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (1307-6527, default 1307):
Using default value 1307
Last cylinder, +cylinders or +size{K,M,G} (1307-6527, default 6527): +10G
Command (m for help): t
Partition number (1-4): 1
Hex code ( type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)
Command (m for help): t
Partition number (1-4): 2
Hex code ( type L to list codes): 8e
Changed system type of partition 2 to 8e (Linux LVM)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re- read partition table.
Syncing disks.
[[email protected] ~] # pvcreate myvg /dev/sdb{1,2}
Device myvg not found (or ignored by filtering).
Physical volume "/dev/sdb1" successfully created
Physical volume "/dev/sdb2" successfully created
[[email protected] ~] # vgcreate -s 16MB myvg /dev/sdb{1,2}
Volume group "myvg" successfully created
[[email protected] ~] # lvcreate -L 7G -n mylv1 myvg
Logical volume "mylv1" created
[[email protected] ~] # mke2fs -t ext4 -b 2048 /dev/myvg/mylv1
mke2fs 1.43-WIP (20-Jun-2013)
Filesystem label=
OS type : Linux
Block size=2048 (log=1)
Fragment size=2048 (log=1)
Stride=0 blocks, Stripe width=0 blocks
458752 inodes, 3670016 blocks
183500 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=541065216
224 block groups
16384 blocks per group, 16384 fragments per group
2048 inodes per group
Superblock backups stored on blocks:
16384, 49152, 81920, 114688, 147456, 409600, 442368, 802816, 1327104,
2048000
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
[[email protected] ~] # mkdi
mkdict mkdir
[[email protected] ~] # mkdir /users
[[email protected] ~] # blkid /dev/myvg/mylv1
/dev/myvg/mylv1 : UUID= "2cf83771-e51e-4e86-a5a3-53309f13ba32" TYPE= "ext4"
[[email protected] ~] # echo ‘/dev/myvg/mylv1 /users ext4 defaults 1 4‘ >> /etc/fstab
[[email protected] ~] # mount -a
[[email protected] ~] # mount
/dev/mapper/vg_demo-lv_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)
/dev/sda1 on /boot type ext4 (rw)
/dev/sr0 on /mnt type iso9660 (ro)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/mapper/myvg-mylv1 on /users type ext4 (rw)
[[email protected] ~] # cd /users/
[[email protected] users ] # ls
lost+found
|