Remove ext3 filesystem but not it's partition ?
Hi,
How do I remove ext3 filesystem structure from it's partition ? I don't want to delete partition and I don't want to create new filesystem structure. I want to get similar result like before making mke2fs call. thanks Vilius |
Example for /dev/sda1 (change the device for your needs)(the structure of the filesystem will be overwritten by many zeros)
Quote:
|
But isn't it fill all partition with zeros - I mean if partition is big enaugh it could take a lot of time.
Maybe there is another method to remove/erase only ext3 structure ? - and not the data itself ? thanks Vilius |
Vilius I can't see what you're trying to do. If you delete the inodes then you can't know where to find the data, so what's the point of keeping them? Could you explain the purpose of doing this?
|
I'm just looking the simplest way to remove filesystem from it's partition - I want some programs like os setups to indicate partition as empty(not formatted).
Recreating partition leaves filesystem unchanged if I recreate partition on the same cylinder boundary (am I right ?) V |
Delete the partition. Any Linux OS will recognize the deleted partition as unused, empty space. Just don't recreate the partition until you need it again.
|
Quote:
One indicator which gives the computer an idea about what kind of filesystem sits inside is the hex code (type) of the partition. In fdisk, you can see a list with the l option: Code:
|
If you don't want to spend the time to blank the whole partition, then it's still a good idea to blank out at least the first few sectors of the partition when you're done with it. That way you don't leave old lvm or filesystem meta-data/headers around which could potentially cause you problems in the future.
Something along the lines of the following should do the trick: Code:
dd if=/dev/zero bs=512 count=512 of=/dev/your_partition It's not strictly necessary, but it's a good habit to get into. |
wipefs is another possibility.
The wipefs utilitity will automatically remove any relevant FS metadata, without overwriting the whole disk. Therefore, when you try to make a new fs, with mke2fs or what have you, it will not see the disk as already containing a file system. On debian, it's part of the util-linux package.
|
All times are GMT -5. The time now is 03:14 AM. |