LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
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?

Notices

Reply
 
LinkBack Search this Thread
Old 04-14-2007, 11:20 AM   #1
dkaplowitz
Member
 
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.

Dave
 
Old 04-14-2007, 11:36 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,546

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
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
dkaplowitz
Member
 
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.

Cheers,

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

Rep: Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923
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.
 
  


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
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 12:19 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