Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-20 Thread Thomas Schmitt
Hi,

Max Nikulin wrote:
> I admit "dithering" may be incorrect term, [...]
> Consider 2 squares having size of 2.5×2.5 pixels. Non-even sizes and fuzzy
> lines variants:
> █████
> ██████
> ████ ██
>██ ██
>█████
> Second variant might have sense if an image is treated as a photo unlikely
> having regular patterns with horizontal and vertical lines.

I see ...
The second rendering style is probably best described as "Bad Distortion".


Have a nice day :)

Thomas



Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-20 Thread Max Nikulin

On 20/03/2024 01:51, Thomas Schmitt wrote:

Max Nikulin wrote:

When vector graphics, that does not match device resolution, is rasterized,
the result is either non-even sizes of similar elements or fuzzy lines due
to dithering.


Nitpicking:

"Dithering" in raster graphics is emulation of color resolution at the
expense of space resolution.

[...]


The fuzzy lines are rather the opposite. They use surplus color
resolution to emulate ibetter spacial resolution. Over here the usual
term is "Anti-aliasing".


I admit "dithering" may be incorrect term, but I am in doubts if that 
printer (claimed to have 300dpi resolution, but not suitable for QR 
codes) has surplus color resolution. I do not mean anti-aliasing in the 
sense of adjusting pixels darkness (and color).


Consider 2 squares having size of 2.5×2.5 pixels. Non-even sizes and 
fuzzy lines variants:


█████
██████
████ ██
   ██ ██
   █████

Second variant might have sense if an image is treated as a photo 
unlikely having regular patterns with horizontal and vertical lines.




Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-19 Thread Thomas Schmitt
Hi,

Max Nikulin wrote:
> When vector graphics, that does not match device resolution, is rasterized,
> the result is either non-even sizes of similar elements or fuzzy lines due
> to dithering.

Nitpicking:

"Dithering" in raster graphics is emulation of color resolution at the
expense of space resolution. Multiple coarsly colored pixels together
create the impression of a finer color tone. A certain random aspect is
added to prevent unwanted patters.
  https://en.wikipedia.org/wiki/Dither

The fuzzy lines are rather the opposite. They use surplus color
resolution to emulate ibetter spacial resolution. Over here the usual
term is "Anti-aliasing".
  https://en.wikipedia.org/wiki/Line_drawing_algorithm
  https://www.geeksforgeeks.org/antialiasing/
I get a suspiciously high share of german language results when
searching this term in the web. But "Computer Grapics" by Foley, Van Dam,
Feiner, Hughes of 1990 has a dozen occurences in its Index.


Have a nice day :)

Thomas



Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-19 Thread Max Nikulin

On 13/03/2024 12:25, hw wrote:

On Mon, 2024-03-11 at 23:45 +0700, Max Nikulin wrote:

It seems you expect some number that you can use for any QR code. There
is no size that fits for all codes.


It's because you said: "I believed that 300dpi is high enough
resolution for QR-codes of reasonable size if source image has proper
quality." that I keep asking what you consider a reasonable size.


QR codes with more modules must be printed at larger size. Isn't it obvious?

By the way, is 300dpi real resolution of your printer or it is 
over-resolution achieved with overstrike with some offset? If so, does 
the printer driver take it into account?



Out of curiosity I tried to scan a QR code printed on a thermal printer
(so likely having ~200dpi resolution) having size of approximately 0.8in
and 50 pixels (modules) per inch. It encodes a 69 bytes long link.


Did you successfully scan it?


Instantly, no trouble at all.


It limits amount of information you may put into QR codes. You can still
choose to use e.g. 4,5,6, etc. printer dots per QR code module.


How can I choose that?  I don't know that there would be an option
with pdflatex or pdf or the printer driver that would let me choose
how many dots per module the printer puts onto the label.


When a code is generated you can look at it and count its modules. The 
next step is simple math. You have resolution, dots per module and 
number of modules, so you can get size and rerun LaTeX.



When I zoom in on QR-codes in a PDF viewer, they don't get blurry.
Perhaps the pst-barcode package uses vector graphics?


Nice, however you have to adjust size to avoid blurring.


How do you mean?  I thought vector graphics don't blur when scaled.


When vector graphics, that does not match device resolution, is 
rasterized, the result is either non-even sizes of similar elements or 
fuzzy lines due to dithering.


If a few multiplications and divisions is so hard problem and each QR 
code module occupy at least 3x3=9 printer dots then I would try to 
rotate the code by e.g. 30 or 45 degrees before printing.





Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-14 Thread jeremy ardley



On 14/3/24 17:47, jeremy ardley wrote:
For reference on a 203 DPI (8 dots per mm) printer, a GS1-128 barcode 
takes up 12 modules per character. The minimum size of a module is 1 
pixel so 1 character is 12 pixels wide or 1.2mm on a 203 dpi printer.


Assuming a 40 character barcode at 1 pixel per module, it will span 48mm.

However it is very unusual to have 1 pixel per module. Instead at 2 
pixels per module the barcode is 96mm and at 3 pixels it will be 144mm



My error; The character spacing is 1.5mm at 203dpi. So 40 characters is 
60mm at 1 pixel per module, 120mm at 2 pixels per module, and 180mm at 3 
pixels per module. This means for a 40 character barcode you can at best 
print at 2 pixels per module on a typical 100x150m shipping label. This 
allows for no errors in quantization of pixel sizes and It's really hard 
to do with a printing system that does not start and continue with 
accurate pixel registration.




Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-14 Thread jeremy ardley



On 14/3/24 06:59, hw wrote:

Manufacturers can provide CUPS drivers as well, but the barcode
application is usually only windows.

In my case I had to write my own CUPS driver as the manufacturer does
not provide one.

How did you do that?


It is simply a C program that gets given some parameters and a bitmap by 
CUPS


The program processes the bitmap and frames it with printer commands to 
place the bitmap on the printer page.


CUPS abstracts the actual device interface (in my case USB). But in 
development I wrote the code to send commands directly to the USB device





Getting back to pixel registration, the latex CUPS route is very
unlikely to work well.

It's working great here since years.  Barcodes are no problem, only qr
codes can't be scanned.



This surprises me greatly. 2D codes have very large features compared to 
barcodes. They should be relatively immune to pixel quantization.


For reference on a 203 DPI (8 dots per mm) printer, a GS1-128 barcode 
takes up 12 modules per character. The minimum size of a module is 1 
pixel so 1 character is 12 pixels wide or 1.2mm on a 203 dpi printer.


Assuming a 40 character barcode at 1 pixel per module, it will span 48mm.

However it is very unusual to have 1 pixel per module. Instead at 2 
pixels per module the barcode is 96mm and at 3 pixels it will be 144mm


With the barcode you have no leeway in the pixel sizes. You must have it 
exact to scan.


In comparison, a QR code typically will have modules 8 pixels square and 
typically is 26x26 or 32x32 pixels. At 26x26  the printed code is 26mm 
square at 203dpi. You can afford to be out by a pixel at those dimensions.


If you have problems scanning QR codes at those sizes perhaps your QR 
codes are invalid to start with? If you print them out really large will 
they scan?




Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-13 Thread hw
On Wed, 2024-03-13 at 03:50 +0800, jeremy ardley wrote:
> On 12/3/24 21:21, hw wrote:
> > 
> > Even if they did that, it would be totally useless because it won't be
> > able to automatically print labels from databases.
> 
> The manufacturer applications  usually allow you to print a list from a 
> spreadsheet or text file.

That isn't very useful.

> > > It is possible to use document generation tools like latex and printing
> > > systems like CUPS to print a label, but pixel registration will be poor.
> > Why?  The manufacturer provided a CPUS printer driver without which
> > printing wouldn't be possible at all.
> 
> Most custom barcodes programs run on windows and don't use CUPS.

That makes them entirely useless.

> Manufacturers can provide CUPS drivers as well, but the barcode 
> application is usually only windows.
> 
> In my case I had to write my own CUPS driver as the manufacturer does 
> not provide one.

How did you do that?

> Getting back to pixel registration, the latex CUPS route is very 
> unlikely to work well.

It's working great here since years.  Barcodes are no problem, only qr
codes can't be scanned.



signature.asc
Description: This is a digitally signed message part


Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-13 Thread Max Nikulin

On 13/03/2024 02:50, jeremy ardley wrote:
Getting back to pixel registration, the latex CUPS route is very 
unlikely to work well.


TeX with MetaFont fonts worked well with low resolution dot matrix 
printers. Rasterized fonts may be generated for specified resolution. It 
should be still possible unless wide Unicode coverage is required.


I may be wrong, but I have impression that better support of modern 
vector fonts (TTF, OTF, etc.) in LuaTeX has other side. HurfBuz font 
library with priority to speed can not align characters to specified 
pixel grid. Likely nobody cares concerning font hints for low resolution 
devices.


Scale and position of images like QR codes should be adjusted to printer 
resolution.


More than a decade ago it was necessary to provide a document for 
archival purposes. I got a couple of complains: font with too thin lines 
and gray rather than black toner. The cartridge was refilled almost a 
dozen of times, but for routine documents quality was still good. 
CM-Super Type 1 font (converted from original Computer Modern with 
additions related to more scripts) really has hairlines. I configured 
metafont to increase minimal line width and generated a document with 
600dpi raster fonts using latex+dvips+ps2pdf instead of pdflatex. I went 
to a print shop nearby with hope to find there a printer filled with 
really black toner. The person there did not get the point why I was not 
satisfied looking into a test page from my document. It was blurry. 
Likely the page was scaled to printable area and dithering was applied. 
I preferred to go to another shop and got a stack of paper printed with 
proper quality. Either stuff there were a bit more experienced or 
default printer settings were more reasonable.


So it is not difficult to ruin efforts invested into print quality by 
inappropriate checkbox. The process is not fool-proof.




Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-13 Thread Florent Rougon
Florent Rougon  wrote:

>   - printer matrix alignment if printer resolution is low (more
> difficult; maybe try with some very small horizontal and veritical
> shifts to see if it helps...).

Thinking about it more, this is probably hopeless unless printer
resolution is *extremely* low. Typical printer dots are so small that
you can't realistically expect paper placement to have good enough
precision to align both grids (say, 1/4 of the printer dot size).

This is, I believe, what Jeremy meant when he wrote earlier in this
thread:

> Getting back to pixel registration, the latex CUPS route is very unlikely to
> work well. However a custom application that generates a pixel perfect bitmap
> that is printed at 100% scale through cups should work.

I agree with that if printer resolution is so low that the QR code and
printer dot grids have to be aligned. Even with perfect size in the PDF,
there is very little hope that paper will be every time correctly
aligned in the vertical and horizontal directions with the matrix of
dots managed by the printer—a dot at 300 dpi being approximately
0.08 mm. The only realistic hopes are:
  - high enough resolution that grid alignment doesn't really matter (is
300 dpi enough? Maybe.);
  - direct control over the printer bitmap (what Jeremy mentioned).

For the sake of completeness, the following LaTeX document (an inline
attachment) draws a QR code whose modules are correctly placed for some
“ideal” 300 dpi printer. This assumes that printer dots perfectly start
at a dot-size multiple from the top left corner of the physical page,
which probably can't be obtained in practice. So, this is mainly to show
how accurate placement and computations can be done (\fpeval is provided
by xfp; it is very accurate and expandable).

\documentclass{article}
\usepackage[papersize={50mm,35mm},margin=0cm]{geometry}
\usepackage{xfp}
\usepackage{qrcode}

\pagestyle{empty}
\newlength{\modulesize}
\setlength{\modulesize}{\fpeval{6/300}in}% assume 300 dpi, set 6 dots/module

\begin{document}

\noindent
\hspace{10\modulesize}% horizontal offset from paper edge: 10 modules
\raisebox{\dimexpr \topskip - \height - 10\modulesize}{% ditto in vert. direction
  \qrcode[height=25\modulesize, version=2]{Hey Debian-user!}}%
% The modules will have the expected size only if the QR code is effectively
% doable at version=2 (check the LaTeX terminal output). Indeed, version=2
% means 25×25 modules.

\end{document}

Regards

-- 
Florent


Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-13 Thread Florent Rougon
hw  wrote:

>> That is quite likely: the pst- prefix means this is PSTricks, which is
>> an oldish way of doing vector graphics with LaTeX. I tend to avoid
>> PSTricks these days as it is generally awkward to use in PDF contexts,
>> although there are various workarounds that often allow to do so.
>
> Is that bad?  It works great for what I'm doing.

Well, “bad” is a strong word in this context. ;-) First, PDF has been
replacing PostScript in the last 20+ years, so it is often easier to
find tools that do interesting things with PDF than with PostScript.

Second, regarding the existing workarounds that allow PSTricks code to
be used in PDF workflows: I haven't used many of them but AFAIK, most of
the times, if you want things to work automatically, you need to enable
\write18 which has security implications. In the most relaxed case, it
allows the compiled document, as well as any class or package it loads,
to run arbitrary shell commands. There is a restricted mode for \write18
(see -shell-restricted and “§5.5 Shell escapes” in `texdoc web2c`), but
it currently doesn't allow running ps2pdf:

,[ /usr/share/texmf/web2c/texmf.cnf ]
| shell_escape_commands = \
| bibtex,bibtex8,\
| extractbb,\
| gregorio,\
| kpsewhich,\
| makeindex,\
| memoize-extract.pl,\
| memoize-extract.py,\
| repstopdf,\
| r-mpost,\
| texosquery-jre8,\
| 
| % we'd like to allow:
| % dvips - but external commands can be executed, need at least -R1.
| % epspdf, ps2pdf, pstopdf - need to respect openout_any,
| %   and gs -dSAFER must be used and check for shell injection with filenames.
| ...
`

One of the problems with PostScript is that it is “too powerful” for
something that should only produce text and graphics—AIUI, security
concerns were not at the core of its design.

Finally, for a few things like transparency and “new” font formats
(e.g., TrueType, OpenType), PostScript is either a no-go or has
solutions that appeared very late, contrary to PDF.

>> The ubiquitous, powerful and modern way to do vector graphics in LaTeX
>> is PGF/TiKZ[1],
>
> That package has almost 1300 pages of documentation which doesn't seem
> to mention qr-codes or barcodes.

Right. Presumably, the qrcode package is good enough. BTW, since its
\qrcode command produces a TeX box without using any TikZ code, it can
be placed without restriction in a TikZ node (I say this because TikZ
nodes can't be nested—more precisely, doing so is not supported).

> I wonder why it uses different options for URLs and other data.  What
> difference does that make?

I believe you misunderstood the manual here, or maybe I don't understand
what you meant. The \qrcode command can encode both URLs and other text.
What I see is simply options (and the starred variant \qrcode*) to
decide whether to turn the QR codes into PDF hyperlinks.

Global switch at \usepackage level:  hyperlinks/nolinks
Local switch for each \qrcode command:   link/nolink

\qrcode*{…} == \qrcode[nolink]{…}

These options are provided because when the hyperref package is loaded,
QR codes are output as hyperlinks by default; however, it is quite
possible to write QR codes that don't encode URLs, in which case making
them hyperlinks would be confusing and useless.

> It might be worth a try for when I need to experiment with qr-codes on
> small labels again.  It might not work because I may need to place the
> qr-code in some way and it could conflict with other packages like the
> labels package ...  I even might have already tried it; it's been a
> few years and I don't remember exactly.

Since \qrcode outputs a TeX box without using any TikZ code, it has
about the highest level of “compatibility” you can expect in a TeX
document.

> Now I'm wondering why the qr-codes I printed with the label printer
> couldn't be reliably scanned.  When I look at [1] and [2], for the
> data I wanted to print (between 38 and 40 alphanumericals at L
> quality) I would have to use a version 2 qr code, i. e. 25x25 modules.
> I don't know how the modules transfer to dots, but assuming the
> minimum of 4 dots per module, it would take 25 x 4 dots, i. e. 100
> dots.  Each module would be 0.33mm in size which would require 25 x
> 0.33mm, i. e. 8.25mm for the size of the qr-code.
>
> I printed the qr-code much larger than that, about 1x1".  That is
> about three times as large as would be required, and the printer can
> print three times as many dots per inch as the 100 dots needed.
>
> So in theory, my theory that the resolution of the printer is too low
> can't be true.
>
> But why couldn't these qr-codes be scanned?  It shouldn't have been a
> problem at all.

L quality is the worst; can't you use a better one? Also worth
considering:

  - scanner limitation? Did you try to scan the codes with a smartphone?

  - printer matrix alignment if printer resolution is low (more
difficult; maybe try with some very small horizontal and veritical
shifts to see if it helps...).

Regards

-- 
Florent



Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-12 Thread hw
On Mon, 2024-03-11 at 23:45 +0700, Max Nikulin wrote:
> On 11/03/2024 08:06, hw wrote:
> > On Sun, 2024-03-10 at 09:50 +0700, Max Nikulin wrote:
> > > On 10/03/2024 04:41, hw wrote:
> > > > \psbarcode{textblah foo}{height=0.6 width=0.6 eclevel=L}{qrcode}
> > > > 
> > > > That works for 600dpi laser printers.  When you print the QR-code with
> > > > a 300dpi label printer you can't reliably scan it, not even when you
> > > > make the QR-code 1x1" in size.
> > > > 
> > > > Perhaps that's not a reasonable size?
> > > 
> > > Perhaps height and width are chosen improperly. An image some percents
> > > smaller may be sharper.
> > 
> > What size do you consider reasonable?
> 
> It seems you expect some number that you can use for any QR code. There 
> is no size that fits for all codes.

It's because you said: "I believed that 300dpi is high enough
resolution for QR-codes of reasonable size if source image has proper
quality." that I keep asking what you consider a reasonable size.

> Out of curiosity I tried to scan a QR code printed on a thermal printer 
> (so likely having ~200dpi resolution) having size of approximately 0.8in 
> and 50 pixels (modules) per inch. It encodes a 69 bytes long link. 
> Likely the same code scaled to 0.4in will still work, but I would prefer 
> to avoid it, 0.6in should be more reliable. On your 300dpi printer this 
> particular QR code may be printed e.g. at ~(0.8/1.5)in.

Did you successfully scan it?

> > [...]
> > The QR-code must fit on the label, plus some text.  The labels are
> > 50x35mm in size.
> 
> It limits amount of information you may put into QR codes. You can still 
> choose to use e.g. 4,5,6, etc. printer dots per QR code module.

How can I choose that?  I don't know that there would be an option
with pdflatex or pdf or the printer driver that would let me choose
how many dots per module the printer puts onto the label.

> > When I zoom in on QR-codes in a PDF viewer, they don't get blurry.
> > Perhaps the pst-barcode package uses vector graphics?
> 
> Nice, however you have to adjust size to avoid blurring.

How do you mean?  I thought vector graphics don't blur when scaled.



signature.asc
Description: This is a digitally signed message part


Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-12 Thread hw
On Mon, 2024-03-11 at 11:58 +0100, Florent Rougon wrote:
> Hi,
> 
> I haven't read the whole thread (sorry) but thought this might help.
> 
> hw  wrote:
> 
> > When I zoom in on QR-codes in a PDF viewer, they don't get blurry.
> > Perhaps the pst-barcode package uses vector graphics?
> 
> That is quite likely: the pst- prefix means this is PSTricks, which is
> an oldish way of doing vector graphics with LaTeX. I tend to avoid
> PSTricks these days as it is generally awkward to use in PDF contexts,
> although there are various workarounds that often allow to do so.

Is that bad?  It works great for what I'm doing.

> The ubiquitous, powerful and modern way to do vector graphics in LaTeX
> is PGF/TiKZ[1],

That package has almost 1300 pages of documentation which doesn't seem
to mention qr-codes or barcodes.

> however this is not even necessary for QR codes, because
> [...]

good :)

> I've played with a different package for producing QR codes in LaTeX,
> which uses the aforementioned \hrule and \vrule primitives: qrcode. Its
> manual is here (follow the “Package documentation” link):
> 
>   https://ctan.org/pkg/qrcode

I wonder why it uses different options for URLs and other data.  What
difference does that make?

> Here is a simple example you can compile with pdflatex:
> 
> \documentclass{article}
> \usepackage{qrcode}
> 
> \pagestyle{empty}
> 
> \begin{document}
> 
> \noindent
> % \qrset affects \qrcode commands in the current group. You can use it
> % to factor out options used for several QR codes.
> \qrset{nolinks, padding}% add padding to make sure the codes are 
> “legal”/readable
> \qrcode[version=1]{Hey Debian-user!}% Can't do version=1 with level=M or more
> \qrcode[level=L, version=1]{Hey Debian-user!}% Less redundancy but is doable
> 
> \end{document}
> 
> Note the terminal output:
> 
> 
> 
>  Version increased to '2' to fit text.>
> 
> 
>  calculated.>
> 
> 
> 
> 
>  calculated.>
> 

It might be worth a try for when I need to experiment with qr-codes on
small labels again.  It might not work because I may need to place the
qr-code in some way and it could conflict with other packages like the
labels package ...  I even might have already tried it; it's been a
few years and I don't remember exactly.

> [...]
> But with low printer resolution constraints, who knows?).
> 
> Hope this helps!

Yes, thanks, knowing about these packages can be useful.

Now I'm wondering why the qr-codes I printed with the label printer
couldn't be reliably scanned.  When I look at [1] and [2], for the
data I wanted to print (between 38 and 40 alphanumericals at L
quality) I would have to use a version 2 qr code, i. e. 25x25 modules.
I don't know how the modules transfer to dots, but assuming the
minimum of 4 dots per module, it would take 25 x 4 dots, i. e. 100
dots.  Each module would be 0.33mm in size which would require 25 x
0.33mm, i. e. 8.25mm for the size of the qr-code.

I printed the qr-code much larger than that, about 1x1".  That is
about three times as large as would be required, and the printer can
print three times as many dots per inch as the 100 dots needed.

So in theory, my theory that the resolution of the printer is too low
can't be true.

But why couldn't these qr-codes be scanned?  It shouldn't have been a
problem at all.


[1]: https://www.qrcode.com/en/about/version.html
[2]: https://www.qrcode.com/en/howto/cell.html

> 
> Regards
> 
> [1] https://ctan.org/pkg/pgf
> 





signature.asc
Description: This is a digitally signed message part


Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-12 Thread jeremy ardley



On 12/3/24 21:21, hw wrote:


Even if they did that, it would be totally useless because it won't be
able to automatically print labels from databases.


The manufacturer applications  usually allow you to print a list from a 
spreadsheet or text file.



It is possible to use document generation tools like latex and printing
systems like CUPS to print a label, but pixel registration will be poor.

Why?  The manufacturer provided a CPUS printer driver without which
printing wouldn't be possible at all.


Most custom barcodes programs run on windows and don't use CUPS.

Manufacturers can provide CUPS drivers as well, but the barcode 
application is usually only windows.


In my case I had to write my own CUPS driver as the manufacturer does 
not provide one.


Getting back to pixel registration, the latex CUPS route is very 
unlikely to work well. However a custom application that generates a 
pixel perfect bitmap that is printed at 100% scale through cups should work.


There are a number of programs that can do that, though I have not used 
them so far.


- zint

- GNU barcode

- BWIPP

also a possibility is

- qrencode




Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-12 Thread hw
On Mon, 2024-03-11 at 09:57 +0800, jeremy ardley wrote:
> On 11/3/24 07:34, hw wrote:
> > Do you think that thermal transfer printers with 203dpi would be
> > better suited to print QR codes than the 300dpi multi-mode printers?
> > 
> > I'm not fond of thermal transfer at all.  Usually what is being
> > printed that way fades rather quickly over time and is more slightly
> > gray rather than black and so thin that it's hard to read even when
> > freshly printed.  Perhaps better labels are available, but the labels
> > must not get too expensive ...
> 
> 
> Thermal transfer and thermal direct printers have the same resolution.
> 
> Thermal transfer printers are used for archival labels as they fade very 
> little over time.
> 
> Direct thermal printers are intended for mailing applications where it 
> doesn't matter if they fade after a few months.
> 
> Given that, I think a lot of commercial shippers use thermal transfer 
> for mailing labels. Very few shippers use laser printed adhesive address 
> label, nor non-adhesive in pockets or pouches.
> 
> To print a QR code or other 2D code on any thermal printer, the printer 
> manufacturer will supply an application that generate the codes and 
> prints them independently of the host printing system. These codes will 
> scan perfectly.

Even if they did that, it would be totally useless because it won't be
able to automatically print labels from databases.

> It is possible to use document generation tools like latex and printing 
> systems like CUPS to print a label, but pixel registration will be poor. 

Why?  The manufacturer provided a CPUS printer driver without which
printing wouldn't be possible at all.

> The only practical option for this route is to print the code BIG
 
That's what I thought, but then the codes won't fit on the labels.
That's why I wonder if there's a better way.



signature.asc
Description: This is a digitally signed message part


Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-11 Thread Max Nikulin

On 11/03/2024 08:06, hw wrote:

On Sun, 2024-03-10 at 09:50 +0700, Max Nikulin wrote:

On 10/03/2024 04:41, hw wrote:

\psbarcode{textblah foo}{height=0.6 width=0.6 eclevel=L}{qrcode}

That works for 600dpi laser printers.  When you print the QR-code with
a 300dpi label printer you can't reliably scan it, not even when you
make the QR-code 1x1" in size.

Perhaps that's not a reasonable size?


Perhaps height and width are chosen improperly. An image some percents
smaller may be sharper.


What size do you consider reasonable?


It seems you expect some number that you can use for any QR code. There 
is no size that fits for all codes.


Out of curiosity I tried to scan a QR code printed on a thermal printer 
(so likely having ~200dpi resolution) having size of approximately 0.8in 
and 50 pixels (modules) per inch. It encodes a 69 bytes long link. 
Likely the same code scaled to 0.4in will still work, but I would prefer 
to avoid it, 0.6in should be more reliable. On your 300dpi printer this 
particular QR code may be printed e.g. at ~(0.8/1.5)in.


Fix size of QR code pixel (module), not size of whole QR code.


- Find number of pixels in QR code in QR specs (or just calculate them)


Calculate them how or find them where?  Pdflatex somehow does it and
the QR-codes are fine when printed on a laser printer and when shown
on a 4k display.


"Modules" in Florent's message is what I referred to as QR code "pixels" 
and their count depends on "version".



- Specify width and height so that the ration of 2 numbers above is a
whole number.

Image may become a bit larger or a bit smaller.


The QR-code must fit on the label, plus some text.  The labels are
50x35mm in size.


It limits amount of information you may put into QR codes. You can still 
choose to use e.g. 4,5,6, etc. printer dots per QR code module.



When I zoom in on QR-codes in a PDF viewer, they don't get blurry.
Perhaps the pst-barcode package uses vector graphics?


Nice, however you have to adjust size to avoid blurring.




Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-11 Thread Florent Rougon
Hi,

I haven't read the whole thread (sorry) but thought this might help.

hw  wrote:

> When I zoom in on QR-codes in a PDF viewer, they don't get blurry.
> Perhaps the pst-barcode package uses vector graphics?

That is quite likely: the pst- prefix means this is PSTricks, which is
an oldish way of doing vector graphics with LaTeX. I tend to avoid
PSTricks these days as it is generally awkward to use in PDF contexts,
although there are various workarounds that often allow to do so.

The ubiquitous, powerful and modern way to do vector graphics in LaTeX
is PGF/TiKZ[1], however this is not even necessary for QR codes, because
these are made of perfect monochrome rectangles, which TeX can draw
natively using its \hrule and \vrule primitives.

> 'pdfimages -list' doesn't show any images for a PDF with QR-codes
> created with pdflatex.

AFAIK, 'pdfimages' would extract “actual images” embedded in a PDF file
(e.g., PNG or JPG), however here pst-barcode presumably uses PostScript
or PDF primitives for drawing and filling polygons, which in your case
probably end up as PDF primitives. Hence, 'pdfimages' can't see these QR
codes (AFAIUI).

I've played with a different package for producing QR codes in LaTeX,
which uses the aforementioned \hrule and \vrule primitives: qrcode. Its
manual is here (follow the “Package documentation” link):

  https://ctan.org/pkg/qrcode

Here is a simple example you can compile with pdflatex:

\documentclass{article}
\usepackage{qrcode}

\pagestyle{empty}

\begin{document}

\noindent
% \qrset affects \qrcode commands in the current group. You can use it
% to factor out options used for several QR codes.
\qrset{nolinks, padding}% add padding to make sure the codes are 
“legal”/readable
\qrcode[version=1]{Hey Debian-user!}% Can't do version=1 with level=M or more
\qrcode[level=L, version=1]{Hey Debian-user!}% Less redundancy but is doable

\end{document}

Note the terminal output:














There are several quality levels allowing error correction (see the
manual): Low, Medium, Quality, and High. They correspond to 'level'
values L, M, Q, H. Default is M but if the chosen 'version' (which maps
to a specific number of modules) allows for a better level, qrcode
automatically upgrades to the best level possible for the chosen
'version' (which the above log demonstrates for the first QR code).

My example tries to print two QR codes with version=1, which means
21×21 modules (see below). Using the default level (M), this is not
possible for the specified text, therefore the first QR code is drawn as
a version=2 one (i.e., it has 25×25 modules). For the second QR code, I
explicitly ask for level=L which has the worst redundancy for error
correction; this allows "Hey Debian-user!" to be QR-encoded with
version=1, i.e. as a square of 21×21 modules.

The length of what you are encoding obviously dictates which quality
parameters you can afford, so you need to play with actual text for your
application. You can control the size of the QR code with e.g.
\qrcode[height=1cm]{...}. Since the modules are stuck to each other,
once you've determined an appropriate 'version' parameter, you can
easily choose a height that causes the modules to have the exact size
you want in the resulting PDF file (printer driver issues are out of my
league).

Regarding the 'version' parameter:

  version=1  → 21×21 modules
  version=2  → 25×25 modules
  version=3  → 29×29 modules
  ...
  version=40 → 177×177 modules

(each version step adds 4 to the number of modules in each direction)

So, you may want to play with text of yours and these parameters.
Examine the terminal output or log file to make sure the qrcode package
didn't have to increase the 'version' in order to encode the text you
specified. Note that in my example, the second QR code scanned with a
smartphone from a computer screen display seems to be significantly
harder to recognize than the first one (IOW, using level=L is probably a
bad idea even though it allows one to reduce the number of modules. But
with low printer resolution constraints, who knows?).

Hope this helps!

Regards

[1] https://ctan.org/pkg/pgf

-- 
Florent



Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-10 Thread jeremy ardley



On 11/3/24 07:34, hw wrote:

Do you think that thermal transfer printers with 203dpi would be
better suited to print QR codes than the 300dpi multi-mode printers?

I'm not fond of thermal transfer at all.  Usually what is being
printed that way fades rather quickly over time and is more slightly
gray rather than black and so thin that it's hard to read even when
freshly printed.  Perhaps better labels are available, but the labels
must not get too expensive ...



Thermal transfer and thermal direct printers have the same resolution.

Thermal transfer printers are used for archival labels as they fade very 
little over time.


Direct thermal printers are intended for mailing applications where it 
doesn't matter if they fade after a few months.


Given that, I think a lot of commercial shippers use thermal transfer 
for mailing labels. Very few shippers use laser printed adhesive address 
label, nor non-adhesive in pockets or pouches.


To print a QR code or other 2D code on any thermal printer, the printer 
manufacturer will supply an application that generate the codes and 
prints them independently of the host printing system. These codes will 
scan perfectly.


It is possible to use document generation tools like latex and printing 
systems like CUPS to print a label, but pixel registration will be poor. 
The only practical option for this route is to print the code BIG




Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-10 Thread hw
On Sun, 2024-03-10 at 09:50 +0700, Max Nikulin wrote:
> On 10/03/2024 04:41, hw wrote:
> > \psbarcode{textblah foo}{height=0.6 width=0.6 eclevel=L}{qrcode}
> > 
> > That works for 600dpi laser printers.  When you print the QR-code with
> > a 300dpi label printer you can't reliably scan it, not even when you
> > make the QR-code 1x1" in size.
> > 
> > Perhaps that's not a reasonable size?
> 
> Perhaps height and width are chosen improperly. An image some percents 
> smaller may be sharper.

What size do you consider reasonable?

> - Find the dpi value in the specs of your printer

300dpi

> - Find number of pixels in QR code in QR specs (or just calculate them)

Calculate them how or find them where?  Pdflatex somehow does it and
the QR-codes are fine when printed on a laser printer and when shown
on a 4k display.

> - Specify width and height so that the ration of 2 numbers above is a 
> whole number.
> 
> Image may become a bit larger or a bit smaller.

The QR-code must fit on the label, plus some text.  The labels are
50x35mm in size.

That limits the QR-code to about 1x1", give or take a few mm.  1" is
already half the width of the label which doesn't leave much room for
text, and you have to give it some slack because you want to end up
printing somewhere on the label and not on the gaps between the
labels.

When I zoom in on QR-codes in a PDF viewer, they don't get blurry.
Perhaps the pst-barcode package uses vector graphics?

'pdfimages -list' doesn't show any images for a PDF with QR-codes
created with pdflatex.



signature.asc
Description: This is a digitally signed message part


Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-10 Thread hw
On Sun, 2024-03-10 at 07:56 +0800, jeremy ardley wrote:
> On 10/3/24 05:41, hw wrote:
> > The QR-codes are sharp and easily scanable when printed in 600dpi.
> > With the label printer you can't really tell if they're sharp or not.
> 
> As  mentioned in my previous post, thermal label printers are 203dpi, 
> *not the 300 that the OP quoted.*

The printers I've been printing on are 300dpi and can do both thermal
and ribbon/ink.  I haven't tried thermal.

> [...]
> The data_matrix code (like a QRcode) for the same 41 digits is a 26x26 matrix 
> which at 203dpi can have pixels of 8x8 dots in a field of 26x26mm. These are 
> super easy for a thermal printer

Do you think that thermal transfer printers with 203dpi would be
better suited to print QR codes than the 300dpi multi-mode printers?

I'm not fond of thermal transfer at all.  Usually what is being
printed that way fades rather quickly over time and is more slightly
gray rather than black and so thin that it's hard to read even when
freshly printed.  Perhaps better labels are available, but the labels
must not get too expensive ...



signature.asc
Description: This is a digitally signed message part


Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-10 Thread hw
On Sun, 2024-03-10 at 10:21 +0700, Max Nikulin wrote:
> On 10/03/2024 03:48, jeremy ardley wrote:
> > 
> > Standard thermal label printers are 203DPI (8 dots per mm).
> 
> Thanks, this number suits better to my expectation. I just trusted hw 
> earlier.

I should clarify:

The printer the OP pointed to seems to be rated at 203DPI and I
somehow thought it had 300dpi.  (203 seems very odd.)

The printers I have been trying to print QR-codes on are actually
300dpi printers.  They can do both thermal transfer or use a ribbon
that transfers ink to the labels kinda like typewriters did.  I
haven't used the thermal transfer mode and only the ribbon/ink mode.

> > I have asked the postal service to generate labels at 203dpi which will 
> > print just fine at 600 dpi and so work with laser and thermal printers, 
> > but they will not cooperate.

Why would they create labels that can not be scanned when printed?

Maybe ask them to print the labels for you?  If they can't scan them
then that's their problem.



signature.asc
Description: This is a digitally signed message part


Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-10 Thread jeremy ardley



On 10/3/24 15:39, Max Nikulin wrote:
From your earlier message I count approximately 1000px for 5in (125 
mm) barcode. If it is 1:1 to ~200dpi then it is incompatible with 
300dpi printers, so it may be a reason why your proposal to the post 
office was rejected. If it is 500 black or white lines and each one 
occupies 2 printer dots then 300dpi image of the same size has 3 dots 
per line. (Sorry, I am unsure concerning "module" term.) You should be 
able to rasterize PDF files to 600dpi (2x factor) and downsample them 
by 1/3 keeping lines sharp.


In barcodes such as Code-128 a module is 12 'slots' which at minimum is 
one pixel per slot or 12 pixels. Code-128 has over 100 character 
encodings in a module.


So code 128 on a 203dpi printer 12 * characters / 8 mm e.g. for 40 
characters it's 12*40/8 = 60mm. 2 pixels per module make it 120mm. 3 
pixels per module make it 180mm so too big for mailing labels.


As for my post office, their barcodes do not match 300dpi or 600dpi. 
They are scaled at about 75-80% of what they should be. I'm really 
surprised they work. I can only guess most people use 1200dpi.


Thermal labels are the way to go as they stick really well and resist 
water. They are also *cheap*. around 1-2 cents in bulk for 100x150 . 
Plastic envelope and laser printed label will cost 10-20c. A self 
adhesive laser label is getting on to 50c.




Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-09 Thread Max Nikulin

On 10/03/2024 10:51, jeremy ardley wrote:


I have far less problems with the QR code (in my case data_matrix code) 
than with the barcode. The pixel elements of the QR code are much larger 
than the lines in a barcode so there is much less chance for pixel 
ambiguity.


From your earlier message I count approximately 1000px for 5in (125 mm) 
barcode. If it is 1:1 to ~200dpi then it is incompatible with 300dpi 
printers, so it may be a reason why your proposal to the post office was 
rejected. If it is 500 black or white lines and each one occupies 2 
printer dots then 300dpi image of the same size has 3 dots per line. 
(Sorry, I am unsure concerning "module" term.) You should be able to 
rasterize PDF files to 600dpi (2x factor) and downsample them by 1/3 
keeping lines sharp.


Certainly this simple trick would fail if QR in the same file requires 
3/4 scaling.



from pdf2image import convert_from_path


The pdfimage(1) tool may extract images in their original format, 
perhaps there is a similar python module.



     detected_codes = pyzbar.decode(img)


Each barcode and QR code may be resampled individually without 
recognizing it. If position of each image on the page is known,
resampled images may be put back to correct places in the document 
rasterized to your printer resolution.


P.S. Post office guys may believe that labels created using laser 
printers are more resistant to wearing during processing and delivery, 
so 300dpi resolution may be intentional to discourage usage of thermal 
printers.




Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-09 Thread jeremy ardley



On 10/3/24 11:21, Max Nikulin wrote:


Is the QR image a raster one? I am unsure concerning its printer dots 
per QR pixel ratio. Let's take e.g. 4 as a value inconvenient for 
direct scaling from 300dpi to 203dpi. I expect that upscaling it by 3 
and downscaling the result by 4 with disabled smoothing (e.g. using 
splines) should generate an image that is 1.5% larger than the one 
suitable for 203dpi. So setting 98.5% scaling for printer should allow 
to achieve sharp QR image without re-encoding QR.



In my case I have never seen a bigger dogs breakfast of a pdf! It has 
many elements in different formats including bitmaps, scalable vector 
graphics, and text elements. That and some images are colour and some 
black and white. I just preprocess it


I have far less problems with the QR code (in my case data_matrix code) 
than with the barcode. The pixel elements of the QR code are much larger 
than the lines in a barcode so there is much less chance for pixel 
ambiguity.


I think i you make it 'big enough' it will scan fine. So a factor of 2 
magnification should work with a QR code.


I spent many (un)happy hours with gimp and imagemagick to try and get 
the best solution for barcodes. Sadly there is none other than print the 
barcode as big as possible in your page real-estate.


I spent an hour today with my friend GPT4 and python and I can now pluck 
out any and all codes from my mailing labels and I next plan to generate 
new labels at 203dpi using freshly encoded barcodes and data_matrix codes.


Here is some experimental code

from PIL import Image
import pyzbar.pyzbar as pyzbar
import qrcode  # For generating QR codes
from barcode import EAN13, generate  # Using EAN13 as an example; this 
might vary

from barcode.writer import ImageWriter
import os

from pdf2image import convert_from_path

def pdf_to_image(pdf_path, dpi=600):
    images = convert_from_path(pdf_path, dpi=dpi)
    for img in images:
    yield img

def detect_and_extract_codes(images):
    for img in images:
    detected_codes = pyzbar.decode(img)
    for code in detected_codes:
    print(code)
    if code.type == 'QRCODE':
    # Process QR code
    process_qr_code(code)
    else:
    # Process other types of barcodes
    process_barcode(code)

def process_qr_code(code):
    qr = qrcode.QRCode(
    version=1,
    error_correction=qrcode.constants.ERROR_CORRECT_L,
    box_size=10,
    border=4,
    )
    qr.add_data(code.data.decode())
    qr.make(fit=True)
    img = qr.make_image(fill_color="black", back_color="white")
    img.show()  # Or save the image



Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-09 Thread Max Nikulin

On 10/03/2024 03:48, jeremy ardley wrote:


Standard thermal label printers are 203DPI (8 dots per mm).


Thanks, this number suits better to my expectation. I just trusted hw 
earlier.


I have asked the postal service to generate labels at 203dpi which will 
print just fine at 600 dpi and so work with laser and thermal printers, 
but they will not cooperate.


Is the QR image a raster one? I am unsure concerning its printer dots 
per QR pixel ratio. Let's take e.g. 4 as a value inconvenient for direct 
scaling from 300dpi to 203dpi. I expect that upscaling it by 3 and 
downscaling the result by 4 with disabled smoothing (e.g. using splines) 
should generate an image that is 1.5% larger than the one suitable for 
203dpi. So setting 98.5% scaling for printer should allow to achieve 
sharp QR image without re-encoding QR.


You may try to find rational approximation for (4*208)/300 better than 
4/3 (or for actual QR pixel size).





Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-09 Thread Max Nikulin

On 10/03/2024 04:41, hw wrote:

\psbarcode{textblah foo}{height=0.6 width=0.6 eclevel=L}{qrcode}

That works for 600dpi laser printers.  When you print the QR-code with
a 300dpi label printer you can't reliably scan it, not even when you
make the QR-code 1x1" in size.

Perhaps that's not a reasonable size?


Perhaps height and width are chosen improperly. An image some percents 
smaller may be sharper.


- Find the dpi value in the specs of your printer
- Find number of pixels in QR code in QR specs (or just calculate them)
- Specify width and height so that the ration of 2 numbers above is a 
whole number.


Image may become a bit larger or a bit smaller.



Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-09 Thread jeremy ardley



On 10/3/24 05:41, hw wrote:

The QR-codes are sharp and easily scanable when printed in 600dpi.
With the label printer you can't really tell if they're sharp or not.


As  mentioned in my previous post, thermal label printers are 203dpi, 
*not the 300 that the OP quoted.*


you can read the OP specs here which say 203. 
.


Thermal label printers have no problems printing even long bar codes, QR codes, 
and data_matrix codes if the generator uses the correct dpi and the print 
process maintains the pixel mapping.

In my case my barcodes are 41 digits long (extreme GS1 !) and at 2 pixels per 
module (12 modules per digit) it is 123mm long which fits into a 150x100 
thermal label

The data_matrix code (like a QRcode) for the same 41 digits is a 26x26 matrix 
which at 203dpi can have pixels of 8x8 dots in a field of 26x26mm. These are 
super easy for a thermal printer



Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-09 Thread hw
On Sat, 2024-03-09 at 23:20 +0700, Max Nikulin wrote:
> On 09/03/2024 19:08, hw wrote:
> > On Fri, 2024-03-08 at 23:21 +0700, Max Nikulin wrote:
> > > On 08/03/2024 12:35, hw wrote:
> > > > On Thu, 2024-03-07 at 23:15 -0500, Jeffrey Walton wrote:
> > > > > 
> > > > > I have a USB thermal printer for the shipping labels,
> > > > > <https://www.amazon.com/gp/product/B08V28J3JS>.
> > > > 
> > > > This printer has only 300dpi.  If you print QR-codes on it make sure
> > > > you can scan them: they have to be large enough or get you an
> > > > unscanable smear.
> > > 
> > > I believed that 300dpi is high enough resolution for QR-codes of
> > > reasonable size if source image has proper quality. On the other hand,
> > > if possible, it is better to scale QR-codes to match some whole factor
> > > of printer pixel size.
> > 
> > What do you consider a 'reasonable size'?
> 
> Looking at a QR code likely having ~75 pixels per inch I find it 
> unreasonably small for delivery labels.

Shipping labels tend to be pretty large.

> I am in doubts if its redundancy is high enough to reliably
> recognize it if it would be scratched during delivery. Another

Increased redundancy can make the QR-code harder or impossible to
scan because it creates more smear instead of more redundancy.

Once you've seen what that looks like, it is evident that smearing
more ink into the same area for more redundancy makes things only
worse.  You'd have to print the QR-code larger.

> limitation may be stability of optics in scanners in respect to
> labels. This one is printed using a laser printer with resolution at
> least 600 dpi. Each QR code pixel has still 4x4 printer dots in the
> case of 300dpi, so when image is properly aligned, printer quality
> is not an issue.

Yes, the QR-codes printed on a 600dpi laser printer are fine.

> > There is no source image other than whatever LaTeX creates.  I can
> > specify the size of the QR-code.  Other than that, how do you apply
> > scaling?
> 
> I am unsure what particular QR code generator do you use and what is the 

I'm using the pst-barcode package and pdflatex to create a PDF file
which is then sent through cups to the printer.  So LaTeX, the
bst-barcode package, some PDF stuff, the printer driver, the printer
and it's settings for darkness and printing speed, the material the
labels are made of and the ribbon with the ink on it which gets
transferred to the label all influence the result.

Also, labels are continuously being fed through the printer while
printing without stopping.  That makes some smear inevitable.

> format of QR codes.

It basically goes like this:

\psbarcode{textblah foo}{height=0.6 width=0.6 eclevel=L}{qrcode}

That works for 600dpi laser printers.  When you print the QR-code with
a 300dpi label printer you can't reliably scan it, not even when you
make the QR-code 1x1" in size.

Perhaps that's not a reasonable size?

> Is it raster or vector image? Specify size that makes QR code pixels
> having whole number of printer pixels.

I only know that the QR-code must fit on the label.

> "Fit to page" or "fit to printable area" in printer options may make an 
> image blurry.

No such options are specified.

> In the case of low input image resolution, upscaling method suitable
> for photos may make QR code blurry. However consistent configuration
> should make QR codes sharp.

IIRC there is an option to create a PDF having a particular
resolution, like 300DPI, but that didn't seem to have any effect.  I
don't remember what that option was :/

The QR-codes are sharp and easily scanable when printed in 600dpi.
With the label printer you can't really tell if they're sharp or not.




signature.asc
Description: This is a digitally signed message part


Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-09 Thread jeremy ardley



On 10/3/24 00:20, Max Nikulin wrote:


Looking at a QR code likely having ~75 pixels per inch I find it 
unreasonably small for delivery labels. I am in doubts if its 
redundancy is high enough to reliably recognize it if it would be 
scratched during delivery. Another limitation may be stability of 
optics in scanners in respect to labels. This one is printed using a 
laser printer with resolution at least 600 dpi. Each QR code pixel has 
still 4x4 printer dots in the case of 300dpi, so when image is 
properly aligned, printer quality is not an issue. 


Standard thermal label printers are 203DPI (8 dots per mm).

The problem with printing QR codes and bar codes is not the resolution 
of the printer but getting the the software drivers to produce a bitmap 
that is the same resolution as the printer resolution and aligned at the 
pixel level when it goes to the printer


I have written a CUPS driver for a thermal printer and routinely print 
labels with barcodes and QR style codes. I have immense problems with 
PDF labels generated by my local postal service which are generated for 
a 300 DPI printer. The barcodes especially end up with too thick or too 
thin bars where the pixel mapping doesn't align. These will not scan.


I have asked the postal service to generate labels at 203dpi which will 
print just fine at 600 dpi and so work with laser and thermal printers, 
but they will not cooperate.


I am in the process of developing software to take the issued labels, 
extract the barcode and QR fields, decode them, and then generate new 
bitmaps at 203 dpi to replace  the misaligned bitmaps. This is not 
straight forward as the postal service does not fully comply with the 
coding rules.


In the meantime I have to extract the QR and bar code fields, enlarge 
them, and print on separate labels.


As far as printer drivers work, CUPS typically generates a bitmap from a 
source document such as PDF or postscript, and passes that to a raster 
printer. This in itself can be a problem as any stage of the process of 
generation of pdf, 'printing', and rasterisation can misalign and 
distort pixels. To be absolutely sure of clean output you need a custom 
program directly driving the printer.





Re: printing QR-codes on labels with 300dpi label printers with LaTeX

2024-03-09 Thread Max Nikulin

On 09/03/2024 19:08, hw wrote:

On Fri, 2024-03-08 at 23:21 +0700, Max Nikulin wrote:

On 08/03/2024 12:35, hw wrote:

On Thu, 2024-03-07 at 23:15 -0500, Jeffrey Walton wrote:


I have a USB thermal printer for the shipping labels,
<https://www.amazon.com/gp/product/B08V28J3JS>.


This printer has only 300dpi.  If you print QR-codes on it make sure
you can scan them: they have to be large enough or get you an
unscanable smear.


I believed that 300dpi is high enough resolution for QR-codes of
reasonable size if source image has proper quality. On the other hand,
if possible, it is better to scale QR-codes to match some whole factor
of printer pixel size.


What do you consider a 'reasonable size'?


Looking at a QR code likely having ~75 pixels per inch I find it 
unreasonably small for delivery labels. I am in doubts if its redundancy 
is high enough to reliably recognize it if it would be scratched during 
delivery. Another limitation may be stability of optics in scanners in 
respect to labels. This one is printed using a laser printer with 
resolution at least 600 dpi. Each QR code pixel has still 4x4 printer 
dots in the case of 300dpi, so when image is properly aligned, printer 
quality is not an issue.



There is no source image other than whatever LaTeX creates.  I can
specify the size of the QR-code.  Other than that, how do you apply
scaling?


I am unsure what particular QR code generator do you use and what is the 
format of QR codes. Is it raster or vector image? Specify size that 
makes QR code pixels having whole number of printer pixels.


"Fit to page" or "fit to printable area" in printer options may make an 
image blurry. In the case of low input image resolution, upscaling 
method suitable for photos may make QR code blurry. However consistent 
configuration should make QR codes sharp.





printing QR-codes on labels with 300dpi label printers with LaTeX (was: libbusiness-us-usps-webtools-perl and USPS Ground Advantage shipping)

2024-03-09 Thread hw
On Fri, 2024-03-08 at 23:21 +0700, Max Nikulin wrote:
> On 08/03/2024 12:35, hw wrote:
> > On Thu, 2024-03-07 at 23:15 -0500, Jeffrey Walton wrote:
> > > 
> > > I have a USB thermal printer for the shipping labels,
> > > <https://www.amazon.com/gp/product/B08V28J3JS>.
> > 
> > This printer has only 300dpi.  If you print QR-codes on it make sure
> > you can scan them: they have to be large enough or get you an
> > unscanable smear.
> 
> I believed that 300dpi is high enough resolution for QR-codes of 
> reasonable size if source image has proper quality. On the other hand, 
> if possible, it is better to scale QR-codes to match some whole factor 
> of printer pixel size.

What do you consider a 'reasonable size'?  The maximum possible size
of the QR-code is limited by the size of the label.  (Shipping labels
are probably big enough ...)

There is no source image other than whatever LaTeX creates.  I can
specify the size of the QR-code.  Other than that, how do you apply
scaling?




signature.asc
Description: This is a digitally signed message part


worn off key labels

2023-12-23 Thread songbird
Jeremy Nicoll wrote:
> On Thu, 21 Dec 2023, at 13:36, songbird wrote:
>
>> i've
>> already worn some of letters off the keys.  :(  but, well, i got
>> it on sale for about $30 so i really can't complain.
>
> For years I've used Dymo labels to replace keyboard legends.
> (Not the 1960s/1970s thick 3d labels, but 'printed' ones).  After
> sticking individual letters onto keytops (usually using tweezers
> to position them as accurately as possible) I put mutiple coats
> of clear nail varnish over them - which seems to lengthen their
> life & help to hold down the edges of the stickers.
>
> When they eventually need replaced it's sometimes difficult 
> to get a Dymo letter off a key, needing something sharp (eg
> a needle or scalpel) to lift the sticky label off the key.
>
> Then I clean the key with isopropyl alcohol (as used eg for
> cleaning heads on tape recorders), & make & attach a new
> label.
>
> Mostly I use Dymo media corresponding to the colour 
> scheme of the original keyboard, but - eg on a laptop
> which has white legends on black keys - I've replaced
> some legends with "black print on yellow tape" labels
> which are much easier to see and provide me with a
> few visual landmarks on the keyboard ... which helps me
> when I don't yet quite need to put a room light on.
>
> I keep hoping that my next laptop will have a backlit
> keyboard but very often the machines I choose (for
> other higher-priority criteria) don't have them.
>
> I've also tried a few clip-on mini lights (plugged into a
> spare USB socket) but many such lights come with poor
> quality clips &/ cables that are too short to reach the
> USB socket of choice (or indeed any USB socket). 

  i usually don't even look at the keyboard when i'm
typing.  just once in a while when i need to use a 
strange key.  :)  in the winter i may even type with
my hands under a light blanket.

  the idea of using a sticker is a good one but i have
black keys and no white ink.  however, i could get by
using something to just mark the key a bit in the right
shape to give me a hint if i need it.  so far i don't
seem to need it.

  this would really amaze my typing teacher from Jr.
High School (who is likely now long dead) as i managed
to flunk it.  at that time (several years before i
even first touched a computer) the class was all manual
typewriters and i was a bored trouble maker.  i did
deserve to be flunked - no excuse there at all...  but
what was funny is that i went on to college and having
to use a keypunch and then terminals of many kinds and
so with all the hours i spent at the keyboards i was
forced to learn how to touch type after all, so yes,
that teacher was right.  :)


  songbird



Re: Print flakes off mailing labels, use a fixative?

2023-12-05 Thread Anders Andersson
On Tue, Dec 5, 2023 at 1:46 PM D MacDougall  wrote:
>
> On 12/4/23 16:52, Tom Browder wrote:
> >
> > HP printer and toner, Office Depot labels.
> >
> > I bought so hair spray and will try that.
> >
> > -Tom
>
> I just looked at Office Depot website and the only labels I see that are
> for both laser and inkjet are an off brand.  I see why you went for the
> off brand, they are a whole lot cheaper than the Avery labels the same
> size, but maybe this is why.  100 sheets for $13. Twice as many labels
> for 1/3 the price.  I might have tried them too.
>
> I really don't see how hairspray or any other liquid spray could do any
> good.  If you think it will seep under the toner and glue it down that
> seems problematic to me and it might make the labels peel off.
> Cellophane tape might work better.
>
> I think you said that you took the label to the UPS store and their
> printer had the same problem so the problem is definitely the labels and
> best just swallow hard and buy the Avery labels.  (Or just write the
> address with a ball point pen.)
>
> -Don

Please take this discussion about paper adhesive private or to a
suitable forum - it has not have anything to do with debian in a long
time, I'm amazed it's still tolerated!



Re: Print flakes off mailing labels, use a fixative?

2023-12-05 Thread David Christensen

On 12/4/23 16:52, Tom Browder wrote:

On Sun, Dec 3, 2023 at 19:36 David Christensen 
wrote:
...


Please confirm printer, toner cartridge, and labels are all HP.  If so,
I would contact HP.



HP printer and toner, Office Depot labels.

I bought so hair spray and will try that.

-Tom



I have an HP LaserJet printer and use generic toner catridges.  HP 
multi-purpose paper and Avery labels work well.  Retail store (Staples) 
branded supplies do not work as well.



I suggest buying HP or Avery laser printer labels.


David




Re: Print flakes off mailing labels, use a fixative?

2023-12-04 Thread D MacDougall

On 12/4/23 16:52, Tom Browder wrote:


HP printer and toner, Office Depot labels.

I bought so hair spray and will try that.

-Tom


I just looked at Office Depot website and the only labels I see that are 
for both laser and inkjet are an off brand.  I see why you went for the 
off brand, they are a whole lot cheaper than the Avery labels the same 
size, but maybe this is why.  100 sheets for $13. Twice as many labels 
for 1/3 the price.  I might have tried them too.


I really don't see how hairspray or any other liquid spray could do any 
good.  If you think it will seep under the toner and glue it down that 
seems problematic to me and it might make the labels peel off. 
Cellophane tape might work better.


I think you said that you took the label to the UPS store and their 
printer had the same problem so the problem is definitely the labels and 
best just swallow hard and buy the Avery labels.  (Or just write the 
address with a ball point pen.)


-Don



Re: Print flakes off mailing labels, use a fixative?

2023-12-04 Thread Tom Browder
On Sun, Dec 3, 2023 at 19:36 David Christensen 
wrote:
...

> Please confirm printer, toner cartridge, and labels are all HP.  If so,
> I would contact HP.


HP printer and toner, Office Depot labels.

I bought so hair spray and will try that.

-Tom


Re: Print flakes off mailing labels, use a fixative?

2023-12-03 Thread Gareth Evans



> On 3 Dec 2023, at 12:06, Gareth Evans  wrote:
> 
> ... I've never had a problem with laser-designated labels.  

I do have experience of toner falling off non-laser labels, so perhaps your 
laser labels are a duff batch, or perhaps they were mis-labelled :p

G


Re: Print flakes off mailing labels, use a fixative?

2023-12-03 Thread David Christensen

On 12/3/23 04:05, Gareth Evans wrote:




On 3 Dec 2023, at 11:39, Tom Browder  wrote:
On Sat, Dec 2, 2023 at 5:17 PM Gareth Evans  wrote:

Are your labels "laser" labels?


Yes, DUAL INKJET and LASER


OK.  I don't have much experience of label printing, but I've never had a 
problem with laser-designated labels.

I would probably try a different brand.  I wouldn't imagine it's a hardware 
issue if the toner fuses properly to paper.

What's the printer model and type of toner in use?

Thanks
Gareth



+1


Please confirm printer, toner cartridge, and labels are all HP.  If so, 
I would contact HP.



David




Re: Print flakes off mailing labels, use a fixative?

2023-12-03 Thread Gareth Evans



> On 3 Dec 2023, at 11:39, Tom Browder  wrote:
> On Sat, Dec 2, 2023 at 5:17 PM Gareth Evans  wrote:
>> Are your labels "laser" labels?
> 
> Yes, DUAL INKJET and LASER

OK.  I don't have much experience of label printing, but I've never had a 
problem with laser-designated labels.  

I would probably try a different brand.  I wouldn't imagine it's a hardware 
issue if the toner fuses properly to paper.

What's the printer model and type of toner in use?

Thanks
Gareth




Re: Print flakes off mailing labels, use a fixative?

2023-12-03 Thread Tom Browder
On Sun, Dec 3, 2023 at 2:01 AM David Christensen
 wrote:
> I would not put anything through a laser printer unless it is
> specifically rated for laser printers.  Applying fixative to printer
> labels before printing sounds like a good way to damage your equipment.
> If anything, apply the fixative after printing.

Of course.



Re: Print flakes off mailing labels, use a fixative?

2023-12-03 Thread Tom Browder
On Sat, Dec 2, 2023 at 5:17 PM Gareth Evans  wrote:
> Are your labels "laser" labels?

Yes, DUAL INKJET and LASER

-Tom



Re: Print flakes off mailing labels, use a fixative?

2023-12-02 Thread David Christensen

On 12/2/23 15:16, Gareth Evans wrote:




On 2 Dec 2023, at 19:37, Tom Browder  wrote:

I’ve had a print flaking problem with my old HP laser which has a fairly new 
toner cartridge. I have a set of brand new Office Depot labels.

I intend to try a “fixative” on them to see if that will help.

Any other suggestions?

Thanks.

Happy Christmas!

-Tom




Hi Tom,

Are your labels "laser" labels?



+1


I would not put anything through a laser printer unless it is 
specifically rated for laser printers.  Applying fixative to printer 
labels before printing sounds like a good way to damage your equipment. 
If anything, apply the fixative after printing.



David



Re: Print flakes off mailing labels, use a fixative?

2023-12-02 Thread Gareth Evans



> On 2 Dec 2023, at 19:37, Tom Browder  wrote:
> 
> I’ve had a print flaking problem with my old HP laser which has a fairly new 
> toner cartridge. I have a set of brand new Office Depot labels.
> 
> I intend to try a “fixative” on them to see if that will help.
> 
> Any other suggestions?
> 
> Thanks.
> 
> Happy Christmas!
> 
> -Tom
> 
> 

Hi Tom,

Are your labels "laser" labels?  

Gareth


Re: Print flakes off mailing labels, use a fixative?

2023-12-02 Thread Tom Browder
On Sat, Dec 2, 2023 at 3:03 PM Dan Ritter  wrote:
> Brother has all those features, plus BRScript/3 and ethernet. I
> buy them for work where they tend to last about 8-10 years of high-volume 
> work.

Thanks, Dan. I have owned a Brother between two of my HPs.

I'll keep an eye out for one.

Blessings to all.

-Tom



Re: Print flakes off mailing labels, use a fixative?

2023-12-02 Thread Dan Ritter
Tom Browder wrote: 
> On Sat, Dec 2, 2023 at 2:18 PM Donald Mac Dougall  wrote:
> If I do need a new printer, I want another B laser, double
> sided-printing, copying,
> and scanning. Multiple paper trays for two sizes of paper would be nice.
> I have had great luck with HP over the years, but  I'm open to suggestions.


Brother has all those features, plus BRScript/3 and ethernet. I
buy them for work where they tend to last about 8-10 years of high-volume work.

Extra paper trays are expensive, but often compatible across 2
generations; consider EBay or Craigslist for more.

Recommended.

-dsr-



Re: Print flakes off mailing labels, use a fixative?

2023-12-02 Thread Donald Mac Dougall
My experience many years ago with HP laser printers was that if the print 
flaked off it was because the fuser roller wasn't hot enough to fuse the toner 
to the paper.


From: Tom Browder 
Sent: Saturday, December 2, 2023 11:36:52 AM
To: Debian Users ML 
Subject: Print flakes off mailing labels, use a fixative?

I’ve had a print flaking problem with my old HP laser which has a fairly new 
toner cartridge. I have a set of brand new Office Depot labels.

I intend to try a “fixative” on them to see if that will help.

Any other suggestions?

Thanks.

Happy Christmas!

-Tom




Re: Print flakes off mailing labels, use a fixative?

2023-12-02 Thread Tom Browder
On Sat, Dec 2, 2023 at 2:18 PM Donald Mac Dougall  wrote:
> My experience many years ago with HP laser printers was that if the print 
> flaked off
> it was because the fuser roller wasn't hot enough to fuse the toner to the 
> paper.

Yes, I've investigated that a bit. I had the same trouble with my
labels at a local UPS
store. The owner insisted his printers are in top shape. As I said,
these are fresh labels
and I don't have any trouble with printing on normal paper. I'll try a
fixative for now.

If I do need a new printer, I want another B laser, double
sided-printing, copying,
and scanning. Multiple paper trays for two sizes of paper would be nice.
I have had great luck with HP over the years, but  I'm open to suggestions.

Thanks, Donald.

-Tom



Print flakes off mailing labels, use a fixative?

2023-12-02 Thread Tom Browder
I’ve had a print flaking problem with my old HP laser which has a fairly
new toner cartridge. I have a set of brand new Office Depot labels.

I intend to try a “fixative” on them to see if that will help.

Any other suggestions?

Thanks.

Happy Christmas!

-Tom


Re: GPT partions: capability for user friendly labels on partitions for all OSs?

2019-04-12 Thread Tom Browder
On Thu, Apr 11, 2019 at 14:34 Felix Miata  wrote:

> Tom Browder composed on 2019-04-11 08:42 (UTC-0500):
>
...

> > Does GPT partitioning on Windows 10 allow a user-friendly label along
> with
> > its UUID for a partition?
>
> > If so, is that label visible with Debian system administration programs
> as
> > well?


Thanks, Felix.

-Tom


Re: GPT partions: capability for user friendly labels on partitions for all OSs?

2019-04-11 Thread Felix Miata
Tom Browder composed on 2019-04-11 08:42 (UTC-0500):

> I run dual boot Deb/Win 10 on several systems, only one of which has UEFI
> capability (the latest, new as of last fall). Unfortunately, I failed to
> use the GPT on the new one, and the Win 10 disk management program doesn't
> show much info on the non-NTFS disks.

> Does GPT partitioning on Windows 10 allow a user-friendly label along with
> its UUID for a partition?

> If so, is that label visible with Debian system administration programs as
> well? 

Should be equivalent with Win10 and Debian to MacOS and openSUSE:
## Linux
# parted -l
Model: ATA ST1000DM003-1SB1 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End SizeFile systemName Flags
 1  1049kB  387MB   386MB   fat16  EFI  msftdata
 2  387MB   38.3GB  37.9GB  hfsx   sda2 Mac OS X HFS+ system
 3  38.3GB  38.9GB  650MB   hfs+   Recovery HD
 4  38.9GB  500GB   461GB   hfsx   sda4 Mac OS X HFS+ data
 5  500GB   505GB   4429MB  linux-swap(v1) sda5 Linux Swap  swap
 6  505GB   539GB   34.1GB  ext4   sda6 openSUSE Leap
 7  539GB   573GB   34.1GB  ext4   sda7 Linux next
 8  573GB   1000GB  427GB   ext4   sda8 Linux Home

## MacOS
> diskutil list -all
/dev/disk0 (internal, physical):
   #:   TYPE NAMESIZE   IDENTIFIER
   0:  GUID_partition_scheme*1.0 TB disk0
   1:   Microsoft Basic Data EFI 385.9 MB   disk0s1
   2:  Apple_HFS OS X System Partition   37.9 GBdisk0s2
   3: Apple_Boot Recovery HD 650.0 MB   disk0s3
   4:  Apple_HFS sda4 Mac User Data p... 461.4 GB   disk0s4
   5: Linux Swap 4.4 GB disk0s5
   6:   Linux Filesystem 34.1 GBdisk0s6
   7:   Linux Filesystem 34.1 GBdisk0s7
   8:   Linux Filesystem 427.2 GB   disk0s8
> system_profiler SPStorageDataType | egrep 'BSD|UUID|t Poin'
  Mount Point: /Volumes/EFI
  BSD Name: disk0s1
  Volume UUID: B7D872D6-51A3-39A8-AB54-69C5842C7A84
  Mount Point: /
  BSD Name: disk0s2
  Volume UUID: A99B09C3-37C0-3C4D-A3BC-0A2190C8FBE8
  Mount Point: /Volumes/sda4 Mac User Data partition
  BSD Name: disk0s4
  Volume UUID: D1A77490-BA19-3547-AA65-4BE3A2AE08F8
-- 
Evolution as taught in public schools is religion, not science.

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata  ***  http://fm.no-ip.com/



Re: GPT partions: capability for user friendly labels on partitions for all OSs?

2019-04-11 Thread Tom Browder
On Thu, Apr 11, 2019 at 12:44 PM Pascal Hambourg  wrote:
>
> Le 11/04/2019 à 15:42, Tom Browder a écrit :
> >
> > Does GPT partitioning on Windows 10 allow a user-friendly label along with
> > its UUID for a partition?
>
> Why do you care ? You can manage it in Debian.

I care because my main Win box stays running Win most of the time
(it's the default) and it not always convenient to reboot.

Thanks, Pascal.

-Tom



Re: GPT partions: capability for user friendly labels on partitions for all OSs?

2019-04-11 Thread Pascal Hambourg

Le 11/04/2019 à 15:42, Tom Browder a écrit :


Does GPT partitioning on Windows 10 allow a user-friendly label along with
its UUID for a partition?


Why do you care ? You can manage it in Debian.



GPT partions: capability for user friendly labels on partitions for all OSs?

2019-04-11 Thread Tom Browder
I run dual boot Deb/Win 10 on several systems, only one of which has UEFI
capability (the latest, new as of last fall). Unfortunately, I failed to
use the GPT on the new one, and the Win 10 disk management program doesn't
show much info on the non-NTFS disks.

Does GPT partitioning on Windows 10 allow a user-friendly label along with
its UUID for a partition?

If so, is that label visible with Debian system administration programs as
well?

Thanks very much.

Warm regards,

-Tom


[OT] LABELs Re: swap on second hard drive

2016-05-19 Thread David Wright
On Thu 19 May 2016 at 07:46:10 (+0200), deloptes wrote:
> Peter Hillier-Brook wrote:
> > On 18/05/16 22:02, deloptes wrote:
> >> Peter Hillier-Brook wrote:
> >>> On 17/05/16 18:02, Felix Miata wrote:
> >>>> Mounting by UUID is an optional default. Mounting life is simpler here,
> >>>> because I don't use UUID mounting on any of my hundreds of multiboot
> >>>> installations. Most of my mounts are by LABEL, strings I as a fallible
> >>>> human choose and can remember, according to usage, disk name and/or
> >>>> hostname.
> >>>
> >>> Thanks for the very useful pointers. I don't know who is the culprit,
> >>> but fstab has an entry for swap with a UUID that is not consistent with
> >>> the actual UUID for the swap partition. I'm going with your advice and
> >>> switch to using labels.
> >> 
> >> UUID is better flexible solution in many cases - why not updating fstab
> >> to have the correct uuid?
> > 
> > Because I prefer an identifier that I can remember. :-)
> 
> Haha, that's fair enough. It took me about 1h to reverse the setup to paper,
> that I have done few years ago on one server with 12disks
> Not only uuid, but crypt and lvm on top. I finally draw a map with this.
> I suggest not relaying on memory anyway ;-)

In the land of car analogies, I think of Serial numbers as VIN,
LABELs as number-plate/tag/rego (I write the LABEL onto disks with marker pen),
partitions UUIDs as the number on a V5 registration document (UK parlance),
UUIDs as the 16-digit number on a V11 (registration renewal).

Cheers,
David.

http://laughbreak.com/lists/if-microsoft-built-cars/



Re: disk labels mismatch

2013-02-19 Thread Bob Proulx
pavicic wrote:
 This problem has been solved but since some points might be of
 general interest even to Debian developers here is a report on the
 issue.

Good to hear it has been solved for you.

 To summarize: There are 3 disks on the machine sda, sdb, sdc. Debian
 Sid is installed on sda.  sdb is _not_ mounted but contained an
 older installation of Debian Squeeze.
 ...
 The problem was that grub saw that old installation on sdb
 although sdb was _not_ mounted.  For example, I deleted grub.cfg and
 updated grub and all old installations from sdb would
 reapear. Equally so during booting.
 ...
 I would say that this is something that should be 
 changed. Grub simply should not read unmounted disks.  

This is actually a feature that other people rely upon to work.  For
example people who dual boot multiple systems expect the update-grub
script to search and automatically detect those other systems.  If
update-grub didn't locate those then these other people would have the
opposite problem to yours.  They would then no longer have an
automatically provided boot option for those systems.

Since these are conflicting features there is no way to satisfy both
at the same time.

Bob


signature.asc
Description: Digital signature


Re: disk labels mismatch

2013-02-19 Thread pavicic
On Tue, Feb 19, 2013 at 11:57:28AM -0700, Bob Proulx wrote:
  The problem was that grub saw that old installation on sdb
  although sdb was _not_ mounted.  For example, I deleted grub.cfg and
  updated grub and all old installations from sdb would
  reapear. Equally so during booting.
  ...
  I would say that this is something that should be 
  changed. Grub simply should not read unmounted disks.  
 
 This is actually a feature that other people rely upon to work.  For
 example people who dual boot multiple systems expect the update-grub
 script to search and automatically detect those other systems.  If
 update-grub didn't locate those then these other people would have the
 opposite problem to yours.  They would then no longer have an
 automatically provided boot option for those systems.

Do you want to say that they can boot from a disk which is not mounted?

Mladen. 


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130219190907.ga21...@grad.hr



Re: disk labels mismatch

2013-02-18 Thread pavicic

Hi!

This problem has been solved but since some points 
might be of general interest even to Debian developers 
here is a report on the issue. 

To summarize: There are 3 disks on the machine
sda, sdb, sdc. Debian Sid is installed on sda. 
sdb is _not_ mounted but contained an older 
installation of Debian Squeeze.

The problem was that grub saw that old installation 
on sdb although sdb was _not_ mounted. For example, 
I deleted grub.cfg and updated grub and all old 
installations from sdb would reapear. Equally so 
during booting. 

At the beginning I thought that was the problem of 
the MBR at sdb but Bob Proulx and Igor Cicimov helped 
in excluding that option. Then I reformated sdb and, 
of course, the installations were no more. 

I would say that this is something that should be 
changed. Grub simply should not read unmounted disks.  

Best, 

Mladen. 


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130218214247.gb29...@grad.hr



Re: disk labels mismatch

2013-02-18 Thread Ralf Mardorf

On Mon, 18 Feb 2013 22:42:48 +0100, pavicic pavi...@grad.hr wrote:

updated grub


So you updated grub automatically, not manually ;)?

I always write my grub.cfg or menu.lst myself, doing this I can chose the  
entries, the way I need them. It might be impossible, but at least it  
would be much, much work, to set up this automatic update thingy, to fit  
to my needs.


Regards,
Ralf

PS: Take a look at your mail client, perhaps it does support reply to  
list only by the preferences, many users are nor aware of this option.



--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/op.wsp662z3qhadp0@freebsd



Re: disk labels mismatch

2013-02-18 Thread Slavko
Hi,

Dňa Mon, 18 Feb 2013 22:42:48 +0100 pavicic pavi...@grad.hr napísal:

 The problem was that grub saw that old installation 
 on sdb although sdb was _not_ mounted. For example, 
 I deleted grub.cfg and updated grub and all old 
 installations from sdb would reapear. Equally so 
 during booting. 

IMHO os-prober is checking all MBR and not only MBR on mounted
devices... You can consider to fill the bugreport about this.

i have uninstalled os-prober for a long time :-)

regards

-- 
Slavko
http://slavino.sk


signature.asc
Description: PGP signature


Re: disk labels mismatch

2013-01-20 Thread Bob Proulx
pavicic wrote:
 I've added a new disk in a hurry and now I have several mismatches.
 Would anyone care to help me to sort them out. Below I'm giving fstab,
 fdisk -l, df -la (apparently / (root) is duplicated ??, etc.). I
 also enclose relevant sections from /var/log/system and grub. Each
 section starts with ***

Only the fstab data was useful.  All of the rest of that data you sent
is pretty much useless data.  None of it will help us or you determine
anything useful.  Sorry.

The /etc/fstab you sent included (with some readability fixup by me):

# / was on /dev/sda1 during installation
UUID=2b4e1ed6-4b09-4c42-a958-9493cffa7f58 / ext3 errors=remount-ro 0 1
# /home was on /dev/sda3 during installation
UUID=a3cb2cbb-d6db-46e1-a0e7-73f264d255a1 /home ext3 defaults 0 2
# swap was on /dev/sda2 during installation
UUID=25c7fb6d-47a4-4594-9cfd-20e9680f5e0b none swap sw 0 0 /dev/scd0

That is unambiguous!  The partitions with those UUIDs are mounted as
shown.

  UUID=2b... is mounted on /.
  UUID=a3... is mounted on /home
  UUID=25... is used as swap.

The entire purpose of the UUIDs is to handle just the case you are
asking about.  The case where you have installed a system on two
different disks and then install both disks in the same system.
Without the UUIDs it is ambiguous.  But since the UUIDs will be unique
it means that the correct disk will be mounted.

Use the blkid program to print out the UUIDs of the disks on your
system.  Example:

  $ blkid
  /dev/sda1: LABEL=boot UUID=a72b4b9b-eb92-49a3-b64c-29e47ad8ba0d 
TYPE=ext2 
  /dev/sda2: UUID=e515fbe8-0ac0-4bdf-95f2-573eacdd286a TYPE=swap 
  /dev/sda5: UUID=cf27b371-bb12-44bb-a5f2-deca5d65cb20 TYPE=ext3 

Line up the UUIDs with the ones from your fstab.  Those are the ones
in use.

 The system works without apparent problems but I do not have a clear
 correspondence between disks sda, sdb. sdc and directories / , /run/,
 etc. I would like to establish correspondence (and, e.g., have only
 sda, sdb, and sdc in fstab, and have only one /) so as to be able to
 optimally use the space on the disks and avoid possible duplication of
 system files. For instance, does the appearance of two / mean that

Your question confuses me very much.

If you are noticing that your 'df' command produces two lines for /
this is due to a change from using /etc/mtab as a file to being a
symlink to /proc/mounts.  If you look in /proc/mounts you will see
that the / filesystem is listed twice.

  $ awk '$2==/' /proc/mounts
  rootfs / rootfs rw 0 0
  /dev/mapper/v1-root / ext3 
rw,relatime,errors=remount-ro,barrier=1,data=ordered 0 0

Since it is listed twice it is reported twice.  This is a minor
regression in behavior due to the change to the symlink.  This will
eventually get improved but for the moment just ignore it.

 optimally use the space on the disks and avoid possible duplication of
 system files. For instance, does the appearance of two / mean that
 systems files are written on both sda and sdb? If so, how can sort
 that out.

No.  It does not.

 Some more details. sdb is not mounted but I can easily mount
 it. Then I'll have two / two /home etc.

What?  No.

 This is because sdb is from an old system.

Just because it is an old system does not cause it to be a duplicate.

 The problem is that I'm afraid to reformat sdb because it has a
 bootable label

So?  What does a bootable label matter?  It does not matter at all.
Please unlearn that piece of incorrect knowledge.

 and sdc as well.

Why mention sdc here?  You clearly have a system installed on
/dev/sda{1,2,3}.  That is all that is relevant here.

 So, the first thing I would like to find out is which disk the
 system boots from: sdb or sdc?

Neither.  It is booting from sda.  And your fstab unambiguously states
that your system will mount the specified UUIDs.  If you need help in
tracking down which UUID maps to which disk see the output of the
blkid program.

 The next thing is: If sdb, where is the boot sector? in the master
 boot sector (outside of the partions of the disk) or in the volume
 boot sector (inside the first partition of the disk)? If the later I
 must not reformat the disk.

It isn't booting from sdb or sdc or sdz.  (Hopefully you did not chain
them into the boot process.)  You can verify this by unplugging sdb
and sdc from your system and booting it without them.

 The third question is: How can I move the boot sectors?
 I would like to move the boot sector to sda

You don't move the MBR.  You install the MBR.

  # grub-install /dev/sda

But I am sure that is already the case since that is the default.

 and remove boot labels from sdb and sdc.

Use a partition editor such as gparted, sfdisk, cfdisk, fdisk or other
to change labels and bootable flags.

 But sdc also hosts Windoze 7?  Is that a problem.

Of course!  MS-Windows is always a problem.  :-)

 So, I should change grub, fstab, and what else?  And how?

You have asked very many questions based upon incorrect assumptions!
Because

Re: disk labels mismatch

2013-01-15 Thread pavicic

Hi

 Date: Mon, 14 Jan 2013 19:43:50 -0800
 Subject: Re: disk labels mismatch
 I'd suggest that you gather usage information for your various
 partitions/ directories, back up everything, wipe the disks, and start
 over.

I thought I came to a Linux forum where people 
solve problems not scrap them. The latter sounds like
from a Windoze forum. 

Some more details. sdb is not mounted but I can easily 
mount it. Then I'll have two / two /home etc. This is 
because sdb is from an old system. The problem is that
I'm afraid to reformat sdb because it has a bootable 
label and sdc as well. So, the first thing I would like
to find out is which disk the system boots from: sdb 
or sdc? The next thing is: If sdb, where is the boot 
sector? in the master boot sector (outside of the 
partions of the disk) or in the volume boot sector 
(inside the first partition of the disk)? If the 
later I must not reformat the disk. The third question 
is: How can I move the boot sectors? I would like to 
move the boot sector to sda and remove boot labels 
from sdb and sdc. But sdc also hosts Windoze 7? Is 
that a problem. So, I should change grub, fstab, and 
what else? And how? 

Mladen. 


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130115120651.ga4...@grad.hr



Re: disk labels mismatch

2013-01-15 Thread David Christensen

On 01/15/13 04:06, pavicic wrote:

I thought I came to a Linux forum where people
solve problems not scrap them. The latter sounds like
from a Windoze forum.


I have a SOHO network with my primary desktop/ VirtualBox server, two 
desktops, one backup server, and a Windows XP laptop.  I used to do paid 
work at home, but not right now.



I've found that it's better/ faster/ cheaper to backup/ wipe/ rebuild 
machines than to try to trouble-shoot them.  This forces me to have 
robust backup procedures in place, and reinforces my system 
installation/ configuration and data restoration skills.



As I once heard a speaker say at a LUG meeting:

You should be able to throw any machine out a nine story window
and have a replacement in operation within half a day.


That said, successfully trouble-shooting a mess you created would help 
you understand what you did wrong, and deepen your knowledge of that 
part of the system.  I've done plenty of trouble-shooting over the 
years.  The problem is that I can't estimate it, or guarantee success. 
I can for backup/ wipe/ rebuild.



So, I guess it depends on your goals.  Mine are 1) reliable operations 
and 2) disaster preparedness.  What are yours?



David


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/50f62b52.2070...@holgerdanske.com



disk labels mismatch

2013-01-14 Thread pavicic

Hi!

I've added a new disk in a hurry and now I have several mismatches.
Would anyone care to help me to sort them out. Below I'm giving fstab,
fdisk -l, df -la (apparently / (root) is duplicated ??, etc.). I also
enclose relevant sections from /var/log/system and grub. Each section 
starts with ***

The system works without apparent problems but I do not have a clear
correspondence between disks sda, sdb. sdc and directories / , /run/,
etc. I would like to establish correspondence (and, e.g., have only sda,
sdb, and sdc in fstab, and have only one /) so as to be able to
optimally use the space on the disks and avoid possible duplication of
system files. For instance, does the appearance of two / mean that
systems files are written on both sda and sdb? If so, how can sort that
out.

*** fstab:

proc /proc proc defaults 0 0
/ was on /dev/sda1 during installation

UUID=2b4e1ed6-4b09-4c42-a958-9493cffa7f58 / ext3 errors=remount-ro 0 1
/home was on /dev/sda3 during installation

UUID=a3cb2cbb-d6db-46e1-a0e7-73f264d255a1 /home ext3 defaults 0 2
swap was on /dev/sda2 during installation

UUID=25c7fb6d-47a4-4594-9cfd-20e9680f5e0b none swap sw 0 0 /dev/scd0
/media/cdrom0 udf,iso9660 user,noauto 0 0 /dev/sdc3 /windoze vfat
rw,user,noauto 0 0 /dev/sdc4 /mutant ext3 defaults,errors=remount-ro 0 1
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0

*** fdisk -l

Disk /dev/sdb: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track,
14593 cylinders, total 234441648 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: 0x000b1cf4

Device Boot Start End Blocks Id System /dev/sdb1 * 2048 78125055
39061504 83 Linux /dev/sdb2 78125056 203124735 62499840 83 Linux
/dev/sdb3 203124736 234440703 15657984 82 Linux swap / Solaris

Disk /dev/sdc: 240.1 GB, 240057409536 bytes 255 heads, 63 sectors/track,
29185 cylinders, total 468862128 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: 0xc4c22279

Device Boot Start End Blocks Id System /dev/sdc1 * 2048 206847 102400 7
HPFS/NTFS/exFAT /dev/sdc2 206848 247676927 123735040 7 HPFS/NTFS/exFAT
/dev/sdc3 247676928 36000 56161536+ b W95 FAT32 /dev/sdc4 36001
468862127 54431063+ 83 Linux

Disk /dev/sda: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track,
14593 cylinders, total 234441648 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: 0x49382feb

Device Boot Start End Blocks Id System /dev/sda1 2048 78125055 39061504
83 Linux /dev/sda2 78125056 203192319 62533632 83 Linux /dev/sda3
203192320 234440703 15624192 82 Linux swap / Solaris

*** df -la

Filesystem 1K-blocks Used Available Use% Mounted on rootfs 38445384
7493556 28998756 21% / sysfs 0 0 0 - /sys proc 0 0 0 - /proc udev 10240
0 10240 0% /dev devpts 0 0 0 - /dev/pts tmpfs 1645524 896 1644628 1%
/run /dev/sda1 38445384 7493556 28998756 21% / tmpfs 5120 0 5120 0%
/run/lock tmpfs 6415880 0 6415880 0% /run/shm fusectl 0 0 0 -
/sys/fs/fuse/connections /dev/sda2 61550604 4113240 54310684 8% /home
/dev/sdc4 53575504 32089000 18764952 64% /mutant rpc_pipefs 0 0 0 -
/var/lib/nfs/rpc_pipefs

*** /var/log/system

Jan 14 14:44:46 BlenderMonster kernel: [ 2.602349] scsi 0:0:0:0:
Direct-Access ATA OCZ-AGILITY3 2.06 PQ: 0 ANSI: 5 

Jan 14 14:44:46 BlenderMonster kernel: [ 2.605979] scsi 1:0:0:0: 
Direct-Access ATA KINGSTON SH100S3 320A PQ: 0ANSI: 5 

Jan 14 14:44:46 BlenderMonster kernel: [ 2.606285] scsi 1:0:1:0:
Direct-Access ATA ADATA SSD S599 2 3.4. PQ: 0 ANSI:

Jan 14 14:44:46 BlenderMonster kernel: [ 2.421387] ata2.00: 
ATA-8: KINGSTON SH100S3120G, 320ABBF0, max UDMA/133 
Jan 14 14:44:46 BlenderMonster kernel: [ 2.421392] ata2.00: 
234441648 sectors, multi 16:LBA48 NCQ (depth 0/32) 
Jan 14 14:44:46 BlenderMonster kernel: [2.421400] ata2.01: 
ATA-8: ADATA SSD S599 256GB, 3.4.6, max UDMA/133 
Jan 14 14:44:46 BlenderMonster kernel: [ 2.421403] ata2.01: 
468862128 sectors, multi 16: LBA48 NCQ (depth 0/32) 
Jan 14 14:44:46 BlenderMonster kernel: [ 2.428910] ata1.00: 
ATA-9: OCZ-AGILITY3, 2.06, max UDMA/133 Jan 14 14:44:46 
BlenderMonster kernel: [ 2.428912] ata1.00: 234441648
sectors, multi 16: LBA48 NCQ (depth 0/32)

Jan 14 14:44:46 BlenderMonster kernel: [ 2.608483] sd 0:0:0:0: [sda]
234441648 512-byte logical blocks: (120 GB/111 GiB) 
Jan 14 14:44:46 BlenderMonster kernel: [ 2.608486] sd 1:0:0:0: [sdb] 
234441648 512-byte logical blocks: (120 GB/111 GiB) 
Jan 14 14:44:46 BlenderMonster kernel: [ 2.608489] sd 1:0:1:0: [sdc] 
468862128 512-byte logical blocks: (240 GB/223 GiB) 
Jan 14 14:44:46 BlenderMonster kernel: [ 2.608544] sd 1:0:0:0: [sdb] 
Write Protect is off 
Jan 14 14:44:46 BlenderMonster kernel: [ 2.608546] sd 1:0:0:0: [sdb] 
Mode Sense: 00 3a 00 00 
Jan 14 14:44:46 

Re: disk labels mismatch

2013-01-14 Thread David Christensen

On 01/14/13 07:18, pavicic wrote:

I've added a new disk in a hurry and now I have several mismatches.
Would anyone care to help me to sort them out.


I'd suggest that you gather usage information for your various 
partitions/ directories, back up everything, wipe the disks, and start over.



I typically put boot and root on one drive (system drive), and put data 
on another drive (or multiple drives assembled into one using LVM).



The faster the system drive, the better.  An SSD system drive is best.


HTH,

David


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/50f4d076.2030...@holgerdanske.com



Re: pmount-hal not using labels on encrypted filesystems

2012-12-14 Thread Aidan Gauland
Michael Biebl bi...@debian.org writes:
 On 14.12.2012 05:06, Aidan Gauland wrote:
 How can I fix this?  Given that HAL is deprecated, I suspect there is
 some other tool that serves the same purpose as pmount-hal that I should
 be using instead.

 yeah, hal is dead.
 You might try udisks --mount instead.

I get
Mount failed: Not a mountable file system
It seems that udisks does not handle encrypted partitions.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87ehit2ekf@dimension8.tehua.net



Re: pmount-hal not using labels on encrypted filesystems

2012-12-14 Thread Michael Biebl
On 14.12.2012 10:00, Aidan Gauland wrote:
 Michael Biebl bi...@debian.org writes:
 On 14.12.2012 05:06, Aidan Gauland wrote:
 How can I fix this?  Given that HAL is deprecated, I suspect there is
 some other tool that serves the same purpose as pmount-hal that I should
 be using instead.

 yeah, hal is dead.
 You might try udisks --mount instead.
 
 I get
 Mount failed: Not a mountable file system
 It seems that udisks does not handle encrypted partitions.

udisks-daemon does handle luks/cryptsetup encrypted partitions but it
seems the udisks command line tool is too limited.

Try gvfs-mount -d /dev/foo. This should prompt you for the passphrase,
unlock and mount the file system under /media/FS_LABEL

Can be unmounted again via umount /media/FS_LABEL


Michael


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Re: pmount-hal not using labels on encrypted filesystems

2012-12-14 Thread Michael Biebl
On 14.12.2012 17:12, Michael Biebl wrote:
 Try gvfs-mount -d /dev/foo. This should prompt you for the passphrase,
 unlock and mount the file system under /media/FS_LABEL

Just in case: If you run that command from a session which has no
running dbus session bus, change that command to:

dbus-launch gvfs-mount -d /dev/foo


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Re: pmount-hal not using labels on encrypted filesystems

2012-12-14 Thread Aidan Gauland
Michael Biebl bi...@debian.org writes:
 udisks-daemon does handle luks/cryptsetup encrypted partitions but it
 seems the udisks command line tool is too limited.

 Try gvfs-mount -d /dev/foo. This should prompt you for the passphrase,
 unlock and mount the file system under /media/FS_LABEL

 Can be unmounted again via umount /media/FS_LABEL

Yep, that does the job.  Thanks!

I think I'll file a feature request against udisks.

—Aidan


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87a9tg35e2@dimension8.tehua.net



pmount-hal not using labels on encrypted filesystems

2012-12-13 Thread Aidan Gauland
When I mount a filesystem on an encrypted partition with pmount-hal, it
just mounts it on /media/usbdisk instead of using the filesystem's label
to name the mount point, as it does with unencrypted filesystems.

For example,

$ pmount-hal /dev/sdb1
Enter passphrase for /dev/sdb1: 
/dev/mapper/_dev_sdb1 on /media/usbdisk type ext4 
(rw,noexec,nosuid,nodev,errors=remount-ro)

But I want the mount point to be named after the label of the (encrypted) 
filesystem
on /dev/sdb1, in this case, Gauland_HDD.

How can I fix this?  Given that HAL is deprecated, I suspect there is
some other tool that serves the same purpose as pmount-hal that I should
be using instead.

Regards,
Aidan Gauland


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87ip852s6y@dimension8.tehua.net



Re: pmount-hal not using labels on encrypted filesystems

2012-12-13 Thread Michael Biebl
On 14.12.2012 05:06, Aidan Gauland wrote:

 How can I fix this?  Given that HAL is deprecated, I suspect there is
 some other tool that serves the same purpose as pmount-hal that I should
 be using instead.

yeah, hal is dead.
You might try udisks --mount instead.


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Re: Preseed for Wheezy - Sizes, Labels and Logicals

2012-09-24 Thread Camaleón
On Sat, 22 Sep 2012 19:03:51 -0700, ray wrote:

 The partman auto instructions say that with partition 'max' parameter
 set to 10, all remaining space on the disk will be used.  Then
 it says that there is a partition size limit of 10 due to the
 32-bit shell integer limitation.

(...)

Ray, I would ask for this also at debian-boot mailing list because 
people in there will be able to answer your questions about the specifics 
of presseding or at least can point you to some good (or more complete/
detailed) documentation that covers your required scenario.

Greetings,

-- 
Camaleón


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/k3q5p1$e50$1...@ger.gmane.org



Preseed for Wheezy - Sizes, Labels and Logicals

2012-09-22 Thread ray
The partman auto instructions say that with partition 'max' parameter
set to 10, all remaining space on the disk will be used.  Then
it says that there is a partition size limit of 10 due to the
32-bit shell integer limitation.

I am installng a 64-bit version.  So, what are the limitations for
64-bit?  I want to set a 16GB partition.  How can I define a 16GB
partition?  How can I allocate the remaining unused space with method{
keep }?

The partman auto instructions say how to label a partitions, but I did
not see a way to label the disk.  Is there a way to label the disk?

The partman auto instructions shows how to define a partition as
primary, but there wasn't a description of how to define logical
partitions.

My intent was to have four primary partitions, each bootable for four
different multi-boots.  How do I associate any one /boot with a / or
other mount point?  After experiementing with this configuration, my
plan is to convert the system to Xen.  There is not intent to multi-boot
with Xen.  Is there any value in this multi-partition setup like this
for VMs?

ray


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/20120922190351.1753ead7c2b35a7d15c5b99498690bcc.47b43ba0a8@email11.secureserver.net



Re: drive labels --- update to my previous post

2012-07-09 Thread Paul E Condon
On 20120706_225838, cletusjenkins wrote:

   I add one line to /etc/fstab for each labeled usb external drive like 
   the following: 

   LABEL=gflx1 /media/gflx1ext3rw,user,noauto  0   0 

   And I create the named mount point in /media with: 

   mkdir /media/gflx1 

   I have my own system of choosing label values 
   mnemonic-letter-groupdigits, but you can create your own 
   system. (gflx is a contraction of Seagate GoFlex) Don't try to use 
   labels that are informative of the contents of the drive. You can 
   easily maintian a text database of label contents. If you choose 
   to have the label never change, then the extra work of adding a line 
   to /etc/fstab is done only once when a new device is originally 
   acquired and adds very little to the drill of writing and ext3 file 
   system onto the partition Avoid giving two devices the same LABEL. The 
   text database is a good aid in this. 

   Its also a good idea to write the LABEL on a stickum label and place 
   the stickum label on the device. 

   HTH 
   --  
   Paul E Condon
   pecon...@mesanetworks.net 
 
 Thanks for your reply. I never thought of trying to specify these drives in 
 the fstab file. I would have thought that doing so would hose-up the 
 auto-mounter. But I'll give it a try.
 
 These are little 1TB drives that get their power via the USB cable, so the 
 first thing I do when I get one is slap an old VHS label (the one for the top 
 of the tape not the long one for the edge) on the back of the drive to 
 catalog what it is for. I haven't bought a VHS tape in at least 9 years, but 
 like a mental patient I've kept every single extra label I ever bought for 
 every single type of media I've used. I even have extra labels for the 8 
 floppies I used with a mini-computer my school had.
 

Since writing about my way of dealing with pluggable drives things
have changed in a puzzling way:

I was forced to reinstall Squeeze because of a worsening instability
and kernel oops events on the computer that I use for backups. With
the new install things behave differently, very differently.  Now
there are no lines in /etc/fstab mentioning devices /dev/usb1 ,
etc. and the computer recognizes and mounts usb drives in /media
without an special lines supplied by me. It creates the mount point
dynamically, and deletes the mount point when I do umount
/media/gflx1. In a way, it behaves as if I had written a udev script,
but I don't remember doing that, so I hypothesize that the packager of
some debian package added such a script to his/her package (which
package that is, I do not know).

Now the behavior seems to be that any device that has a partition
label will be mounted under /media using the partition label string as
a mount point name. I don't have any unlabeled devices so I can't
easily discover the behavior for an unlabeled device. Some kind and
talented person seems to have fixed the problem. I'm inclined to
believe that one can have the new, better behavior without doing a
full re-install. Perhaps this post will prompt some to contribute the
name of the package whose config files need up-grading. Then you can
get this behavior without going thru the pain that I went thru.

Also, the behavior that I described in my earlier post really did
exist once-upon-a-time, but not any more, so readers of the archives
should not waste their time trying to repeat what I reported.  It
isn't true anymore. I don't know what package change made it go
away, and don't have the forensic skills to have a hope of finding
out. The new behavior is better. I really don't want to go back.

About old stickum labels: They lose their stickiness if one stores 
them in a place without proper climate control. Too hot, too cold,
or too damp, and they become useless within just a few years ;-/


-- 
Paul E Condon   
pecon...@mesanetworks.net


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120709155101.ga3...@big.lan.gnu



Re: drive labels

2012-07-08 Thread shawn wilson
fstab works. However, if it gets unworldly with device records, you can
also figure out a udev script that makes the appropriate mount point and
mounts when a device is inserted and removes it when the device is removed.
On Jul 6, 2012 8:25 PM, Paul E Condon pecon...@mesanetworks.net wrote:

 On 20120706_105247, cletusjenkins wrote:
  I have several USB external drives. I have them formatted as ext3 and
 have assigned them labels (via tune2fs -L). All of my labels are made up of
 letters no numbers, spaces or other special characters. When I connect a
 drive, it's label is displayed correctly in gnome (on the desktop and when
 browsing in nautilus), but the devices is mounted as /media/usb0. If I
 connect another, it will show up in the GUI correctly and it actually gets
 mounted using the label name (/media/filebackup). Is there a way to get my
 system to mount the drive with the label instead of usb0?

 I add one line to /etc/fstab for each labeled usb external drive like
 the following:

 LABEL=gflx1 /media/gflx1ext3rw,user,noauto  0   0

 And I create the named mount point in /media with:

 mkdir /media/gflx1

 I have my own system of choosing label values
 mnemonic-letter-groupdigits, but you can create your own
 system. (gflx is a contraction of Seagate GoFlex) Don't try to use
 labels that are informative of the contents of the drive. You can
 easily maintian a text database of label contents. If you choose
 to have the label never change, then the extra work of adding a line
 to /etc/fstab is done only once when a new device is originally
 acquired and adds very little to the drill of writing and ext3 file
 system onto the partition Avoid giving two devices the same LABEL. The
 text database is a good aid in this.

 Its also a good idea to write the LABEL on a stickum label and place
 the stickum label on the device.

 HTH
 --
 Paul E Condon
 pecon...@mesanetworks.net


 --
 To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
 with a subject of unsubscribe. Trouble? Contact
 listmas...@lists.debian.org
 Archive: http://lists.debian.org/20120707002504.ga2...@big.lan.gnu




Re: drive labels

2012-07-08 Thread Camaleón
El 2012-07-07 a las 19:34 -0700, cletusjenkins escribió:

(resending to the list)

   In any case, it should be mounted under /media using the label, so if  
   it fails there has to be a reason for it (e.g., naming collisions?). 

   Attach the USB disk an run dmesg | tail -20 and dmesg | grep -i usb,  
   then put here both outputs. 
 
 Thanks for assuming I still had a genuine issue(/wasn't an idiot) and 
 continuing to offer help to me!

You're welcome but I wonder what makes you think people can think 
that...

Greetings, 

-- 
Camaleón 


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120708134912.ga6...@stt008.linux.site



Re: drive labels

2012-07-07 Thread cletusjenkins
   
  I add one line to /etc/fstab for each labeled usb external drive like 
  the following: 
   
  LABEL=gflx1 /media/gflx1ext3rw,user,noauto  0   0 
   
  And I create the named mount point in /media with: 
   
  mkdir /media/gflx1 
   
  I have my own system of choosing label values 
  mnemonic-letter-groupdigits, but you can create your own 
  system. (gflx is a contraction of Seagate GoFlex) Don't try to use 
  labels that are informative of the contents of the drive. You can 
  easily maintian a text database of label contents. If you choose 
  to have the label never change, then the extra work of adding a line 
  to /etc/fstab is done only once when a new device is originally 
  acquired and adds very little to the drill of writing and ext3 file 
  system onto the partition Avoid giving two devices the same LABEL. The 
  text database is a good aid in this. 
   
  Its also a good idea to write the LABEL on a stickum label and place 
  the stickum label on the device. 
   
  HTH 
  --  
  Paul E Condon
  pecon...@mesanetworks.net 

Thanks for your reply. I never thought of trying to specify these drives in the 
fstab file. I would have thought that doing so would hose-up the auto-mounter. 
But I'll give it a try.

These are little 1TB drives that get their power via the USB cable, so the 
first thing I do when I get one is slap an old VHS label (the one for the top 
of the tape not the long one for the edge) on the back of the drive to catalog 
what it is for. I haven't bought a VHS tape in at least 9 years, but like a 
mental patient I've kept every single extra label I ever bought for every 
single type of media I've used. I even have extra labels for the 8 floppies I 
used with a mini-computer my school had.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/1027613247.39640.1341641018914.JavaMail.sas1@172.29.244.248



Re: drive labels

2012-07-07 Thread Andrei POPESCU
On Vi, 06 iul 12, 22:40:49, cletusjenkins wrote:

   I often see this when I install Debian on a PC using a USB stick. The 
   installer seems to put an entry in /etc/fstab to mount /dev/sdb 
   at /media/usb0. I just delete this line. 

   --  
   Tixy 
 
 Thanks for your reply. I'm not sure if that is the problem I am 
 having, I installed from a CD to an SATA harddrive. The USB drives I 
 have are just for files I can't fit on the internal HD that I boot 
 from. What my issue boils down to is whenever I plug in one of these 
 drives, the automounter ignores the label on the first drive I attach, 
 any subsequent drives work as I expect them to (using the label as a 
 mount point). It doesn't matter which drive I attach, it always just 
 uses /media/usb0 for the first. If I dismount it and then attach 
 another, the 2nd drive gets the /media/usb0 mount point. If I then 
 reattach the first drive, it gets mounted using the label. The 
 automounter just acts weird with the first device I attach.

These symptoms match exactly to Tixy's suggestion, could you please at 
least show us your /etc/fstab?

Kind regards,
Andrei
-- 
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic


signature.asc
Description: Digital signature


Re: drive labels

2012-07-07 Thread Camaleón
On Fri, 06 Jul 2012 10:52:47 -0700, cletusjenkins wrote:

 I have several USB external drives. I have them formatted as ext3 and
 have assigned them labels (via tune2fs -L). All of my labels are made up
 of letters no numbers, spaces or other special characters. 

Output sample, please :-)

Also, what Debian version are you using?

 When I connect a drive, it's label is displayed correctly in gnome (on
 the desktop and when browsing in nautilus), but the devices is mounted
 as /media/usb0. If I connect another, it will show up in the GUI
 correctly and it actually gets mounted using the label name (/media
/filebackup). Is there a way to get my system to mount the drive with
 the label instead of usb0?

In any case, it should be mounted under /media using the label, so if 
it fails there has to be a reason for it (e.g., naming collisions?).

Attach the USB disk an run dmesg | tail -20 and dmesg | grep -i usb, 
then put here both outputs.

Greetings,

-- 
Camaleón


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/jt938p$2af$4...@dough.gmane.org



Re: drive labels

2012-07-07 Thread cletusjenkins
These symptoms match exactly to Tixy's suggestion, could you please at 
least show us your /etc/fstab? 
 
Kind regards, 
Andrei 

Ah, you are right, I completely misunderstood what Tixy was saying! I went to 
try what Paul Condon suggested I saw the line specifying /media/usb0 as the 
mount point. I've looked at the fstab several times but never noticed it. DOH! 
Thanks everyone.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/862742497.13100.1341715175668.JavaMail.sas@172.29.252.227



drive labels

2012-07-06 Thread cletusjenkins
I have several USB external drives. I have them formatted as ext3 and have 
assigned them labels (via tune2fs -L). All of my labels are made up of letters 
no numbers, spaces or other special characters. When I connect a drive, it's 
label is displayed correctly in gnome (on the desktop and when browsing in 
nautilus), but the devices is mounted as /media/usb0. If I connect another, it 
will show up in the GUI correctly and it actually gets mounted using the label 
name (/media/filebackup). Is there a way to get my system to mount the drive 
with the label instead of usb0?

-- clet
debian is my main squeeze



-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/1072733254.1958.1341597467185.JavaMail.sas2@172.29.254.227



Re: drive labels

2012-07-06 Thread Tixy
On Fri, 2012-07-06 at 10:52 -0700, cletusjenkins wrote:
 I have several USB external drives. I have them formatted as ext3 and have 
 assigned them labels (via tune2fs -L). All of my labels are made up of 
 letters no numbers, spaces or other special characters. When I connect a 
 drive, it's label is displayed correctly in gnome (on the desktop and when 
 browsing in nautilus), but the devices is mounted as /media/usb0. If I 
 connect another, it will show up in the GUI correctly and it actually gets 
 mounted using the label name (/media/filebackup). Is there a way to get my 
 system to mount the drive with the label instead of usb0?

I often see this when I install Debian on a PC using a USB stick. The
installer seems to put an entry in /etc/fstab to mount /dev/sdb
at /media/usb0. I just delete this line.

-- 
Tixy


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1341618219.2952.6.ca...@computer2.home



Re: drive labels

2012-07-06 Thread Paul E Condon
On 20120706_105247, cletusjenkins wrote:
 I have several USB external drives. I have them formatted as ext3 and have 
 assigned them labels (via tune2fs -L). All of my labels are made up of 
 letters no numbers, spaces or other special characters. When I connect a 
 drive, it's label is displayed correctly in gnome (on the desktop and when 
 browsing in nautilus), but the devices is mounted as /media/usb0. If I 
 connect another, it will show up in the GUI correctly and it actually gets 
 mounted using the label name (/media/filebackup). Is there a way to get my 
 system to mount the drive with the label instead of usb0?

I add one line to /etc/fstab for each labeled usb external drive like
the following:

LABEL=gflx1 /media/gflx1ext3rw,user,noauto  0   0

And I create the named mount point in /media with:

mkdir /media/gflx1

I have my own system of choosing label values
mnemonic-letter-groupdigits, but you can create your own
system. (gflx is a contraction of Seagate GoFlex) Don't try to use
labels that are informative of the contents of the drive. You can
easily maintian a text database of label contents. If you choose
to have the label never change, then the extra work of adding a line
to /etc/fstab is done only once when a new device is originally
acquired and adds very little to the drill of writing and ext3 file
system onto the partition Avoid giving two devices the same LABEL. The
text database is a good aid in this.

Its also a good idea to write the LABEL on a stickum label and place
the stickum label on the device.

HTH
-- 
Paul E Condon   
pecon...@mesanetworks.net


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120707002504.ga2...@big.lan.gnu



Re: drive labels

2012-07-06 Thread cletusjenkins
   
  I often see this when I install Debian on a PC using a USB stick. The 
  installer seems to put an entry in /etc/fstab to mount /dev/sdb 
  at /media/usb0. I just delete this line. 
   
  --  
  Tixy 

Thanks for your reply. I'm not sure if that is the problem I am having, I 
installed from a CD to an SATA harddrive. The USB drives I have are just for 
files I can't fit on the internal HD that I boot from. What my issue boils down 
to is whenever I plug in one of these drives, the automounter ignores the label 
on the first drive I attach, any subsequent drives work as I expect them to 
(using the label as a mount point). It doesn't matter which drive I attach, it 
always just uses /media/usb0 for the first. If I dismount it and then attach 
another, the 2nd drive gets the /media/usb0 mount point. If I then reattach the 
first drive, it gets mounted using the label. The automounter just acts weird 
with the first device I attach.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/2253221.28033.1341639949497.JavaMail.sas1@172.29.254.227



Re: Reach ext3 partitions with UUID labels

2011-01-31 Thread Camaleón
On Mon, 31 Jan 2011 07:08:31 +, Csanyi Pal wrote:

(...)

 Debian Squeeze uses UUID's to mount it's partitions, but Debian SID
 didn't so I think that cause that that I can't reach partitions of
 Debian Squeeze from Debian SID.

Quite strange.
 
 How can I convert the way system reach partitions (from /dev/sdaN to
 UUID's)? What package must I install for this?

AFAIK, no convertion needed nor package installation required, just list 
the UUID of your devices/partitions and adjust your /etc/fstab 
accordingly.

ls -l /dev/disk/by-uuid

Greetings,

-- 
Camaleón


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/pan.2011.01.31.12.32...@gmail.com



Reach ext3 partitions with UUID labels

2011-01-30 Thread Csanyi Pal
Hi,

I just have installed Debian SID with linux kernel 2.6.32-5-amd64 #1
SMP.

I installed it following http://io.debian.net/~tar/gnustep/install.txt

I have on my PC Box two SCSI hard disks: sda and sdb.
Debian SID is on /dev/sda3 and
the previously installed Debian GNU/Linux Squeeze is on
/dev/sdb5

Debian Squeeze uses UUID's to mount it's partitions, but Debian SID
didn't so I think that cause that that I can't reach partitions of
Debian Squeeze from Debian SID.

How can I convert the way system reach partitions (from /dev/sdaN to
UUID's)? What package must I install for this?

-- 
Best Regards,
Paul Chany
http://csanyi-pal.info


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/8739o935zk@gmail.com



Utilisation des labels pour les partitions.

2008-12-10 Thread Thierry Leurent
Bonjour,

J'ai un problème avec un chapeau rouge installé sur un san et utilisant LVM2.
De temps en temps, au boot, le système s'arrête et indique un fschl.ext3 
unable to resolve 'LABEL=/boot'.

Je crois me rappeler qu'il y avait eu un fil à ce sujet sur la liste mais je 
n'arrive plus à remettre la main dessus.

Quelqu'un aurait-il plus de chance que moi ? 
Merci 

-- 
---
Thierry Leurent


--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/DebFrFrenchLists
Vous pouvez aussi ajouter le mot ``spam'' dans vos champs From et
Reply-To:

To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Utilisation des labels pour les partitions.

2008-12-10 Thread Gilles Mocellin
On Wed, Dec 10, 2008 at 01:36:29PM +0100, Thierry Leurent wrote:
 Bonjour,
 
 J'ai un problème avec un chapeau rouge installé sur un san et utilisant LVM2.
 De temps en temps, au boot, le système s'arrête et indique un fschl.ext3 
 unable to resolve 'LABEL=/boot'.

[...]

Nous avons des Debian et des RedHat (c'est pas la bonne liste!)sur notre SAN.
Je n'ai jamais eu ce problème.

La partition correspondant au /boot est-elle sur le SAN ?

Sinon, il faut peut-être enlever les aspect SAN de l'initrd, que les disques 
SAN ne passent pas devant les disques locaux et empeche la détection dans le 
temps prévu du /boot et /root...


signature.asc
Description: Digital signature


Re: etch y uuid/labels

2008-04-21 Thread Federico Alberto Sayd

Luis Miguel R. escribió:

Buenas a todos, a ver si alguien me puede echar una mano con un tema,
tengo en un servidor dos controladoras sata con discos en ambas, de vez
en cuando la máquina no arrancaba bien y después de muchas horas de
pruebas y de buscar info resulta que las controladoras se detectan de
forma aleatoria y según el orden de detección se nombran los
dispositivos sata: sdX, también leo que para solucionar ese problema se
pueden usar las Labels en las particiones o bien los UUID, de forma
que identificas la partición por esa etiqueta o UUID en vez de por el
nombre del dispositivo /dev/sdX, hasta aquí todo bien, configuro el
fstab para que use etiquetas en vez de los devices, pero queda el
problema de la partición root, toda la información que encuentro por Internet 
dice que para poder usar labels o uuids para montar la partición root en

arranque hay que usar imágenes initrd creadas con mkinitcpio, por lo
que las que lleva debian, que van creadas con mkinitramfs no valdrían.

No me queda otra forma de confirma esto que haciendo pruebas,
hago los cambios pertinentes en el fstab y en el lilo , sustituyendo
todos los /dev/sdX por /dev/disk/by-label/LABEL.
Cuando las controladoras se detectan en el orden correcto el sistema
carga perfectamente, por lo que los cambios en fstab estan funcionando,
pero cuando se detecta mal, el sistema no arranca, por lo que parece que 
que efectivamente las imágenes initrd creadas con mkinitramfs no valen.


Tenéis alguna información al respecto de este problema o sabéis de una
solución? 


Lo único que se me ha ocurrido es una solución un poco patatera pero que
solucionaría el problema, sería modificar la imagen initrd y quitarle
el driver de la controladora que debe de detectarse en segundo lugar
para que solo se cargue el de la otra y luego con un script de inicio
cargar el driver de la segunda controladora, asegurándome así que
siempre se nombrarán los discos con el nombre correcto.

Gracias y un saludo.


  
Puedes recompilar el kernel y no usar una imagen initramfs, pero no se 
si funcionará.
Ahora bien, el problema es que no carga el kernel o que no monta las 
particiones? Porque si es lo último los paths relativos a uuids tienen 
que ir en el /etc/fstab


Saludos


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: etch y uuid/labels

2008-04-21 Thread Luis Miguel R.
El lunes, 21 abril del 2008 a las 09:12:10, Federico Alberto Sayd escribió:
 Luis Miguel R. escribió:
 Buenas a todos, a ver si alguien me puede echar una mano con un tema,
 tengo en un servidor dos controladoras sata con discos en ambas, de vez
 en cuando la máquina no arrancaba bien y después de muchas horas de
 pruebas y de buscar info resulta que las controladoras se detectan de
 forma aleatoria y según el orden de detección se nombran los
 dispositivos sata: sdX, también leo que para solucionar ese problema se
 pueden usar las Labels en las particiones o bien los UUID, de forma
 que identificas la partición por esa etiqueta o UUID en vez de por el
 nombre del dispositivo /dev/sdX, hasta aquí todo bien, configuro el
 fstab para que use etiquetas en vez de los devices, pero queda el
 problema de la partición root, toda la información que encuentro por 
 Internet dice que para poder usar labels o uuids para montar la partición 
 root en
 arranque hay que usar imágenes initrd creadas con mkinitcpio, por lo
 que las que lleva debian, que van creadas con mkinitramfs no valdrían.
 
 No me queda otra forma de confirma esto que haciendo pruebas,
 hago los cambios pertinentes en el fstab y en el lilo , sustituyendo
 todos los /dev/sdX por /dev/disk/by-label/LABEL.
 Cuando las controladoras se detectan en el orden correcto el sistema
 carga perfectamente, por lo que los cambios en fstab estan funcionando,
 pero cuando se detecta mal, el sistema no arranca, por lo que parece que 
 que efectivamente las imágenes initrd creadas con mkinitramfs no valen.
 
 Tenéis alguna información al respecto de este problema o sabéis de una
 solución? 
 
 Lo único que se me ha ocurrido es una solución un poco patatera pero que
 solucionaría el problema, sería modificar la imagen initrd y quitarle
 el driver de la controladora que debe de detectarse en segundo lugar
 para que solo se cargue el de la otra y luego con un script de inicio
 cargar el driver de la segunda controladora, asegurándome así que
 siempre se nombrarán los discos con el nombre correcto.
 
 Gracias y un saludo.
 
 
   
 Puedes recompilar el kernel y no usar una imagen initramfs, pero no se 
 si funcionará.
 Ahora bien, el problema es que no carga el kernel o que no monta las 
 particiones? Porque si es lo último los paths relativos a uuids tienen 
 que ir en el /etc/fstab
 

Hola, lo he solucionado con la forma patatera, he creado  una imagen
initramfs sin los drivers sata de la placa base, y luego cargo estos mas
adelante en el arranque, así se nombran correctamente..

Comentarte que la info para montar la particion raiz no se saca de
fstab, ya que para leer este fichero previamente tienes que haber
montado la partición.

Un saludo.




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



etch y uuid/labels

2008-04-19 Thread Luis Miguel R.
Buenas a todos, a ver si alguien me puede echar una mano con un tema,
tengo en un servidor dos controladoras sata con discos en ambas, de vez
en cuando la máquina no arrancaba bien y después de muchas horas de
pruebas y de buscar info resulta que las controladoras se detectan de
forma aleatoria y según el orden de detección se nombran los
dispositivos sata: sdX, también leo que para solucionar ese problema se
pueden usar las Labels en las particiones o bien los UUID, de forma
que identificas la partición por esa etiqueta o UUID en vez de por el
nombre del dispositivo /dev/sdX, hasta aquí todo bien, configuro el
fstab para que use etiquetas en vez de los devices, pero queda el
problema de la partición root, toda la información que encuentro por Internet 
dice que para poder usar labels o uuids para montar la partición root en
arranque hay que usar imágenes initrd creadas con mkinitcpio, por lo
que las que lleva debian, que van creadas con mkinitramfs no valdrían.

No me queda otra forma de confirma esto que haciendo pruebas,
hago los cambios pertinentes en el fstab y en el lilo , sustituyendo
todos los /dev/sdX por /dev/disk/by-label/LABEL.
Cuando las controladoras se detectan en el orden correcto el sistema
carga perfectamente, por lo que los cambios en fstab estan funcionando,
pero cuando se detecta mal, el sistema no arranca, por lo que parece que 
que efectivamente las imágenes initrd creadas con mkinitramfs no valen.

Tenéis alguna información al respecto de este problema o sabéis de una
solución? 

Lo único que se me ha ocurrido es una solución un poco patatera pero que
solucionaría el problema, sería modificar la imagen initrd y quitarle
el driver de la controladora que debe de detectarse en segundo lugar
para que solo se cargue el de la otra y luego con un script de inicio
cargar el driver de la segunda controladora, asegurándome así que
siempre se nombrarán los discos con el nombre correcto.

Gracias y un saludo.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Are volume labels a file-system thing?

2007-05-10 Thread Hendrik Boom
I just discovered that the commands for reading ans setting volume labels
have 'e2' in their names, like e2label.  Does this mean that I can label
my partitions only if I put an ext2 of ext3 file system on them?  Or is
there some other mechanism I should know about?


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Are volume labels a file-system thing?

2007-05-10 Thread Andrei Popescu
On Thu, May 10, 2007 at 03:15:13PM +, Hendrik Boom wrote:
 I just discovered that the commands for reading ans setting volume labels
 have 'e2' in their names, like e2label.  Does this mean that I can label
 my partitions only if I put an ext2 of ext3 file system on them?  Or is
 there some other mechanism I should know about?

Labels are file-system specific, but most (all?) should support them one 
way or another. You just need the specific tools to create/change them.

Regards,
Andrei
-- 
If you can't explain it simply, you don't understand it well enough.
(Albert Einstein)


signature.asc
Description: Digital signature


Re: Are volume labels a file-system thing?

2007-05-10 Thread Bob McGowan

Hendrik Boom wrote:

I just discovered that the commands for reading ans setting volume labels
have 'e2' in their names, like e2label.  Does this mean that I can label
my partitions only if I put an ext2 of ext3 file system on them?  Or is
there some other mechanism I should know about?




Labels are specific to each file system type, because the superblock is 
where it's stored, and each FS has a different format for that area on disk.


You will need to do a bit of research, but each FS type should have a 
program available to create/edit labels.  As you discovered, for ext[23] 
the program is 'e2label'.  For XFS, it's 'xfs_admin'.  I did some man 
searching, using the 'SEE ALSO' section, several times before looking 
for some of the specific programs in the /sbin and /usr/sbin directories.


Upshot is that once you know the general form used for FS specific 
commands (e2 or xfs_ prefix, for example), you can just do:


   ls /sbin/xfs* /usr/sbin/xfs*

And then use man on whatever command looks most promising.  If you're 
lucky, the name will actually have 'label' in it ;)


Bob


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Are volume labels a file-system thing?

2007-05-10 Thread Douglas Allan Tutty
On Thu, May 10, 2007 at 03:15:13PM +, Hendrik Boom wrote:
 I just discovered that the commands for reading ans setting volume labels
 have 'e2' in their names, like e2label.  Does this mean that I can label
 my partitions only if I put an ext2 of ext3 file system on them?  Or is
 there some other mechanism I should know about?

Each filesystem's utilities will have different commands to lable them.
For JFS it's jfs_tune -L 

Doug.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Are volume labels a file-system thing?

2007-05-10 Thread Kevin Mark
On Thu, May 10, 2007 at 03:15:13PM +, Hendrik Boom wrote:
 I just discovered that the commands for reading ans setting volume labels
 have 'e2' in their names, like e2label.  Does this mean that I can label
 my partitions only if I put an ext2 of ext3 file system on them?  Or is
 there some other mechanism I should know about?
You can specify disks by using by-id or by-uuid values for fstab, grub
and other config files also. 

-- 
|  .''`.  == Debian GNU/Linux == |   my web site:   |
| : :' :  The  Universal |mysite.verizon.net/kevin.mark/|
| `. `'  Operating System| go to counter.li.org and |
|   `-http://www.debian.org/ |be counted! #238656   |
|  my keyserver: subkeys.pgp.net | my NPO: cfsg.org |
|join the new debian-community.org to help Debian!  |
|___  Unless I ask to be CCd, assume I am subscribed ___|


signature.asc
Description: Digital signature


Re: Debian AMD64 boots only at random: how to use labels/fstab/grub

2006-10-02 Thread Bob McGowan

Sorry, I forgot that bit ;(

The command 'mkswap -L label device' will create a swap area and add a 
label for it.  This should probably be done from a rescue disk 
environment, so you don't confuse the running kernel with changes to its 
swap area.  I'm not aware of a separate tool to label a swap area 
without reformatting it, though such may well exist.


Add the label to /etc/fstab the same as you did for the file system labels.

Bob

Joost Kraaijeveld wrote:

Hi Bob,

Thanks: it works as described. 

Just 1 other question: can I label my swap partition? 


If I try e2label /dev/sda5 /my_name it returns:

e2label: Bad magic number in super-block while trying to open /dev/sdb5
Couldn't find valid filesystem superblock.

TIA



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Debian AMD64 boots only at random: how to use labels/fstab/grub

2006-10-02 Thread Jim Crilly
On 10/02/06 09:40:00AM -0700, Bob McGowan wrote:
 Sorry, I forgot that bit ;(
 
 The command 'mkswap -L label device' will create a swap area and add a 
 label for it.  This should probably be done from a rescue disk 
 environment, so you don't confuse the running kernel with changes to its 
 swap area.  I'm not aware of a separate tool to label a swap area 
 without reformatting it, though such may well exist.
 

Just do 'swapoff /dev/whatever' first and you'll be fine.

Jim.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Debian AMD64 boots only at random: how to use labels/fstab/grub

2006-09-30 Thread Joost Kraaijeveld
Hi Bob,

Thanks: it works as described. 

Just 1 other question: can I label my swap partition? 

If I try e2label /dev/sda5 /my_name it returns:

e2label: Bad magic number in super-block while trying to open /dev/sdb5
Couldn't find valid filesystem superblock.

TIA

-- 
Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
web: www.askesis.nl


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Debian AMD64 boots only at random: how to use labels/fstab/grub

2006-09-30 Thread Stephen Gran
This one time, at band camp, Joost Kraaijeveld said:
 Hi Bob,
 
 Thanks: it works as described. 
 
 Just 1 other question: can I label my swap partition? 
 
 If I try e2label /dev/sda5 /my_name it returns:
 
 e2label: Bad magic number in super-block while trying to open /dev/sdb5
 Couldn't find valid filesystem superblock.

e2label, perhaps unsurprisingly, given it's name, only handles ext2 and
ext3 filesystems.  See
http://www.sgvlug.org/pipermail/sgvlug/2005-September/000874.html for a
discussion of swap labels.
-- 
 -
|   ,''`.Stephen Gran |
|  : :' :[EMAIL PROTECTED] |
|  `. `'Debian user, admin, and developer |
|`- http://www.debian.org |
 -


signature.asc
Description: Digital signature


Debian AMD64 boots only at random: how to use labels/fstab/grub

2006-09-29 Thread Joost Kraaijeveld
Hi,

After an update of my kernel to 2.6.17 my machine only boots at random.
I have googled for a solution and it appears that it happens because of
the way the harddisks are found during startup . The solution described
involves using lables in fstab and grub (menu.lst).

But whatever I do, I cannot find a way to add labels in my fstab an grub
that actually work. Can anyone tell me what I have to do to make my
machine boot reliable using labels with fstab/grub? I have tried to add
labels to both fstab and menu.lst but a reboot failed miserably

Excerpt from my menu.lst

title   Debian GNU/Linux, kernel 2.6.17-2-amd64
root(hd0,0)
kernel  /boot/vmlinuz-2.6.17-2-amd64 root=/dev/sda1 ro
initrd  /boot/initrd.img-2.6.17-2-amd64
savedefault


My fstab:

# /etc/fstab: static file system information. 
# 
# file system mount point   type  options   dump  pass 
proc/proc   procdefaults0   0 
/dev/sda1   /   ext3defaults,errors=remount-ro 0 1 
/dev/sdb1   /varext3defaults0   2 
/dev/sdc1   /home   xfs defaults0   2 
/dev/sdc2   /pgdata xfs defaults0   2 
/dev/sda5   noneswapsw  0   0 
/dev/hdc/media/cdrom0   udf,iso9660 user,noauto 0   0 
/dev/fd0/media/floppy0  autorw,user,noauto  0   0 


TIA


-- 
Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
web: www.askesis.nl


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Debian AMD64 boots only at random: how to use labels/fstab/grub

2006-09-29 Thread Bob McGowan
I'm only familiar with the ext[23]/xfs filesystem commands which is what 
you appear to be using.  Other FS's have similar tools, I expect.


First, you need to be sure your disks are labeled.  For ext[23], the 
command is 'e2label -L /dev/...' where ... would be sda4 or hdb2, or 
whatever else you have.  For xfs, the command is 'xfs_admin -l /dev/...'


If you have a disk with no label, you would need to add one.  The disks 
must be unmounted before you can make changes, so you'd need to boot 
from a CD as the quickest, easiest way to work with them.  For ext[23], 
the command is 'e2label -L label', for xfs it's 'xfs_admin -L label', 
where 'label' is any name you choose, within the size limits specified 
in the man page for the commands.  Note the lower/upper case option with 
the xfs command.


All recent Debian installs that I've done have created labels for the 
devices created during the install.  These are the name of the mount 
point.  So, if you have a disk that is mounted on '/var' (as you do), 
the default label will be '/var'.


The only issue I have with this is the label chosen for the 'root' 
device.  This is '/', which is not a legal name in the file system, so 
no link is made for the root device, to use with the mount command.  I 
changed the root label on my system from '/' to '/root', so a valid link 
is created.


Now that you have labels on all your disk drives, change the two files 
like this:


  menu.lst:
  from
kernel  /boot/vmlinuz-2.6.17-2-amd64 root=/dev/sda1 ro
  to
kernel  /boot/vmlinuz-2.6.17-2-amd64 root=LABEL=/root ro

  fstab (just one example, the rest are similar):
  from
/dev/sdb1  /var  ext3   defaults  0 2
  to
LABEL=/var /var  ext3   defaults  0 2

Reboot.

Bob

Joost Kraaijeveld wrote:

Hi,

After an update of my kernel to 2.6.17 my machine only boots at random.
I have googled for a solution and it appears that it happens because of
the way the harddisks are found during startup . The solution described
involves using lables in fstab and grub (menu.lst).

But whatever I do, I cannot find a way to add labels in my fstab an grub
that actually work. Can anyone tell me what I have to do to make my
machine boot reliable using labels with fstab/grub? I have tried to add
labels to both fstab and menu.lst but a reboot failed miserably

Excerpt from my menu.lst

title   Debian GNU/Linux, kernel 2.6.17-2-amd64
root(hd0,0)
kernel  /boot/vmlinuz-2.6.17-2-amd64 root=/dev/sda1 ro
initrd  /boot/initrd.img-2.6.17-2-amd64
savedefault


My fstab:

# /etc/fstab: static file system information. 
# 
# file system mount point   type  options   dump  pass 
proc/proc   procdefaults0   0 
/dev/sda1   /   ext3defaults,errors=remount-ro 0 1 
/dev/sdb1   /varext3defaults0   2 
/dev/sdc1   /home   xfs defaults0   2 
/dev/sdc2   /pgdata xfs defaults0   2 
/dev/sda5   noneswapsw  0   0 
/dev/hdc/media/cdrom0   udf,iso9660 user,noauto 0   0 
/dev/fd0/media/floppy0  autorw,user,noauto  0   0 



TIA




smime.p7s
Description: S/MIME Cryptographic Signature


  1   2   >