You are not logged in.

#1 2014-12-22 18:58:19

nrwilk
Member
Registered: 2014-12-11
Posts: 6

[SOLVED] Formatted Drive Auto-Mounts as Old Partition with Old Data

My USB flash drive used to be formatted as ext4 with a Debian live install on it. I inserted the drive into my new arch install once. It was correctly auto-mounted with udevil. I unmounted the drive and proceeded to format it as fat32 to use as free space since I haven't needed to boot into the live environment in a long time.

After the format, when I plug the drive in, it is auto-mounted read-only with the old name, "Debian Wheezy". I can even see the old files that used to be on the drive before the format.

Since then, I have tried formatting it with many different filesystems and re-creating the partition table multiple times. I have done this with gparted, the command line, and even the Windows format utility under Windows 7. But, after every format, it still shows up as "Debian Wheezy", read-only. I checked this in Thunar, PCmanFM, and Double Commander.

If I unmount the drive and re-mount it from the command line, it is mounted properly and I can interact with it as I should be able to.

Is this an issue with udevil? I don't even know where to start.

Other USB drives are mounted just fine. Only the one USB drive seems to be affected. My guess is that the name and filesystem of the disk is somehow cached on the computer and when I plug it in, the cache is being read instead of the drive itself. I mean, that information should not be on the drive after so many formats.

I am a newb for sure, and I understand that logs should help here in some way, but to be honest, I don't know which logs I should provide. I will provide whatever information I can to help make clearer what is happening.

Thank you for any help!

Last edited by nrwilk (2014-12-22 20:38:18)

Offline

#2 2014-12-22 19:15:17

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,802

Re: [SOLVED] Formatted Drive Auto-Mounts as Old Partition with Old Data

Could please you attach the drive and post the output of lsblk   ?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2014-12-22 19:23:25

nrwilk
Member
Registered: 2014-12-11
Posts: 6

Re: [SOLVED] Formatted Drive Auto-Mounts as Old Partition with Old Data

Sure!

lsblk                                                                                                                                  0 
NAME     MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda        8:0    0 232.9G  0 disk  
├─sda1     8:1    0   512M  0 part  /boot
├─sda2     8:2    0    40G  0 part  
│ └─root 254:0    0    40G  0 crypt /
└─sda3     8:3    0 192.4G  0 part  
  └─home 254:1    0 192.4G  0 crypt /home
sdc        8:32   1  59.6G  0 disk  
└─sdc1     8:33   1  59.6G  0 part

The drive is /dev/sdc here.

Offline

#4 2014-12-22 19:33:26

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,802

Re: [SOLVED] Formatted Drive Auto-Mounts as Old Partition with Old Data

That drive (sdc) has a partition table with a single partition in it (sdc1).  When you for formatted it, did you format sdc, or sdc1?  How is it mounted? As sdc, or sdc1?
What happens if you (carefully) unmount the drive and use fdisk to delete the sdc1 partition --  Then generate a file system on sdc. ?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#5 2014-12-22 20:04:49

nrwilk
Member
Registered: 2014-12-11
Posts: 6

Re: [SOLVED] Formatted Drive Auto-Mounts as Old Partition with Old Data

OK, I used fdisk to delete the fat32 partition I had created. I used the 'o' option to create a new DOS partition table.

After this, I unattached the drive and re-attached it. In Thunar, "Debian Wheezy" pops up again.

I unmounted the drive again, opened the disk in fdisk, created a new partition table, and created a new partition.

Now, that new partition is mounted in Thunar. Awesome!

Unmount, unplug, re-attach, annnnnnd... "Debian Wheezy" again. sad

EDIT: It appears that, when it is auto-mounted, it is mounted as /dev/sdc, not /dev/sdc1. I think this is the cause of the problem. How can I make udevil mount /dev/sdc1 and not /dev/sdc?

If I mount the drive manually, it works just fine.

Last edited by nrwilk (2014-12-22 20:12:56)

Offline

#6 2014-12-22 20:14:47

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,802

Re: [SOLVED] Formatted Drive Auto-Mounts as Old Partition with Old Data

What if you try it without a partition table?  Just format sdc  (not sdc1)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#7 2014-12-22 20:37:31

nrwilk
Member
Registered: 2014-12-11
Posts: 6

Re: [SOLVED] Formatted Drive Auto-Mounts as Old Partition with Old Data

Thank you, ewaller! I was able to fix the drive with the information you gave me.

When I installed the Debian live image, I must have done it directly to the root of the drive (/dev/sdc, in this case). I used wipefs on /dev/sdc and was able to remove the lingering filesystem.

I then used fdisk to create the partition table as I wanted it and everything now works as expected.

I have to admit, I didn't even know you could write partition information directly to the root of the disk like that. I thought one must use partitions.

Thank you so much!

Offline

Board footer

Powered by FluxBB