/etc/fstab label /proc/partitions partprobe mount blkid lsblk

cat /proc/partitions

show any added partitions

fdisk /dev/sdc

partprobe (partprobe /dev/sdc is faster)

after partprobe partition is added  cat /proc/partitions

mkfs.xfs -L mylabel /dev/sdc2

mount /dev/sdc2 /lsdc

[root@localhost ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Sat Sep  9 22:05:18 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/cl-root     /                       xfs     defaults        0 0
UUID=64f8607e-7764-4841-bd8b-3196bbea8223 /boot                   xfs     defaults        0 0
/dev/mapper/cl-swap     swap                    swap    defaults        0 0
/dev/sdb2 /sdbmount xfs defaults 0 0
/dev/sdc1 /sdcmount xfs defaults 0 0
LABEL=mylabel /lsdc xfs defaults 0 0
[root@localhost ~]#


<dump> - used by the dump utility to decide when to make a backup. Dump checks the entry and uses the number to decide if a file system should be backed up. Possible entries are 0 and 1. If 0, dump will ignore the file system; if 1, dump will make a backup. Most users will not have dump installed, so they should put 0 for the <dump> entry.
<pass> - used by fsck to decide which order filesystems are to be checked. Possible entries are 0, 1 and 2. The root file system should have the highest priority 1 - all other file systems you want to have checked should have a 2. File systems with a value 0 will not be checked by the fsck utility.
Note that UUID refers to the naming of your block device(s) (partitions); not the filetype.


[root@localhost ~]# mount | grep sdc
/dev/sdc2 on /lsdc type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
/dev/sdc1 on /sdcmount type xfs (rw,relatime,seclabel,attr2,inode64,noquota)

locate/print block device attributes

view all UUIDs for all available disks on my system

[root@localhost ~]# blkid
/dev/mapper/cl-root: UUID="4f676fc6-b9d1-4869-95f0-1369cefe885a" TYPE="xfs" 
/dev/sda2: UUID="czb1Jv-MRMq-Te7f-B6HB-K2hM-2yQe-4uphHw" TYPE="LVM2_member" 
/dev/sda1: UUID="64f8607e-7764-4841-bd8b-3196bbea8223" TYPE="xfs" 
/dev/mapper/cl-swap: UUID="8094f6df-d751-4d6a-aa65-f04a06f8422a" TYPE="swap" 
/dev/sdb1: UUID="FUhXcw-40aJ-7Fym-MiT2-OglF-EhKi-DR0w2W" TYPE="LVM2_member" 
/dev/sdb2: UUID="742a0999-3d38-48ba-9dfe-d6bffa4c8a1f" TYPE="xfs" 
/dev/sdb3: UUID="4fdab5ca-abef-4475-bf01-acc72546ec29" TYPE="xfs" 
/dev/sdc1: UUID="2907dabf-f97c-4695-a43d-88238d059a34" TYPE="xfs" 
/dev/sdc2: LABEL="mylabel" UUID="2b51d52c-1a1f-4f23-87a9-0677bca94093" TYPE="xfs" 
/dev/sr0: UUID="2016-12-05-13-52-39-00" LABEL="CentOS 7 x86_64" TYPE="iso9660" PTTYPE="dos" 
/dev/mapper/vg_sdbmount-lv_sdb: UUID="ecc81585-a740-423d-86c4-b4b807b616ef" TYPE="xfs" 
[root@localhost ~]# 

list block devices

[root@localhost ~]# lsblk 
NAME                   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                      8:0    0   40G  0 disk 
├─sda1                   8:1    0    1G  0 part /boot
└─sda2                   8:2    0   39G  0 part 
  ├─cl-root            253:0    0   37G  0 lvm  /
  └─cl-swap            253:1    0    2G  0 lvm  [SWAP]
sdb                      8:16   0   20G  0 disk 
├─sdb1                   8:17   0  100M  0 part 
│ └─vg_sdbmount-lv_sdb 253:2    0   92M  0 lvm  
├─sdb2                   8:18   0  100M  0 part /sdbmount
└─sdb3                   8:19   0  100M  0 part /test
sdc                      8:32   0   10G  0 disk 
├─sdc1                   8:33   0   50M  0 part /sdcmount
├─sdc2                   8:34   0   40M  0 part /lsdc
└─sdc3                   8:35   0   60M  0 part 
sr0                     11:0    1  7.7G  0 rom  /run/media/bit/CentOS 7 x86_64

Comments

Popular posts from this blog

HAproxy logging

teamcity Automatic Agent Start under Linux

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all