Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > uk.comp.os.linux > #20304 > unrolled thread

Does it need fsck?

Started byHuge <Huge@nowhere.much.invalid>
First post2016-10-23 15:32 +0000
Last post2016-10-24 09:05 +0100
Articles 4 — 3 participants

Back to article view | Back to uk.comp.os.linux


Contents

  Does it need fsck? Huge <Huge@nowhere.much.invalid> - 2016-10-23 15:32 +0000
    Re: Does it need fsck? Huge <Huge@nowhere.much.invalid> - 2016-10-23 17:30 +0000
    Re: Does it need fsck? Jim Price <d1version@hotmail.com> - 2016-10-23 19:11 +0100
      Re: Does it need fsck? Theo <theom+news@chiark.greenend.org.uk> - 2016-10-24 09:05 +0100

#20304 — Does it need fsck?

FromHuge <Huge@nowhere.much.invalid>
Date2016-10-23 15:32 +0000
SubjectDoes it need fsck?
Message-ID<e743g4Fjmf2U1@mid.individual.net>
I do my backups to SATA disks plugged into a USB dock, which works
perfectly well for my purposes. However, the system reports that the
backup disks require fsck (if indeed they do) when they are (auto)mounted,
but only in /var/log/kern.log. I'd like to incorporate that functionality
in my backup script (which I wrote).

Before I sit down and do that (probably by parsing the output from
dumpe2fs), does anyone know if there's a standard utility that will
tell me if USB disks require fsck?


-- 
Today is Sweetmorn, the 4th day of The Aftermath in the YOLD 3182
                  I don't have an attitude problem.
    If you have a problem with my attitude, that's your problem.

[toc] | [next] | [standalone]


#20305

FromHuge <Huge@nowhere.much.invalid>
Date2016-10-23 17:30 +0000
Message-ID<e74ad2Fjmf2U3@mid.individual.net>
In reply to#20304
On 2016-10-23, Huge <Huge@nowhere.much.invalid> wrote:
> I do my backups to SATA disks plugged into a USB dock, which works
> perfectly well for my purposes. However, the system reports that the
> backup disks require fsck (if indeed they do) when they are (auto)mounted,
> but only in /var/log/kern.log. I'd like to incorporate that functionality
> in my backup script (which I wrote).
>
> Before I sit down and do that (probably by parsing the output from
> dumpe2fs), does anyone know if there's a standard utility that will
> tell me if USB disks require fsck?

Hmmm. I wonder if "fsck -N /dev/sdd1" will do the trick? Can't test
it right now - I've "borrowed" the SATA dock to back up the Mac.


-- 
Today is Sweetmorn, the 4th day of The Aftermath in the YOLD 3182
                  I don't have an attitude problem.
    If you have a problem with my attitude, that's your problem.

[toc] | [prev] | [next] | [standalone]


#20306

FromJim Price <d1version@hotmail.com>
Date2016-10-23 19:11 +0100
Message-ID<nuiugd$743$1@dont-email.me>
In reply to#20304
On 23/10/16 16:32, Huge wrote:
> I do my backups to SATA disks plugged into a USB dock, which works
> perfectly well for my purposes. However, the system reports that the
> backup disks require fsck (if indeed they do) when they are (auto)mounted,
> but only in /var/log/kern.log. I'd like to incorporate that functionality
> in my backup script (which I wrote).
>
> Before I sit down and do that (probably by parsing the output from
> dumpe2fs), does anyone know if there's a standard utility that will
> tell me if USB disks require fsck?

The standard utility is fsck. When used without arguments other than the 
filesystem on which to run its checks, the exit code tells you whether 
you need to give things further attention. Exit codes are:

0 – No errors
1 – Filesystem errors corrected
2 – System should be rebooted
4 – Filesystem errors left uncorrected
8 – Operational error
16 – Usage or syntax error
32 – Fsck canceled by user request
128 – Shared-library error

dumpe2fs can be used to check whether a filesystem has reached a mount 
count which would schedule an fsck at the next reboot, but that is not 
telling you anything about the actual state of the filesystem, just the 
number of mounts it has been through.

I don't know off the top of my head if any of the above is different for 
USB mounted filesystems. Also, it is normal to run fsck on an  unmounted 
filesystem (a consideration for your script if you are using an 
automounter).

-- 
    ╔═╦═╦═════╦═══╗
    ║ ║ ║     ║   ║
  ╔═╝ ║ ║ ║ ║ ║ ╔═╝
  ╚═══╩═╩═╩═╩═╩═╝  -- JimP.

[toc] | [prev] | [next] | [standalone]


#20308

FromTheo <theom+news@chiark.greenend.org.uk>
Date2016-10-24 09:05 +0100
Message-ID<Pwn*Ya3aw@news.chiark.greenend.org.uk>
In reply to#20306
Jim Price <d1version@hotmail.com> wrote:
> I don't know off the top of my head if any of the above is different for 
> USB mounted filesystems. Also, it is normal to run fsck on an  unmounted 
> filesystem (a consideration for your script if you are using an 
> automounter).

There's nothing special about USB.  It's Just Another Filesystem, however
you happen to have connected it.

Theo

[toc] | [prev] | [standalone]


Back to top | Article view | uk.comp.os.linux


csiph-web