* deleting partition does not effect superblock?
@ 2006-04-06 6:37 Sumit Narayan
2006-04-06 6:58 ` Jan-Benedict Glaw
2006-04-06 7:31 ` Damian Menscher
0 siblings, 2 replies; 5+ messages in thread
From: Sumit Narayan @ 2006-04-06 6:37 UTC (permalink / raw)
To: linux-kernel, ext3-users
Hi,
I am using kernel 2.6.15.4.
On my system, I first created a partition with EXT3 and put some data
on it. Later, I deleted the partition, and re-created another
partition with the same starting block number and a higher ending
block number. I intended to format it with another filesystem, but
surprisingly (or maybe just to me), the superblock of the partition
had not changed. I could still mount the new partition as the same old
filesystem. I could see all the files which was present earlier. Doing
'df' showed me the older partition details (size, % used etc.).
Shouldn't the superblock be changed/deleted once the partition is
deleted? I tried a reboot, but the output remained the same.
-- Sumit
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: deleting partition does not effect superblock?
2006-04-06 6:37 deleting partition does not effect superblock? Sumit Narayan
@ 2006-04-06 6:58 ` Jan-Benedict Glaw
2006-04-10 15:28 ` Jan Engelhardt
2006-04-06 7:31 ` Damian Menscher
1 sibling, 1 reply; 5+ messages in thread
From: Jan-Benedict Glaw @ 2006-04-06 6:58 UTC (permalink / raw)
To: Sumit Narayan; +Cc: linux-kernel, ext3-users
[-- Attachment #1: Type: text/plain, Size: 1465 bytes --]
On Thu, 2006-04-06 14:37:33 +0800, Sumit Narayan <talk2sumit@gmail.com> wrote:
> Shouldn't the superblock be changed/deleted once the partition is
> deleted? I tried a reboot, but the output remained the same.
No, everything you see is "works as expected." A partition is only a
container (as well as "disks", "volume groups", "RAID arrays",
"logical volumes", "image files" etc. are.)
Whenever you destroy such a container, its contents isn't modified (or
deleted) or otherwise modified. So it's perfectly okay to delete such
a container (eg. remove start and end from the partition table) and
recreate it at some time later (by adding those values back to the
partition table.) As long as the new container starts at the same
location, a filesystem driver will be able to find the old
information. If you start a block later, it won't find it's
superblocks.
Finally, you have several choices how to defeat getting back old data.
Most probably, you'd just zero it out before deleting the partition
with something like:
# cat /dev/zero > /dev/hda3
(of course with the correct device name!)
MfG, JBG
--
Jan-Benedict Glaw jbglaw@lug-owl.de . +49-172-7608481 _ O _
"Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg _ _ O
für einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: deleting partition does not effect superblock?
2006-04-06 6:58 ` Jan-Benedict Glaw
@ 2006-04-10 15:28 ` Jan Engelhardt
2006-04-10 16:00 ` Jan-Benedict Glaw
0 siblings, 1 reply; 5+ messages in thread
From: Jan Engelhardt @ 2006-04-10 15:28 UTC (permalink / raw)
To: Jan-Benedict Glaw; +Cc: Sumit Narayan, linux-kernel, ext3-users
>deleted) or otherwise modified. So it's perfectly okay to delete such
>a container (eg. remove start and end from the partition table) and
>recreate it at some time later (by adding those values back to the
>partition table.) As long as the new container starts at the same
>location, a filesystem driver will be able to find the old
>information. If you start a block later, it won't find it's
>superblocks.
>
If using a filesystem with replicated superblocks (ext*, xfs), then ...?
[Includes expecting weird breakage.]
Jan Engelhardt
--
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: deleting partition does not effect superblock?
2006-04-10 15:28 ` Jan Engelhardt
@ 2006-04-10 16:00 ` Jan-Benedict Glaw
0 siblings, 0 replies; 5+ messages in thread
From: Jan-Benedict Glaw @ 2006-04-10 16:00 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: Sumit Narayan, linux-kernel, ext3-users
[-- Attachment #1: Type: text/plain, Size: 1036 bytes --]
On Mon, 2006-04-10 17:28:18 +0200, Jan Engelhardt <jengelh@linux01.gwdg.de> wrote:
> >deleted) or otherwise modified. So it's perfectly okay to delete such
> >a container (eg. remove start and end from the partition table) and
> >recreate it at some time later (by adding those values back to the
> >partition table.) As long as the new container starts at the same
> >location, a filesystem driver will be able to find the old
> >information. If you start a block later, it won't find it's
> >superblocks.
> >
> If using a filesystem with replicated superblocks (ext*, xfs), then ...?
> [Includes expecting weird breakage.]
I'll possibly test if this works in another life...
MfG, JBG
--
Jan-Benedict Glaw jbglaw@lug-owl.de . +49-172-7608481 _ O _
"Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg _ _ O
für einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: deleting partition does not effect superblock?
2006-04-06 6:37 deleting partition does not effect superblock? Sumit Narayan
2006-04-06 6:58 ` Jan-Benedict Glaw
@ 2006-04-06 7:31 ` Damian Menscher
1 sibling, 0 replies; 5+ messages in thread
From: Damian Menscher @ 2006-04-06 7:31 UTC (permalink / raw)
To: Sumit Narayan; +Cc: linux-kernel, ext3-users
On Thu, 6 Apr 2006, Sumit Narayan wrote:
> On my system, I first created a partition with EXT3 and put some data
> on it. Later, I deleted the partition, and re-created another
> partition with the same starting block number and a higher ending
> block number. I intended to format it with another filesystem, but
> surprisingly (or maybe just to me), the superblock of the partition
> had not changed. I could still mount the new partition as the same old
> filesystem. I could see all the files which was present earlier. Doing
> 'df' showed me the older partition details (size, % used etc.).
>
> Shouldn't the superblock be changed/deleted once the partition is
> deleted? I tried a reboot, but the output remained the same.
This is the expected behavior. A filesystem is created within the
partition. If you grow the partition, the filesystem doesn't
automatically grow (use resize2fs for that). In fact, you should
probably read the resize2fs manpage, as it might give you some starting
clue of what's going on.
Damian Menscher
--
-=#| <menscher@uiuc.edu> www.uiuc.edu/~menscher/ Ofc:(650)253-2757 |#=-
-=#| The above opinions are not necessarily those of my employers. |#=-
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-04-10 16:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-06 6:37 deleting partition does not effect superblock? Sumit Narayan
2006-04-06 6:58 ` Jan-Benedict Glaw
2006-04-10 15:28 ` Jan Engelhardt
2006-04-10 16:00 ` Jan-Benedict Glaw
2006-04-06 7:31 ` Damian Menscher
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.