Posts

Showing posts with the label fdisk

Some important commands

# Find CPU specifications cat /proc/cpuinfo # System information via uname: uname -r [Kernel release] uname -a [All information about the kernal] uname -s [Kernel name] uname -m [Machine hw name] uname -p [Processor type] uname -o [OS] uname -n [Node name] # Running kernel and compiler: cat /proc/version # X server version: X -showconfig or Xorg -version # List of Kernel modules loaded: lsmod # Memory and swap information cat /proc/meminfo free free -m [in MB] # Hard drives information: fdisk -l # Free/used drive space or mount points: df -h # Distribution ?? cat /etc/issue cat /etc/issue.net # Finding or locating files find locate which whereis # Log messages as they happen: tail -f /var/log/messages (shows last 10 lines). # What processes are running [concise information]: ps -A ps -A | grep <PROCESS_NAME/PID> [For specific process] # What process are running [Brief information]: ps -ef ps -ef | grep -i <PROCESS_NAME/PID...

Ways of searching a disk/hdd in RHEL6

There must be an entry in /sys/block/XXX # ls -lrt /sys/block/ /proc/partitions ==> cat /proc/partitions  major minor  #blocks  name    8        0   15728640 sda    8        1     512000 sda1    8        2   15215616 sda2    8       16    2097152 sdb  253        0   13148160 dm-0  253        1    2064384 dm-1 To list all the disk in the machine ==> fdisk -l # fdisk -l /dev/?d? To avoid all the dm devices. # fdisk -l 2>/dev/null | grep "Disk \/" Disk /dev/sda: 16.1 GB, 16106127360 bytes Disk /dev/sdb: 2147 MB, 2147483648 bytes Disk /dev/mapper/VolGroup-lv_root: 13.5 GB, 13463715840 bytes Disk /dev/mapper/VolGroup-lv_swap: 2113 MB, 2113929216 bytes # lsblk NAME                   ...

Managing Partitions

Harddisk : It is a storage device which is used to store any kind of data, Currently there are two types of HDD available in market: SATA (Serial Advanced Technology Attachment). PATA (Parallel Advanced Technology Attachment). So the basic command to check your file system structure is fdisk -l, it will show you list of your harddisk's partition table. For more information on this you can see its man page by firing a command as man fdisk. Usually when a hard disk is inserted in a machine it acts like a file and is stored in /dev partition. So suppose that there are 3 hard disk in your machine then there naming convention would be /dev/sda (for the first HDD), /dev/sdb (for the second HDD), /dev/sdc (for the third HDD). parted : Stands for GNU Parted - a partition manipulation program, it is  a  disk  partitioning  and  partition resizing program.  It allows you to create, destroy, resize, move and copy ext2,  linux-swap,FAT,  FAT32,...

LVM ?

LVM is a logical volume manager for the Linux kernel, it manages disk drives and similar mass-storage devices. The term "volume" refers to a disk drive or partitions. LVM is suitable for: Managing large hard disk farms by letting you add disks, replace disks, copy and share contents from one disk to another without disrupting service (hot swapping). On small systems (like a desktop at home), instead of having to estimate at installation time how big a partition might need to be in the future, LVM allows you to resize your disk partitions easily as needed. Making backups by taking "snapshots." Creating single logical volumes of multiple physical volumes or entire hard disks, allowing for dynamic volume resizing. One can think of LVM as a thin software layer on top of the hard disks and partitions, which creates an illusion of continuity and ease-of-use for managing hard-drive replacement, repartitioning, and backup. Features of LVM: Resize ...