why unable to open /dev/sda5(6) using fdisk?
administrator@ubuntu:/dev$ df -h
Filesystem Size Used Avail Use% Mounted on /dev/loop0 7.5G 4.4G 2.8G 61% / none 431M 640K 431M 1% /dev none 438M 192K 438M 1% /dev/shm none 438M 104K 438M 1% /var/run none 438M 0 438M 0% /var/lock /dev/sda6 32G 15G 18G 46% /host /dev/sda5 32G 9.0G 24G 29% /media/软件 administrator@ubuntu:/dev$ fdisk /dev/sda5 Unable to open /dev/sda5 |
Because it's a partition, and fdisk only operates on whole devices.
|
o, thank you! but where can I find the whole device? I have only a hard disk on my computer. I want to list partitions on this hard disk using fdisk.
|
The whole disk is /dev/sda so that the command to list the partitions on it is
Code:
sudo fdisk -l /dev/sda |
The simple rule here is: use the device you saw/wanted, and chop of the digit.
So, instead of Code:
fdisk /dev/sda5 Code:
fdisk -l /dev/sda of the respective partitions. I added that -l as a "safety measure". While you can obviously use fdisk and then interactively display the information you're after, it's safer to use the -l switch, which makes fdisk output the partition table and some other information, and quit. No risk of accidentally re-writing (destroying?) your partitioning. Cheers, Tink |
thank you! I see the partitions on my hard disk.
|
All times are GMT -5. The time now is 09:34 AM. |