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 08-01-2003, 02:56 AM   #1
arunshivanandan
Member
 
Registered: May 2003
Location: Kerala,India
Distribution: RedHat,Mandrake,Debian
Posts: 643

Rep: Reputation: 30
To show all partitions(without using fdisk -l)


I am wondering what will show all the partitions of ur hdd along with their sizes,preferably in a tree view with primary,extended and logical partitions.(supposing that i am not root,and i dont have fdisk).
 
Old 08-01-2003, 03:28 AM   #2
scott_R
Member
 
Registered: Jul 2003
Location: Brighton, Michigan, USA
Distribution: Lots of distros in the past, now Linux Mint
Posts: 746

Rep: Reputation: 31
You might be able to find some program that allows you to look at partitions without being root, but more than likely, that would be a bug. Simply put, being able to know what partitions are available can be enough to compromise the security of a system, so it's unlikely you'll find something to do so without being root.

The reason may not be obvious at first, but if you know which partition is which, you can build a boot disk that ignores normal startup security, loading other preferences instead. Something as simple as messing with user's /home partitions could happen. While it may be easy enough to do that anyway, just by guessing the partitions (assuming the sysadmin didn't set up any security to block this kind of attempt), it also doesn't make sense not to have this restrictions. After all, there really isn't any reason for a non-root user to need to see partitions. Most people (even "pro" windows users) don't even know what they are.

Of course, if you really have a need to do this, you can probably write a small script or program to do so. It's not that hard, but I'd rethink your reasons for needing it before you put it into place. Perhaps just a list of partitions (fdisk output piped to a user accessible file?) would be sufficient.
 
Old 08-01-2003, 03:40 AM   #3
arunshivanandan
Member
 
Registered: May 2003
Location: Kerala,India
Distribution: RedHat,Mandrake,Debian
Posts: 643

Original Poster
Rep: Reputation: 30
What if I have root permissions??What abt the tree view of partitions??
 
Old 08-01-2003, 08:43 AM   #4
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Quote:
Originally posted by scott_R
The reason may not be obvious at first, but if you know which partition is which, you can build a boot disk that ignores normal startup security, loading other preferences instead. Something as simple as messing with user's /home partitions could happen. While it may be easy enough to do that anyway, just by guessing the partitions (assuming the sysadmin didn't set up any security to block this kind of attempt), it also doesn't make sense not to have this restrictions. After all, there really isn't any reason for a non-root user to need to see partitions. Most people (even "pro" windows users) don't even know what they are.
According to this logic, both mount and df should probably be removed. A non-root user can use both of these commands to see devices and mount points.
 
Old 08-01-2003, 11:11 AM   #5
arunshivanandan
Member
 
Registered: May 2003
Location: Kerala,India
Distribution: RedHat,Mandrake,Debian
Posts: 643

Original Poster
Rep: Reputation: 30
atleast,how can we know that this is logical partition and this is primary partition?
 
Old 08-04-2003, 02:28 AM   #6
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,665

Rep: Reputation: Disabled
Quote:
Originally posted by arunshivanandan
at least,how can we know that this is logical partition and this is primary partition?
hdx1 to hdx4 are the primaries, hdx5 to hdx... are extended in the logicals, where x=letter of the drive. There is a tool which prints the extendeds in <brackets> after the logical "parent", I forgot which, just try a few and you'll find it.
 
Old 08-04-2003, 02:43 AM   #7
arunshivanandan
Member
 
Registered: May 2003
Location: Kerala,India
Distribution: RedHat,Mandrake,Debian
Posts: 643

Original Poster
Rep: Reputation: 30
I have wondered why my first partition is named hda1 and the rest hda5,hda6 etc,why not hda2 etc.This has solved it...Thanks
 
Old 08-04-2003, 02:51 AM   #8
ksgill
Senior Member
 
Registered: Apr 2003
Location: Toronto, Canada
Distribution: Ubuntu Jaunty (9.04)
Posts: 1,044

Rep: Reputation: 45
command:
df
 
Old 08-04-2003, 02:56 AM   #9
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,665

Rep: Reputation: Disabled
@Jatt_thugz: Thanks.
@arunshivanandan: You are wellcome.


 
Old 08-04-2003, 03:00 AM   #10
arunshivanandan
Member
 
Registered: May 2003
Location: Kerala,India
Distribution: RedHat,Mandrake,Debian
Posts: 643

Original Poster
Rep: Reputation: 30
'df' on the present system gave this:

Filesystem 1k-blocks Used Available Use% Mounted on
/dev/sda2 6048352 3065532 2675580 54% /
/dev/sda7 6301256 1993552 3987612 34% /backup
/dev/sda1 101089 10772 85098 12% /boot
none 256640 0 256640 0% /dev/shm
/dev/sdb1 17488652 5942440 10657820 36% /reccal
/dev/sda5 2016016 1705236 208368 90% /tmp
/dev/sda3 2016044 1119864 793768 59% /var

here,which are the primary,extended and logical partitions??
 
Old 08-04-2003, 10:15 AM   #11
ksgill
Senior Member
 
Registered: Apr 2003
Location: Toronto, Canada
Distribution: Ubuntu Jaunty (9.04)
Posts: 1,044

Rep: Reputation: 45
Thats for you to figure out. Generally, bootable partitions are primary partitions and others are extended. your /dev/sda1 certainly looks like primary. You can figure it out easily by looking at sizes and mount points carefully.
 
Old 08-04-2003, 10:25 AM   #12
ksgill
Senior Member
 
Registered: Apr 2003
Location: Toronto, Canada
Distribution: Ubuntu Jaunty (9.04)
Posts: 1,044

Rep: Reputation: 45
Heres another one,
sfdisk -l -x |more
 
Old 08-04-2003, 10:29 AM   #13
arunshivanandan
Member
 
Registered: May 2003
Location: Kerala,India
Distribution: RedHat,Mandrake,Debian
Posts: 643

Original Poster
Rep: Reputation: 30
I tried this one,and it says there is no command like that.then i tried /sbin/sfdisk -l -x,and there was no output.Anyway,that is in the college LAN.
 
Old 08-04-2003, 10:32 AM   #14
ksgill
Senior Member
 
Registered: Apr 2003
Location: Toronto, Canada
Distribution: Ubuntu Jaunty (9.04)
Posts: 1,044

Rep: Reputation: 45
Oh you have to be root in order to use that command.
 
Old 08-04-2003, 10:40 AM   #15
arunshivanandan
Member
 
Registered: May 2003
Location: Kerala,India
Distribution: RedHat,Mandrake,Debian
Posts: 643

Original Poster
Rep: Reputation: 30
Oh,so df is the only command for this stuff taht can be run without root permission.Anyway,thanks again.
 
  


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
weird fdisk problem (Fdisk unable to see winxp partitions) khidot Slackware - Installation 5 04-07-2007 09:26 PM
Fdisk can't show my partitiontable... anti.corp Slackware 9 11-12-2005 05:26 PM
freeBSD install - fdisk not showing partitions? a2ps *BSD 2 06-26-2005 11:02 AM
How do you make three partitions using fdisk? inward_eye Linux - Hardware 9 04-20-2004 03:13 PM
RH9 lvm and fdisk forgetting about hdb partitions davel75 Linux - Software 0 10-27-2003 09:59 AM


All times are GMT -5. The time now is 03:42 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration