linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: "Lukáš Czerner" <lczerner@redhat.com>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH 6/7] mke2fs: check for pre-existing file system
Date: Wed, 30 Apr 2014 10:10:48 -0400	[thread overview]
Message-ID: <20140430141048.GC9213@thunk.org> (raw)
In-Reply-To: <alpine.LFD.2.00.1404301346460.2100@localhost.localdomain>

On Wed, Apr 30, 2014 at 01:50:13PM +0200, Lukáš Czerner wrote:
> > +	/*
> > +	 * We should eventually replace this with a test for the
> > +	 * presence of a partition table.  Unfortunately the blkid
> > +	 * library doesn't test for partition tabels, and checking for
> > +	 * valid GPT and MBR and possibly others isn't quite trivial.
> > +	 */
> 
> That is not true. libblkid definitely can scan for partition or any
> other signature for that matter (lvm, mdraid, ...) and we should
> definitely utilize that.

libblkid scan scan for LVM and mdraid, sure.  But it doesn't scan for
GPT or MBR partition labels:

% dpkg -S /sbin/blkid
util-linux: /sbin/blkid
% fdisk -l /dev/sda

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xae7b6b2b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
/dev/sda2          206848   167772159    83782656    7  HPFS/NTFS/exFAT
/dev/sda3       167772160   482344959   157286400   83  Linux
/dev/sda4       482344960  1953525167   735590104   8e  Linux LVM

% sudo /sbin/blkid  /dev/sda
%

Ohhh...  this may be debian's fault for having a pre-historic
util-linux.

But anyway, if util-linux does detect partition labels, then this
patch will catch the problem.



							- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-04-30 14:10 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-27  0:00 [PATCH 1/7] mke2fs: don't ask the proceed question using a regular file Theodore Ts'o
2014-04-27  0:00 ` [PATCH 2/7] mke2fs, tune2fs: call proceed_question() from check_plausibility()'s caller Theodore Ts'o
2014-04-27  0:00 ` [PATCH 3/7] mke2fs: don't complain if the regular file is too small Theodore Ts'o
2014-04-28 15:26   ` Eric Sandeen
2014-04-27  0:00 ` [PATCH 4/7] mke2fs: create a regular file if necessary Theodore Ts'o
2014-04-30 12:21   ` Lukáš Czerner
2014-04-30 14:06     ` Theodore Ts'o
2014-04-30 14:14       ` Lukáš Czerner
2014-04-30 14:18         ` Theodore Ts'o
2014-04-30 14:35           ` Lukáš Czerner
2014-04-30 15:26             ` Theodore Ts'o
2014-05-05 15:17   ` Eric Sandeen
2014-04-27  0:00 ` [PATCH 5/7] mke2fs: proceed if the user doesn't type anything after 5 seconds Theodore Ts'o
2014-04-28 15:33   ` Eric Sandeen
2014-04-28 15:36     ` Eric Sandeen
2014-04-28 23:26     ` Theodore Ts'o
2014-04-29  0:32       ` Eric Sandeen
2014-04-30  6:53         ` Lukáš Czerner
2014-04-27  0:00 ` [PATCH 6/7] mke2fs: check for pre-existing file system Theodore Ts'o
2014-04-30 11:50   ` Lukáš Czerner
2014-04-30 13:44     ` Lukáš Czerner
2014-04-30 14:10     ` Theodore Ts'o [this message]
2014-04-27  0:00 ` [PATCH 7/7] mke2fs: only print the low-level file system stats in verbose mode Theodore Ts'o
2014-04-30 11:22   ` Lukáš Czerner
2014-04-30 14:01     ` Theodore Ts'o
2014-04-30 14:25       ` Lukáš Czerner
2014-04-28 15:24 ` [PATCH 1/7] mke2fs: don't ask the proceed question using a regular file Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140430141048.GC9213@thunk.org \
    --to=tytso@mit.edu \
    --cc=lczerner@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).