LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-14-2009, 02:37 AM   #1
wmasry
LQ Newbie
 
Registered: Nov 2009
Posts: 26

Rep: Reputation: 15
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).
 
Old 12-14-2009, 03:10 AM   #2
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,696
Blog Entries: 33

Rep: Reputation: 290Reputation: 290Reputation: 290
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

Last edited by GlennsPref; 12-14-2009 at 04:09 AM.
 
Old 12-14-2009, 03:21 AM   #3
divyashree
Senior Member
 
Registered: Apr 2007
Location: Bangalore, India
Distribution: RHEL,SuSE,CentOS,Fedora,Ubuntu
Posts: 1,386

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by wmasry View Post
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 .

Last edited by divyashree; 12-14-2009 at 03:24 AM.
 
Old 12-14-2009, 03:25 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,384

Rep: Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190
Quote:
Originally Posted by wmasry View Post
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.
 
Old 12-14-2009, 03:48 AM   #5
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
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.
 
Old 12-15-2009, 04:25 AM   #6
wmasry
LQ Newbie
 
Registered: Nov 2009
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by GlennsPref View Post
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
 
Old 12-15-2009, 06:08 AM   #7
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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.
 
Old 12-15-2009, 06:26 AM   #8
pierre2
Member
 
Registered: May 2009
Location: Perth, AU
Distribution: LinuxMint
Posts: 390
Blog Entries: 9

Rep: Reputation: 88
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.
 
Old 12-15-2009, 06:41 AM   #9
amit.bk02
LQ Newbie
 
Registered: Dec 2009
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by wmasry View Post
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 ..................................
 
Old 09-17-2024, 03:08 PM   #10
creggy
LQ Newbie
 
Registered: Sep 2024
Posts: 2

Rep: Reputation: 1
Deleting a partition with fdisk removes the metadata that tells the operating system where the partition starts and ends on the disk. However, the data within the deleted partition is not immediately destroyed. It remains on the disk, but without the partition table entry, the operating system cannot access or recognize this data in a normal way. At least i understand it is like that. Correct me if i am wrong.

Last edited by rtmistler; 11-27-2024 at 06:12 AM.
 
1 members found this post helpful.
Old 09-17-2024, 05:18 PM   #11
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,674

Rep: Reputation: 8153Reputation: 8153Reputation: 8153Reputation: 8153Reputation: 8153Reputation: 8153Reputation: 8153Reputation: 8153Reputation: 8153Reputation: 8153Reputation: 8153
Quote:
Originally Posted by creggy View Post
Deleting a partition with fdisk removes the metadata that tells the operating system where the partition starts and ends on the disk. However, the data within the deleted partition is not immediately destroyed. It remains on the disk, but without the partition table entry, the operating system cannot access or recognize this data in a normal way. At least i understand it is like that. Correct me if i am wrong
Right, that's what everyone said **FIFTEEN YEARS AGO** when this thread was created.
 
Old 09-17-2024, 06:47 PM   #12
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 11,201
Blog Entries: 4

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
I will repeat myself: this forum software should "auto-lock" forum threads after a (fairly short) period of time. Thereafter, you can certainly refer to them, through an appropriate URL, but you cannot resurrect them.

Now, as to this "resurrected topic" today. Today, "it is no longer necessary."

Today, LVM = Logical Volume Management eliminates the need for this sort of "partition twiddling." (This is the default installation option for most distros ... for very obvious reasons. And, it can be added later.) Disk partitions are combined to create so-called "storage pools," to which "logical volumes" are assigned. The operating system and its users directly see only these "volumes," which may be spread across multiple partitions and drives. Unlike the "bad old days" when a "mount point" corresponded to a single physical resource, that is no longer the case.

The facility provides other very pragmatic features. For example, if a particular drive "begins to make ominous clicking noises," you can remove all of the data from this drive without(!) downtime.

So, today, the user would simply create a new partition somewhere, and "add it to a storage pool." Then, expand the filesystem to recognize the additional space. Today, this process is very easy to do.

In general, the designers of this subsystem did an exceptional job of engineering. (Is there a 'Nerd Award?' ...)

Last edited by sundialsvcs; 09-17-2024 at 06:51 PM.
 
Old 11-27-2024, 01:39 AM   #13
creggy
LQ Newbie
 
Registered: Sep 2024
Posts: 2

Rep: Reputation: 1
THat makes sense
 
Old 11-27-2024, 01:45 AM   #14
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,253

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
this is just spam. edited post (#10) with a link to a windows software
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
fdisk deleted my lenovo recovery partition. suyashram Linux - Newbie 4 04-09-2009 04:22 PM
Cannot delete partition with fdisk jackpal Linux - Hardware 2 07-18-2005 11:57 AM
What app can REALLY delete a partition? (not fdisk, parted, etc...) kornerr Linux - General 4 05-28-2005 12:14 PM
Cannot use fdisk to write partition data evolvedlight Slackware - Installation 4 04-20-2005 09:00 AM
I can't get rid of linux, can't delete partition with fdisk Dachy Linux - Newbie 14 05-05-2004 01:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration