All of lore.kernel.org
 help / color / mirror / Atom feed
* What is the proper way to remove an xfs partition?
@ 2017-08-31 18:04 ToddAndMargo
  2017-08-31 18:16 ` Eric Sandeen
  2017-09-02  0:34 ` ToddAndMargo
  0 siblings, 2 replies; 10+ messages in thread
From: ToddAndMargo @ 2017-08-31 18:04 UTC (permalink / raw)
  To: linux-xfs

Hi All,

Fedora 26
BIOS boot = legacy (EUFI give me hives)

I have a SATA backup drive formatted gpt, one partition, xfs. I went 
into gparted, erased the partition, recreated the partition as ext4 and 
formatted it as ext4.

Then I mounted it as ext4, copied some files to it, unmounted it. When I 
went to remount it, mount told me there was something wrong with ext4. 
So I mounted it as xfs AND IT WORKED! I repeated with the same result. 
The drive thinks it is ext4 until the second mount.

Out of shear frustration, I did a dd /dev/zero overwrite of the stinker 
and left it running overnight.  That did the trick, but it takes
forever and I have four more drives to go.

What is the official way to remove an xfs partition?

Many thanks,
-T


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: What is the proper way to remove an xfs partition?
  2017-08-31 18:04 What is the proper way to remove an xfs partition? ToddAndMargo
@ 2017-08-31 18:16 ` Eric Sandeen
  2017-08-31 18:32   ` ToddAndMargo
  2017-09-02  0:34 ` ToddAndMargo
  1 sibling, 1 reply; 10+ messages in thread
From: Eric Sandeen @ 2017-08-31 18:16 UTC (permalink / raw)
  To: ToddAndMargo, linux-xfs

xOn 8/31/17 1:04 PM, ToddAndMargo wrote:
> Hi All,
> 
> Fedora 26
> BIOS boot = legacy (EUFI give me hives)
> 
> I have a SATA backup drive formatted gpt, one partition, xfs. I went into gparted, erased the partition, recreated the partition as ext4 and formatted it as ext4.
> 
> Then I mounted it as ext4, copied some files to it, unmounted it. When I went to remount it, mount told me there was something wrong with ext4.

What "something" was that?

> So I mounted it as xfs AND IT WORKED! I repeated with the same result. The drive thinks it is ext4 until the second mount.

This should not be the case.  It's possible to leave old magic numbers & signatures lying around in general, but mkfs.ext4, in my testing, zeros out the XFS superblock at offset 0; xfs should fail to mount after that.  It sounds like there may be more going on, here.

> Out of shear frustration, I did a dd /dev/zero overwrite of the stinker and left it running overnight.  That did the trick, but it takes
> forever and I have four more drives to go.
> 
> What is the official way to remove an xfs partition?

It's not usually needed, but if you don't want the kernel and/or utilities to recognize an xfs block device as xfs anymore, simply zero the first 512 bytes of that block device.

Or more conveniently, there's also the wipefs utility:

NAME
       wipefs - wipe a signature from a device

-Eric

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: What is the proper way to remove an xfs partition?
  2017-08-31 18:16 ` Eric Sandeen
@ 2017-08-31 18:32   ` ToddAndMargo
  2017-08-31 21:09     ` Eric Sandeen
  0 siblings, 1 reply; 10+ messages in thread
From: ToddAndMargo @ 2017-08-31 18:32 UTC (permalink / raw)
  To: linux-xfs

On 08/31/2017 11:16 AM, Eric Sandeen wrote:
> xOn 8/31/17 1:04 PM, ToddAndMargo wrote:
>> Hi All,
>>
>> Fedora 26
>> BIOS boot = legacy (EUFI give me hives)
>>
>> I have a SATA backup drive formatted gpt, one partition, xfs. I went into gparted, erased the partition, recreated the partition as ext4 and formatted it as ext4.
>>
>> Then I mounted it as ext4, copied some files to it, unmounted it. When I went to remount it, mount told me there was something wrong with ext4.
> 
> What "something" was that?

mount: /lin-bak: wrong fs type, bad option, bad superblock on /dev/sdd1, 
missing codepage or helper program, or other error.


> 
>> So I mounted it as xfs AND IT WORKED! I repeated with the same result. The drive thinks it is ext4 until the second mount.
> 
> This should not be the case.  It's possible to leave old magic numbers & signatures lying around in general, but mkfs.ext4, in my testing, zeros out the XFS superblock at offset 0; xfs should fail to mount after that.  It sounds like there may be more going on, here.

I have notices issues in the past with gparted.  It use to not
format an ntfs partition that Windows recognized.  Now
it can't label and ntfs partition that Windows also recognized.
But these were usually relegated to Windows problems.
I would love it if gparted would FINALLY support luks.

>> Out of shear frustration, I did a dd /dev/zero overwrite of the stinker and left it running overnight.  That did the trick, but it takes
>> forever and I have four more drives to go.
>>
>> What is the official way to remove an xfs partition?
> 
> It's not usually needed, but if you don't want the kernel and/or utilities to recognize an xfs block device as xfs anymore, simply zero the first 512 bytes of that block device.

I can do that!

I was concerned about the gpt stuff at the end of the drive.
Ignored if I clobber the first 512 bytes?

> Or more conveniently, there's also the wipefs utility:
> 
> NAME
>         wipefs - wipe a signature from a device

Didn't know about that one.  Thank you!

-T

> -Eric
> 



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: What is the proper way to remove an xfs partition?
  2017-08-31 18:32   ` ToddAndMargo
@ 2017-08-31 21:09     ` Eric Sandeen
  2017-09-01  7:02       ` Carlos Maiolino
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Sandeen @ 2017-08-31 21:09 UTC (permalink / raw)
  To: ToddAndMargo, linux-xfs

On 8/31/17 1:32 PM, ToddAndMargo wrote:
> On 08/31/2017 11:16 AM, Eric Sandeen wrote:
>> xOn 8/31/17 1:04 PM, ToddAndMargo wrote:
>>> Hi All,
>>>
>>> Fedora 26
>>> BIOS boot = legacy (EUFI give me hives)
>>>
>>> I have a SATA backup drive formatted gpt, one partition, xfs. I went into gparted, erased the partition, recreated the partition as ext4 and formatted it as ext4.
>>>
>>> Then I mounted it as ext4, copied some files to it, unmounted it. When I went to remount it, mount told me there was something wrong with ext4.
>>
>> What "something" was that?
> 
> mount: /lin-bak: wrong fs type, bad option, bad superblock on /dev/sdd1, missing codepage or helper program, or other error.

       In some cases useful info is found in syslog - try
       dmesg | tail  or so
       ^^^^^^^^^^^^
 
<snip>

>>> What is the official way to remove an xfs partition?
>>
>> It's not usually needed, but if you don't want the kernel and/or utilities to recognize an xfs block device as xfs anymore, simply zero the first 512 bytes of that block device.
> 
> I can do that!
> 
> I was concerned about the gpt stuff at the end of the drive.
> Ignored if I clobber the first 512 bytes?

The filesystem signature on a partition is a separate issue from
the partition table signatures on the disk...

-Eric

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: What is the proper way to remove an xfs partition?
  2017-08-31 21:09     ` Eric Sandeen
@ 2017-09-01  7:02       ` Carlos Maiolino
  0 siblings, 0 replies; 10+ messages in thread
From: Carlos Maiolino @ 2017-09-01  7:02 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: ToddAndMargo, linux-xfs

Hi,

> >>> Hi All,
> >>>
> >>> Fedora 26
> >>> BIOS boot = legacy (EUFI give me hives)
> >>>
> >>> I have a SATA backup drive formatted gpt, one partition, xfs. I went into gparted, erased the partition, recreated the partition as ext4 and formatted it as ext4.
> >>>
> >>> Then I mounted it as ext4, copied some files to it, unmounted it. When I went to remount it, mount told me there was something wrong with ext4.
> >>
> >> What "something" was that?
> > 
> > mount: /lin-bak: wrong fs type, bad option, bad superblock on /dev/sdd1, missing codepage or helper program, or other error.
> 
>        In some cases useful info is found in syslog - try
>        dmesg | tail  or so
>        ^^^^^^^^^^^^
>  
> <snip>
> 
> >>> What is the official way to remove an xfs partition?
> >>
> >> It's not usually needed, but if you don't want the kernel and/or utilities to recognize an xfs block device as xfs anymore, simply zero the first 512 bytes of that block device.
> > 
> > I can do that!
> > 
> > I was concerned about the gpt stuff at the end of the drive.
> > Ignored if I clobber the first 512 bytes?
> 
> The filesystem signature on a partition is a separate issue from
> the partition table signatures on the disk...
>
The overall report sounds interesting, the only thing I could think from the
top of my head is that ext4 and xfs places superblocks on different locations of
the disk (xfs at the very beginning, and ext4 skipping the first 1024bytes). I
wonder if for some reason when initializing ext4, the xfs superblock was not
wiped out.

Maybe some ext4 option to not touch old data and so prevent it to trash out the
xfs superblock?

Or, as Eric said, a dmesg might be useful, maybe you just have some caching that
complete messed up your filesystem initialization?


> -Eric

-- 
Carlos

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: What is the proper way to remove an xfs partition?
  2017-08-31 18:04 What is the proper way to remove an xfs partition? ToddAndMargo
  2017-08-31 18:16 ` Eric Sandeen
@ 2017-09-02  0:34 ` ToddAndMargo
  2017-09-03 12:34   ` Carlos E. R.
  1 sibling, 1 reply; 10+ messages in thread
From: ToddAndMargo @ 2017-09-02  0:34 UTC (permalink / raw)
  To: linux-xfs

On 08/31/2017 11:04 AM, ToddAndMargo wrote:
> Hi All,
> 
> Fedora 26
> BIOS boot = legacy (EUFI give me hives)
> 
> I have a SATA backup drive formatted gpt, one partition, xfs. I went 
> into gparted, erased the partition, recreated the partition as ext4 and 
> formatted it as ext4.
> 
> Then I mounted it as ext4, copied some files to it, unmounted it. When I 
> went to remount it, mount told me there was something wrong with ext4. 
> So I mounted it as xfs AND IT WORKED! I repeated with the same result. 
> The drive thinks it is ext4 until the second mount.
> 
> Out of shear frustration, I did a dd /dev/zero overwrite of the stinker 
> and left it running overnight.  That did the trick, but it takes
> forever and I have four more drives to go.
> 
> What is the official way to remove an xfs partition?
> 
> Many thanks,
> -T

I don't know if you guys care about such things, but I just
request that gparted do a disk blank

https://bugzilla.redhat.com/show_bug.cgi?id=1487807

By the way, thank you all for the help and support
through all this!



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: What is the proper way to remove an xfs partition?
  2017-09-02  0:34 ` ToddAndMargo
@ 2017-09-03 12:34   ` Carlos E. R.
  2017-09-04  0:03     ` ToddAndMargo
  0 siblings, 1 reply; 10+ messages in thread
From: Carlos E. R. @ 2017-09-03 12:34 UTC (permalink / raw)
  To: Linux-XFS mailing list


[-- Attachment #1.1: Type: text/plain, Size: 1388 bytes --]

On 2017-09-02 02:34, ToddAndMargo wrote:

> 
> I don't know if you guys care about such things, but I just
> request that gparted do a disk blank
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1487807

It is a known issue with gparted that when you reformat a partition or
disk with something else, it doesn't properly erase at least the
critical areas of the previous filesystem, causing problems.

One that has been noticed more than once at openSUSE is this:

- 'dd' a CD image on an USB stick for operating system installation. For
instance, openSUSE-Leap-42.2-NET-x86_64.iso install disk.

- Afterwards, use gparted to remove partitions on the stick, create a
new partition, format it as FAT32 (with a label).

Tumbleweed (at some version) thought the USB to still be a CD (printing
its old label) and failed to mount it (because it is FAT).

The code detecting filesystem type had to be changed on Tumbleweed, but
the cause of the issue is that gparted did not erase the areas at the
start of the disk with that information, and the FAT format did not
write on them.



So this is not a problem with XFS, but a problem caused by gparted
(feature needed). You have to manually destroy key areas manually,
probably just a few sectors at partition start.


-- 
Cheers / Saludos,

		Carlos E. R.
		(from 42.2 x86_64 "Malachite" at Telcontar)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: What is the proper way to remove an xfs partition?
  2017-09-03 12:34   ` Carlos E. R.
@ 2017-09-04  0:03     ` ToddAndMargo
  2017-09-04  0:14       ` Carlos E. R.
  0 siblings, 1 reply; 10+ messages in thread
From: ToddAndMargo @ 2017-09-04  0:03 UTC (permalink / raw)
  To: Carlos E. R., Linux-XFS mailing list

On 09/03/2017 05:34 AM, Carlos E. R. wrote:
> On 2017-09-02 02:34, ToddAndMargo wrote:
> 
>>
>> I don't know if you guys care about such things, but I just
>> request that gparted do a disk blank
>>
>> https://bugzilla.redhat.com/show_bug.cgi?id=1487807
> 
> It is a known issue with gparted that when you reformat a partition or
> disk with something else, it doesn't properly erase at least the
> critical areas of the previous filesystem, causing problems.
> 
> One that has been noticed more than once at openSUSE is this:
> 
> - 'dd' a CD image on an USB stick for operating system installation. For
> instance, openSUSE-Leap-42.2-NET-x86_64.iso install disk.
> 
> - Afterwards, use gparted to remove partitions on the stick, create a
> new partition, format it as FAT32 (with a label).
> 
> Tumbleweed (at some version) thought the USB to still be a CD (printing
> its old label) and failed to mount it (because it is FAT).
> 
> The code detecting filesystem type had to be changed on Tumbleweed, but
> the cause of the issue is that gparted did not erase the areas at the
> start of the disk with that information, and the FAT format did not
> write on them.
> 
> 
> 
> So this is not a problem with XFS, but a problem caused by gparted
> (feature needed). You have to manually destroy key areas manually,
> probably just a few sectors at partition start.
> 
> 

Thank you!  And something for 1478707 to reproduce!

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: What is the proper way to remove an xfs partition?
  2017-09-04  0:03     ` ToddAndMargo
@ 2017-09-04  0:14       ` Carlos E. R.
  2017-09-04  5:06         ` ToddAndMargo
  0 siblings, 1 reply; 10+ messages in thread
From: Carlos E. R. @ 2017-09-04  0:14 UTC (permalink / raw)
  To: Linux-XFS mailing list


[-- Attachment #1.1: Type: text/plain, Size: 728 bytes --]

On 2017-09-04 02:03, ToddAndMargo wrote:
> On 09/03/2017 05:34 AM, Carlos E. R. wrote:


>> So this is not a problem with XFS, but a problem caused by gparted
>> (feature needed). You have to manually destroy key areas manually,
>> probably just a few sectors at partition start.
>>
>>
> 
> Thank you!  And something for 1478707 to reproduce!

If you are interested, these are the openSUSE bugzillas:

https://bugzilla.opensuse.org/show_bug.cgi?id=1046268
USB Keys are mis-identified by device notifier

https://bugzilla.opensuse.org/show_bug.cgi?id=1046096
Can't mount fat32 USB stick: issue on the partition table

-- 
Cheers / Saludos,

		Carlos E. R.
		(from 42.2 x86_64 "Malachite" at Telcontar)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: What is the proper way to remove an xfs partition?
  2017-09-04  0:14       ` Carlos E. R.
@ 2017-09-04  5:06         ` ToddAndMargo
  0 siblings, 0 replies; 10+ messages in thread
From: ToddAndMargo @ 2017-09-04  5:06 UTC (permalink / raw)
  To: Linux-XFS mailing list

On 09/03/2017 05:14 PM, Carlos E. R. wrote:
> On 2017-09-04 02:03, ToddAndMargo wrote:
>> On 09/03/2017 05:34 AM, Carlos E. R. wrote:
> 
> 
>>> So this is not a problem with XFS, but a problem caused by gparted
>>> (feature needed). You have to manually destroy key areas manually,
>>> probably just a few sectors at partition start.
>>>
>>>
>>
>> Thank you!  And something for 1478707 to reproduce!
> 
> If you are interested, these are the openSUSE bugzillas:
> 
> https://bugzilla.opensuse.org/show_bug.cgi?id=1046268
> USB Keys are mis-identified by device notifier
> 
> https://bugzilla.opensuse.org/show_bug.cgi?id=1046096
> Can't mount fat32 USB stick: issue on the partition table
> 

I added the second one to the read hat bug report.
Thank you!


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-09-04  5:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-31 18:04 What is the proper way to remove an xfs partition? ToddAndMargo
2017-08-31 18:16 ` Eric Sandeen
2017-08-31 18:32   ` ToddAndMargo
2017-08-31 21:09     ` Eric Sandeen
2017-09-01  7:02       ` Carlos Maiolino
2017-09-02  0:34 ` ToddAndMargo
2017-09-03 12:34   ` Carlos E. R.
2017-09-04  0:03     ` ToddAndMargo
2017-09-04  0:14       ` Carlos E. R.
2017-09-04  5:06         ` ToddAndMargo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.