Drive - Hard (disk|drive) (HDD) - Mass Storage - Flash in Linux.
It contains partitions that contains file system that are mounted to be made available to the OS.
A disk name is the following syntax without the Partition number but to understand the whole story, we have added it.
# Disk Name
/dev/[sd|hd]Unit
# Partition Name
/dev/[sd|hd]UnitPartition
where:
Therefore:
The disk name is:
Examples:
Under Red Hat Linux, the device files for disk drives appear in the /dev/ directory.
ls /dev/
agpgart floppy-fd0 null ram4 tty1 tty30 tty51 vcs1
cdrom full nvram ram5 tty10 tty31 tty52 vcs2
cdrom-hdc gpmctl oldmem ram6 tty11 tty32 tty53 vcs3
console hdc par0 ram7 tty12 tty33 tty54 vcs4
core hpet parport0 ram8 tty13 tty34 tty55 vcs5
disk initctl parport1 ram9 tty14 tty35 tty56 vcs6
fd input parport2 ramdisk tty15 tty36 tty57 vcs7
...........................
The format for each file name depends on several aspects of the actual hardware and how it has been configured. The important points are as follows:
dmesg | grep -i "device sd"
# Axure: dmesg | grep SCSI
# or grep -i "\[sd.\]"
SCSI device sda: 167772160 512-byte hdwr sectors (85899 MB)
SCSI device sda: 167772160 512-byte hdwr sectors (85899 MB)
SCSI device sdb: 1048576000 512-byte hdwr sectors (536871 MB)
SCSI device sdb: 1048576000 512-byte hdwr sectors (536871 MB)
Here we can see that we have two disk:
sudo -i blkid
/dev/sdc1: UUID="aa6c9d84-94d3-48dd-a037-d98064b9f96c" TYPE="ext4"
/dev/sda1: UUID="ca02dd2d-a91b-4fb1-b24b-0fb19c18b89d" TYPE="xfs"
/dev/sda2: UUID="3c11fba3-32c7-4d0c-b614-aad5630504eb" TYPE="xfs"
/dev/sdb1: UUID="d824e95a-04db-479e-8acf-a3179ee64d16" TYPE="ext4"
mount /dev/sdc1 /datadrive
Write a the ext4 file system to the partition 1 of the disk sdc
mkfs -t ext4 /dev/sdc1
mke2fs 1.42.9 (28-Dec-2013)
Discarding device blocks: done
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
2621440 inodes, 10485504 blocks
524275 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2157969408
320 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
More information about ATA and SCSI can be found in Present-Day Industry-Standard Interfaces.