LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   If i deleted a partition using fdisk , will that delete the data on this partition? (https://www.linuxquestions.org/questions/linux-newbie-8/if-i-deleted-a-partition-using-fdisk-will-that-delete-the-data-on-this-partition-775489/)

wmasry 12-14-2009 02:37 AM

If i deleted a partition using fdisk , will that delete the data on this partition?
 
If i deleted a partition using fdisk , will that delete the data on this partition?

I want to use this in order to increase the partition size (after i increased the file system size).

GlennsPref 12-14-2009 03:10 AM

Hi, the real answer is no, but you won't be able to access it directly.

The file table will be gone, so the files will have no-names and just be data.

<edit>Looks like gparted copes well with the job, post #4 by syg00 and post #5 by exvor, thank you </edit>

gparted

There are programs that can recover data from a partition,

like testdisk and photorec,
http://www.cgsecurity.org/wiki/TestDisk
http://www.cgsecurity.org/wiki/PhotoRec

dd_rhelp and dd-rescue
http://freshmeat.net/projects/dd_rhelp/
http://www.garloff.de/kurt/linux/ddrescue/

The best option for you would be to backup the data first, then resize the partition,

format it, reboot, and finally copy the data back.

You might want to use "rsync" to backup and restore the files, it saves file-permisions

Cheers, Glenn

divyashree 12-14-2009 03:21 AM

Quote:

Originally Posted by wmasry (Post 3790575)
If i deleted a partition using fdisk , will that delete the data on this partition?

I want to use this in order to increase the partition size (after i increased the file system size).

After u delete the partition the data becomes raw data(without any format),so u need to recover ur data.

U should use lvm partitioning ,using which u can resize ur partition size(increase or decrease) without affecting the data .

syg00 12-14-2009 03:25 AM

Quote:

Originally Posted by wmasry (Post 3790575)
If i deleted a partition using fdisk , will that delete the data on this partition?

Nope - quite safe.
Quote:

I want to use this in order to increase the partition size (after i increased the file system size).
Do it in the other order. The resize will (generally) resize up to the size of the partition - saves having to worry about passing the actual size to the resize.
Generally you'd be better to use gparted to do the whole lot - a GUI like partition magic.

exvor 12-14-2009 03:48 AM

gparted will also allow you to extend a existing file system and its a gui. Tho I would only try this on a ext2 or ext3 partition. Otherwise its perfectly safe.

wmasry 12-15-2009 04:25 AM

Quote:

Originally Posted by GlennsPref (Post 3790605)
Hi, the real answer is no, but you won't be able to access it directly.

The file table will be gone, so the files will have no-names and just be data.

<edit>Looks like gparted copes well with the job, post #4 by syg00 and post #5 by exvor, thank you </edit>

gparted

There are programs that can recover data from a partition,

like testdisk and photorec,
http://www.cgsecurity.org/wiki/TestDisk
http://www.cgsecurity.org/wiki/PhotoRec

dd_rhelp and dd-rescue
http://freshmeat.net/projects/dd_rhelp/
http://www.garloff.de/kurt/linux/ddrescue/

The best option for you would be to backup the data first, then resize the partition,

format it, reboot, and finally copy the data back.

You might want to use "rsync" to backup and restore the files, it saves file-permisions

Cheers, Glenn

But what if i used the fdisk back again to create a new partition with a larger size , using the same first cylinder , will that effect the data or not

pixellany 12-15-2009 06:08 AM

Caution: Playing with fire here. Much of this has not been thoroughly tested.

If I am not mistaken, creating, deleting, and re-sizing partitions only affects the partition tables**. For example, if you had a partition, formatted with a filesystem, and full of data, then you could delete it and create a new one with the same starting point and size, and everything would be intact.

If you create a new partition with different parameters, the first thing that happens is that the filesystem structure is no longer correct----then, once you create a new filesystem, you have effectively de-referenced all of the data. Even then, some of it is still intact and can be recovered.

The only way to be totally sure of all this is to run experiments on a system with no irreplaceable data.


**In addition to the primary partition table (4 entries), each logical partition has a 2-entry table as part of the "linked-list" structure when using extended/logical partitions.

pierre2 12-15-2009 06:26 AM

I have deleted a partition that I didn't want anymore (& therefore its data).
& then resized the required partition up a bit in size.

Takes a while, on a slow processor, but works ok with Gparted, for all of those functions.

amit.bk02 12-15-2009 06:41 AM

Quote:

Originally Posted by wmasry (Post 3790575)
If i deleted a partition using fdisk , will that delete the data on this partition?

I want to use this in order to increase the partition size (after i increased the file system size).

he frend the actual data is not deleted u just deleted access entry if want to access is just go to /etc/vi fstab see the device driver(label) mount it on any folder and take a backup if u want to incress the size you have to go throw lvm method ....for mounting use command mount/dev/(label name) /folder name ..................................


All times are GMT -5. The time now is 11:36 PM.