Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Hardware
User Name
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?


  Search this Thread
Old 04-14-2007, 11:20 AM   #1
Registered: Oct 2002
Location: Havertown PA
Distribution: Ubuntu/RHEL/Fedora
Posts: 253

Rep: Reputation: 31
Confusing USB Filesystem Problem (Can't Wipe Ext3 Filesystem)

Hi all, I have this confusing problem with an externally (USB2) mounted hard drive. I have it formatted as an ext3 partition and I want to wipe that and format it with another filesystem. I've used cfdisk, fdisk and parted. Every time I successfully delete partition 1 (the only partition), it goes well, says "free space" for the full size of the drive. The minute I create a linux label (type 83), the drive automounts as the old filesystem with all the old files still in tact. (!)

I recall having this similar problem with a FAT partition and the cfdisk man page tells me to do a dd if=/dev/zero of=/dev/sdf1 bs=512 count=1. That also works, but when I create a new label, the old filesystem and files are still there. (I've tried dd if=/dev/zero of=/dev/sdf bs=512 count=1 too)

I even booted into a Windows partition and zapped that partition using their native disk mgmnt utils and got the same thing (though I didn't format as NTFS --should have tried, but I don't want to boot back into Windows).

This is Ubuntu Feisty, so I'm wondering if they have some weird protection in place, or if I'm just missing something really obvious.

Thanks for any help.

Old 04-14-2007, 11:36 AM   #2
Registered: Aug 2002
Posts: 14,742

Rep: Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476Reputation: 1476
This is normal with any operating system or filesystem. Deleting files does not really erase any actual data just the pointer that says where it is located.

cfdisk, fdisk and parted are used to create and manipulate partitions. They do not create filesystems. Deleting and recreating will not erase the actual data which is why you can magically can still see all of your data.

"dd if=/dev/zero of=/dev/sdf bs=512 count=1" again will wipe out the MBR and partition table but will not erase the actual data either.

mkfs is the command to create filesystems. For example to create a ext3 filesystem
on your USB device.
mkfs -t ext3 -j /dev/sdf1
Old 04-14-2007, 04:38 PM   #3
Registered: Oct 2002
Location: Havertown PA
Distribution: Ubuntu/RHEL/Fedora
Posts: 253

Original Poster
Rep: Reputation: 31
Thanks for the reply.

Hmmm... I would have thought that deleting the partition (1) and writing that to the disk, thus leaving the disk with all free space and then creating a new label would have effectively wiped everything on the disk (even before the mkfs/mkreiserfs). I guess I was wrong about that. Just making a new filesystem did the trick. I guess I have a superstitious fear that it wasn't as clean as first wiping a disk then formatting. Either way, I'm good to go.


Old 04-14-2007, 06:30 PM   #4
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,700

Rep: Reputation: 1757Reputation: 1757Reputation: 1757Reputation: 1757Reputation: 1757Reputation: 1757Reputation: 1757Reputation: 1757Reputation: 1757Reputation: 1757Reputation: 1757
The problem is there is an in-storage copy of the partition table. After a reboot things would have been as you expected.
Similarly had you done the mkfs first, then assigned the label. Labels are a file-system concept, not part of the partition (table) definition.


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
Corrupted Ext3 Filesystem pyrosim Linux - General 2 07-23-2005 11:21 AM
Using the ext3 filesystem in 2.4 kernel powah Linux - General 2 04-21-2005 11:55 PM
Problem mounting ext3 filesystem on 2nd Hard Disk judgedeath2 Linux - Hardware 2 08-16-2004 09:43 AM
ext3 filesystem problem karlan Linux - General 1 01-16-2004 03:54 PM
need to resize ext3 filesystem clsonnt Linux - Newbie 2 07-09-2003 10:59 AM

All times are GMT -5. The time now is 07:13 PM.

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