LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   partition using fdisk gone wrong. (https://www.linuxquestions.org/questions/linux-newbie-8/partition-using-fdisk-gone-wrong-4175531489/)

sachin.davra 01-19-2015 05:06 AM

partition using fdisk gone wrong.
 
Code:

Disk /dev/sda (Sun disk label): 255 heads, 63 sectors, 60801 cylinders
Units = cylinders of 16065 * 512 bytes

  Device Flag    Start      End    Blocks  Id  System
/dev/sda1            0    60795 488335837+  83  Linux native
/dev/sda2  u      60795    60801    48195  82  Linux swap
/dev/sda3            0    60801 488384032+  5  Whole disk

Actually i created 100 mb lvm partition using fdisk but after checking in fdisk, i am getting this. I don't know next time my system will boot or not.

What should i do in this situation to recover from this situation?

I am using centos6 x64.

pan64 01-19-2015 05:37 AM

the information you gave is not enough to tell you the correct answer. But probably you only need to set the first partition bootable (and remove /dev/sda3).

dt64 01-19-2015 05:55 AM

How did you create the partitions, e.g. playing with the expert settings of fdisk?
Please let us know which actual steps you took.
Was this a brand new HDD?

My guess would be that sda1 was your system, sda2 your swap and you tried to add another (sda3) partition to a disk without free space left, which usually would fail.

sachin.davra 01-19-2015 05:56 AM

Quote:

Originally Posted by pan64 (Post 5303343)
the information you gave is not enough to tell you the correct answer. But probably you only need to set the first partition bootable (and remove /dev/sda3).

Actually before creating /dev/sda8 it was like
Code:

[root@GAIDL-5015 ~]# cat /proc/partitions
major minor  #blocks  name

  8        0  488386584 sda
  8        1    512000 sda1
  8        2  102400000 sda2
  8        3  102400000 sda3
  8        4          1 sda4
  8        5  51200000 sda5
  8        6    8192000 sda6
  8        7  104859165 sda7

As i created sda8 i am getting this. In case, if i will remove sda3, i will loose all my data.

sachin.davra 01-19-2015 06:56 AM

Quote:

Originally Posted by dt64 (Post 5303350)
How did you create the partitions, e.g. playing with the expert settings of fdisk?
Please let us know which actual steps you took.
Was this a brand new HDD?

My guess would be that sda1 was your system, sda2 your swap and you tried to add another (sda3) partition to a disk without free space left, which usually would fail.

Nope, i created sda8 but i don't know, how all of my partitions have gone. what is the mean of "+" sign at the end of partition size.

pan64 01-19-2015 07:26 AM

looks like you need to convert that info back to a valid partition table. sda4 is an extended partition, containing sda5, sda6 and sda7. But I have no idea about the filesystem types.

sachin.davra 01-19-2015 07:30 AM

Quote:

Originally Posted by pan64 (Post 5303374)
looks like you need to convert that info back to a valid partition table. sda4 is an extended partition, containing sda5, sda6 and sda7. But I have no idea about the filesystem types.

You are going on absolute right path. I am using ext4 file system. sorry for not telling about file system type.

pan64 01-19-2015 07:43 AM

based on this "example" you can easily construct the partition table, I think. The blocks field contains the same values (the only exception is the extended partition).


All times are GMT -5. The time now is 03:59 PM.