LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-06-2015, 03:52 PM   #1
kb2tfa
Member
 
Registered: Oct 2006
Location: New Jersey
Distribution: CentOS
Posts: 175

Rep: Reputation: 18
Viewing partition scheme via the command line.


I've been experimenting. I custom formatted one fedora box, and the other is auto formatted. Is there a way to see the partition scheme via command line? I'm curious to compare the two.

Last edited by kb2tfa; 11-06-2015 at 03:53 PM.
 
Old 11-06-2015, 03:58 PM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Code:
fdisk -l
 
Old 11-06-2015, 04:42 PM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,922
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
Member response

Hi,

From 'man fdisk';
Quote:
NAME
fdisk - manipulate disk partition table

SYNOPSIS
fdisk [-uc] [-b sectorsize] [-C cyls] [-H heads] [-S sects] device

fdisk -l [-u] [device...]

fdisk -s partition...

fdisk -v

fdisk -h

DESCRIPTION
fdisk (in the first form of invocation) is a menu-driven program for creation and manipulation of partition tables. It understands DOS-type
partition tables and BSD- or SUN-type disklabels.

fdisk does not understand GUID partition tables (GPTs) and it is not designed for large partitions. In these cases, use the more advanced GNU
parted(8).

fdisk does not use DOS-compatible mode and cylinders as display units by default. The old deprecated DOS behavior can be enabled with the
'-c=dos -u=cylinders' command-line options.

Hard disks can be divided into one or more logical disks called partitions. This division is recorded in the partition table, found in sector
0 of the disk. (In the BSD world one talks about `disk slices' and a `disklabel'.)

Linux needs at least one partition, namely for its root file system. It can use swap files and/or swap partitions, but the latter are more
efficient. So, usually one will want a second Linux partition dedicated as swap partition. On Intel-compatible hardware, the BIOS that boots
the system can often only access the first 1024 cylinders of the disk. For this reason people with large disks often create a third parti-
tion, just a few MB large, typically mounted on /boot, to store the kernel image and a few auxiliary files needed at boot time, so as to make
sure that this stuff is accessible to the BIOS. There may be reasons of security, ease of administration and backup, or testing, to use more
than the minimum number of partitions.

DEVICES
The device is usually /dev/sda, /dev/sdb or so. A device name refers to the entire disk. Old systems without libata (a library used inside
the Linux kernel to support ATA host controllers and devices) make a difference between IDE and SCSI disks. In such cases the device name
will be /dev/hd* (IDE) or /dev/sd* (SCSI).

The partition is a device name followed by a partition number. For example, /dev/sda1 is the first partition on the first hard disk in the
system. See also Linux kernel documentation (the Documentation/devices.txt file).

...
Options:
-l 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.
By using 'fdisk -l' you will get all devices available data. You can be specific for a particular device: 'fdisk -l /dev/sda' would provide partition information for the '/dev/sda' device.

Hope this helps.
have fun & enjoy!
 
1 members found this post helpful.
Old 11-06-2015, 05:58 PM   #4
kb2tfa
Member
 
Registered: Oct 2006
Location: New Jersey
Distribution: CentOS
Posts: 175

Original Poster
Rep: Reputation: 18
Thank you.
 
Old 11-06-2015, 07:21 PM   #5
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
The lsblk command is also very useful, more information using up less screen space in many situations.
 
Old 11-07-2015, 08:00 AM   #6
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231
sudo parted -l
gives useful results, also.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
taking a picture from the command line (no window or viewing) KansaiRobot Linux - Software 5 03-11-2015 07:23 PM
Command line image viewing for bash script? Romanus81 Programming 3 08-10-2008 11:39 PM
viewing pictures in command line??? mlu Linux - Software 4 05-25-2005 10:48 PM
scheme interpreter w/ command-line editing nazdrowie Programming 1 12-03-2004 08:20 AM
viewing images on the command line darkangel Linux - General 3 02-14-2002 10:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration