SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
Click here to see the post LQ members have rated as the most helpful post in this thread.
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 ?
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 ?)
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.
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
Yes if you recreate it you should find the filesystem there, but you can simply format it during installation. That is, you don't need to make it look like empty. Besides, installers detect the partitions but they usually don't know or care what filesystem lies inside (unless you explicitly ask them not to overwrite but to mount those partitions somewhere in your filesystem).
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:
0 Empty 1e Hidden W95 FAT1 80 Old Minix bf Solaris
1 FAT12 24 NEC DOS 81 Minix / old Lin c1 DRDOS/sec (FAT-
2 XENIX root 39 Plan 9 82 Linux swap c4 DRDOS/sec (FAT-
3 XENIX usr 3c PartitionMagic 83 Linux c6 DRDOS/sec (FAT-
4 FAT16 <32M 40 Venix 80286 84 OS/2 hidden C: c7 Syrinx
5 Extended 41 PPC PReP Boot 85 Linux extended da Non-FS data
6 FAT16 42 SFS 86 NTFS volume set db CP/M / CTOS / .
7 HPFS/NTFS 4d QNX4.x 87 NTFS volume set de Dell Utility
8 AIX 4e QNX4.x 2nd part 88 Linux plaintext df BootIt
9 AIX bootable 4f QNX4.x 3rd part 8e Linux LVM e1 DOS access
a OS/2 Boot Manag 50 OnTrack DM 93 Amoeba e3 DOS R/O
b W95 FAT32 51 OnTrack DM6 Aux 94 Amoeba BBT e4 SpeedStor
c W95 FAT32 (LBA) 52 CP/M 9f BSD/OS eb BeOS fs
e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad hi ee GPT
f W95 Ext'd (LBA) 54 OnTrackDM6 a5 FreeBSD ef EFI (FAT-12/16/
10 OPUS 55 EZ-Drive a6 OpenBSD f0 Linux/PA-RISC b
11 Hidden FAT12 56 Golden Bow a7 NeXTSTEP f1 SpeedStor
12 Compaq diagnost 5c Priam Edisk a8 Darwin UFS f4 SpeedStor
14 Hidden FAT16 <3 61 SpeedStor a9 NetBSD f2 DOS secondary
16 Hidden FAT16 63 GNU HURD or Sys ab Darwin boot fb VMware VMFS
17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE
18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto
1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep
1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT
So you can mark the partition type 0 to make the installers think it's empty. This code doesn't have anything to do with formatting and may not even match the real content of the partition; but gives the installers a hint of what they are. For example Slackware installers will detect partitions of type 82 (swap) and automatically suggest activating them as swap space.
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:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.