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 10-15-2011, 04:04 AM   #1
Micik
Member
 
Registered: Dec 2004
Distribution: open suse
Posts: 137

Rep: Reputation: 15
Find out partitions using terminal


Hello,

what is the command for displaying HDD partitions in cli?

I have tried cat /etc/fstab, but that is not what I need.
I want to see in format /dev/sda1,.../dev/sdan

Is there such command in terminal?

Thanks
 
Old 10-15-2011, 04:18 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hi,

Are you looking for the df command? That will give you output similar to the following:
Code:
df -h
Filesystem                  Size  Used Avail Use% Mounted on
/dev/sda2                    49G   15G   32G  32% /
tmpfs                       5.0M  4.0K  5.0M   1% /lib/init/rw
tmpfs                       377M  1.0M  376M   1% /run
udev                        1.9G     0  1.9G   0% /dev
tmpfs                       753M  1.9M  752M   1% /run/shm
/dev/sda1                   485M   67M  393M  15% /boot
/dev/mapper/datagroup-data  247G  115G  120G  49% /home/eric/DATA
Kind regards,

Eric
 
Old 10-15-2011, 04:18 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,

Have a look at the df and mount commands:
Code:
# df, human readable (-h flag)
$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              63G   28G   33G  46% /
/dev/sda4             348G  155G  176G  47% /data
/dev/sdb3              12G  157M   11G   2% /tmp

# mount command
$ mount
/dev/sda3 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
/dev/sda4 on /data type ext3 (rw)
/dev/sdb3 on /tmp type ext3 (rw)
Hope this helps.
 
Old 10-15-2011, 04:51 AM   #4
whizje
Member
 
Registered: Sep 2008
Location: The Netherlands
Distribution: Slackware64 current
Posts: 592

Rep: Reputation: 140Reputation: 140
Maybe fdisk -l
 
Old 10-15-2011, 06:24 AM   #5
kindofabuzz
Member
 
Registered: Mar 2010
Location: There
Distribution: Linux Mint 17.1
Posts: 237

Rep: Reputation: 45
sudo fdisk -l, or as root
 
Old 10-15-2011, 06:44 AM   #6
Micik
Member
 
Registered: Dec 2004
Distribution: open suse
Posts: 137

Original Poster
Rep: Reputation: 15
Thank you for your replies.
fdisk -l was what I wanted. I was familiar with mount but didn't see all.
For example, in yast -> Partitioner I see something like this:
/dev/sda4 Extended
/dev/sda5 Swap
/dev/sda6 and /dev/sda 7 both ext4

but sda5 and sda 4 was not listed using mount nor df command.

Thank you again.
 
Old 10-15-2011, 07:32 AM   #7
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
mount and df only display mounted partitions.
 
  


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
[SOLVED] Gnome terminal 2.1.0, centos 5 - how to 'find' text listed on terminal screen linuxquestions_forum_use Linux - Newbie 2 12-21-2010 08:35 PM
Where can I find the two partitions in Linux? SHENGTON Linux - Newbie 7 09-03-2008 12:49 PM
cant find partitions binarysoul Fedora 2 04-24-2006 09:27 PM
is there a terminal command that shows how much space is left in my partitions lemuel Linux - Newbie 3 01-23-2005 07:16 PM
Can't find partitions Time Lord Mandriva 3 09-20-2003 08:53 AM


All times are GMT -5. The time now is 04:21 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration