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).
|
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. |
What if I have root permissions??What abt the tree view of partitions??
|
Quote:
|
atleast,how can we know that this is logical partition and this is primary partition?
|
Quote:
|
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
|
command:
df |
@Jatt_thugz: Thanks.
@arunshivanandan: You are wellcome. :) |
'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?? |
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.
|
Heres another one,
sfdisk -l -x |more |
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.
|
Oh you have to be root in order to use that command.
|
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 10:20 AM. |