Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #205544
| From | "Thomas Schmitt" <scdbackup@gmx.net> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: Can't scan new disk |
| Date | 2019-02-20 11:30 +0100 |
| Message-ID | <xtxiy-8B-3@gated-at.bofh.it> (permalink) |
| References | <xtwFP-88J-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi,
Mark Allums wrote:
> The disk is not mounted.
At least not from the perception of e2fsck, indeed, or else it would say
"%s is mounted.\n"
instead of
"%s is in use.\n"
See
https://sources.debian.org/src/e2fsprogs/1.44.5-1/e2fsck/unix.c/?hl=269#L269
(found by
https://codesearch.debian.net/search?q=package%3Ae2fsprogs+is+in+use
)
If i understand the code correctly, the program gets to that spot because
condition
if ((!(ctx->mount_flags & (EXT2_MF_MOUNTED | EXT2_MF_BUSY))) ||
is not true. It says "is in use", because
if (ctx->mount_flags & EXT2_MF_MOUNTED)
is not true. I.e. (ctx->mount_flags & EXT2_MF_BUSY) is true.
I bet that it is about open(2)/fcntl(2) flag O_EXCL, because of
https://codesearch.debian.net/search?q=package%3Ae2fsprogs+EXT2_MF_BUSY
https://sources.debian.org/src/e2fsprogs/1.44.5-1/lib/ext2fs/ismounted.c/?hl=415#L410
where i see
int fd = open(device, O_RDONLY | O_EXCL);
if (fd >= 0)
close(fd);
else if (errno == EBUSY)
*mount_flags |= EXT2_MF_BUSY;
O_EXCL has a special meaning with Linux device files. It works as advisory
locking with this file type only. In the context of mounting, a failure
with O_EXCL and success without that flag instructs the mounter to mount
read-only. In the context of CD burning, it tells an interested drive
groping program (except mount(8)) to leave the drive alone. Even cdrecord
joined that party.
So one should hop back to the sub-thread where open file pointers to
/dev/sdb1 were the main suspects.
fcntl(2) would be able to inquire the O_EXCL flag by command F_GETFL,
but it needs the file descriptor which is an integer number in the context
of the using process. Dunno whether it is possible to inquire this from
another process.
Have a nice day :)
Thomas
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Can't scan new disk Mark Allums <mark@allums.email> - 2019-02-16 00:30 +0100
Re: Can't scan new disk deb <deb@rangingthoughts.org> - 2019-02-16 01:10 +0100
Re: Can't scan new disk Mark Allums <mark@allums.email> - 2019-02-16 02:50 +0100
Re: Can't scan new disk songbird <songbird@anthive.com> - 2019-02-16 01:30 +0100
Re: Can't scan new disk Mark Allums <mark@allums.email> - 2019-02-16 02:50 +0100
Re: Can't scan new disk David Christensen <dpchrist@holgerdanske.com> - 2019-02-16 04:20 +0100
Re: Can't scan new disk Mark Allums <mark@allums.email> - 2019-02-16 21:40 +0100
Re: Can't scan new disk David Christensen <dpchrist@holgerdanske.com> - 2019-02-16 23:20 +0100
Re: Can't scan new disk Mark Allums <mark@allums.email> - 2019-02-18 04:20 +0100
Re: Can't scan new disk David Christensen <dpchrist@holgerdanske.com> - 2019-02-19 00:40 +0100
Re: Can't scan new disk Celejar <celejar@gmail.com> - 2019-02-19 19:00 +0100
Re: Can't scan new disk David Christensen <dpchrist@holgerdanske.com> - 2019-02-20 03:50 +0100
Re: Can't scan new disk Celejar <celejar@gmail.com> - 2019-02-20 04:30 +0100
Re: Can't scan new disk David Christensen <dpchrist@holgerdanske.com> - 2019-02-20 06:30 +0100
Re: Can't scan new disk Celejar <celejar@gmail.com> - 2019-02-20 14:20 +0100
Re: Can't scan new disk Curt <curty@free.fr> - 2019-02-16 09:50 +0100
Re: Can't scan new disk Mark Allums <mark@allums.email> - 2019-02-16 21:30 +0100
Re: Can't scan new disk "Alexander V. Makartsev" <avbetev@gmail.com> - 2019-02-18 06:10 +0100
Re: Can't scan new disk Mark Allums <mark@allums.email> - 2019-02-20 07:20 +0100
Re: Can't scan new disk Curt <curty@free.fr> - 2019-02-20 10:30 +0100
Re: Can't scan new disk Mark Allums <mark@allums.email> - 2019-02-20 10:30 +0100
Re: Can't scan new disk Curt <curty@free.fr> - 2019-02-20 11:30 +0100
Re: Can't scan new disk "Alexander V. Makartsev" <avbetev@gmail.com> - 2019-02-20 10:30 +0100
Re: Can't scan new disk Mark Allums <mark@allums.email> - 2019-02-20 10:50 +0100
Re: Can't scan new disk "Thomas Schmitt" <scdbackup@gmx.net> - 2019-02-20 11:30 +0100
Re: Can't scan new disk Curt <curty@free.fr> - 2019-02-20 13:20 +0100
Re: Can't scan new disk Mark Allums <mark@allums.email> - 2019-02-24 15:50 +0100
Re: Can't scan new disk David Christensen <dpchrist@holgerdanske.com> - 2019-02-24 21:30 +0100
Re: Can't scan new disk David Wright <deblis@lionunicorn.co.uk> - 2019-02-24 23:10 +0100
Re: Can't scan new disk David Christensen <dpchrist@holgerdanske.com> - 2019-02-25 01:10 +0100
Re: Can't scan new disk Linux-Fan <Ma_Sys.ma@web.de> - 2019-02-25 12:40 +0100
Re: Can't scan new disk Mark Allums <mark@allums.email> - 2019-02-25 15:20 +0100
Re: Can't scan new disk Curt <curty@free.fr> - 2019-02-25 15:50 +0100
Re: Can't scan new disk Mark Allums <mark@allums.email> - 2019-02-25 16:00 +0100
Re: Can't scan new disk David Wright <deblis@lionunicorn.co.uk> - 2019-02-25 16:30 +0100
Re: Can't scan new disk <tomas@tuxteam.de> - 2019-02-26 09:30 +0100
Re: Can't scan new disk David Wright <deblis@lionunicorn.co.uk> - 2019-02-24 23:10 +0100
Re: Can't scan new disk "Alexander V. Makartsev" <avbetev@gmail.com> - 2019-02-25 20:20 +0100
Re: Can't scan new disk Jude DaShiell <jdashiel@panix.com> - 2019-02-20 18:40 +0100
csiph-web