Debian bug report logs - #379
Repeatable mount(1) problem with removable disks

Package: mount; Reported by: Bill Mitchell <mitchell@mdd.comm.mot.com>; 269 days old.

Message received at debian-bugs:


From pixar.com!bruce Fri Aug  4 21:30:44 1995
Return-Path: <bruce@pixar.com>
Received: from pixar.com by mongo.pixar.com with smtp
	(Smail3.1.28.1 #15) id m0seasm-000BCVC; Fri, 4 Aug 95 21:30 PDT
Received: from mongo.pixar.com by pixar.com with SMTP id AA11083
  (5.67b/IDA-1.5 for debian-bugs-pipe@mongo.pixar.com); Fri, 4 Aug 1995 21:30:39 -0700
Received: by mongo.pixar.com (Smail3.1.28.1 #15)
	id m0seasj-000BCVC; Fri, 4 Aug 95 21:30 PDT
Message-Id: <m0seasj-000BCVC@mongo.pixar.com>
Date: Fri, 4 Aug 95 21:30 PDT
From: bruce@pixar.com (Bruce Perens)
To: mitchell@mdd.comm.mot.com, debian-bugs@pixar.com
Subject: Re: Bug#379: Repeatable mount(1) problem with removable disks

Bill,

Can you report on whether or not this bug still exists in kernel-1.2.12 ?
I consider this a kernel problem.

	Thanks

	Bruce Perens
--
-- Attention Ham Radio Operators: For information on "Linux for Hams", read
-- the World Wide Web page http://www.hams.com/perens/LinuxForHams, or send
-- an e-mail message containing the word "help" to info@hams.com .

Acknowledgement sent to bruce@pixar.com (Bruce Perens):
Extra info received and forwarded. Full text available.
Information forwarded to debian-devel@pixar.com:
Bug#379; Package mount. Full text available.

Message received at debian-bugs:


From mdd.comm.mot.com!mitchell Sun Feb  5 10:35:28 1995
Return-Path: <mitchell@mdd.comm.mot.com>
Received: from pixar.com by mongo.pixar.com with smtp
	(Smail3.1.28.1 #15) id m0rbBny-0002u1C; Sun, 5 Feb 95 10:35 PST
Received: from motgate.mot.com by pixar.com with SMTP id AA17392
  (5.65c/IDA-1.4.4 for <debian-bugs@pixar.com>); Sun, 5 Feb 1995 10:35:58 -0800
Received: from pobox.mot.com by motgate.mot.com with SMTP (5.67b/IDA-1.4.4/MOT-3.1 for <debian-bugs@pixar.com>)
          id AA06029; Sun, 5 Feb 1995 12:35:22 -0600
Received: from mdd.comm.mot.com (mdisea.mdd.comm.mot.com) by pobox.mot.com with SMTP (5.67b/IDA-1.4.4/MOT-3.1)
          id AA21930; Sun, 5 Feb 1995 12:35:21 -0600
Received: from bb29c.mdd.comm.mot.com by mdd.comm.mot.com (4.1/SMI-4.1)
	id AA08919; Sun, 5 Feb 95 10:35:19 PST
Received: by bb29c.mdd.comm.mot.com (4.1/SMI-4.1)
	id AA04239; Sun, 5 Feb 95 10:35:13 PST
Date: Sun, 5 Feb 1995 10:35:12 -0800 (PST)
From: Bill Mitchell <mitchell@mdd.comm.mot.com>
X-Sender: mitchell@bb29c
To: Ian Jackson <iwj10@cus.cam.ac.uk>
Cc: debian-bugs@pixar.com
Subject: Re: Bug#379: Repeatable mount(1) problem with removable disks
In-Reply-To: <m0rb6Fh-0002g8Z.ijackson@nyx.cs.du.edu>
Message-Id: <Pine.SUN.3.90.950205101406.4161D-100000@bb29c>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII


On Sun, 5 Feb 1995, Ian Jackson wrote:

> [...]
> There is an ioctl that causes the kernel to re-read the partition
> table; this is used by fdisk.  [... but not used by mount ... (wtm)]
>
> [...]                                                           what
> if you insert a cartridge that has a /dev/sdc4 but whose sdc4 is the
> wrong size ?

Ouch!  This sounds like I could have one cartridge with a single
150MB partition on /dev/sdc1 mounted, unmount it and mount /dev/scd1
from another cartridge which has two 75MB partitions, and trash
the second partition.  No... perhaps not.  Surely mounting the
new partition would involve reading in the superblock, or whatever
disk usage and sizing information the mounted filesystem contains.

On the other hand, what about the case where I had that 75MB
/dev/sdc1 partition mounted, unmounted it and mounted a 150MB
/dev/sdc1 partition from another cartridge?  If the partition
table is not reread, mount will read in disk usage information
showing that the filesystem it's mounted is bigger than the
un-reread partition table shows the partition where it resides
to be.  Messy.

> The right solution is surely to make sure that the kernel spots the
> cartridge change and invalidates the partition table information
> itself.

Yes, but is it "right" for mount not to be paranoid enough to re-read
the partition table before attempting a mount?  If nothing else, having
mount reread the partition table before attempting a mount would provide
protection to folks using a later vintage mount program with an earlier
vintage kernel.

> Is there anything about this in the SCSI HOWTO ?  If not you should
> probably report it as a bug to the SCSI mailing list.

I happen have a removable-cartridge disk which has a SCSI interface,
but it seems to me these same concerns would apply to a removeable
cartridge disk with an IDE <or whatever> interface as well.


Message sent:


From: iwj@cam-orl.co.uk (Ian Jackson)
To: Bill Mitchell <mitchell@mdd.comm.mot.com>
Subject: Bug#379: Info received (was Bug#379: Repeatable mount(1) problem with removable disks)
In-Reply-To: <Pine.SUN.3.90.950205101406.4161D-100000@bb29c>
References: <Pine.SUN.3.90.950205101406.4161D-100000@bb29c>

Thank you for the additional information you have supplied regarding
your problem report.  It has been forwarded to the developers to
accompany the original report.

If you wish to continue submit further information on your problem,
please do the same thing again: send it to debian-bugs@pixar.com, ensuring
that the Subject line starts with "Bug#379" or "Re: Bug#379" so that
we can identify it as relating to the same problem.

Please do not to reply to the address at the top of this message,
unless you wish to report a problem with the bug-tracking system.

Ian Jackson
(maintainer, debian-bugs)


Message sent to debian-devel@pixar.com:


Subject: Bug#379: Repeatable mount(1) problem with removable disks
Reply-To: Bill Mitchell <mitchell@mdd.comm.mot.com>, debian-bugs-done@pixar.com
Resent-To: debian-devel@pixar.com
Resent-From: Bill Mitchell <mitchell@mdd.comm.mot.com>
Resent-Sender: iwj10@cus.cam.ac.uk
Resent-Date: Sun, 05 Feb 1995 18:48:02 GMT
Resent-Message-ID: <debian-bugs-handler.379.0205183636844@pixar.com>
X-Debian-PR-Package: mount
X-Debian-PR-Keywords: 
Received: via spool for debian-bugs; Sun, 05 Feb 1995 18:48:02 GMT
Received: with rfc822 via encapsulated-mail id 0205183636844;
          Sun, 05 Feb 1995 18:36:36 GMT
Received: from pixar.com by mongo.pixar.com with smtp
	(Smail3.1.28.1 #15) id m0rbBny-0002u1C; Sun, 5 Feb 95 10:35 PST
Received: from motgate.mot.com by pixar.com with SMTP id AA17392
  (5.65c/IDA-1.4.4 for <debian-bugs@pixar.com>); Sun, 5 Feb 1995 10:35:58 -0800
Received: from pobox.mot.com by motgate.mot.com with SMTP (5.67b/IDA-1.4.4/MOT-3.1 for <debian-bugs@pixar.com>)
          id AA06029; Sun, 5 Feb 1995 12:35:22 -0600
Received: from mdd.comm.mot.com (mdisea.mdd.comm.mot.com) by pobox.mot.com with SMTP (5.67b/IDA-1.4.4/MOT-3.1)
          id AA21930; Sun, 5 Feb 1995 12:35:21 -0600
Received: from bb29c.mdd.comm.mot.com by mdd.comm.mot.com (4.1/SMI-4.1)
	id AA08919; Sun, 5 Feb 95 10:35:19 PST
Received: by bb29c.mdd.comm.mot.com (4.1/SMI-4.1)
	id AA04239; Sun, 5 Feb 95 10:35:13 PST
Date: Sun, 5 Feb 1995 10:35:12 -0800 (PST)
From: Bill Mitchell <mitchell@mdd.comm.mot.com>
X-Sender: mitchell@bb29c
To: Ian Jackson <iwj10@cus.cam.ac.uk>
Cc: debian-bugs@pixar.com
In-Reply-To: <m0rb6Fh-0002g8Z.ijackson@nyx.cs.du.edu>
Message-Id: <Pine.SUN.3.90.950205101406.4161D-100000@bb29c>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII


On Sun, 5 Feb 1995, Ian Jackson wrote:

> [...]
> There is an ioctl that causes the kernel to re-read the partition
> table; this is used by fdisk.  [... but not used by mount ... (wtm)]
>
> [...]                                                           what
> if you insert a cartridge that has a /dev/sdc4 but whose sdc4 is the
> wrong size ?

Ouch!  This sounds like I could have one cartridge with a single
150MB partition on /dev/sdc1 mounted, unmount it and mount /dev/scd1
from another cartridge which has two 75MB partitions, and trash
the second partition.  No... perhaps not.  Surely mounting the
new partition would involve reading in the superblock, or whatever
disk usage and sizing information the mounted filesystem contains.

On the other hand, what about the case where I had that 75MB
/dev/sdc1 partition mounted, unmounted it and mounted a 150MB
/dev/sdc1 partition from another cartridge?  If the partition
table is not reread, mount will read in disk usage information
showing that the filesystem it's mounted is bigger than the
un-reread partition table shows the partition where it resides
to be.  Messy.

> The right solution is surely to make sure that the kernel spots the
> cartridge change and invalidates the partition table information
> itself.

Yes, but is it "right" for mount not to be paranoid enough to re-read
the partition table before attempting a mount?  If nothing else, having
mount reread the partition table before attempting a mount would provide
protection to folks using a later vintage mount program with an earlier
vintage kernel.

> Is there anything about this in the SCSI HOWTO ?  If not you should
> probably report it as a bug to the SCSI mailing list.

I happen have a removable-cartridge disk which has a SCSI interface,
but it seems to me these same concerns would apply to a removeable
cartridge disk with an IDE <or whatever> interface as well.



Message received at debian-bugs:


From cus.cam.ac.uk!iwj10 Sun Feb  5 08:52:42 1995
Return-Path: <iwj10@cus.cam.ac.uk>
Received: from pixar.com by mongo.pixar.com with smtp
	(Smail3.1.28.1 #15) id m0rbACX-0006fTC; Sun, 5 Feb 95 08:52 PST
Received: from bootes.cus.cam.ac.uk by pixar.com with SMTP id AA06611
  (5.65c/IDA-1.4.4 for <debian-bugs@pixar.com>); Sun, 5 Feb 1995 08:52:59 -0800
Received: by bootes.cus.cam.ac.uk 
	(Smail-3.1.29.0 #24) id m0rbA9S-000C0QC; Sun, 5 Feb 95 16:49 GMT
Received: by chiark (Smail3.1.28.1 #3)
	id m0rb6Fh-0002g8Z; Sun, 5 Feb 95 12:39 GMT
Message-Id: <m0rb6Fh-0002g8Z.ijackson@nyx.cs.du.edu>
Date: Sun, 5 Feb 95 12:39 GMT
From: iwj10@cus.cam.ac.uk (Ian Jackson)
To: debian-bugs@pixar.com
Subject: Re: Bug#379: Repeatable mount(1) problem with removable disks

Bill Mitchell writes ("Bug#379: Repeatable mount(1) problem with removable disks"):
> [...]
> I report this as a mount(1) problem instead of a kernel problem
> because I've noticed that I can clear the problem by running
>     fdisk /dev/sdc
> and then exiting fdisk.  If I do this in between the unmount of a
> cartridge with one partition present and the mount of a cartridge
> with another partition present, the mount succeeds.  Apparently
> fdisk(1) causes the partition information to be re-read from the
> disk.

There is an ioctl that causes the kernel to re-read the partition
table; this is used by fdisk.

> I'm suggesting that mount(1) should also re-read the partition
> information from the disk.  It should either do this all the time,
> or it should do it after a mount failure, then retrythe mount request
> before considering the failure to be a hard one and reporting it.

No, I don't think it should.  Certainly the latter won't work - what
if you insert a cartridge that has a /dev/sdc4 but whose sdc4 is the
wrong size ?

The right solution is surely to make sure that the kernel spots the
cartridge change and invalidates the partition table information
itself.

Is there anything about this in the SCSI HOWTO ?  If not you should
probably report it as a bug to the SCSI mailing list.

Regards,
Ian.

Message sent:


From: iwj@cam-orl.co.uk (Ian Jackson)
To: iwj10@cus.cam.ac.uk (Ian Jackson)
Subject: Bug#379: Info received (was Bug#379: Repeatable mount(1) problem with removable disks)
In-Reply-To: <m0rb6Fh-0002g8Z.ijackson@nyx.cs.du.edu>
References: <m0rb6Fh-0002g8Z.ijackson@nyx.cs.du.edu>

Thank you for the additional information you have supplied regarding
your problem report.  It has been forwarded to the developers to
accompany the original report.

If you wish to continue submit further information on your problem,
please do the same thing again: send it to debian-bugs@pixar.com, ensuring
that the Subject line starts with "Bug#379" or "Re: Bug#379" so that
we can identify it as relating to the same problem.

Please do not to reply to the address at the top of this message,
unless you wish to report a problem with the bug-tracking system.

Ian Jackson
(maintainer, debian-bugs)


Message sent to debian-devel@pixar.com:


Subject: Bug#379: Repeatable mount(1) problem with removable disks
Reply-To: iwj10@cus.cam.ac.uk (Ian Jackson), debian-bugs-done@pixar.com
Resent-To: debian-devel@pixar.com
Resent-From: iwj10@cus.cam.ac.uk (Ian Jackson)
Resent-Sender: iwj10@cus.cam.ac.uk
Resent-Date: Sun, 05 Feb 1995 17:03:04 GMT
Resent-Message-ID: <debian-bugs-handler.379.020516571324976@pixar.com>
X-Debian-PR-Package: mount
X-Debian-PR-Keywords: 
Received: via spool for debian-bugs; Sun, 05 Feb 1995 17:03:04 GMT
Received: with rfc822 via encapsulated-mail id 020516571324976;
          Sun, 05 Feb 1995 16:57:13 GMT
Received: from pixar.com by mongo.pixar.com with smtp
	(Smail3.1.28.1 #15) id m0rbACX-0006fTC; Sun, 5 Feb 95 08:52 PST
Received: from bootes.cus.cam.ac.uk by pixar.com with SMTP id AA06611
  (5.65c/IDA-1.4.4 for <debian-bugs@pixar.com>); Sun, 5 Feb 1995 08:52:59 -0800
Received: by bootes.cus.cam.ac.uk
	(Smail-3.1.29.0 #24) id m0rbA9S-000C0QC; Sun, 5 Feb 95 16:49 GMT
Received: by chiark (Smail3.1.28.1 #3)
	id m0rb6Fh-0002g8Z; Sun, 5 Feb 95 12:39 GMT
Message-Id: <m0rb6Fh-0002g8Z.ijackson@nyx.cs.du.edu>
Date: Sun, 5 Feb 95 12:39 GMT
From: iwj10@cus.cam.ac.uk (Ian Jackson)
To: debian-bugs@pixar.com

Bill Mitchell writes ("Bug#379: Repeatable mount(1) problem with removable disks"):
> [...]
> I report this as a mount(1) problem instead of a kernel problem
> because I've noticed that I can clear the problem by running
>     fdisk /dev/sdc
> and then exiting fdisk.  If I do this in between the unmount of a
> cartridge with one partition present and the mount of a cartridge
> with another partition present, the mount succeeds.  Apparently
> fdisk(1) causes the partition information to be re-read from the
> disk.

There is an ioctl that causes the kernel to re-read the partition
table; this is used by fdisk.

> I'm suggesting that mount(1) should also re-read the partition
> information from the disk.  It should either do this all the time,
> or it should do it after a mount failure, then retrythe mount request
> before considering the failure to be a hard one and reporting it.

No, I don't think it should.  Certainly the latter won't work - what
if you insert a cartridge that has a /dev/sdc4 but whose sdc4 is the
wrong size ?

The right solution is surely to make sure that the kernel spots the
cartridge change and invalidates the partition table information
itself.

Is there anything about this in the SCSI HOWTO ?  If not you should
probably report it as a bug to the SCSI mailing list.

Regards,
Ian.


Message received at debian-bugs:


From mdd.comm.mot.com!mitchell Sat Feb  4 10:45:20 1995
Return-Path: <mitchell@mdd.comm.mot.com>
Received: from pixar.com by mongo.pixar.com with smtp
	(Smail3.1.28.1 #15) id m0rapTz-0002piC; Sat, 4 Feb 95 10:45 PST
Received: from motgate.mot.com by pixar.com with SMTP id AA24564
  (5.65c/IDA-1.4.4 for <debian-bugs@pixar.com>); Sat, 4 Feb 1995 10:45:54 -0800
Received: from pobox.mot.com by motgate.mot.com with SMTP (5.67b/IDA-1.4.4/MOT-3.1 for <debian-bugs@pixar.com>)
          id AA28632; Sat, 4 Feb 1995 12:45:18 -0600
Received: from mdd.comm.mot.com (mdisea.mdd.comm.mot.com) by pobox.mot.com with SMTP (5.67b/IDA-1.4.4/MOT-3.1 for <debian-bugs@pixar.com>)
          id AA05388; Sat, 4 Feb 1995 12:45:17 -0600
Received: from bb29c.mdd.comm.mot.com by mdd.comm.mot.com (4.1/SMI-4.1)
	id AA01421; Sat, 4 Feb 95 10:45:16 PST
Received: by bb29c.mdd.comm.mot.com (4.1/SMI-4.1)
	id AA03215; Sat, 4 Feb 95 10:45:14 PST
Date: Sat, 4 Feb 1995 10:45:13 -0800 (PST)
From: Bill Mitchell <mitchell@mdd.comm.mot.com>
X-Sender: mitchell@bb29c
To: debian-bugs@pixar.com
Subject: Repeatable mount(1) problem with removable disks
In-Reply-To: <Pine.SUN.3.90.950204100804.3156A-100000@bb29c>
Message-Id: <Pine.SUN.3.90.950204104141.3198E-100000@bb29c>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII


PACKAGE:  mount
VARSION:  1.10
PACKAGE_REVISION:  4 (and later?)

One of the devices on my system is a removeable cartridge disk drive.
I have this on /dev/sdc.

The disk cartridges come preformatted for MSDOS, with partitions
1 thru 3 not present and with an MSDOS filesystem in partition 4.
I use them the way they come out of the box for MSDOS use.

I also use this disk for ext2 filesystems.  I usually repartition
a disk cartridge so that partition 1 is present instead of partition 4,
and put an ext2 filesystem in partition 1.

So, to mount a disk cartridge, I usually say one of the following:

    mount -t msdos /dev/sdc4 /mnt
    mount -t ext2 /dev/sdc1 /mnt

This works fine for the initial mount of this disk, and works just
fine if I unmount and remount disks of the same type.  However, if
I unmount an MSDOS disk and try to mount an ext2 disk, mount(1)
fails with the message:

    mount: /dev/sdc1 is not a valid block device

and I get a similar failure message for /dev/sdc4 when trying to
mount an MSDOS disk after I've unmounted an ext2 disk.

Apparently the partition table info is kept cached somewhere in the
kernel, and mount requests use this cached info instead of re-reading
the partition table from the disk.

I report this as a mount(1) problem instead of a kernel problem
because I've noticed that I can clear the problem by running

    fdisk /dev/sdc

and then exiting fdisk.  If I do this in between the unmount of a
cartridge with one partition present and the mount of a cartridge
with another partition present, the mount succeeds.  Apparently
fdisk(1) causes the partition information to be re-read from the
disk.

I'm suggesting that mount(1) should also re-read the partition
information from the disk.  It should either do this all the time,
or it should do it after a mount failure, then retrythe mount request 
before considering the failure to be a hard one and reporting it.

mitchell@mdd.comm.mot.com (Bill Mitchell)



Message sent:


From: iwj@cam-orl.co.uk (Ian Jackson)
To: Bill Mitchell <mitchell@mdd.comm.mot.com>
Subject: Bug#379: Acknowledgement (was: Repeatable mount(1) problem with removable disks)
In-Reply-To: <Pine.SUN.3.90.950204104141.3198E-100000@bb29c>
References: <Pine.SUN.3.90.950204104141.3198E-100000@bb29c>

Thank you for the problem report you have sent regarding Debian GNU/Linux.
This is an automatically generated reply, to let you know your message has
been received.  It is being forwarded to the developers' mailing list for
their attention; they will reply in due course.

If you wish to submit further information on your problem, please send
it to debian-bugs@pixar.com, but please ensure that the Subject
line of your message starts with "Bug#379" or "Re: Bug#379" so that
we can identify it as relating to the same problem.

Please do not to reply to the address at the top of this message,
unless you wish to report a problem with the bug-tracking system.

Ian Jackson
(maintainer, debian-bugs)


Message sent to debian-devel@pixar.com:


Subject: Bug#379: Repeatable mount(1) problem with removable disks
Reply-To: Bill Mitchell <mitchell@mdd.comm.mot.com>, debian-bugs-done@pixar.com
Resent-To: debian-devel@pixar.com
Resent-From: Bill Mitchell <mitchell@mdd.comm.mot.com>
Resent-Sender: iwj10@cus.cam.ac.uk
Resent-Date: Sat, 04 Feb 1995 18:48:05 GMT
Resent-Message-ID: <debian-bugs-handler.379.02041846278127@pixar.com>
X-Debian-PR-Package: mount
X-Debian-PR-Keywords: 
Received: via spool for debian-bugs; Sat, 04 Feb 1995 18:48:05 GMT
Received: with rfc822 via encapsulated-mail id 02041846278127;
          Sat, 04 Feb 1995 18:46:27 GMT
Received: from pixar.com by mongo.pixar.com with smtp
	(Smail3.1.28.1 #15) id m0rapTz-0002piC; Sat, 4 Feb 95 10:45 PST
Received: from motgate.mot.com by pixar.com with SMTP id AA24564
  (5.65c/IDA-1.4.4 for <debian-bugs@pixar.com>); Sat, 4 Feb 1995 10:45:54 -0800
Received: from pobox.mot.com by motgate.mot.com with SMTP (5.67b/IDA-1.4.4/MOT-3.1 for <debian-bugs@pixar.com>)
          id AA28632; Sat, 4 Feb 1995 12:45:18 -0600
Received: from mdd.comm.mot.com (mdisea.mdd.comm.mot.com) by pobox.mot.com with SMTP (5.67b/IDA-1.4.4/MOT-3.1 for <debian-bugs@pixar.com>)
          id AA05388; Sat, 4 Feb 1995 12:45:17 -0600
Received: from bb29c.mdd.comm.mot.com by mdd.comm.mot.com (4.1/SMI-4.1)
	id AA01421; Sat, 4 Feb 95 10:45:16 PST
Received: by bb29c.mdd.comm.mot.com (4.1/SMI-4.1)
	id AA03215; Sat, 4 Feb 95 10:45:14 PST
Date: Sat, 4 Feb 1995 10:45:13 -0800 (PST)
From: Bill Mitchell <mitchell@mdd.comm.mot.com>
X-Sender: mitchell@bb29c
To: debian-bugs@pixar.com
In-Reply-To: <Pine.SUN.3.90.950204100804.3156A-100000@bb29c>
Message-Id: <Pine.SUN.3.90.950204104141.3198E-100000@bb29c>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII


PACKAGE: mount
VARSION: 1.10
PACKAGE_REVISION: 4 (and later?)

One of the devices on my system is a removeable cartridge disk drive.
I have this on /dev/sdc.

The disk cartridges come preformatted for MSDOS, with partitions
1 thru 3 not present and with an MSDOS filesystem in partition 4.
I use them the way they come out of the box for MSDOS use.

I also use this disk for ext2 filesystems.  I usually repartition
a disk cartridge so that partition 1 is present instead of partition 4,
and put an ext2 filesystem in partition 1.

So, to mount a disk cartridge, I usually say one of the following:

    mount -t msdos /dev/sdc4 /mnt
    mount -t ext2 /dev/sdc1 /mnt

This works fine for the initial mount of this disk, and works just
fine if I unmount and remount disks of the same type.  However, if
I unmount an MSDOS disk and try to mount an ext2 disk, mount(1)
fails with the message:

    mount: /dev/sdc1 is not a valid block device

and I get a similar failure message for /dev/sdc4 when trying to
mount an MSDOS disk after I've unmounted an ext2 disk.

Apparently the partition table info is kept cached somewhere in the
kernel, and mount requests use this cached info instead of re-reading
the partition table from the disk.

I report this as a mount(1) problem instead of a kernel problem
because I've noticed that I can clear the problem by running

    fdisk /dev/sdc

and then exiting fdisk.  If I do this in between the unmount of a
cartridge with one partition present and the mount of a cartridge
with another partition present, the mount succeeds.  Apparently
fdisk(1) causes the partition information to be re-read from the
disk.

I'm suggesting that mount(1) should also re-read the partition
information from the disk.  It should either do this all the time,
or it should do it after a mount failure, then retrythe mount request
before considering the failure to be a hard one and reporting it.

mitchell@mdd.comm.mot.com (Bill Mitchell)




Ian Jackson / iwj10@thor.cam.ac.uk, with the debian-bugs tracking mechanism
This page last modified 07:43:01 GMT Wed 01 Nov