≡ Menu

fdisk command

Linux Create Software RAID 1 (Mirror) Array

How do I create Software RAID 1 arrays on Linux systems without using GUI tools or installer options? How do I setup RAID 1 array under Linux systems?
[click to continue…]

See Filesystems In Linux

How do I see filesystem status in Linux?
[click to continue…]

How do I remove all partitions, data and create clean empty hard disk under Linux operating systems?
[click to continue…]

FreeBSD: How To Add A Second Hard Disk

Q. How do I add a second hard disk to my FreeBSD server? How do I partition, label and mount a new hard disk under FreeBSD for backup or additional data?
[click to continue…]

Linux Hard Disk Format Command

Q. I've installed a new 250GB SATA hard disk on our office CentOS Linux server. How do I format a hard disk under Linux operating system from a shell prompt?
[click to continue…]

Q. How Do I Create a New ext3 File System If a Disk Was Added To The Server / Desktop Under Any Linux Operating Systems?
[click to continue…]

Q. I'd like to see all the partitions on my scsi hard drives. Under Windows Disk manager shows exactly how space is allocated on the disk drivers and free space etc. How do I display hard drive partitions information?

A. You can use any one of the following command:
[a] fdisk command : Partition table manipulator for Linux
[b] GNU Parted : a partition manipulation program

fdisk -l command

To list the partition tables for the specified devices and then exit. If no devices are given, those mentioned in /proc/partitions (if that exists) are used i.e. it will try to display all partitions, enter:
$ sudo fdisk -l
OR
# fdisk -l
Output

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000f1a3e
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       12749   102400000    7  HPFS/NTFS
/dev/sda2           12750       24906    97651102+  83  Linux
/dev/sda3           24907       25149     1951897+  82  Linux swap / Solaris
/dev/sda4           25150       60802   286375936    f  W95 Ext'd (LBA)
/dev/sda5           25150       60802   286374912    7  HPFS/NTFS

GNU parted command

Pass print option to displays the partition table, enter:
$ sudo parted /dev/sda print
Output:

Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number  Start   End    Size    Type      File system  Flags
 1      1049kB  105GB  105GB   primary   ntfs         boot
 2      105GB   205GB  100GB   primary   ext3
 3      205GB   207GB  1999MB  primary   linux-swap
 4      207GB   500GB  293GB   extended               lba
 5      207GB   500GB  293GB   logical   ntfs
Information: Don't forget to update /etc/fstab, if necessary.