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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
08-01-2003, 03:56 AM
|
#1
|
Member
Registered: May 2003
Location: Kerala,India
Distribution: RedHat,Mandrake,Debian
Posts: 643
Rep:
|
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).
|
|
|
08-01-2003, 04:28 AM
|
#2
|
Member
Registered: Jul 2003
Location: Brighton, Michigan, USA
Distribution: Lots of distros in the past, now Linux Mint
Posts: 748
Rep:
|
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.
|
|
|
08-01-2003, 04:40 AM
|
#3
|
Member
Registered: May 2003
Location: Kerala,India
Distribution: RedHat,Mandrake,Debian
Posts: 643
Original Poster
Rep:
|
What if I have root permissions??What abt the tree view of partitions??
|
|
|
08-01-2003, 09:43 AM
|
#4
|
Senior Member
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552
Rep:
|
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.
|
|
|
08-01-2003, 12:11 PM
|
#5
|
Member
Registered: May 2003
Location: Kerala,India
Distribution: RedHat,Mandrake,Debian
Posts: 643
Original Poster
Rep:
|
atleast,how can we know that this is logical partition and this is primary partition?
|
|
|
08-04-2003, 03:28 AM
|
#6
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637
Rep:
|
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.
|
|
|
08-04-2003, 03:43 AM
|
#7
|
Member
Registered: May 2003
Location: Kerala,India
Distribution: RedHat,Mandrake,Debian
Posts: 643
Original Poster
Rep:
|
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
|
|
|
08-04-2003, 03:51 AM
|
#8
|
Senior Member
Registered: Apr 2003
Location: Toronto, Canada
Distribution: Ubuntu Jaunty (9.04)
Posts: 1,044
Rep:
|
command:
df
|
|
|
08-04-2003, 03:56 AM
|
#9
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637
Rep:
|
@Jatt_thugz: Thanks.
@arunshivanandan: You are wellcome.
|
|
|
08-04-2003, 04:00 AM
|
#10
|
Member
Registered: May 2003
Location: Kerala,India
Distribution: RedHat,Mandrake,Debian
Posts: 643
Original Poster
Rep:
|
'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??
|
|
|
08-04-2003, 11:15 AM
|
#11
|
Senior Member
Registered: Apr 2003
Location: Toronto, Canada
Distribution: Ubuntu Jaunty (9.04)
Posts: 1,044
Rep:
|
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.
|
|
|
08-04-2003, 11:25 AM
|
#12
|
Senior Member
Registered: Apr 2003
Location: Toronto, Canada
Distribution: Ubuntu Jaunty (9.04)
Posts: 1,044
Rep:
|
Heres another one,
sfdisk -l -x |more
|
|
|
08-04-2003, 11:29 AM
|
#13
|
Member
Registered: May 2003
Location: Kerala,India
Distribution: RedHat,Mandrake,Debian
Posts: 643
Original Poster
Rep:
|
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.
|
|
|
08-04-2003, 11:32 AM
|
#14
|
Senior Member
Registered: Apr 2003
Location: Toronto, Canada
Distribution: Ubuntu Jaunty (9.04)
Posts: 1,044
Rep:
|
Oh you have to be root in order to use that command.
|
|
|
08-04-2003, 11:40 AM
|
#15
|
Member
Registered: May 2003
Location: Kerala,India
Distribution: RedHat,Mandrake,Debian
Posts: 643
Original Poster
Rep:
|
Oh,so df is the only command for this stuff taht can be run without root permission.Anyway,thanks again.
|
|
|
All times are GMT -5. The time now is 11:37 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|