LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to find unmounted partition (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-find-unmounted-partition-502506/)

cnm 11-17-2006 09:04 AM

how to find unmounted partition
 
I accidently unmounted a partition that I had created when installing Linux. How can I retreive it. doest that hard disk space remain unused.

is there a command to find free hard disk space not used for any partitions?

I should have mentioned this earlier. after unmounting I tried "mkfs -t ext3 /dev/hda19" :D where /dev/hda19 Label was /ext3Drive1 :rolleyes:

matthewg42 11-17-2006 09:11 AM

You can list the partitions on a device like this (example device is /dev/hda - the primary master IDE drive). Execute this command as root, or with sudo:
Code:

fdisk -l /dev/hda
On my machine, the output looks like this:
Code:

Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/hda1              1        1816    14586988+  83  Linux
/dev/hda2            1817        7867    48604657+  83  Linux
/dev/hda3            7868        7992    1004062+  82  Linux swap / Solaris
/dev/hda4  *        7993        9729    13952452+  83  Linux

I can see that there are mountable partitions /dev/hda1, /dev/hda2 and /dev/hda4. (hda3 is a swap partition).

alphy 11-17-2006 09:39 AM

Well,

you can use,
#sfdisk -s

to list all your partitions,then you use fdisk to list all your active partitions.

comparing these two o/p,you should be able to make an educated guess on the parition name that you had accidentaly umounted.

hope this info helps.

-Alphy

haertig 11-17-2006 02:41 PM

Just login as root and run mount -a

That will mount all your partitions as specified in /etc/fstab. For those that are already mounted, nothing will happen. For the one that you accidently unmounted, it will be remounted.

haertig 11-17-2006 02:47 PM

p.s. - It seems you might have some confusion about what "unmounting" means. It does not free up any disk space. Think of it like removing a floppy disk from your floppy drive (if you still have one of those things!) Sure, you can't use the floppy when it's not in the drive ("unmounted"), but there's no damage or major change to your system. When you need the floppy, just stick it back in the drive ("mount" it) and continue on. Mounting/unmounting is no big deal. It's done all the time.

cnm 11-17-2006 10:35 PM

Quote:

Originally Posted by alphy
Well,

you can use,
#sfdisk -s

to list all your partitions,then you use fdisk to list all your active partitions.

comparing these two o/p,you should be able to make an educated guess on the parition name that you had accidentaly umounted.

hope this info helps.

-Alphy

whta did you mean by "o/p"

cnm 11-17-2006 10:39 PM

Quote:

Originally Posted by haertig
p.s. - It seems you might have some confusion about what "unmounting" means. It does not free up any disk space. Think of it like removing a floppy disk from your floppy drive (if you still have one of those things!) Sure, you can't use the floppy when it's not in the drive ("unmounted"), but there's no damage or major change to your system. When you need the floppy, just stick it back in the drive ("mount" it) and continue on. Mounting/unmounting is no big deal. It's done all the time.


Great example.

cnm 11-17-2006 10:48 PM

Quote:

Originally Posted by haertig
Just login as root and run mount -a

That will mount all your partitions as specified in /etc/fstab. For those that are already mounted, nothing will happen. For the one that you accidently unmounted, it will be remounted.

Ok But then it says

mount: special Device LABEL=/ext3Drive1 does not exist
mount: special Device LABEL=/opt1 does not exist
mount: special Device /dev/hda18 does not exist


I should have mentioned this earlier. after unmounting I tried "mkfs -t ext3 /dev/hda19" :D where /dev/hda19 Label was /ext3Drive1 :rolleyes:

Nylex 11-18-2006 12:34 AM

Quote:

Originally Posted by cnm
whta did you mean by "o/p"

Original poster, i.e. you.

matthewg42 11-18-2006 08:17 AM

Quote:

Originally Posted by Nylex
Original poster, i.e. you.

Ah, I'd been wondering that too... :)


All times are GMT -5. The time now is 05:27 PM.