LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 03-30-2009, 01:11 PM   #1
Vilius
Member
 
Registered: Jan 2006
Location: Lithuania
Distribution: CentOS, Debian
Posts: 184

Rep: Reputation: 15
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
 
Old 03-30-2009, 01:39 PM   #2
lupinix
LQ Newbie
 
Registered: May 2008
Location: Nievern (Germany)
Distribution: Slackware, Bluewhite64
Posts: 22

Rep: Reputation: 15
Example for /dev/sda1 (change the device for your needs)(the structure of the filesystem will be overwritten by many zeros)

Quote:
cat /dev/zero > /dev/sda1
No Warranty!
 
Old 03-31-2009, 03:47 PM   #3
Vilius
Member
 
Registered: Jan 2006
Location: Lithuania
Distribution: CentOS, Debian
Posts: 184

Original Poster
Rep: Reputation: 15
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
 
Old 03-31-2009, 03:57 PM   #4
Ilgar
Member
 
Registered: Jan 2005
Location: Istanbul, Turkey
Distribution: Slackware 14.1, Slackware64 14.1
Posts: 916

Rep: Reputation: 87
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?
 
Old 03-31-2009, 04:30 PM   #5
Vilius
Member
 
Registered: Jan 2006
Location: Lithuania
Distribution: CentOS, Debian
Posts: 184

Original Poster
Rep: Reputation: 15
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
 
Old 03-31-2009, 04:38 PM   #6
mlangdn
Senior Member
 
Registered: Mar 2005
Location: Kentucky
Distribution: Slackware64-current
Posts: 1,366

Rep: Reputation: 156Reputation: 156
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.
 
Old 03-31-2009, 04:59 PM   #7
Ilgar
Member
 
Registered: Jan 2005
Location: Istanbul, Turkey
Distribution: Slackware 14.1, Slackware64 14.1
Posts: 916

Rep: Reputation: 87
Quote:
Originally Posted by Vilius View Post
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.
 
Old 03-31-2009, 05:43 PM   #8
GazL
Senior Member
 
Registered: May 2008
Posts: 3,231

Rep: Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828
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
(clears the first 256K - I pulled the number out of the air, but it ought to be big enough to do the job)

It's not strictly necessary, but it's a good habit to get into.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ext3 filesystem repair: partition table munched. mrspiffy Linux - Newbie 2 10-23-2008 01:29 AM
Confusing USB Filesystem Problem (Can't Wipe Ext3 Filesystem) dkaplowitz Linux - Hardware 3 04-14-2007 06:30 PM
how to convert ext3 to ntfs? cannot even see ext3 partition parv Linux - Hardware 1 12-31-2004 02:56 PM
need to resize ext3 filesystem clsonnt Linux - Newbie 2 07-09-2003 10:59 AM
Cannot remove EXT3 partition. keymoo Linux - Newbie 1 05-23-2002 09:56 AM


All times are GMT -5. The time now is 02:43 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration