Re: How I scan, was Re: xsane can't see Brother ADS-2700W scanner

2021-04-01 Thread David Pottage

On 2021-03-31 22:05, Stefan Monnier wrote:

Scanning the output to a server just seems plain obvious to me.
What's the downside?


It has its advantages, indeed.  On the downsides:

- the scanner usually has a very limited UI, making it
  difficult/inconvenient (if at all possible) to control and select the
  scanning options, compared to the comfort of a large screen.

- scanning to a server implies allowing the scanner device write access
  to a server, which either implies the users authenticating themselves
  on the scanner itself (which is rather problematic and is compounded
  with the previous downside), or making the scan result land on an
  "anonymous" area where anyone can see what anyone else scans.

- It usually means you're stuck with the functionality that the
  manufacturer decided to include in the scanner's software stack,
  because it's always proprietary or "walled" (it may contain Free
  Software for all I know, but I can't access nor modify the code).

The option I favour is that the scan is controlled by your own 
computer,

but you can trigger new scans by hitting buttons on the scanner
(i.e. the button-presses get sent to your computer who then decides
what action to take in response to them), so that you can comfortably
setup the scan parameters on your computer and then you can comfortably
scan the various documents without having to go back to your computer
between them.


Sounds like we have yet another use for a Raspberry Pi or similar small 
and cheap computer.


Hook it up to a dumb USB scanner, the local network and a touch screen.

Users can walk up, put their originals in the scanner, and use a much
richer UI to chose their scanning options. The scans are emailed to them
in their preferred file format using the email address they gave when
they authenticated.

I wonder if such an open source project already exists?

--
David Pottage



Re: Replace a failed block device with null PV in an LVM VG

2021-03-24 Thread David Pottage

On 2021-03-24 12:37, Reco wrote:

Hi.

On Wed, Mar 24, 2021 at 10:26:49AM +, David Pottage wrote:

Is there a way to assemble the VG and mount those ext4 filesystems in
such a way that read attempts from the missing PV will return zeros,
but the rest of the filesystem will work?


Try this:

vgchange --activationmode partial -ay
lvs
# immediately dump logical volume in question somewhere with cat/dd
cat /dev// > lv.img
vgchange -an 
# run fsck -f on a copy of logical volume
fsck -f lv.img
# try mounting it
mount -o loop lv.img /



Thanks, that partly worked. It was an older version of LVM2, so I had to 
modify the command line syntax to "vgchange --partial -ay "


I was then able to mount the damaged volumes and get back nearly half of 
the lost files. I had a separate record of SHA1 checksums of all the 
lost files and all the recovered files have been checked and are 
undamaged.


Thanks for your help.

--
David Pottage



Replace a failed block device with null PV in an LVM VG

2021-03-24 Thread David Pottage

Hello,

At work, there is a fileserver with a failed external drive enclosure. I 
am attempting to recover some data that is probably not on the failed 
drives.


This file server started out with 36 internal drives (in three RAID-6 
arrays) that formed the initial 3 physical volumes to an LVM volume 
group. In that LVM I created 16 of logical volumes (all where 5Tb in 
size), formatted each with ext4, and stored a huge number of smallish 
files. That was about 9 years ago.


Over the years, as more disc space was needed, 5 external RAID drive 
enclosures where added of varying capacity between 30 and 90Tb. Each was 
added to the LVM VG as another physical volume, and the existing logical 
volumes where expanded to fill the additional available space, and the 
ext4 filesystems where resized to use the expanded volumes till they 
where each 15Tb in size.


Now one of those external drive enclosures with 42Tb of capacity has 
failed. The data centre technician tells me that it has 28 drive bays, 
and 15 of those drives are flashing angry red lights, so recovery is 
unlikely


Most of the data on that file server is already backed up elsewhere, but 
I have been told that there are about 50,000 files that where somehow 
not backed up, and could I try to get them back.


The missing files are the oldest, and would have been on the original 
good drives, but I can't mount the ext4 filesystems because the LVM 
cannot assemble the VG because one of the physical volumes is missing.


Is there a way to assemble the VG and mount those ext4 filesystems in 
such a way that read attempts from the missing PV will return zeros, but 
the rest of the filesystem will work? Perhaps by creating a virtual 
block device with the correct capacity and UUID, or by special LVM 
commands?


How will ext4 behave if some parts of it's underlying block device 
return zeros on read?


I know that this is a last ditch data recovery effort. Is it likely to 
work?


--
David Pottage

Re: Markdown previewer

2021-03-17 Thread David Pottage

On 2021-03-17 06:30, Victor Sudakov wrote:

Dear Colleagues,

Can you please advise a good GUI Markdown previewer?

Many editors (vim, mousepad) can highlight Markdown syntax, but it's a
different matter. I'd like the previewer to display rendered Markdown
nicely with fonts, hyperlinks, numbered lists etc.


If you don't hate Microsoft, then I have found that the the markdown 
editor plugin for VSCode works very nicely. You get two side by side 
panes, one a monospace text editor for the markdown with syntax 
highlighting, and next to it a live preview of rendered markdown. The 
editor includes a syntax checker.


To view my markdown, I added mod-markdown [1] to my Apache2 setup.

[1] https://github.com/hamano/apache-mod-markdown

--
David Pottage



Re: Sharing a scanner from a Buster system

2021-03-05 Thread David Pottage

On 2021-03-04 23:38, John Boxall wrote:

I have been trying for some time to setup a system that will share an
attached scanner over the network. I had hoped to use Buster as it is
still the stable instance of Debian. I have followed everything in [1]
but I could never get it to work. I then tried Bullseye and it worked
right away. Today I decided to install a clean NETINST image of each
and repeat the "server" steps as outlined at [1].

Even though the howto states that it covers Debian from versions 8 to
11, I could not get it to work on Buster (10). The process failed on
Buster, again, even though scanimage on the system saw the USB scanner
(Epson Perfection 2480 Photo). I then installed Bullseye. The exact
same process and the very same saned.conf file worked immediately.

The client was the same in both cases (Buster).

Is there a tweak that I am missing? Has there been a change that isn't
in Buster but has made it to Bullseye? Any recommendations on debug
steps would be appreciated?


I suspect the tweak you are missing is the permissions on the scanner 
device so that the saned daemon can access it.


I have a network shared scanner on my Debian buster system (With an 
Ubuntu client), and had trouble getting it to work.


Firstly, make sure can you access the scanner locally as root, and can 
scan an image via the command line.


Then you need to set the ACL permissions on your scanner so that the 
username 'scanner' that the saned daemon uses can access the device in 
order to share it over the network. The Debian docs [2] for a scanner 
have the necessary commands to identify your scanner on the USB bus, and 
set the ACL on it.


For my scanner, the command I used was:

setfacl -m g:scanner:rw- /dev/bus/usb/003/002

Your scanner is probably connected to a different USB socket, so for you 
the command will be different.


Then restart the saned daemon, and test connectivity from your client 
machine.


If that works then you need to make the change permanent (otherwise it 
will be lost when you reboot). For that you will need to add a custom 
udev rule so that the kernel will recognise the device as a scanner 
during boot up device enumeration or when you connect it. The notes on 
how to do this came from the Arch Linux wiki. [3]


From the sane-find-scanner output, make a note of the Device id & vendor 
id for your scanner, and then prepare a new udev rule file:


/etc/udev/rules.d/49-sane-missing-scanner.rules

Mine contains the identification for my scanner (HP ScanJet 3300c), 
Yours will be different:


ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="0205", MODE="0664", 
GROUP="scanner", ENV{libsane_matched}="yes"



I hope this solves your problem. I struggled with that exact issue a 
couple of months ago, and I know how frustrating it can be.


[2] https://wiki.debian.org/Scanner
[3] https://wiki.archlinux.org/index.php/SANE#Permission_problem


--
David Pottage