1

I am about to get a new PC and will have Fedora 20 installed on it (with dual boot for a bit of Windows in case I really have to use it). It will have a new hard drive, but I want to keep the existing ones available for the data on them.

At present I have Fedora 12, and two internal hard drives whose details and partitioning I have forgotten. So, my question is: please, how can I find out what is on each? I can't understand the output of df and how it relates to the physical drives.

4

There are a couple of tools you can use to check the layout of a disk to see how it's partitioned. Given you're using an older distro in F12 some of these tools may not be present, so your mileage will vary. I have an ancient version of FC3 and can confirm that this tool is present which will do what you want.

blkid

$ blkid
/dev/hda1: LABEL="/boot" UUID="0a956929-XXXX-461a-XXXX-59e0XXXbcf0" SEC_TYPE="ext2" TYPE="ext3" 
/dev/dm-0: UUID="f51cdcd9-23XX-XXXX-XXXX-eb342c3b3fda" SEC_TYPE="ext2" TYPE="ext3" 
/dev/dm-1: TYPE="swap" 

fdisk

You can also use fdisk:

$ fdisk -l

Disk /dev/hda: 81.9 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14        9964    79931407+  8e  Linux LVM

sfdisk

You might be able to get your hands on sfdisk as well.

$ sfdisk -l

Disk /dev/sda: 30394 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sda1          0+      5       6-     48163+  de  Dell Utility
/dev/sda2          6     267     262    2104515    b  W95 FAT32
/dev/sda3   *    268     292      25     200812+  83  Linux
/dev/sda4        293   30393   30101  241786282+   5  Extended
/dev/sda5        293+    305      13-    104391   83  Linux
/dev/sda6        306+  30393   30088- 241681828+  8e  Linux LVM

cfdisk

Finally there's cfdisk which is an interactive ncurses based application.

$ cfdisk

    ss #!

Conclusions

There are other tools but these are 4 of the more common ones, in addition to lsblk as you move up the chain of newer releases of Fedora (and other distros).

References

1

The command mount by itself should tell you where each partition is mounted. If you are mounting raw partitions, it will talk about /dev/sdaX, /dev/sdbX and such, where X is a number identifying the partition.

If I were you, I'd just get a portable drive (such an old machine shouldn't have more than 1TiB disk total...) and get your tame geek copy all over. That way, if you need anything later, it'll be at hand. If that is too expensive, perhaps a full backup to a set of DVD.

0

Listing partitions of a disk one choice is using command fdisk on each drive device (/dev/sd[ab] has been assumed) adapt for your drives.

sudo fdisk -l /dev/sda
sudo fdisk -l /dev/sdb
  • Just sudo fdisk -l would be enough, no need to manually iterating over all the devices. – Ruslan Feb 8 '14 at 16:14
0

Have a look at lsblk, which will show you all your disks and partitions and how they are related. This is especially useful if intermediate layers like LVM or data-mapper are involved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.