Re: Archiving content of a directory on a DVD-R.

2022-03-18 Thread Thomas Schmitt
Hi,

> xorriso : UPDATE : 1219.8m content bytes read in 216 seconds = 4.3xD
> Ok, session data match recorded md5.

Success \o/

The next adventure would be with trying newly bought media.


Have a nice day :)

Thomas



Re: Archiving content of a directory on a DVD-R.

2022-03-17 Thread peter
From: "Thomas Schmitt" 
Date: Wed, 16 Mar 2022 08:52:24 +0100
> Now it depends on how much it was used in the last 18 years.

Unused since the lab which donated it closed 2016 or 2017.  Likely it 
was unused there for several years.  Could be a decade or more since 
it last operated.

> It will be interesting to learn which of the commercially available media
> are still willing to work.

Old blanks marked "TDK DVD-R 1-16x 4.7 GB". 

This is the shell function from your advice years ago.

FilesToDVD ()
{
printf "Insert open or new DVD-R.";
read t;
cd ~/MY0.Bak/;
xorriso -for_backup -dev /dev/sr0 -update_r . / -commit -toc -check_md5 
failure -- -eject all;
echo "xorriso -dev /dev/sr0 -toc";
echo "sudo mount -o sbsector=nn /dev/sr0 /mnt/iso"
}

Excerpts from the log.

root@joule:/home/root# FilesToDVD
Insert open or new DVD-R.
xorriso 1.5.2 : RockRidge filesystem manipulator, libburnia project.

Drive current: -dev '/dev/sr0'
Media current: DVD-R sequential recording
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 4489m free
Updating '/home/root/MY0.Bak' to '/'
xorriso : UPDATE : Adjusted attributes of '/'
xorriso : UPDATE : Added/overwrote '/packages.imager'  (209k)
xorriso : UPDATE : Added/overwrote '/HamamatsuG3367.png'  (987k)
...
xorriso : UPDATE : Added/overwrote '/hosts.carnot'  (536)
Differences detected and updated. (runtime 11.4 s)
xorriso : UPDATE : Writing: 16s0.0%   fifo   8%  buf   0%
xorriso : UPDATE : Writing: 16s0.0%   fifo  17%  buf   0%
xorriso : UPDATE : Writing: 16s0.0%   fifo 100%  buf   0%0.0xD 
...
xorriso : UPDATE : Writing: 624717s  100.0%   fifo   0%  buf  88%0.0xD 
xorriso : UPDATE : Writing: 624717s  100.0%   fifo   0%  buf  88%0.0xD 
xorriso : UPDATE : Closing track/session. Working since 246 seconds
xorriso : UPDATE : Closing track/session. Working since 247 seconds
...
xorriso : UPDATE : Closing track/session. Working since 289 seconds
xorriso : UPDATE : Thank you for being patient. Working since 290 seconds.
ISO image produced: 624567 sectors
Written to medium : 624720 sectors at LBA 0
Writing to '/dev/sr0' completed successfully.

xorriso : NOTE : Re-assessing -outdev '/dev/sr0'
xorriso : NOTE : Loading ISO image tree from LBA 0
xorriso : UPDATE :  10 nodes read in 2 seconds
xorriso : UPDATE :3210 nodes read in 2 seconds
Drive current: -dev '/dev/sr0'
Media current: DVD-R sequential recording
Media status : is written , is appendable
Media summary: 1 session, 624720 data blocks, 1220m data, 3194m free
Volume id: 'ISOIMAGE'
Drive current: -dev '/dev/sr0'
Drive access : exclusive:unrestricted
Drive type   : vendor 'PLEXTOR' product 'DVDR PX-708A' revision '1.06'
Drive id : '148925  '
Media current: DVD-R sequential recording
Media product: CMC_MAG._AM3 , CMC Magnetics Corporation
Media status : is written , is appendable
Media blocks : 624720 readable , 1635264 writable , 2297888 overall
TOC layout   : Idx ,  sbsector ,   Size , Volume Id
ISO session  :   1 , 0 ,624567s , ISOIMAGE
Media summary: 1 session, 624720 data blocks, 1220m data, 3194m free
Media nwa: 662624s
Checking loaded session by its recorded MD5.
Session MD5 8d6f545135195508327eacdc1f1c365b , LBA 0 , 624540 blocks
xorriso : UPDATE :  23232k content bytes read in 5 seconds , 3.4xD
...
xorriso : UPDATE : 1213.6m content bytes read in 215 seconds , 5.1xD
xorriso : UPDATE : 1219.8m content bytes read in 216 seconds = 4.3xD
Ok, session data match recorded md5.
xorriso -dev /dev/sr0 -toc
sudo mount -o sbsector=nn /dev/sr0 /mnt/iso
root@joule:/home/root/MY0.Bak# 

Thanks,   ... P.

-- 
mobile: +1 778 951 5147
  VoIP: +1 604 670 0140
   48.7693 N 123.3053 W



Re: Archiving content of a directory on a DVD-R.

2022-03-16 Thread Thomas Schmitt
Hi,

pe...@easthope.ca wrote:
> Nameplate is marked "September 2003".

Now it depends on how much it was used in the last 18 years.
(My oldest burner is from 2008 and lives on a strict diet of BD-RW.)


> Profile  : 0x001B (DVD+R)
> Profile  : 0x001A (DVD+RW)
> Profile  : 0x0014 (DVD-RW sequential recording)
> Profile  : 0x0013 (DVD-RW restricted overwrite)
> Profile  : 0x0011 (DVD-R sequential recording)

It will be interesting to learn which of the commercially available media
are still willing to work.

My best bet is DVD+RW because those did not gain any speed since they
were introduced.
I see in
  
https://www.amazon.de/Plextor-PX-708A-DVD-Brenner-8x4x12x-4x2x12x/dp/BALX3E
  "DVD + R with up to 8 speed, DVD-R with 4x speed"
which both is lower than the usual nominal speeds of the currently
available DVD+R and DVD-R (usually "16x" = ~ 22 MB/s). So there might
arise problems with possibly new-fangled chemistry between the plastic
layers.


Have a nice day :)

Thomas



Re: Archiving content of a directory on a DVD-R.

2022-03-15 Thread peter
From:   "Thomas Schmitt" 
Date:   Tue, 15 Mar 2022 22:27:37 +0100
> How old is it ?

Nameplate is marked "September 2003".

> I find this model mentioned as early as 2003. DVD burning was a novelty
> back then.

Consistent. 

> You may ask it by
> 
>   xorriso -outdev /dev/sr0 -list_profiles out

Drive current: -outdev '/dev/sr0'
Media current: CD-R
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data,  703m free
Drive current: -outdev '/dev/sr0'
Drive type   : vendor 'PLEXTOR' product 'DVDR PX-708A' revision '1.06'
Profile  : 0x001B (DVD+R)
Profile  : 0x001A (DVD+RW)
Profile  : 0x0014 (DVD-RW sequential recording)
Profile  : 0x0013 (DVD-RW restricted overwrite)
Profile  : 0x0011 (DVD-R sequential recording)
Profile  : 0x0010 (DVD-ROM)
Profile  : 0x000A (CD-RW)
Profile  : 0x0009 (CD-R) (current)
Profile  : 0x0008 (CD-ROM)

> DVD-R and DVD+RW should both be ok. DVD-R can store up to 99 sessions
> with several MB wasted between each session. 

Will aim for DVD+R, DVD-R or DVD+RW and report the result.

> If you cannot avoid DVD-RW ...

Should be a choice to avoid it.

Thanks,  ... P.

 


-- 
mobile: +1 778 951 5147
  VoIP: +1 604 670 0140
   48.7693 N 123.3053 W



Re: Archiving content of a directory on a DVD-R.

2022-03-15 Thread Thomas Schmitt
Hi,

pe...@easthope.ca wrote:
> Drive type   : vendor 'PLEXTOR' product 'DVDR PX-708A' revision '1.06'

How old is it ?
I find this model mentioned as early as 2003. DVD burning was a novelty
back then.


> https://www.londondrugs.com/verbatim-dvd-rw---30-pack/L7011505.html

Says "You have been blocked".

Guessing from the URL: DVD-RW media.
I would avoid DVD-RW with an old DVD burner. After DVD+R DL this is the
next type of DVD which fails when the burner's sight becomes blurred by
age.

The internet says that PX-708A does DVD-R, DVD-RW, and DVD+RW.

You may ask it by

  xorriso -outdev /dev/sr0 -list_profiles out

A modern DVD burner is supposed to reply something like

  Profile  : 0x0012 (DVD-RAM)
  Profile  : 0x0011 (DVD-R sequential recording)
  Profile  : 0x0015 (DVD-R/DL sequential recording)
  Profile  : 0x0016 (DVD-R/DL layer jump recording)
  Profile  : 0x0014 (DVD-RW sequential recording)
  Profile  : 0x0013 (DVD-RW restricted overwrite)
  Profile  : 0x001A (DVD+RW)
  Profile  : 0x001B (DVD+R)
  Profile  : 0x002B (DVD+R/DL)
  Profile  : 0x0010 (DVD-ROM)
  Profile  : 0x0009 (CD-R)
  Profile  : 0x000A (CD-RW)
  Profile  : 0x0008 (CD-ROM)
  Profile  : 0x0002 (Removable disk)

Yours might omit some of those lines.
A profile is a set of features. It describes a media role. Most of them
are about writing particular media types. Some are about reading.


> Not clear which medium is suitable for weekly backups.

DVD-R and DVD+RW should both be ok. DVD-R can store up to 99 sessions
with several MB wasted between each session. DVD+RW get their sessions
emulated by xorriso with no more than 64 MB waste between sessions.
In case that the drive announces to support DVD+R: 153 sessions with
4 MB waste between sessions.

If you cannot avoid DVD-RW then format them (if profile 0x0013 is
announced):

  xorriso -outdev /dev/sr0 -format as_needed

This makes them similar to DVD+RW.

DVD+RW and DVD-RW can be re-used. But xorriso will not be willing to
overwrite them from scratch unless you explicitely tell it to invalidate
the existing ISO 9660 filesystem (or other filesystem formats):

  xorriso -outdev /dev/sr0 -blank as_needed


Have a nice day :)

Thomas



Re: Archiving content of a directory on a DVD-R.

2022-03-15 Thread peter
From: "Thomas Schmitt" 
Date: Sat, 26 Feb 2022 18:29:45 +0100
> What messages do you get printed when the CD-or-DVD medium is inserted
> and you do:
> 
>   xorriso -outdev /dev/sr0 -toc

Have this drive in an external case with a blank CD.
No DVDs yet.

root@joule:/home/root#   xorriso -outdev /dev/sr0 -toc
xorriso 1.5.2 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev '/dev/sr0'
Media current: CD-R
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data,  703m free
Drive current: -outdev '/dev/sr0'
Drive access : exclusive:unrestricted
Drive type   : vendor 'PLEXTOR' product 'DVDR PX-708A' revision '1.06'
Drive id : '148925  '
Media current: CD-R
Media product: 97m26s66f/79m59s71f , CMC Magnetics Corporation
Media status : is blank
Media blocks : 0 readable , 359846 writable , 359846 overall
Media summary: 0 sessions, 0 data blocks, 0 data,  703m free

Several specifications described here.
https://en.wikipedia.org/wiki/DVD_recordable

Media which should be available.
https://www.londondrugs.com/verbatim-dvd-rw---30-pack/L7011505.html
https://www.londondrugs.com/verbatim-dvd%2Br-4.76gb-16x---50-pack---95037/L2167674.html

Not clear that this Plextor handles plus and minus.
Not clear which medium is suitable for weekly backups.

Thanks,... P.

-- 
mobile: +1 778 951 5147
  VoIP: +1 604 670 0140
   48.7693 N 123.3053 W



Re: Archiving on SD cards (was: Re: Archiving on optical media; was Re: Archiving content of a directory on a DVD-R.)

2022-02-28 Thread Chris Ramsden

Monday, February 28, 2022, 2:52:35 PM, rhkramer wrote:

> On Monday, February 28, 2022 12:37:49 AM pe...@easthope.ca wrote:
>> Backing data in a 4 or 16 GB SD card is a modest requirement.
>> PC Galore might have a drive in stock.  http://www.pcgalore.com/
> What has been your experience with reliability of SD cards for backup?

Mine has been bad. I have accumulated several dead SD cards, yet over many 
years, I can think of only one USB memory device failing. 
 
USB and SD memory devices are based on similar (if not identical) flash 
technology, are they not? 
 
Under this assumption, I'd guess that the USB interface is rather more robust 
than that found in SD cards. SD cards seem to be fine if installed and left 
there (IP cameras, dashcams, phones) but fail when handled. And yes, I am aware 
of ESD (electrostatic discharge) issues and take steps to minimize risk. 
 
I wouldn't trust my data to SD cards.   
-- 
Regards,
Chris



Archiving on SD cards (was: Re: Archiving on optical media; was Re: Archiving content of a directory on a DVD-R.)

2022-02-28 Thread rhkramer
On Monday, February 28, 2022 12:37:49 AM pe...@easthope.ca wrote:
> Backing data in a 4 or 16 GB SD card is a modest requirement.
> PC Galore might have a drive in stock.  http://www.pcgalore.com/

What has been your experience with reliability of SD cards for backup?



Archiving on optical media; was Re: Archiving content of a directory on a DVD-R.

2022-02-27 Thread peter
From: "Thomas Schmitt" 
Date: Sun, 27 Feb 2022 09:15:04 +0100
> Ouch. That's a "Combo" drive which can write only CD-R and CD-RW.
> With DVD media it can only do reading.
  ...
> That would be the job of an older project of mine:
>   http://scdbackup.sourceforge.net/main_eng.html
>   http://scdbackup.sourceforge.net/scdbackup-0.9.2.tar.gz
> 
> Installation and configuration are some work:
>   http://scdbackup.sourceforge.net/examples.html#configure
  ...
> (Back in 1999 a 650 MB CD-R was a respectable backup medium, competing
> with 500 MB QIC tapes and 1.2 GB DDS tapes.
> Nowadays i use them only for small backups and for software delivery.
> My bread-and-butter backup media are now "25 GB" BD-RE media. They are
> not much more expensive than DVD+RW. Only the prices of burner drives
> are significantly higher for BD than for DVD.)

My conclusion: invest in more recent hardware.
https://en.wikipedia.org/wiki/Blu-ray_Disc_recordable#Pricing

Backing data in a 4 or 16 GB SD card is a modest requirement.  
PC Galore might have a drive in stock.  http://www.pcgalore.com/

Tips to select a drive welcome.

Thanks, ... P.


-- 
mobile: +1 778 951 5147
  VoIP: +1 604 670 0140
   48.7693 N 123.3053 W



Re: Archiving content of a directory on a DVD-R.

2022-02-27 Thread Thomas Schmitt
Hi,

pe...@easthope.ca wrote:
> Drive type   : vendor 'SONY' product 'CD-RW CRX320E' revision 'NYK2'

Ouch. That's a "Combo" drive which can write only CD-R and CD-RW.
With DVD media it can only do reading.

So there is no use buying writable DVDs for it.


> To squeeze the data, add -zisofs.

This can help if the data are compressible by a factor 3.
But that would be quite boring data.


>  xorriso -for_backup -dev /dev/sr0 \
>  -update_r . / \
>  -zisofs \
>  -commit \

Command -zisofs sets parameters for the compression. It needs an argument
or else it would eat the command -commit and complain that it is not
a suitable parameter for -zisofs.

To cause the files to be compressed you have to equip them by zisofs
filters. For best and slowest compression choose zlib level 9:

  xorriso -for_backup -dev /dev/sr0 \
  -update_r . / \
  -zisofs level=9 \
  -find / -type f -pending_data -exec set_filter --zisofs -- \
  -commit \
  ...

--

> Likely xorriso provides a way to spread an archive over multiple CDs.
> Documentation or example?

That would be the job of an older project of mine:
  http://scdbackup.sourceforge.net/main_eng.html
  http://scdbackup.sourceforge.net/scdbackup-0.9.2.tar.gz

Installation and configuration are some work:
  http://scdbackup.sourceforge.net/examples.html#configure

(That's a reason why it is not in Debian. Another reason is that scdbackup
gets installed by particular users, which is good for isolating their
backup data but not suitable for the sysadmin-driven model of a Linux
distro.)

For building the software you need the C compiler and its companions
from Debian package "build-essential". Compilation happens automatically
during the run of ./CONFIGURE_CD or ./CONFIGURE_DVD.

After the installation you may simply run

  scdbackup_home

See
  http://scdbackup.sourceforge.net/examples.html#scdbackup_home

The more general command

  scdbackup

takes pathspecs as known from mkisofs and exclusions of paths:

  scdbackup /home /home2=/usr/home -not /home/guest

This example backups /home and /usr/home . It gives on CD the name /home2
to the directory tree that is /usr/home on hard disk. Subdir /home/guest
will not get into the backup.

(Back in 1999 a 650 MB CD-R was a respectable backup medium, competing
with 500 MB QIC tapes and 1.2 GB DDS tapes.
Nowadays i use them only for small backups and for software delivery.
My bread-and-butter backup media are now "25 GB" BD-RE media. They are
not much more expensive than DVD+RW. Only the prices of burner drives
are significantly higher for BD than for DVD.)


Have a nice day :)

Thomas



Re: Archiving content of a directory on a DVD-R.

2022-02-26 Thread Thomas Schmitt
Hi,

pe...@easthope.ca wrote:
> With a blank disk,
> xorriso : FAILURE : Image size 1072576s exceeds free space on media 359844s

359844 * 2048 = 736,960,512 bytes = 702.82 MiB.
This looks more like the size of a "700 MB" CD-R medium.


> Building temporary data structures in / space is limited?

Not in particular. Processing of directories with very many files can
become a bit sloww. There is memory needed for each file name and its
attribute when the emerging ISO 9660 filesystemi s planned. But unless
you have millions of files this should not be a problem even with an
old computer.

The FAILURE complaint rather says that libburn told xorriso that the
medium offers ~700 MiB for writing. But the emerging ISO 9660 filesystem
would need 2094.875 MiB of medium capacity.
A blank DVD-R would take that filesystem. A blank CD-R would not.


Question:
What messages do you get printed when the CD-or-DVD medium is inserted
and you do:

  xorriso -outdev /dev/sr0 -toc

With a blank "700 MB" CD-R i get:

  Drive current: -outdev '/dev/sr0'
  Media current: CD-R
  Media status : is blank
  Media summary: 0 sessions, 0 data blocks, 0 data,  703m free
  Drive current: -outdev '/dev/sr0'
  Drive access : exclusive:unrestricted
  Drive type   : vendor 'ASUS' product 'BW-16D1HT' revision '1.01'
  Drive id : 'K9CF92A5012 '
  Media current: CD-R
  Media product: 97m34s23f/79m59s73f , Mitsubishi Chemical Corporation
  Media status : is blank
  Media blocks : 0 readable , 359846 writable , 359846 overall
  Media summary: 0 sessions, 0 data blocks, 0 data,  703m free

(The capacity of CD-R varies by nominal size: "650 MB", ... "900 MB"
 and in smaller range between manufacturers which use the exact start
 and end address to distinguish their products from other companies.)

With a blank DVD-R i get:

  Drive current: -outdev '/dev/sr0'
  Media current: DVD-R sequential recording
  Media status : is blank
  Media summary: 0 sessions, 0 data blocks, 0 data, 4489m free
  Drive current: -outdev '/dev/sr0'
  Drive access : exclusive:unrestricted
  Drive type   : vendor 'ASUS' product 'BW-16D1HT' revision '1.01'
  Drive id : 'K9CF92A5012 '
  Media current: DVD-R sequential recording
  Media product: RITEKF1 , Ritek Corp
  Media status : is blank
  Media blocks : 0 readable , 2298496 writable , 2298496 overall
  Media summary: 0 sessions, 0 data blocks, 0 data, 4489m free


Have a nice day :)

Thomas



Re: Archiving content of a directory on a DVD-R.

2022-02-26 Thread peter
From: "Thomas Schmitt" 
Date: Wed, 06 Mar 2019 17:28:39 +0100
>   xorriso -for_backup -dev /dev/sr0 \
>   -update_r . / \ 
>   -commit \
>   -toc -check_md5 failure -- \ 
>   -eject all 

With a blank disk, 
...
xorriso : FAILURE : Image size 1072576s exceeds free space on media 359844s
libisofs: MISHAP : Image write cancelled
...

root@joule:/home/root# df | grep sd
/dev/sda16227904 4218756   1673072  72% /
/dev/sda4   25764060 4672576  19759672  20% /home
/dev/sdb13658244 2214144   1258252  64% /home/root/MY

Building temporary data structures in / space is limited?

How can xorriso to told to work in /home?

Thx,   ... P.

-- 
mobile: +1 778 951 5147
  VoIP: +1 604 670 0140
   48.7693 N 123.3053 W



Re: Archiving content of a directory on a DVD-R.

2019-05-10 Thread Thomas Schmitt
Hi,

pe...@easthope.ca wrote:
> xorriso : UPDATE : Writing: 115440s   29.7%   fifo 100%  buf 100% 6.0xD
> libburn : FATAL : SCSI error on write(117872,16): [5 21 02] Illegal request.
> Invalid address for write.

That's new to me. I wonder how this could happen.

A DVD-R has to be written strictly sequentially, beginning at its
Next Writable Address as told by the drive. The SCSI WRITE commands
which are issued by libburn are supposed to bear the appropriate target
block address. After each WRITE command the address gets incremented by
the number of blocks which were written.
The code which does this is quite hard to fool.

In principle there are several possible reasons:
- libburn did not increment its WRITE address properly.
- a WRITE command was repeated by libburn or by the kernel.
- a WRITE command was dropped by the kernel.
- the drive's firmware had a hick-up.

Currently i have few ideas how to diagnose this. There is a debug message
in the Linux-specific code of libburn, which might have told more iabout
repetitions if the run had been made with debug verbosity:

  xorriso -report_about debug ...other.commands...

But that's quite verbous in many other aspects, too.
I will have to increase the severity of the non-fatal SG_IO driver events.

A repetition would not be noticed on overwritable media. I mostly use
BD-RE and DVD+RW media, which belong to that class. But once per day i
write a BD-R and about every week a CD-RW. Since years.


> libburn : FAILURE : Failed to close session (2). SCSI error : [5 72 03]
> Illegal request. Session fixation error, incomplete track in session.

... and i will have to review the bail-out procedure for failed write
operations. There seems to be missing a close-track operation.

Error handling of rarely occuring problems tends to be buggy by itself.


Have a nice day :)

Thomas



Re: Archiving content of a directory on a DVD-R.

2019-05-10 Thread peter
From: "Thomas Schmitt" 
Date: Wed, 06 Mar 2019 17:28:39 +0100
>   xorriso -for_backup -dev /dev/sr0 \
>   -update_r . / \ 
>   -commit \
>   -toc -check_md5 failure -- \ 
>   -eject all 
> 
> Now you can write to the DVD-R until it is full. Each run will produce a
> complete directory tree of the current state. 

Gave it a try this morning with this result.

  ...
xorriso : UPDATE : Writing: 103200s   26.6%   fifo 100%  buf 100%6.0xD
xorriso : UPDATE : Writing: 107280s   27.6%   fifo  96%  buf 100%6.0xD
xorriso : UPDATE : Writing: 111360s   28.7%   fifo  85%  buf 100%6.0xD
xorriso : UPDATE : Writing: 115440s   29.7%   fifo 100%  buf 100%6.0xD
libisofs: MISHAP : Image write cancelled
libburn : FATAL : SCSI error on write(117872,16): [5 21 02] Illegal request. Inv
alid address for write.
xorriso : FATAL : -abort_on 'FAILURE' encountered 'FATAL' during image writing
xorriso : NOTE : libburn has now been urged to cancel its operation
xorriso : UPDATE : Writing: 117888s   30.4%   fifo 100%  buf 100%3.6xD
xorriso : UPDATE : Writing: 117888s   30.4%   fifo 100%  buf 100%0.0xD
libburn : FAILURE : Failed to close session (2). SCSI error : [5 72 03] Illegal
request. Session fixation error, incomplete track in session.
xorriso : FAILURE : libburn indicates failure with writing.
xorriso : aborting : -abort_on 'FAILURE' encountered 'FATAL'

Until now I've never seen xorriso fail.  Invalid address?

Thanks,   ... Peter E.

-- 
Composed and transmitted by software designed to avoid the 
complication and vulnerability of antivirus software.



Re: Archiving content of a directory on a DVD-R.

2019-03-06 Thread Thomas Schmitt
Hi,

pe...@easthope.ca wrote:
> Media current: DVD-R sequential recording
> [...]
> xorriso : UPDATE :  742.1m content bytes read in 112 seconds = 5.0xD

It seems that next the joy of incremental backups could be explored.


> http://easthope.ca/DebianPage.html

First precondition would be to give up xorriso command
  -close on
to keep the DVD-R writable on its yet unused area.

Next replace -outdev by -dev and -map by -update_r.
I.e.:

  xorriso -for_backup -dev /dev/sr0 \
  -update_r . / \ 
  -commit \
  -toc -check_md5 failure -- \ 
  -eject all 

Now you can write to the DVD-R until it is full. Each run will produce a
complete directory tree of the current state. Data file content will
only be written if the file is new or its content changed since the
previous backup session (if there is such a session on DVD already).
If not many files changed, the add-on session 

When you mount the DVD on GNU/Linux, the youngest session will be used by
default. Older sessions can be mounted by mount(8) option "-o sbsector="
using the numbers told by column "sbsector" of xorriso command -toc:

  $ sudo mount -o sbsector=567890 /dev/sr0 /mnt/iso

Each session shows the complete directory state as it was at the time
when it was written to DVD.

When the DVD-R has not enough room for the upcomming session, xorriso will
fail without altering the DVD-R content. In this case, just insert a new
blank DVD-R to write a new first session.



The update decision is based on the timestamps and recorded MD5s on DVD.
For the comparison, the MD5s of the files in /home/peter/MY0.Bak have
to be computed by reading the full file content. If the storage device
is slow or your CPU runs hot, then consider to bet on device numbers and
inode numbers:

If the device number of the storage device is persistent over unmounting
or reboot, then insert
  -disk_dev_ino on
between -for_backup and -outdev.

If the device number changes, but the inode numbers are persistent, then
use
  -disk_dev_ino ino_only

Whether those numbers are persistent can be inquired by printing them
with shell command "stat" before and after reboot or re-mounting:

  $ stat --format="device=%d  inode=%i" /.../some_file
  device=2051  inode=3540166

(Device number changes are a matter of the operating system's bus
 management, inode number changes are mostly a matter of the filesystem's
 type. extN should be safe at least with inode numbers.)


Have a nice day :)

Thomas



Re: Archiving content of a directory on a DVD-R.

2019-03-06 Thread peter
*   From: "Thomas Schmitt"fifo 100%  buf   0%0.0xD 
  ...
xorriso : UPDATE : Writing: 380133s  100.0%   fifo   0%  buf 100%0.0xD 
ISO image produced: 379983 sectors
Written to medium : 380133 sectors at LBA 0
Writing to '/dev/sr0' completed successfully.

xorriso : NOTE : Re-assessing -outdev '/dev/sr0'
  ...
xorriso : UPDATE :  742.1m content bytes read in 112 seconds = 5.0xD
Ok, session data match recorded md5.

real5m12.980s
user0m10.536s
sys 0m6.148s




-- 
Message composed and transmitted by software designed to avoid the 
complication and vulnerability of antivirus software.

123456789 123456789 123456789 123456789 123456789 123456789 123456789
Pender Is., BC: +1 604 670 0140 Washington State: +1 360 639 0202
http://easthope.ca/Peter.html  Bcc: peter at easthope. ca



Re: Archiving content of a directory on a DVD-R.

2018-11-14 Thread Jonathan Dowland

On Wed, Nov 14, 2018 at 08:37:41AM -0500, Greg Wooledge wrote:

The point is you can run "sudo ascript" but you cannot run "sudo afunction".


Oh yes of course. I had forgotten that from the earlier messages. Sorry
for the noise.

--

⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Jonathan Dowland
⢿⡄⠘⠷⠚⠋⠀ https://jmtd.net
⠈⠳⣄ Please do not CC me, I am subscribed to the list.



Re: Archiving content of a directory on a DVD-R.

2018-11-14 Thread Greg Wooledge
On Wed, Nov 14, 2018 at 09:55:31AM +, Jonathan Dowland wrote:
> On Tue, Nov 13, 2018 at 08:15:13AM -0500, Greg Wooledge wrote:
> > So move them to scripts instead.  Or a single script.
> > 
> > Defining your system backup in your end-user account's shell functions
> > just seems completely silly and pointless.
> 
> I can't really see the problem, assuming ~/.bashrc is being backed up in
> the same way you might expect ~/bin/backup{1,2,3} to be.

The point is you can run "sudo ascript" but you cannot run "sudo afunction".



Re: Archiving content of a directory on a DVD-R.

2018-11-14 Thread Jonathan Dowland

On Tue, Nov 13, 2018 at 08:15:13AM -0500, Greg Wooledge wrote:

So move them to scripts instead.  Or a single script.

Defining your system backup in your end-user account's shell functions
just seems completely silly and pointless.


I can't really see the problem, assuming ~/.bashrc is being backed up in
the same way you might expect ~/bin/backup{1,2,3} to be.

--

⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Jonathan Dowland
⢿⡄⠘⠷⠚⠋⠀ https://jmtd.net
⠈⠳⣄ Please do not CC me, I am subscribed to the list.



Re: Archiving content of a directory on a DVD-R.

2018-11-13 Thread peter
*   From: Greg Wooledge 
*   Date: Tue, 13 Nov 2018 08:15:13 -0500
> So move them to scripts instead.  Or a single script.

Likely the 2nd (archive build) and 3rd (DVD burn) stages will be 
combined after they have worked for a few weeks with no obvious 
problems.  The first stage will remain distinct.  No need to burn 
multiple DVDs in day. Yes need to sync the SD card to the HDD 
frequently.

> Defining your system backup in your end-user account's shell functions 
> just seems completely silly and pointless.

System backup is provided by debian.  Eg.
https://cdimage.debian.org/debian-cd/current/i386/iso-cd/debian-9.6.0-i386-netinst.iso
No point in backing a widely available archive.  If the HDD fails, 
install another and proceed with *netinst.iso.

My own data is backed of course.  By Backup according to previous 
message.

Additional point: work at user status when possible; root status when 
necessary.  Arbitrary use of root status opens unnecessary 
vulnerability.

> But clearly you're going to ignore all advice I give, so fine.

Not ignoring advice.  Replies concerning pushd, popd, tar and xorriso 
have been invaluable.

Thanks,   ... Peter E.





-- 
Message composed and transmitted by software designed to avoid the 
complication, overhead and vulnerability of antivirus software.

123456789 123456789 123456789 123456789 123456789 123456789 123456789
Tel: +1 360 639 0202  +1 
http://easthope.ca/Peter.html  Bcc: peter at easthope. ca



Re: Archiving content of a directory on a DVD-R.

2018-11-13 Thread Greg Wooledge
On Mon, Nov 12, 2018 at 06:15:29PM -0800, pe...@easthope.ca wrote:
> I was afraid you meant that.  =8~)  My three scripts are executed 
> interactively. To my knowledge there can be only one script in a file.  
> =8~|  By defining chell functions, all three are in .bashrc.  =8~)

So move them to scripts instead.  Or a single script.

Defining your system backup in your end-user account's shell functions
just seems completely silly and pointless.

But clearly you're going to ignore all advice I give, so fine.  It's
your system.  Do whatever you want.



Re: Archiving content of a directory on a DVD-R.

2018-11-12 Thread peter
*   From: Greg Wooledge 
*   Date: Mon, 12 Nov 2018 17:14:13 -0500
> Just put all the commands in one script, for example:
> 
> #!/bin/sh
> backup1 &&
> backup2 &&
> backup3

I was afraid you meant that.  =8~)  My three scripts are executed 
interactively. To my knowledge there can be only one script in a file.  
=8~|  By defining chell functions, all three are in .bashrc.  =8~)

> Here's the backup script I use at home, ...

OK, my first stage follows.  ~/MY/ is an SD card.  This Backup is 
executed when I finish editing something or finish enough editing that 
I wouldn't want to retype it after the flash store fails.  It merely 
syncs from ~/MY/ into ~/MY0.Bak or, if executed with any parameter, to 
~/MY1.Bak.  Then it reports the size of MailMessages and the current size 
of the backup.  Subdirectories, logs, voice messages, installer archives 
and similar non-essential data are excluded.  Definitely more 
primitive than your backup.  Comments welcome of course.

The further two functions put the backup on a DVD-R.  Done once per 
week or less depending on competing "essential" work, fatigue & etc.  Can 
discuss these stages 2 and 3 later.

Thanks, ... Peter E.


Backup() { \
 if [ $# -gt 1 ]; then
   echo "Too many arguments.";
 else
   echo "0 or 1 arguments are OK.";
   if [ $# -eq 0 ]; then
 echo "0 arguments is OK.";
 destination=~/MY0.Bak;
 echo "destination is $destination.";
   else
 echo "1 argument is OK.";
 destination=~/MY1.Bak;
 echo "destination is $destination.";
   fi;
 echo "Executing rsync.";
 rsync \
  --exclude "*/" \
  --exclude='AOS*' \
  --exclude='Trap*' \
  --exclude='*.WAV' \
  --exclude='.aoshome' \
  --exclude "lost+found" \
  --exclude='*.Bak' \
  --exclude='*.bundle' \
  --exclude='*.iso' \
  --exclude='*.mp3' \
  --exclude='*.mp4' \
  --exclude='pe' \
  --exclude='*.sig' \
  --exclude='*.webm' \
  --exclude='*.zd' \
  --exclude='*.zip' \
  --exclude='*Libre*' \
  --exclude='*Linux*' \
  --exclude='Configuration.XML' \
  --exclude='Oberon*Fnt' \
  --exclude='Oberon.Text' \
  -auv /home/peter/MY/* $destination ;
 /bin/ls -ld ~/MY/MailMessages;
 printf "du -s $destination gives ";
 du -s $destination;
  fi;
}

-- 
Message composed and transmitted by software designed to avoid the 
need, overhead and vulnerability of antivirus software.

123456789 123456789 123456789 123456789 123456789 123456789 123456789
Tel: +1 360 639 0202  +1 
http://easthope.ca/Peter.html  Bcc: peter at easthope. ca



Re: Archiving content of a directory on a DVD-R.

2018-11-12 Thread Greg Wooledge
On Mon, Nov 12, 2018 at 01:13:14PM -0800, pe...@easthope.ca wrote:
> How are multiple commands defined in one file?  Then invoke?
> sudo backup1
> sudo backup2
> sudo backup3

Just put all the commands in one script, for example:

#!/bin/sh
backup1 &&
backup2 &&
backup3


Then run "sudo /the/backupscript".  If it's in a directory in your PATH,
you can simply do "sudo backupscript".

Of course, your example is so entirely obfuscated and genericized that
it's meaningless.  You can't even demonstrate anything with it.

Here's the backup script I use at home, with only one piece of information
hidden.  It's not elegant.  It's simply what I've got.

It is named /usr/local/bin/backup.  When I want to run it, I type
"sudo backup".

#!/bin/bash

cd /backup || exit
today=$(date +%Y%m%d)

if [ -e /hd/.hd ]; then
( cd / && rsync -av --delete etc home usr/local /hd/titan/ )
( cd /stuff && rsync -av --delete * /hd/ )
else
echo "/hd not mounted"
fi

( cd /etc && find . -print0 |
cpio -o -0 | gzip > "/backup/compress/backup.$HOSTNAME.etc.$today" )

( export RSYNC_RSH='ssh -p [REDACTED]';
  cd remote && rsync -av --delete r...@remote.wooledge.org:{/etc,/var/moin} . )

( cd remote && find . -print0 |
cpio -o -0 | gzip > "/backup/compress/backup.remote.$today" )

( cd /home && find . \( -type d -name .cache \) -prune -o -print0 |
cpio -o -0 | gzip > "/backup/compress/backup.$HOSTNAME.home.$today" )

find compress -type f -mtime +4 -delete
( cd compress && mkisofs -o ../image . )

ls -ld image
read -p "Write to DVD? [y] " yn
case $yn in ''|[Yy]|[Yy]es) : ;; *) exit ;; esac
cdrecord -v image



Re: Archiving content of a directory on a DVD-R.

2018-11-12 Thread peter
On Wed, Nov 07, 2018 at 01:52:13PM -0800, pe...@easthope.ca wrote:
> > My backup procedures are shell functions 
> > rather than scripts

*   From: Greg Wooledge 
*   Date: Thu, 8 Nov 2018 08:18:15 -0500
> That's pretty bizarre.  I don't see what advantage that gives you over
> simply putting the commands in a script so that you can run something like
> "sudo backup" on demand.

How are multiple commands defined in one file?  Then invoke?
sudo backup1
sudo backup2
sudo backup3

Thanks,  ... Peter E.



-- 
Message composed and transmitted by software designed to avoid the 
need, overhead and vulnerability of antivirus software.

123456789 123456789 123456789 123456789 123456789 123456789 123456789
Tel: +1 360 639 0202  +1 
http://easthope.ca/Peter.html  Bcc: peter at easthope. ca



Re: Archiving content of a directory on a DVD-R.

2018-11-08 Thread Greg Wooledge
On Wed, Nov 07, 2018 at 01:52:13PM -0800, pe...@easthope.ca wrote:
> My backup procedures are shell functions 
> rather than scripts

That's pretty bizarre.  I don't see what advantage that gives you over
simply putting the commands in a script so that you can run something like
"sudo backup" on demand.

Since your backup seems to be tied to your interactive environment, that
also makes it difficult or impossible to schedule backups in cron.



pushd/podp (was Re: Archiving content of a directory on a DVD-R.)

2018-11-08 Thread Jonathan Dowland

On Wed, Nov 07, 2018 at 01:52:13PM -0800, pe...@easthope.ca wrote:

push/popd are helpful when a tree structured file system is present.
Are they in POSIX?  Best avoided?


They are not POSIX, I don't think they are covered by any subsequent
standard either (great opportunity for anyone who wants to contribute to
a future standard I guess!). Originally from csh, they are present in
bash and zsh too, at least; but not dash (by design) and likely not
posh.

--

⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Jonathan Dowland
⢿⡄⠘⠷⠚⠋⠀ https://jmtd.net
⠈⠳⣄ Please do not CC me, I am subscribed to the list.



Re: Archiving content of a directory on a DVD-R.

2018-11-07 Thread Thomas Schmitt
Hi,

Lee  wrote:
> > any chance there's a symlink in the directory? that you want archived?
> > tar -h
> >   Follow symlinks; archive and dump the files they point to.

pe...@easthope.ca wrote:
> I can't think of a reason for a symlink to 
> exist but will keep the possibility in mind.  An exception is a likely 
> source of trouble.

Actually i think that symbolic links should be backuped as what they are.

Backing up link targets instead will prevent recreating of the link
relation at restore time. If the link target or link siblings are also part
of the backup, then they will be backuped and restored as duplicates.

Said this, if you use xorriso for making an ISO 9660 you can control this
by command -follow. Default is

  -follow pattern:mount:limit=100

which will follow links during resolving of search patterns (as would the
shell do), will follow a sub tree into a different mounted filesystem,
and limit link chain length to 100 in order to avoid link loops.

If you want to follow symbolic links inside tress, perform before the
first -map command:

  -follow link:mount:limit=100

If you do not want this but only want to record the link targets of
program arguments, like $SYMBOLIC_LINK_PATH in

  -map $SYMBOLIC_LINK_PATH $ISO_PATH

then perform

  -follow param:mount:limit=100


Have a nice day :)

Thomas



Re: Archiving content of a directory on a DVD-R.

2018-11-07 Thread peter
I've lost the message but someone mentioned that pushd and popd 
suggest the csh shell.  My backup procedures are shell functions 
rather than scripts and the shell name isn't blatant.  Could be in a 
comment.

push/popd are helpful when a tree structured file system is present.  
Are they in POSIX?  Best avoided?

Thanks,   ... Peter E.



-- 
Message composed and transmitted by software designed to avoid the 
need, overhead and vulnerability of antivirus software.

123456789 123456789 123456789 123456789 123456789 123456789 123456789
Tel: +1 360 639 0202  +1 
http://easthope.ca/Peter.html  Bcc: peter at easthope. ca



Re : Archiving content of a directory on a DVD-R.

2018-11-07 Thread peter
From:   Lee 
Date:   Sun, 4 Nov 2018 12:25:43 -0500
> any chance there's a symlink in the directory? that you want archived?
> tar -h
>   Follow symlinks; archive and dump the files they point to.

Thanks for mentioning that. The directory is for plain old files of 
data and a few subdirectories.  Subdirectories are excluded from the 
first stage of backup.  I can't think of a reason for a symlink to 
exist but will keep the possibility in mind.  An exception is a likely 
source of trouble.

Regards, ... Peter E.



-- 
Message composed and transmitted by software designed to avoid the 
need, overhead and vulnerability of antivirus software.

123456789 123456789 123456789 123456789 123456789 123456789 123456789
Tel: +1 360 639 0202  +1 
http://easthope.ca/Peter.html  Bcc: peter at easthope. ca



Re: Archiving content of a directory on a DVD-R.

2018-11-07 Thread Jonathan Dowland

On Wed, Nov 07, 2018 at 01:05:46PM +0100, Thomas Schmitt wrote:

Regrettably i see few chances to get an interpreter for the extra info
into Linux or other kernels. So for restoring ACL, xattr, or hard link
relations, one will have to use commands -osirrox "on" and -extract.
This also helps to work around kernel shortcommings on Solaris and the BSDs.


This would be a really interesting piece of work and if I wasn't already
crazy busy (full time job, young daughter, part time PhD, mostly ignored
Debian responsibilities, proofreading a book…) I'd jump on it. But if
you are prepared to mail me privately some further technical details, I
might think about scheduling it once I've got a few other things done.
It's been too long since my last kernel contribution (which was trivial
anyway)


Have a nice day :)


You too ;)

--

⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Jonathan Dowland
⢿⡄⠘⠷⠚⠋⠀ https://jmtd.net
⠈⠳⣄ Please do not CC me, I am subscribed to the list.



Re: Archiving content of a directory on a DVD-R.

2018-11-07 Thread Thomas Schmitt
Hi,

> "-for_backup" selects all the necessary extensions etc. to do the
> best job possible.

Regrettably i see few chances to get an interpreter for the extra info
into Linux or other kernels. So for restoring ACL, xattr, or hard link
relations, one will have to use commands -osirrox "on" and -extract.
This also helps to work around kernel shortcommings on Solaris and the BSDs.


Have a nice day :)

Thomas



Re: Archiving content of a directory on a DVD-R.

2018-11-07 Thread Jonathan Dowland

On Sun, Nov 04, 2018 at 06:48:45PM +0100, Thomas Schmitt wrote:

If you want to make use of xorriso's capability to create a mountable ISO
filesystem with a copy of your directory, then you do not need tar.

 xorriso -for_backup -outdev /dev/sr0 -map . / \
 -close on -commit \
 -toc -check_md5 failure -- \
 -eject all


This is very, very good advice. The one question I had when reading it
was to what extent this faithfully recorded all the metadata for the
files that are selected. But I answered that via the xorriso(1) manpage,
and "-for_backup" selects all the necessary extensions etc. to do the
best job possible.

So, +1 for this approach - *especially* the -check_md5 step.


--

⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Jonathan Dowland
⢿⡄⠘⠷⠚⠋⠀ https://jmtd.net
⠈⠳⣄ Please do not CC me, I am subscribed to the list.



Re: Archiving content of a directory on a DVD-R.

2018-11-06 Thread Thomas Schmitt
Hi,

i wrote:
> >   $ dd if=/dev/sr0 count=1 >/dev/null 2>&1
> > which shall pull in the tray and wait until the drive is ready, does not
> > work any more.

Dan Ritter wrote:
> Is this approximately equivalent to `eject -t` ?

Yes. And equivalently broken. Only burn programs still do wait for the
drive to become ready, because they rely on the sr driver only for a
few ioctls(), especially SG_IO, which performs SCSI command transactions.


Have a nice day :)

Thomas



Re: Archiving content of a directory on a DVD-R.

2018-11-06 Thread Dan Ritter
Thomas Schmitt: 
> Hi,
> 
> i have to add that the example gesture
> 
>   $ dd if=/dev/sr0 count=1 >/dev/null 2>&1
> 
> which shall pull in the tray and wait until the drive is ready, does not
> work any more.

Is this approximately equivalent to `eject -t` ?

-dsr-



Re: Archiving content of a directory on a DVD-R.

2018-11-06 Thread Thomas Schmitt
Hi,

i have to add that the example gesture

  $ dd if=/dev/sr0 count=1 >/dev/null 2>&1

which shall pull in the tray and wait until the drive is ready, does not
work any more. I was using a very fine kernel 2.6 for many years.
Now i am on younger ones which got probably broken 10 years ago by
   
https://github.com/torvalds/linux/commit/210ba1d1724f5c4ed87a2ab1a21ca861a915f734

(I am still looking for a kernel developer who would be willing to work
 with me to fix this and a few other bugs or shortcommings. The oldest one
 stems probably from the mid 1990s. It's a matter of social standing and
 of the newest kernel on real iron.) 


Have a nice day :)

Thomas



Re: Archiving content of a directory on a DVD-R.

2018-11-06 Thread Thomas Schmitt
Hi,

> The cdrecord "personality" is used to present a familiar 
> legacy syntax?

It helped a lot to get people to trying it out.


> Can the same result be reached using xorriso with no personality?

No. The cdrecord emulation option interface is the only way to achieve
the classical division between ISO producer and optical burn program.

The cdrecord emulation and its enhancements towards cdrecord and wodim
is documented in man 1 xorrecord:
  https://manpages.debian.org/jessie/xorriso/xorrecord.1.en.html
For the mkisofs emulation (which we did not use yet in this thread) see
  https://manpages.debian.org/jessie/xorriso/xorrisofs.1.en.html


> To my thinking, all the examples 
> in https://www.gnu.org/software/xorriso/ assume an ISO 9660 filesystem. 

Most of them, but not all. There is an example for image burning

  Burn an existing ISO image file to medium

   Actually this works with any kind of data, not only ISO images: 
   $ xorriso -as cdrecord -v dev=/dev/sr0 blank=as_needed image.iso

and an example for piping into xorriso -as cdrecord:

   Perform multi-session runs as of cdrtools traditions

   Between both processes there can be performed arbitrary transportation
   or filtering.
   The first session is written like this: 
   $ xorriso -as mkisofs prepared_for_iso/tree1 | \
  xorriso -as cdrecord -v dev=/dev/sr0 blank=fast -multi -eject - 
   Follow-up sessions are written like this:
   $ dd if=/dev/sr0 count=1 >/dev/null 2>&1
   $ m=$(xorriso -as cdrecord dev=/dev/sr0 -msinfo)
   $ xorriso -as mkisofs -M /dev/sr0 -C $m prepared_for_iso/tree2 | \
 xorriso -as cdrecord -v dev=/dev/sr0 -waiti -multi -eject -
   Always eject the drive tray between sessions.

As one can see, the coordination of both roles is complicated and error prone.
That's why xorriso with its native command set integrates both tasks.
  https://manpages.debian.org/jessie/xorriso/xorriso.1.en.html

(Further, a command set makes possible much a finer definition of the job
 than a heap of options can. You can let xorriso do things before or after
 other things, which sometimes makes a big difference.)


Have a nice day :)

Thomas



Re: Archiving content of a directory on a DVD-R.

2018-11-06 Thread peter
Thanks to all who have replied.

*   From: "Thomas Schmitt" 
*   Date: Sun, 04 Nov 2018 18:48:45 +0100

> Writing the tar stream to DVD-R is a classical use case of cdrecord or wodim.
> So:
> 
>   tar -vcpzf - * | xorriso -as cdrecord -v dev=/dev/sr0 -eject fs=16m -

OK, thanks.  The cdrecord "personality" is used to present a familiar 
legacy syntax? Can the same result be reached using xorriso with no 
personality?

> This will not create a filesystem around the tar archive. 

OK.  The distinction between writing arbitrary data (stream, file, ?) and 
writing a file system hadn't crystalized well.  Software can take an 
action, or not, without direct evidence. To my thinking, all the examples 
in https://www.gnu.org/software/xorriso/ assume an ISO 9660 filesystem.  
No issue for an experienced user but a ready trap for a novice.

Thanks again,   ... Peter E.

-- 
Message composed and transmitted by software designed to avoid the 
need, overhead and vulnerability of antivirus software.

123456789 123456789 123456789 123456789 123456789 123456789 123456789
Tel: +1 360 639 0202  +1 
http://easthope.ca/Peter.html  Bcc: peter at easthope. ca



Re: Archiving content of a directory on a DVD-R.

2018-11-05 Thread tomas
On Mon, Nov 05, 2018 at 09:04:58AM -0500, Greg Wooledge wrote:
> On Sun, Nov 04, 2018 at 07:29:53AM -0800, pe...@easthope.ca wrote:
> > How is this for archiving the content of a directory?
> > 
> >   pushd  ;
> >   printf "Insert blank DVD-R."; read t ;
> >   tar -vcpzf - * | xorriso -indev /dev/sr0 -add -- -commit ;
> 
> Be aware that the * glob will probably miss filenames beginning with
> a dot [...]

Greg, as ever :-)

No, seriously: thanks for your constant work here. I do learn quite a
bit from your posts, even if I consider myself as somewhat seasoned.

> inside the script, to make the * glob include "dot files".  That's
> assuming you want to retain the current archive appearance.
> 
> The alternative would be to use . instead of * as tar's starting
> point.  This would change your archive appearance from

+1 on .

> .bashrc
> bin/foo
> lib/libbar.a
> 
> to
> 
> ./.bashrc
> ./bin/foo
> ./lib/libbar.a

If you don't want that, you can use (GNU) tar's wonderful file path
transformation magic, e.g.:

  tar -vcpzf - --xform='s/^\.\///' . | xorriso ...

(it takes an sed expression there).

Cheers
-- t


signature.asc
Description: Digital signature


Re: Archiving content of a directory on a DVD-R.

2018-11-05 Thread Greg Wooledge
On Sun, Nov 04, 2018 at 07:29:53AM -0800, pe...@easthope.ca wrote:
> How is this for archiving the content of a directory?
> 
>   pushd  ;
>   printf "Insert blank DVD-R."; read t ;
>   tar -vcpzf - * | xorriso -indev /dev/sr0 -add -- -commit ;

Be aware that the * glob will probably miss filenames beginning with
a dot.  Since you're using pushd, which is a bash extension, this is
probably a bash script.  Therefore you might consider using

shopt -s dotglob

inside the script, to make the * glob include "dot files".  That's
assuming you want to retain the current archive appearance.

The alternative would be to use . instead of * as tar's starting
point.  This would change your archive appearance from

.bashrc
bin/foo
lib/libbar.a

to

./.bashrc
./bin/foo
./lib/libbar.a



Re: Archiving content of a directory on a DVD-R.

2018-11-04 Thread David Christensen

On 11/4/18 7:29 AM, pe...@easthope.ca wrote:

How is this for archiving the content of a directory?

   pushd  ;
   printf "Insert blank DVD-R."; read t ;
   tar -vcpzf - * | xorriso -indev /dev/sr0 -add -- -commit ;
   xorriso -indev /dev/sr0 -du / -- -toc 2>&1 ;
   xorriso -indev /dev/sr0 -eject ;
   echo "Content of  archived in DVD-R." ;
   popd ;


I tried to find the simplest way to burn files to an optical disc using 
xorriso(1), and then put the incantation into a script.  Here are the 
essential lines:


#!/bin/bash
DEVICE="/dev/cdrom"
VOLID=...
xorriso -outdev  "$DEVICE"  -volid  "$VOLID"  -map_l $PWD / $@
eject  "$DEVICE"


Basically: invoke xorriso with two options and one command that consumes 
the command-line arguments (paths to files).



Note that there is no tar or gzip involve, just a straight copy from one 
file system to another.  (I typically create tarballs and matching 
checksum files on HDD, and then burn those to optical.)




And retrival.

   pushd  ;
   printf "Insert a DVD-R containing a tar archive."; read t ;
   xorriso -indev /dev/sr0 -toc 2>&1 ;
   xorriso -indev /dev/sr0 -extract / -- | tar -vxf ;
   xorriso -indev /dev/sr0 -eject ;
   popd ;


I put the disc into the drive, wait for Thunar (Xfce) to show the volume 
ID on the left pane, and then click on it.  This mounts the disc at 
/media/cdrom0.  I can then use whatever tools I like to access the 
contents of the disc.



Or, from the terminal:

2018-11-04 14:50:42 dpchrist@po ~
$ mount /media/cdrom0
mount: /dev/sr0 is write-protected, mounting read-only

2018-11-04 14:50:54 dpchrist@po ~
$ l /media/cdrom0
./   README.source  dists/ install/  setup.exe
../  README.txt doc/   install.386/  tools/
.disk/   autorun.infefi/   isolinux/ win32-loader.ini
README.html  boot/  firmware/  md5sum.txt
README.mirrors.html  css/   g2ldr  pics/
README.mirrors.txt   debian@g2ldr.mbr  pool/

2018-11-04 14:51:44 dpchrist@po ~
$ eject
eject: unable to open `/dev/sr0'

2018-11-04 15:06:10 dpchrist@po ~
$ eject /mnt/cdrom0
eject: unable to find or open device for: `/mnt/cdrom0'


eject(1) doesn't seem to work, so I press the eject button the drive to 
get the disc out.



David



Re: Archiving content of a directory on a DVD-R.

2018-11-04 Thread Thomas Schmitt
Hi,

pe...@easthope.ca wrote:
>   printf "Insert blank DVD-R."; read t ;
>   tar -vcpzf - * | xorriso -indev /dev/sr0 -add -- -commit ;

Writing the tar stream to DVD-R is a classical use case of cdrecord or wodim.
So:

  tar -vcpzf - * | xorriso -as cdrecord -v dev=/dev/sr0 -eject fs=16m -

This will not create a filesystem around the tar archive. So the planned
xorriso runs with command -indev would then go on strike:

>   xorriso -indev /dev/sr0 -du / -- -toc 2>&1 ;
>   xorriso -indev /dev/sr0 -eject ;

Retrieval is then just a matter of tar and the Linux sr driver:

  tar xvzf /dev/sr0

Of course, this will not give you quick access to single files and even
getting a list of content will last several minutes, if the tar archive
fills most of the DVD:

  tar tvzf /dev/sr0

-

If you want to make use of xorriso's capability to create a mountable ISO
filesystem with a copy of your directory, then you do not need tar.

  xorriso -for_backup -outdev /dev/sr0 -map . / \
  -close on -commit \
  -toc -check_md5 failure -- \
  -eject all

This run acquires /dev/sr0 by command "-outdev". Command "-map . /" maps
the directory tree of the current rd disk directory to the /-directory tree
of the ISO 9660 filesystem on the DVD-R. 
By command "-for_backup" it will record MD5 checksums for the whole
filesystem and for each single data files in the filesystem.

Command "-close on" causes the DVD-R to become unwritable after the burn
run is completed. (If you omit it then the DVD stays appendable for more
sessions.) Command "-commit" performs the burn run.

Command "-toc" will afterwards print an overview of the result after the
new ISO filesystem was assesd by xorriso.
Command "-check_md5 failure --" reads the freshly written blocks and compare
their MD5 with the recorded checksum in the ISO. In case of mismatch it
will throw an event of severity "failure", which will abort the xorriso run.
If not aborted, the drive will be told by "-eject all" to eject the tray.
(It needs to have a motor for that, of course.)

Retrieval:

If not your friendly desktop mounts the DVD automatically on insertion:

  mount /dev/sr0 /mnt/iso

Then use normal file tools like "ls", "cp", or a desktop file manager to
copy the files to hard disk or just to let your application read them from
the mounted directory directly.

Verifying of the medium after a while on the shelf:

  xorriso -for_backup -indev /dev/sr0 -check_media --


Have a nice day :)

Thomas