≡ Menu

partition table

HowTo: Linux Remove a Partition Name (/dev/sdXY entry) Temporarily

I'd like to remove /dev/sdc5 temporarily without deleting partitions on hard drive /dev/sdc under Linux operating systems?
[click to continue…]

HowTo: Linux List Disk Partitions Command

How do I list all hard disk partitions under Linux operating systems?
[click to continue…]

HowTo: Reload (re-read) Partition Table In Ubuntu Linux

How do I reload the partition table in Ubuntu Linux without rebooting the systems?
[click to continue…]

Linux Create A Bootable USB Pen

How do I create a bootable USB pen drive to start my CentOS / Fedora Linux? How do I create a bootable USB flash pen for installation of Linux, and for creation of rescue and other special-purpose boot disks using command line options?
[click to continue…]

Show Linux Partitions Command

How do I display or show a list of all hard disk drive partitions under Linux operating systems?
[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…]

Linux Copy One Hard Disk to Another Using dd Command

Q. How can I copy one hard disk to another using dd command?

A. dd command can copy disk in raw format. It will copy partition table and bootloader and all partitions within this disk. For example, you can copy /dev/sda to /dev/sdb (same size) using the following dd command. dd should complete with no errors, but output the number of records read and written.

Login as the root user (use sudo or su command)

WARNING! These examples may result into data loss, ensure there are good backups before doing this, as using dd wrong way can be dangerous.

Open terminal or shell prompt and type the following dd command:
# dd if=/dev/sda of=/dev/sdb

  • if=/dev/sda : Input disk (source)
  • of=/dev/sdb : Output disk (destination)

You can also copy hard disk or partition image to another system using a network and netcat (nc) command.

Linux View Hard Drive Partitions with fdisk and parted commands

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
# fdisk -l

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

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. 

UNIX / Linux: Copy Master Boot Record (MBR)

How do I copy MBR from one hard disk to another hard disk under Debian Linux?
[click to continue…]

Howto Find Out or Learn Harddisk Size in Linux or UNIX

How do I find out my installed hard disk size in Linux or UNIX like operating systems?
[click to continue…]