Re: Extracting directories from an ISO image, command line tool?
Hi, Richard Owlett wrote: > METHODOLOGY: > Copy all DVDs to ISO 9660 conforming files > [dd understood to be correct tool]. dd, libc, the kernel or whatever on your system seems to have a bug with readable size of DVDs. This size seems not to change when a new DVD is loaded into the drive. Nevertheless, /sys indicates that the correct size is perceived by the kernel at least in some of its parts. So there is some hope that libburn (via xorriso) and the drive could team up to retrieve all data from the DVD. See my proposal xorriso -indev /dev/sr0 \ -check_media data_to="$FILENAME" -- in https://lists.debian.org/debian-user/2015/09/msg00890.html > Copy the resulting files to USB device for convenient loop mounting. > As loop mounting 13 (or more) files can be cumbersome, use xorriso > to process *.iso to obtain complete repository on a single USB device. xorriso may also extract the files directly from DVD: xorriso -osirrox on:auto_chmod_on -overwrite nondir \ -indev /dev/sr0 \ -extract /pool /media/richard/REPO8/test/pool This will use SG_IO for communication with the drive, like above -check_media proposal. It would be interesting to see what happens when the ISO 9660 filesystem driver tries to read blocks which read(2) is not willing to read. I.e. the way of "mount" and "cp". Have a nice day :) Thomas
Re: Extracting directories from an ISO image, command line tool?
Stuart Longland wrote: On 18/09/15 21:57, Richard Owlett wrote: I'll your points in reverse order. The "repository merging" is handled by the -extract option of xorriso. Thomas Schmitt, author of xorriso, has said in this thread to copy from DVD using dd. Yeah, I basically was just focusing on the mechanics of getting the data out of the .iso image. But you never get the desired data in the required form ;/ I'll restate my environment and goals. ENVIRONMENT: I have a stack of purchased Debian distribution DVDs {Squeeze, Wheezy, & Jessie}. [Internet capable of downloading ISOs being *NON*existent] GOALS: To have the ability to install multiple configurations of multiple versions of Debian on multiple widely separated machines with no networking capability [i.e. sneaker net]. METHODOLOGY: Copy all DVDs to ISO 9660 conforming files [dd understood to be correct tool]. Copy the resulting files to USB device for convenient loop mounting. As loop mounting 13 (or more) files can be cumbersome, use xorriso to process *.iso to obtain complete repository on a single USB device.
Re: Extracting directories from an ISO image, command line tool?
On 18/09/15 21:57, Richard Owlett wrote: > I'll your points in reverse order. > The "repository merging" is handled by the -extract option of xorriso. > Thomas Schmitt, author of xorriso, has said in this thread to copy from > DVD using dd. Yeah, I basically was just focussing on the mechanics of getting the data out of the .iso image. > Is there a way to pause your loop to swap DVDs? Why would you want to do that, surely the DVD images are separate files? Or have the DVDs already been burned and you've yet to DD the images of them? In which case, you could modify the loop: dn=/media/distributionA for disc in $( seq 1 N ); do echo "Please insert disc ${disc}" read newline mount /dev/cdrom /mnt/cdrom rsync -aP /mnt/cdrom "${dn}/DVD${disc}"/ umount /mnt/cdrom done That will prompt on each disc. Someone asked why rsync? Well, cp would do the job too I guess, rsync will resume an interrupted copy whereas cp won't. Piping tar to itself is another way. -- Stuart Longland (aka Redhatter, VK4MSL) I haven't lost my mind... ...it's backed up on a tape somewhere. signature.asc Description: OpenPGP digital signature
Re: Extracting directories from an ISO image, command line tool?
Thomas Schmitt wrote: Hi, (Note to myself: This is the extract thread, not the thread about getting .iso files from /dev/sr0.) Stuart Longland wrote: for f in /media/distributionA/*.iso; do bn="$( basename "${f}" .iso )" dn="$( dirname "${f}" )" mount "${f}" /mnt/cdrom -o loop rsync -aP /mnt/cdrom "${dn}/${bn}"/ umount /mnt/cdrom done [snip] Richard Owlett wrote: Is there a way to pause your loop to swap DVDs? while true do echo "Insert medium, wait until blinking ends, press Enter key (or Ctrl+C to end)" read dummy ... mount /dev/sr0, rsync or cp, umount /dev/sr0 or xorriso ... -indev /dev/sr0 ... done Now have half dozen scripting tutorials up. I sometimes take the long way 'round [If retirement isn't for education, what use is it?]
Re: Extracting directories from an ISO image, command line tool?
Hi, (Note to myself: This is the extract thread, not the thread about getting .iso files from /dev/sr0.) Stuart Longland wrote: > > for f in /media/distributionA/*.iso; do > > bn="$( basename "${f}" .iso )" > > dn="$( dirname "${f}" )" > > mount "${f}" /mnt/cdrom -o loop > > rsync -aP /mnt/cdrom "${dn}/${bn}"/ > > umount /mnt/cdrom > > done I wonder why rsync and not "cp -a", and why not only /mnt/cdrom/pool gets copied. Maybe one should only do mount and umount as superuser (via sudo) and leave the loop under control of the normal user. Richard Owlett wrote: > Is there a way to pause your loop to swap DVDs? while true do echo "Insert medium, wait until blinking ends, press Enter key (or Ctrl+C to end)" read dummy ... mount /dev/sr0, rsync or cp, umount /dev/sr0 or xorriso ... -indev /dev/sr0 ... done Have a nice day :) Thomas
Re: Extracting directories from an ISO image, command line tool?
Stuart Longland wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 10/09/15 23:06, Richard Owlett wrote: Environment: Using dd I have copied physical [NO INTERNET AVAILABLE ;] Debian DVD's to /media/distributionA resulting in /media/distributionA/DVD1.iso /media/distributionA/DVD2.iso .. .. /media/distributionA/DVDn.iso Well, I can get you half-way there. for f in /media/distributionA/*.iso; do bn="$( basename "${f}" .iso )" dn="$( dirname "${f}" )" mount "${f}" /mnt/cdrom -o loop rsync -aP /mnt/cdrom "${dn}/${bn}"/ umount /mnt/cdrom done Now you'll have in addition to the above: /media/distributionA/DVD1/ … /media/distributionA/DVD2/ … .. .. /media/distributionA/DVDn/ … I'm not sure how you'd go about merging the repositories together. Someone else can help with that. I'll your points in reverse order. The "repository merging" is handled by the -extract option of xorriso. Thomas Schmitt, author of xorriso, has said in this thread to copy from DVD using dd. Is there a way to pause your loop to swap DVDs?
Re: Narrowing down problem source - was [Re: Extracting directories from an ISO image, command line tool?]
Steve McIntyre wrote: Richard Owlett wrote: I started over again. I switched to a laptop dedicated to things that may not work as expected. For some of my projects I regularly wipe the disk and do a complete reinstall of Debian. Currently I'm running Debian 8.0 with Mate as DE. No updates. I used blocks=$(expr $(/sbin/isosize /dev/sr0) / 2048) echo "Byte count: $(expr $blocks '*' 2048)" dd if=/dev/sr0 bs=2048 count=$blocks of=dvd8_2.iso as a pattern for each DVD. _Some_ passed your test of ls -l /media/richard/Lexar/dvd8_2.iso /sbin/isosize /media/richard/Lexar/dvd8_2.iso Example: ls -l dvd8_9.iso /sbin/isosize dvd8_9.iso resulted in richard@debian:~$ ls -l dvd8_9.iso -rw-r--r-- 1 richard richard 3976200192 Sep 16 11:50 dvd8_9.iso richard@debian:~$ richard@debian:~$ /sbin/isosize dvd8_9.iso 4460664832 I'll tell you what's most likely wrong - you're storing your extracted ISO images on a FAT32 filesystem which doesn't support file sizes larger than 4GiB. That's why DVD #1 works, it's explicitly reduced in size to fit on a 4GB USB stick too. That was true at the very beginning. Latest runs were under the home directory of my Debian 8 install.
Re: Extracting directories from an ISO image, command line tool?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 10/09/15 23:06, Richard Owlett wrote: > Environment: Using dd I have copied physical [NO INTERNET AVAILABLE > ;] Debian DVD's to /media/distributionA resulting in > /media/distributionA/DVD1.iso /media/distributionA/DVD2.iso .. .. > /media/distributionA/DVDn.iso Well, I can get you half-way there. for f in /media/distributionA/*.iso; do bn="$( basename "${f}" .iso )" dn="$( dirname "${f}" )" mount "${f}" /mnt/cdrom -o loop rsync -aP /mnt/cdrom "${dn}/${bn}"/ umount /mnt/cdrom done Now you'll have in addition to the above: /media/distributionA/DVD1/ … /media/distributionA/DVD2/ … .. .. /media/distributionA/DVDn/ … I'm not sure how you'd go about merging the repositories together. Someone else can help with that. - -- Stuart Longland (aka Redhatter, VK4MSL) I haven't lost my mind... ...it's backed up on a tape somewhere. -BEGIN PGP SIGNATURE- Version: GnuPG v2 iQIcBAEBCAAGBQJV+yaxAAoJEE36GRQQveO38CkQALmNl6BUrN4QduBPmREfmRC4 A8GEdua8W9YZ8E4pcKx/9xG6N3pN7stck26/illFewb8MqrgMfsUZfx9UGiqtFSk HQwtHxWvp0N60d4xlXmtmKSB0EopJ3kgPRtPpvKG33HpiZ24dYIgdoMY/dHIdjM4 LTcdqQdWjo0tJA1CAoVY604tXVYGqR+kFWaLfzM/ysxoj1KxuDRgoARSozCLrXpu Mr2wIb3qnjnpm9e3fO9le52HurwEY/RVbYOWd0aY9DSekGKaOg7LiK4qlkP73nnO BjZ8hnqsNmidBZN5647cTEZXCCK0T6Ygxp8CxFNmDDba9TRnDlxQg7Pu6oBseCRW cJVW3ULmiShgiNArsnszXGPzJjpWIYewtpK025npWEc23LoBTQFLk04tyBhvstVr 8Gkcl2Rzyq8sNf6F/fLqmoaDis/abxdigaj61sHHoVPBIIntabzkP+dnAWi8Z9/a XmAcdiZXRGiUDo6K0b+/6VKhzyNKNQg9EvFozZWxIumhCFI0FVRPITJCmre8vdyX rlPDYEL13tyd3UzyTe6X+fhl9xlvCvH3ywkDw7q08k3xZQaHFq91p7idmLT9GI9J FvFqpu7uFNGTmvS6BoJQLpGh63xBMZy8+aTmCXMkLE6y8RhZQwTUN5QwhAOZK3zw aFVAGPp3f3KauHkx6abG =dSnl -END PGP SIGNATURE-
Re: Narrowing down problem source - was [Re: Extracting directories from an ISO image, command line tool?]
Richard Owlett wrote: > >I started over again. I switched to a laptop dedicated to things >that may not work as expected. For some of my projects I >regularly wipe the disk and do a complete reinstall of Debian. >Currently I'm running Debian 8.0 with Mate as DE. No updates. > >I used > blocks=$(expr $(/sbin/isosize /dev/sr0) / 2048) > echo "Byte count: $(expr $blocks '*' 2048)" > dd if=/dev/sr0 bs=2048 count=$blocks of=dvd8_2.iso >as a pattern for each DVD. > >_Some_ passed your test of > ls -l /media/richard/Lexar/dvd8_2.iso > /sbin/isosize /media/richard/Lexar/dvd8_2.iso > >Example: > ls -l dvd8_9.iso > /sbin/isosize dvd8_9.iso > >resulted in >richard@debian:~$ ls -l dvd8_9.iso >-rw-r--r-- 1 richard richard 3976200192 Sep 16 11:50 dvd8_9.iso >richard@debian:~$ >richard@debian:~$ /sbin/isosize dvd8_9.iso >4460664832 I'll tell you what's most likely wrong - you're storing your extracted ISO images on a FAT32 filesystem which doesn't support file sizes larger than 4GiB. That's why DVD #1 works, it's explicitly reduced in size to fit on a 4GB USB stick too. -- Steve McIntyre, Cambridge, UK.st...@einval.com "Further comment on how I feel about IBM will appear once I've worked out whether they're being malicious or incompetent. Capital letters are forecast." Matthew Garrett, http://www.livejournal.com/users/mjg59/30675.html
Narrowing down problem source - was [Re: Extracting directories from an ISO image, command line tool?]
Richard Owlett wrote: Thomas Schmitt wrote: Hi, Richard Owlett wrote: richard@jessie:~$ ls -l /media/richard/Lexar/dvd8_2.iso -rw-r--r-- 1 richard richard 3976200192 Sep 9 07:36 /media/richard/Lexar/dvd8_2.iso richard@jessie:~$ /sbin/isosize /media/richard/Lexar/dvd8_2.iso 4677738496 You will need to get a new dvd8_2.iso of at least 4677738496 bytes size. I've got some links "somewhere" for copying DVDs to files such that checksums can be verified. Suspect that info may useful. Depending on the DVD medium type you have to expect trailing garbage after the end of the ISO. This has to be taken into respect when copying, diffing, or md5summing. I would use for copying from DVD to disk: blocks=$(expr $(/sbin/isosize /dev/sr0) / 2048) echo "Byte count: $(expr $blocks '*' 2048)" dd if=/dev/sr0 bs=2048 count=$blocks of=dvd8_2.iso (It would be nice if Debian's MD5SUMS would not only tell MD5 and image name but also the image size, or if there was a SIZES file.) Error messages from dd or dvd8_2.iso turning out smaller than the announced byte count indicate failure of copying. It appears that all of my dvd8_*.iso (except possibly dvd8_1.iso) were defective. Using instructions above to create dvd8_2.iso apparently works. Don't know what I did wrong last time around. I started over again. I switched to a laptop dedicated to things that may not work as expected. For some of my projects I regularly wipe the disk and do a complete reinstall of Debian. Currently I'm running Debian 8.0 with Mate as DE. No updates. I used blocks=$(expr $(/sbin/isosize /dev/sr0) / 2048) echo "Byte count: $(expr $blocks '*' 2048)" dd if=/dev/sr0 bs=2048 count=$blocks of=dvd8_2.iso as a pattern for each DVD. _Some_ passed your test of ls -l /media/richard/Lexar/dvd8_2.iso /sbin/isosize /media/richard/Lexar/dvd8_2.iso Example: ls -l dvd8_9.iso /sbin/isosize dvd8_9.iso resulted in richard@debian:~$ ls -l dvd8_9.iso -rw-r--r-- 1 richard richard 3976200192 Sep 16 11:50 dvd8_9.iso richard@debian:~$ richard@debian:~$ /sbin/isosize dvd8_9.iso 4460664832 ** 3976200192 <> 4460664832 I did a rerun. The only apparent change in test conditions was I used a different instance of Mate Terminal. blocks=$(expr $(/sbin/isosize /dev/sr0) / 2048) echo "Byte count: $(expr $blocks '*' 2048)" dd if=/dev/sr0 bs=2048 count=$blocks of=rerundvd9.iso ls -l rerundvd9.iso /sbin/isosize rerundvd9.iso result of rerun richard@debian:~$ blocks=$(expr $(/sbin/isosize /dev/sr0) / 2048) richard@debian:~$ richard@debian:~$ echo "Byte count: $(expr $blocks '*' 2048)" Byte count: 4460664832 richard@debian:~$ richard@debian:~$ dd if=/dev/sr0 bs=2048 count=$blocks of=rerundvd9.iso 2178059+0 records in 2178059+0 records out 4460664832 bytes (4.5 GB) copied, 798.488 s, 5.6 MB/s richard@debian:~$ ls -l rerundvd9.iso -rw-r--r-- 1 richard richard 4460664832 Sep 17 08:26 rerundvd9.iso richard@debian:~$ richard@debian:~$ /sbin/isosize rerundvd9.iso 4460664832 I've a gut feeling that Mate Terminal isn't redoing blocks=$(expr $(/sbin/isosize /dev/sr0) / 2048) every time. Nagging memories of a similar problem with either Win95 or Win98. Might not get to do suitable test until tomorrow. Later.
Re: Extracting directories from an ISO image, command line tool?
Thomas Schmitt wrote: Hi, Richard Owlett wrote: richard@jessie:~$ ls -l /media/richard/Lexar/dvd8_2.iso -rw-r--r-- 1 richard richard 3976200192 Sep 9 07:36 /media/richard/Lexar/dvd8_2.iso richard@jessie:~$ /sbin/isosize /media/richard/Lexar/dvd8_2.iso 4677738496 You will need to get a new dvd8_2.iso of at least 4677738496 bytes size. I've got some links "somewhere" for copying DVDs to files such that checksums can be verified. Suspect that info may useful. Depending on the DVD medium type you have to expect trailing garbage after the end of the ISO. This has to be taken into respect when copying, diffing, or md5summing. I would use for copying from DVD to disk: blocks=$(expr $(/sbin/isosize /dev/sr0) / 2048) echo "Byte count: $(expr $blocks '*' 2048)" dd if=/dev/sr0 bs=2048 count=$blocks of=dvd8_2.iso (It would be nice if Debian's MD5SUMS would not only tell MD5 and image name but also the image size, or if there was a SIZES file.) Error messages from dd or dvd8_2.iso turning out smaller than the announced byte count indicate failure of copying. It appears that all of my dvd8_*.iso (except possibly dvd8_1.iso) were defective. Using instructions above to create dvd8_2.iso apparently works. Don't know what I did wrong last time around. Thank you.
Re: Extracting directories from an ISO image, command line tool?
Hi, Richard Owlett wrote: > richard@jessie:~$ ls -l /media/richard/Lexar/dvd8_2.iso > -rw-r--r-- 1 richard richard 3976200192 Sep 9 07:36 > /media/richard/Lexar/dvd8_2.iso > > richard@jessie:~$ /sbin/isosize /media/richard/Lexar/dvd8_2.iso > 4677738496 You will need to get a new dvd8_2.iso of at least 4677738496 bytes size. > I've got some links "somewhere" for copying DVDs to files such that > checksums can be verified. Suspect that info may useful. Depending on the DVD medium type you have to expect trailing garbage after the end of the ISO. This has to be taken into respect when copying, diffing, or md5summing. I would use for copying from DVD to disk: blocks=$(expr $(/sbin/isosize /dev/sr0) / 2048) echo "Byte count: $(expr $blocks '*' 2048)" dd if=/dev/sr0 bs=2048 count=$blocks of=dvd8_2.iso (It would be nice if Debian's MD5SUMS would not only tell MD5 and image name but also the image size, or if there was a SIZES file.) Error messages from dd or dvd8_2.iso turning out smaller than the announced byte count indicate failure of copying. If the size is ok, compute the MD5 of dvd8_2.iso md5sum dvd8_2.iso If you have no checksum for the image, then eject and reload the medium and run dd if=/dev/sr0 bs=2048 count=$blocks | diff - dvd8_2.iso in order to detect instabilities with repeated copying. If so, then diff should report Binary files - and dvd8_2.iso differ -- If everything stays suspiciously silent, make a damage test. Before damaging the ISO, get the original state dd if=dvd8_2.iso bs=1 skip=3 count=1 2>/dev/null | od -t x1 I get told 000 00 001 So byte 3 has value 0. I replace it by a NewLine character (value 10): echo | dd conv=notrunc of=dvd8_2.iso bs=1 seek=3 count=1 Now the above tests must report mismatch. Repair ISO: dd if=/dev/zero conv=notrunc of=dvd8_2.iso bs=1 seek=3 count=1 If the original value was not 0, but hex "43": echo -n $'\0x43' | dd conv=notrunc of=dvd8_2.iso bs=1 seek=3 count=1 Have a nice day :) Thomas
Re: Extracting directories from an ISO image, command line tool?
Thomas Schmitt wrote: Hi, Richard Owlett wrote: xorriso -osirrox on:auto_chmod_on -overwrite nondir -indev /media/richard/Lexar/dvd8_2.iso -extract /pool /media/richard/REPO8/test/pool ... libisoburn: WARNING : ISO image size 2284052s larger than readable size 1941504s Looks like the file dvd8_2.iso is truncated. The Primary Volume Descriptor (superblock) says the ISO has 2284052 * 2048 = 4,677,738,496 bytes, whereas libburn sees a pseudo-drive of 1941504 * 2048 = 3,976,200,192 bytes. It gets this size info from system function stat(2). Check independently of xorriso by ls -l /media/richard/Lexar/dvd8_2.iso /sbin/isosize /media/richard/Lexar/dvd8_2.iso Ask xorriso for more info by xorriso -indev /media/richard/Lexar/dvd8_2.iso -toc 2284052 blocks is a plausible size for a DVD image. Max size for DVD+RW is 2295104 blocks. So probably the file lost 700 MB during some transfer. I'm seeing a pattern ;/ I've got some links "somewhere" for copying DVDs to files such that checksums can be verified. Suspect that info may useful. richard@jessie:~$ ls -l /media/richard/Lexar/dvd8_2.iso -rw-r--r-- 1 richard richard 3976200192 Sep 9 07:36 /media/richard/Lexar/dvd8_2.iso richard@jessie:~$ /sbin/isosize /media/richard/Lexar/dvd8_2.iso 4677738496 richard@jessie:~$ xorriso -indev /media/richard/Lexar/dvd8_2.iso -toc xorriso 1.3.2 : RockRidge filesystem manipulator, libburnia project. libisoburn: WARNING : ISO image size 2284052s larger than readable size 1941504s xorriso : NOTE : Loading ISO image tree from LBA 0 xorriso : UPDATE : 6023 nodes read in 1 seconds Drive current: -indev '/media/richard/Lexar/dvd8_2.iso' Media current: stdio file, overwriteable Media status : is written , is appendable Media summary: 1 session, 1941504 data blocks, 3792m data, 11.0g free Volume id: 'Debian 8.0.0 i386 2' Drive current: -indev '/media/richard/Lexar/dvd8_2.iso' Drive type : vendor 'YOYODYNE' product 'WARP DRIVE' revision 'FX01' Media current: stdio file, overwriteable Media status : is written , is appendable Media blocks : 1941504 readable , 5780880 writable , 8064944 overall TOC layout : Idx , sbsector , Size , Volume Id xorriso : WARNING : Session 1 bears ISO image size 2284052s larger than track size 1941504s ISO session : 1 , 0 , 1941504s , Debian 8.0.0 i386 2 Media summary: 1 session, 1941504 data blocks, 3792m data, 11.0g free Media nwa: 2284064s
Re: Extracting directories from an ISO image, command line tool?
Hi, Richard Owlett wrote: > xorriso -osirrox on:auto_chmod_on -overwrite nondir -indev > /media/richard/Lexar/dvd8_2.iso -extract /pool /media/richard/REPO8/test/pool > ... > libisoburn: WARNING : ISO image size 2284052s larger than readable size > 1941504s Looks like the file dvd8_2.iso is truncated. The Primary Volume Descriptor (superblock) says the ISO has 2284052 * 2048 = 4,677,738,496 bytes, whereas libburn sees a pseudo-drive of 1941504 * 2048 = 3,976,200,192 bytes. It gets this size info from system function stat(2). Check independently of xorriso by ls -l /media/richard/Lexar/dvd8_2.iso /sbin/isosize /media/richard/Lexar/dvd8_2.iso Ask xorriso for more info by xorriso -indev /media/richard/Lexar/dvd8_2.iso -toc 2284052 blocks is a plausible size for a DVD image. Max size for DVD+RW is 2295104 blocks. So probably the file lost 700 MB during some transfer. Have a nice day :) Thomas
Re: Extracting directories from an ISO image, command line tool?
Thomas Schmitt wrote: Hi, my two cents: for i in /media/distributionA/DVD*.iso do xorriso -osirrox on:auto_chmod_on -overwrite nondir \ -indev "$i" \ -extract /pool /media/distributionA/poolA done The setting -osirrox auto_chmod_on enables writing to read-only directories which were created by a previous xorriso -extract command. This is needed especially if duplicate files overwrite each other in such read-only directories. One may change the permissions of the directories before extraction. xorriso -osirrox on -overwrite nondir \ -indev "$i" \ -find /pool -type d -exec chmod u+rwx -- \ -extract /pool /media/distributionA/poolA \ -rollback_end The final command -rollback_end prevents error messages about pending changes and no output drive being acquired. This is equivalent to find /media/distributionA/poolA -type d -exec chmod u+rwx '{}' ';' after each xorriso run. Have a nice day :) Things almost work. I suspect operator error of some sort. I tend to do cut-n-paste of single physical lines rather than looping as in your example. I seem to be able to extract the pool directory of the first ISO I process. The second fails (see sample below). It chokes on the 2nd file processed. I've done multiple runs on different machines varying as many things as seem to make sens with essentially the same failure reports. I'm running Debian 8.0 with Mate. One machine I had done an "expert install" {Windows XP and multiple instances of Debian] aimed at a approximately minimal install. I have a second machine dedicated to experimenting, did a "let the installer make all choices" to do a clean insall using all of the hard drive. The ISO's are derived from the purchased Debian 8.0 DVD's used to do installation on both machines. SAMPLE TEST RUN: richard@jessie:~$ xorriso -osirrox on:auto_chmod_on -overwrite nondir -indev /media/richard/Lexar/dvd8_1.iso -extract /pool /media/richard/REPO8/test/pool xorriso 1.3.2 : RockRidge filesystem manipulator, libburnia project. Copying of file objects from ISO image to disk filesystem is: Enabled xorriso : NOTE : Loading ISO image tree from LBA 0 xorriso : UPDATE : 8653 nodes read in 1 seconds xorriso : NOTE : Detected El-Torito boot information which currently is set to be discarded Drive current: -indev '/media/richard/Lexar/dvd8_1.iso' Media current: stdio file, overwriteable Media status : is written , is appendable Boot record : El Torito , ISOLINUX isohybrid MBR pointing to boot image Media summary: 1 session, 1941504 data blocks, 3792m data, 11.7g free Volume id: 'Debian 8.0.0 i386 1' xorriso : UPDATE : 82 files restored ( 26141k) in 1 seconds , 19.0xD xorriso : UPDATE : 188 files restored ( 52401k) in 2 seconds , 19.3xD . . . xorriso : UPDATE : 6151 files restored (3622.2m) in 151 seconds , 18.1xD xorriso : UPDATE : 6264 files restored (3645.2m) in 152 seconds , 17.4xD xorriso : UPDATE : 6317 files restored (3660.6m) in 153 seconds = 18.2xD Extracted from ISO image: file '/pool'='/media/richard/REPO8/test/pool' richard@jessie:~$ richard@jessie:~$ richard@jessie:~$ richard@jessie:~$ xorriso -osirrox on:auto_chmod_on -overwrite nondir -indev /media/richard/Lexar/dvd8_2.iso -extract /pool /media/richard/REPO8/test/pool xorriso 1.3.2 : RockRidge filesystem manipulator, libburnia project. Copying of file objects from ISO image to disk filesystem is: Enabled libisoburn: WARNING : ISO image size 2284052s larger than readable size 1941504s xorriso : NOTE : Loading ISO image tree from LBA 0 xorriso : UPDATE : 6023 nodes read in 1 seconds Drive current: -indev '/media/richard/Lexar/dvd8_2.iso' Media current: stdio file, overwriteable Media status : is written , is appendable Media summary: 1 session, 1941504 data blocks, 3792m data, 11.0g free Volume id: 'Debian 8.0.0 i386 2' libburn : SORRY : Read start address 2105202s larger than number of readable blocks 1941503 libisofs: FAILURE : Read error occured with IsoDataSource xorriso : FAILURE : Cannot read all bytes from ISO file '/pool/contrib/f/flashplugin-nonfree-extrasound/flashplugin-nonfree-extrasound_0.0.svn2431-5_i386.deb' xorriso : FAILURE : Cannot restore regular file to disk filesystem: '/pool/contrib/f/flashplugin-nonfree-extrasound/flashplugin-nonfree-extrasound_0.0.svn2431-5_i386.deb' xorriso : SORRY : Restoring failed: '/pool/contrib/f/flashplugin-nonfree-extrasound/flashplugin-nonfree-extrasound_0.0.svn2431-5_i386.deb' = '/media/richard/REPO8/test/pool/contrib/f/flashplugin-nonfree-extrasound/flashplugin-nonfree-extrasound_0.0.svn2431-5_i386.deb' xorriso : UPDATE : 5 files restored ( 37934b) in 1 seconds = 0.0xD xorriso : aborting : -abort_on 'FAILURE' encountered 'FAILURE' richard@jessie:~$ richard@jessie:~$
Re: Extracting directories from an ISO image, command line tool?
Hi, David Wright wrote: > I'll be demanding a pass-through mode (no .iso) like cpio has, > for merging archives and the like :) google ... http://www.gnu.org/software/cpio/manual/cpio.html#Copy_002dpass-mode There are more simple ways to achieve this, but: xorriso -osirrox on -overwrite off \ -outdev stdio:/dev/null \ -map /u/test/cdrskin-1.3.2 /foo \ -extract /foo /u/test/copy_of_cdrskin-1.3.2 \ -rollback_end diff -r /u/test/cdrskin-1.3.2 /u/test/copy_of_cdrskin-1.3.2 rm -r /u/test/copy_of_cdrskin-1.3.2 This gesture is uneconomic because libisofs will build a complete directory tree of /foo in memory before xorriso can extract the not-yet-committed files from disk to disk. The best use case for such pack-unpack combinations is out of reach for xorriso, anyway, because ISO 9660 needs random access. Thus an ISO image cannot always be read from a pipe. So xorriso cannot transmit over the net to another xorriso which would unpack on the fly. bsdtar does read from pipe and thus happily fails when confronted with a multi-session ISO, where directories are stored after older file content. Since we have a single session ISO here, it could serve as receiver and unpacker for a xorriso generated ISO. But we still have to invent a good use case for this. Have a nice day :) Thomas
Re: Extracting directories from an ISO image, command line tool?
On 2015-09-11, David Wright wrote: >> >> Expectably they have many /pool files in common. > > You got me there. All I had to try with was a pair of old > lenny DVDs that I'd put by for bird-scarers for the garden. > For the cherry tree? Sorry, but I'm rooting for the birds; what the birds are rooting for, I don't know. Poor things, anyway. At least you could've given them a Squeeze or two. Oh well.
Re: Extracting directories from an ISO image, command line tool?
On Fri 11 Sep 2015 at 10:37:38 -0500, Richard Owlett wrote: > Brian wrote: > >On Thu 10 Sep 2015 at 08:06:36 -0500, Richard Owlett wrote: > > > >>Environment: > >>Using dd I have copied physical [NO INTERNET AVAILABLE ;] Debian DVD's to > >>/media/distributionA resulting in > >>/media/distributionA/DVD1.iso > >>/media/distributionA/DVD2.iso > >>. > >>. > >>/media/distributionA/DVDn.iso > > > >Is there a good reason why the DVDs are copied to /media? > > Yes I nearly forgot to thank you for your first post. It prompted me to return to a project (possibly similar to yours), tidy its code up and complete it. The command line approach fits better than the one using mc.
Re: Extracting directories from an ISO image, command line tool?
Quoting Thomas Schmitt (scdbac...@gmx.net): > I do not really know how the /pool directories of a DVD set > are supposed to be related. > When testing my proposal i did not have a full set at hand > but rather used > > for i in debian*8.1*amd*iso > > which matched two ISOs in my collection of bootables: > debian-8.1.0-amd64-netinst.iso > debian-live-8.1.0-amd64-kde-desktop.iso > > Expectably they have many /pool files in common. You got me there. All I had to try with was a pair of old lenny DVDs that I'd put by for bird-scarers for the garden. > If one wants to prevent overwriting but wants the xorriso > run to go on after a prevented overwrite attempt, one may > raise the abort threshold from default severity "FAILURE" > to "FATAL": > > xorriso -abort_on FATAL \ > -osirrox on:auto_chmod_on -overwrite off \ > ... > > This will still emit error messages like > xorriso : FAILURE : While restoring > '/u/test/poolA/main/x/xfsprogs/xfsprogs-udeb_3.2.1_amd64.udeb' : file object > exists and may not be overwritten > but courageously try to extract all other files. Excellent. I hadn't yet got to that bit in the... > The man page is huge, i confess. Everybody is invited to > ask for advise, e.g. at bug-xorr...@gnu.org . You know, you've put so much dir/file handling in there that I'll be demanding a pass-through mode (no .iso) like cpio has, for merging archives and the like :) Cheers, David.
Re: Extracting directories from an ISO image, command line tool?
Brian wrote: On Thu 10 Sep 2015 at 08:06:36 -0500, Richard Owlett wrote: Environment: Using dd I have copied physical [NO INTERNET AVAILABLE ;] Debian DVD's to /media/distributionA resulting in /media/distributionA/DVD1.iso /media/distributionA/DVD2.iso . . /media/distributionA/DVDn.iso Is there a good reason why the DVDs are copied to /media? Yes
Re: Extracting directories from an ISO image, command line tool?
On Thu, Sep 10, 2015 at 08:03:53PM +, Curt wrote: > On 2015-09-10, Brian wrote: > > On Thu 10 Sep 2015 at 18:26:52 +0200, Hans wrote: > > > >> Maybe you want to give "isomaster" a try. It is in the repos and it is > >> easy to > >> handle. > > > > Does it prevent making the mistake of not capitilising proper nouns? > > > > Or the mistake of not spelling capitalizing correctly? Or the mistake of not spelling capitalising correctly? -- "If you're not careful, the newspapers will have you hating the people who are being oppressed, and loving the people who are doing the oppressing." --- Malcolm X
Re: Extracting directories from an ISO image, command line tool?
On Thursday 10 September 2015 21:03:53 Curt wrote: > On 2015-09-10, Brian wrote: > > On Thu 10 Sep 2015 at 18:26:52 +0200, Hans wrote: > >> Maybe you want to give "isomaster" a try. It is in the repos and it is > >> easy to handle. > > > > Does it prevent making the mistake of not capitilising proper nouns? > > Or the mistake of not spelling capitalizing correctly? He did. We can't help it if you lot can't spell. Lisi
Re: Extracting directories from an ISO image, command line tool?
On Thursday 10 September 2015 16:17:22 Richard Owlett wrote: > Brian wrote: > > On Thu 10 Sep 2015 at 09:06:42 -0500, Richard Owlett wrote: > >> Brian wrote: > >>> On Thu 10 Sep 2015 at 08:06:36 -0500, Richard Owlett wrote: > Environment: > Using dd I have copied physical [NO INTERNET AVAILABLE ;] Debian DVD's > to /media/distributionA resulting in > /media/distributionA/DVD1.iso > /media/distributionA/DVD2.iso > . > . > /media/distributionA/DVDn.iso > > Goal: > Extract pool directory (and all of its sub-directories) resulting in > /media/distributionA/poolA/ > /media/distributionA/poolA/contrib > /media/distributionA/poolA/main > > What commands should I be looking at? > TIA > >>> > >>> I'd use mc (midnight commander) for that. Open ISO, tag files and copy. > >>> It saves having to think about commands. :) > >> > >> I explicitly tried to eliminate GUI and GUI-like responses by subject > >> line. > > > > I explicitly ignored the effort. :) > > > >> I did however browse the man page. It might work. > >> Besides I like to think - that's why I dumped the Windows approach of > >> BIG DADDY knows best ;! > >> > >>> I'd also dispense with the dd part and just mount the media somewhere. > >> > >> VIOLATES 1st line of "Environment". Please note verb tense. > > > > I have. It's the "present". Do I get points now? > > "have copied" is PAST tense - *not* PRESENT tense. > > Some languages have an explicit form denoting "an action > completed in the past with a continuing effect in the present". > Wish English did. It has. The perfect tense. That is exactly what it is. Lisi
Re: Extracting directories from an ISO image, command line tool?
On Thu 10 Sep 2015 at 08:06:36 -0500, Richard Owlett wrote: > Environment: > Using dd I have copied physical [NO INTERNET AVAILABLE ;] Debian DVD's to > /media/distributionA resulting in > /media/distributionA/DVD1.iso > /media/distributionA/DVD2.iso > . > . > /media/distributionA/DVDn.iso Is there a good reason why the DVDs are copied to /media? $HOME is where they are so that would seem to be the natural place to dd them to. If the user has no root privileges it is the only place for them. So: $HOME/distributionA/DVD1.iso $HOME/distributionA/DVD2.iso . . $HOME/distributionA/DVDn.iso > Goal: > Extract pool directory (and all of its sub-directories) resulting in > /media/distributionA/poolA/ > /media/distributionA/poolA/contrib > /media/distributionA/poolA/main > > What commands should I be looking at? bsdtar -C $HOME/distributionA/ -xf $HOME/distributionA/DVD1.iso pool chmod -R u=rwX,go=rX $HOME/distributionA/pool bsdtar -C $HOME/distributionA/ -xf $HOME/distributionA/DVD2.iso . . bsdtar -C $HOME/distributionA/ -xf $HOME/distributionA/DVDn.iso chmod -R u=rX,go=rX $HOME/distributionA/pool
Re: Extracting directories from an ISO image, command line tool?
Hi, i wrote > > xorriso -osirrox on:auto_chmod_on -overwrite nondir \ David Wright wrote: > For this particular use, I think I would use "-overwrite off" I do not really know how the /pool directories of a DVD set are supposed to be related. When testing my proposal i did not have a full set at hand but rather used for i in debian*8.1*amd*iso which matched two ISOs in my collection of bootables: debian-8.1.0-amd64-netinst.iso debian-live-8.1.0-amd64-kde-desktop.iso Expectably they have many /pool files in common. If one wants to prevent overwriting but wants the xorriso run to go on after a prevented overwrite attempt, one may raise the abort threshold from default severity "FAILURE" to "FATAL": xorriso -abort_on FATAL \ -osirrox on:auto_chmod_on -overwrite off \ ... This will still emit error messages like xorriso : FAILURE : While restoring '/u/test/poolA/main/x/xfsprogs/xfsprogs-udeb_3.2.1_amd64.udeb' : file object exists and may not be overwritten but courageously try to extract all other files. The man page is huge, i confess. Everybody is invited to ask for advise, e.g. at bug-xorr...@gnu.org . People who use xorriso should put their favorite runs with some comments to public places where googlers can find them. It would be helpful to mention a few keywords which come to the mind of the xorriso user when thinking about her/his own use cases. (Send negative comments to upstream first ! :)) Have a nice day :) Thomas
Re: Extracting directories from an ISO image, command line tool?
On Thu 10 Sep 2015 at 20:03:53 +, Curt wrote: > On 2015-09-10, Brian wrote: > > On Thu 10 Sep 2015 at 18:26:52 +0200, Hans wrote: > > > >> Maybe you want to give "isomaster" a try. It is in the repos and it is > >> easy to > >> handle. > > > > Does it prevent making the mistake of not capitilising proper nouns? > > Or the mistake of not spelling capitalizing correctly? Considering the remark you are responding to was my criticism of my own spelling, you might want to reflect on your response. On the other hand - maybe not. Guilty, as accused. I'll not even claim typos. :)
Re: Extracting directories from an ISO image, command line tool?
Quoting Thomas Schmitt (scdbac...@gmx.net): > for i in /media/distributionA/DVD*.iso > do > xorriso -osirrox on:auto_chmod_on -overwrite nondir \ > -indev "$i" \ > -extract /pool /media/distributionA/poolA > done > > The setting -osirrox auto_chmod_on enables writing to > read-only directories which were created by a previous > xorriso -extract command. > This is needed especially if duplicate files overwrite > each other in such read-only directories. > > One may change the permissions of the directories before > extraction. > > xorriso -osirrox on -overwrite nondir \ > -indev "$i" \ > -find /pool -type d -exec chmod u+rwx -- \ > -extract /pool /media/distributionA/poolA \ > -rollback_end > > The final command -rollback_end prevents error messages > about pending changes and no output drive being acquired. > > This is equivalent to > find /media/distributionA/poolA -type d -exec chmod u+rwx '{}' ';' > after each xorriso run. Thanks Thomas; another neat tool to try out, twice in the same week. Even better: you wrote it! For this particular use, I think I would use "-overwrite off" because there ought not to be any duplicate packages in one distribution's pool and, if there were, I'd want to check that they had identical contents and see how come they were there. Cheers, David.
Re: Extracting directories from an ISO image, command line tool?
On 2015-09-10, Brian wrote: > On Thu 10 Sep 2015 at 18:26:52 +0200, Hans wrote: > >> Maybe you want to give "isomaster" a try. It is in the repos and it is easy >> to >> handle. > > Does it prevent making the mistake of not capitilising proper nouns? > > Or the mistake of not spelling capitalizing correctly?
Re: Extracting directories from an ISO image, command line tool?
On Thu 10 Sep 2015 at 21:02:36 +0200, Hans wrote: > Am Donnerstag, 10. September 2015, 19:43:25 schrieb Brian: > > > Does it prevent making the mistake of not capitilising proper nouns? > > Don't know, but maybe the op will test it himself? The OP isn't given to testing and reporting back on success. He sets tests. If you pass them you get the seal of approval. Otherwise, nothing.
Re: Extracting directories from an ISO image, command line tool?
Am Donnerstag, 10. September 2015, 19:43:25 schrieb Brian: > Does it prevent making the mistake of not capitilising proper nouns? Don't know, but maybe the op will test it himself? Best Hans
Re: Extracting directories from an ISO image, command line tool?
On Thu 10 Sep 2015 at 18:26:52 +0200, Hans wrote: > Maybe you want to give "isomaster" a try. It is in the repos and it is easy > to > handle. Does it prevent making the mistake of not capitilising proper nouns?
Re: Extracting directories from an ISO image, command line tool?
On Thu 10 Sep 2015 at 10:07:23 -0500, David Wright wrote: > Were I to use mc as suggested, I would do this as a user. I'm not > willing to use such a tool as root. One of the downsides of mc > (there are lots of ups) is that it will only query a duplicate > when it occurs and when you've made a final decision (like nonE > or aLl) you get no further idea of how many files were affected. Another downside is working out what mc does amd applying it in a what we might suppose is a scripting situation. The effort is too much. For a non-scriptable solution it wins hands down. Anyway, here is Plan B. The Wanderer should like it because there is no root involvement. Richard should be over the moon because it is all command line processing and can be scripted if desired. In $HOME: mkdir ISO Then: bsdtar -C ISO -xf /media/distributionA/DVD1.iso Two commands and nirvana looms on the horizon.
Re: Extracting directories from an ISO image, command line tool?
Maybe you want to give "isomaster" a try. It is in the repos and it is easy to handle. Happy hacking. Hans
Re: Extracting directories from an ISO image, command line tool?
On Thu 10 Sep 2015 at 10:17:22 -0500, Richard Owlett wrote: > Brian wrote: > >On Thu 10 Sep 2015 at 09:06:42 -0500, Richard Owlett wrote: > > > >>Brian wrote: > >>> > >>>I'd also dispense with the dd part and just mount the media somewhere. > >> > >>VIOLATES 1st line of "Environment". Please note verb tense. > > > >I have. It's the "present". Do I get points now? > > "have copied" is PAST tense - *not* PRESENT tense. Oh; with "violates" in capitals I thought you were drawing attention to that. "have copied" is the perfect tense. Can we do gerunds? I'm rather fond of them, :) > Some languages have an explicit form denoting "an action completed in the > past with a continuing effect in the present". Wish English did. The Present Perfect?
Re: Extracting directories from an ISO image, command line tool?
On 2015-09-10 at 11:36, Richard Owlett wrote: > The Wanderer wrote: > >> [snip] >> >> And/or similar, more-complex twiddlings if you have other >> /media/distribution* directories which you want to handle. (Note >> that this will not work as expected if the two ISOs have any >> pathnames in common.) > > A problem. ALL ISO's have the same directory structures but different > files within those directories. That's not a problem (as long as directory permissions are handled, which Thomas Schmitt's more-complex commandset should address). I was just warning about the possibility that if the file exists under the same path in two different ISOs, one of the two would get replaced by the other. Thomas Schmitt's post appears to contain exactly the "similar, more-complex twiddlings" I had in mind, plus some tweaks to address concerns I hadn't even known existed. I've marked it as noteworthy on my own end, for my own later reference. -- The Wanderer The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. -- George Bernard Shaw signature.asc Description: OpenPGP digital signature
Re: Extracting directories from an ISO image, command line tool?
The Wanderer wrote: [snip] And/or similar, more-complex twiddlings if you have other /media/distribution* directories which you want to handle. (Note that this will not work as expected if the two ISOs have any pathnames in common.) A problem. ALL ISO's have the same directory structures but different files within those directories. Browsing man page suggests that "-extract iso_rr_path disk_path" is explicitly what I'm looking for. Don't have time for a detailed read right now. Thank you. You're quite welcome.
Re: Extracting directories from an ISO image, command line tool?
Thomas Schmitt wrote: Hi, my two cents: for i in /media/distributionA/DVD*.iso do xorriso -osirrox on:auto_chmod_on -overwrite nondir \ -indev "$i" \ -extract /pool /media/distributionA/poolA done The setting -osirrox auto_chmod_on enables writing to read-only directories which were created by a previous xorriso -extract command. This is needed especially if duplicate files overwrite each other in such read-only directories. One may change the permissions of the directories before extraction. xorriso -osirrox on -overwrite nondir \ -indev "$i" \ -find /pool -type d -exec chmod u+rwx -- \ -extract /pool /media/distributionA/poolA \ -rollback_end The final command -rollback_end prevents error messages about pending changes and no output drive being acquired. This is equivalent to find /media/distributionA/poolA -type d -exec chmod u+rwx '{}' ';' after each xorriso run. Have a nice day :) Thomas Ah, I was a least worried about actual potential problems. Off to do implied homework ;)
Re: Extracting directories from an ISO image, command line tool?
Brian wrote: On Thu 10 Sep 2015 at 09:06:42 -0500, Richard Owlett wrote: Brian wrote: On Thu 10 Sep 2015 at 08:06:36 -0500, Richard Owlett wrote: Environment: Using dd I have copied physical [NO INTERNET AVAILABLE ;] Debian DVD's to /media/distributionA resulting in /media/distributionA/DVD1.iso /media/distributionA/DVD2.iso . . /media/distributionA/DVDn.iso Goal: Extract pool directory (and all of its sub-directories) resulting in /media/distributionA/poolA/ /media/distributionA/poolA/contrib /media/distributionA/poolA/main What commands should I be looking at? TIA I'd use mc (midnight commander) for that. Open ISO, tag files and copy. It saves having to think about commands. :) I explicitly tried to eliminate GUI and GUI-like responses by subject line. I explicitly ignored the effort. :) I did however browse the man page. It might work. Besides I like to think - that's why I dumped the Windows approach of BIG DADDY knows best ;! I'd also dispense with the dd part and just mount the media somewhere. VIOLATES 1st line of "Environment". Please note verb tense. I have. It's the "present". Do I get points now? "have copied" is PAST tense - *not* PRESENT tense. Some languages have an explicit form denoting "an action completed in the past with a continuing effect in the present". Wish English did.
Re: Extracting directories from an ISO image, command line tool?
Quoting Richard Owlett (rowl...@cloud85.net): > Environment: > Using dd I have copied physical [NO INTERNET AVAILABLE ;] Debian > DVD's to > /media/distributionA resulting in > /media/distributionA/DVD1.iso > /media/distributionA/DVD2.iso > . > . > /media/distributionA/DVDn.iso > > Goal: > Extract pool directory (and all of its sub-directories) resulting in > /media/distributionA/poolA/ > /media/distributionA/poolA/contrib > /media/distributionA/poolA/main > > What commands should I be looking at? I'm not sure what use you want to make of this archive, ie how you want it managed, if at all. Personally, I would read /usr/share/doc/apt-cacher-ng/apt-cacher-ng.pdf carefully to see how to import iso images, and how it would deal with the lack of connectivity to import the "dists" part of an archive which is as necessary as the "pool" part for a smooth operation. You may have your own way of dealimg with this. apt-cacher-ng uses a browser interface with a simple user/password like CUPS to protect write operations, but I don't know whether a text browser is non-GUI enough to count as a command-line tool for you. But leaving that suggestion aside, and taking your goal at face value, I'm assuming that "distributionA" really means "dvd-set-a" and that you want no mixing of sets even if you come by, say, 8.1 DVDs and 8.2 ones. What is the significance of "poolA"? As root, I would probably just use the simplest tools available, mount, cp -Rip and chmod. The -i will log duplicate filenames. If you don't want it to wait, yes | cp -i... will log them but carry on copying. Were I to use mc as suggested, I would do this as a user. I'm not willing to use such a tool as root. One of the downsides of mc (there are lots of ups) is that it will only query a duplicate when it occurs and when you've made a final decision (like nonE or aLl) you get no further idea of how many files were affected. Cheers, David.
Re: Extracting directories from an ISO image, command line tool?
On Thu 10 Sep 2015 at 09:06:42 -0500, Richard Owlett wrote: > Brian wrote: > >On Thu 10 Sep 2015 at 08:06:36 -0500, Richard Owlett wrote: > > > >>Environment: > >>Using dd I have copied physical [NO INTERNET AVAILABLE ;] Debian DVD's to > >>/media/distributionA resulting in > >>/media/distributionA/DVD1.iso > >>/media/distributionA/DVD2.iso > >>. > >>. > >>/media/distributionA/DVDn.iso > >> > >>Goal: > >>Extract pool directory (and all of its sub-directories) resulting in > >>/media/distributionA/poolA/ > >>/media/distributionA/poolA/contrib > >>/media/distributionA/poolA/main > >> > >>What commands should I be looking at? > >>TIA > > > >I'd use mc (midnight commander) for that. Open ISO, tag files and copy. > >It saves having to think about commands. :) > > I explicitly tried to eliminate GUI and GUI-like responses by subject line. I explicitly ignored the effort. :) > I did however browse the man page. It might work. > Besides I like to think - that's why I dumped the Windows approach of BIG > DADDY knows best ;! > > > > >I'd also dispense with the dd part and just mount the media somewhere. > > VIOLATES 1st line of "Environment". Please note verb tense. I have. It's the "present". Do I get points now?
Re: Extracting directories from an ISO image, command line tool?
Hi, my two cents: for i in /media/distributionA/DVD*.iso do xorriso -osirrox on:auto_chmod_on -overwrite nondir \ -indev "$i" \ -extract /pool /media/distributionA/poolA done The setting -osirrox auto_chmod_on enables writing to read-only directories which were created by a previous xorriso -extract command. This is needed especially if duplicate files overwrite each other in such read-only directories. One may change the permissions of the directories before extraction. xorriso -osirrox on -overwrite nondir \ -indev "$i" \ -find /pool -type d -exec chmod u+rwx -- \ -extract /pool /media/distributionA/poolA \ -rollback_end The final command -rollback_end prevents error messages about pending changes and no output drive being acquired. This is equivalent to find /media/distributionA/poolA -type d -exec chmod u+rwx '{}' ';' after each xorriso run. Have a nice day :) Thomas
Re: Extracting directories from an ISO image, command line tool?
On 2015-09-10 at 10:23, Richard Owlett wrote: > Darac Marjal wrote: > >> On Thu, Sep 10, 2015 at 08:06:36AM -0500, Richard Owlett wrote: >> >>> Environment: >>> Using dd I have copied physical [NO INTERNET AVAILABLE ;] Debian DVD's to >>> /media/distributionA resulting in >>> /media/distributionA/DVD1.iso >>> /media/distributionA/DVD2.iso >>> . >>> . >>> /media/distributionA/DVDn.iso >>> >>> Goal: >>> Extract pool directory (and all of its sub-directories) resulting in >>> /media/distributionA/poolA/ >>> /media/distributionA/poolA/contrib >>> /media/distributionA/poolA/main >>> >>> What commands should I be looking at? >> >> You can mount an iso using the "-o loop" option to "mount" (see the man >> page under "THE LOOP DEVICE"). So, you can say, for example: >> >> mount -o loop /media/distributionA/DVD.iso /mnt >> cp /mnt/* /media/deistributionA/poolA/ >> >> 'umount' won't need any special options to umount that device. > > Will have to check to see if that or orrisox best fits some > personal preferences. 'mount -o loop' is in fact what I'd do myself if I were doing this manually; I'd only fall back to xorriso / orrisox if I needed to script or otherwise automate the process. (Automating it using 'mount -o loop' would only work if run as root, AFAICT, and that's not a good idea for an automated process with possibly-untrusted input. I wouldn't do it if I had any choice in the matter.) -- The Wanderer The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. -- George Bernard Shaw signature.asc Description: OpenPGP digital signature
Re: Extracting directories from an ISO image, command line tool?
On 2015-09-10 at 10:20, The Wanderer wrote: > On 2015-09-10 at 10:06, Richard Owlett wrote: > >> Brian wrote: >> >>> On Thu 10 Sep 2015 at 08:06:36 -0500, Richard Owlett wrote: >>> Environment: Using dd I have copied physical [NO INTERNET AVAILABLE ;] Debian DVD's to /media/distributionA resulting in > >>> I'd also dispense with the dd part and just mount the media >>> somewhere. >> >> VIOLATES 1st line of "Environment". Please note verb tense. > > Actually, no; "the media" can mean "the ISO(s)", just as well as it can > mean "the physical disc(s)". And if you don't have the ISOs, you > certainly can't extract anything from them. ...and I misread the message entirely; please ignore the above. -- The Wanderer The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. -- George Bernard Shaw signature.asc Description: OpenPGP digital signature
Re: Extracting directories from an ISO image, command line tool?
On 2015-09-10 at 10:18, Richard Owlett wrote: > The Wanderer wrote: > >> On 2015-09-10 at 09:06, Richard Owlett wrote: >> >>> Environment: >>> Using dd I have copied physical [NO INTERNET AVAILABLE ;] Debian >>> DVD's to >>> /media/distributionA resulting in >>> /media/distributionA/DVD1.iso >>> /media/distributionA/DVD2.iso >>> . >>> . >>> /media/distributionA/DVDn.iso >>> >>> Goal: >>> Extract pool directory (and all of its sub-directories) resulting in >>> /media/distributionA/poolA/ >>> /media/distributionA/poolA/contrib >>> /media/distributionA/poolA/main >>> >>> What commands should I be looking at? >>> TIA >> >> Hmm. >> >> In Windows, I know the 7-Zip utility can open and extract ISOs, but >> the 7z command-line utility in Linux apparently doesn't have that >> ability (at least not as packaged in Debian). >> >> For most purposes, I'd just use mount and then either cp or rsync, >> but if you need to automate it as non-root it looks like you can do >> that with orrisox (part of the xorriso package): >> >> orrisox -indev /path/to/file.iso -extract . -subdir >> /path/to/output/directory Brainfart typo here; '-subdir' is not necessary and would probably give an error. The command would be: for file in /media/distributionA/*.iso; do \ orrisox -indev "$file" . /media/distributionA/poolA ; \ done And/or similar, more-complex twiddlings if you have other /media/distribution* directories which you want to handle. (Note that this will not work as expected if the two ISOs have any pathnames in common.) > Browsing man page suggests that "-extract iso_rr_path disk_path" is > explicitly what I'm looking for. Don't have time for a detailed read > right now. Thank you. You're quite welcome. -- The Wanderer The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. -- George Bernard Shaw signature.asc Description: OpenPGP digital signature
Re: Extracting directories from an ISO image, command line tool?
Darac Marjal wrote: On Thu, Sep 10, 2015 at 08:06:36AM -0500, Richard Owlett wrote: Environment: Using dd I have copied physical [NO INTERNET AVAILABLE ;] Debian DVD's to /media/distributionA resulting in /media/distributionA/DVD1.iso /media/distributionA/DVD2.iso . . /media/distributionA/DVDn.iso Goal: Extract pool directory (and all of its sub-directories) resulting in /media/distributionA/poolA/ /media/distributionA/poolA/contrib /media/distributionA/poolA/main What commands should I be looking at? You can mount an iso using the "-o loop" option to "mount" (see the man page under "THE LOOP DEVICE"). So, you can say, for example: mount -o loop /media/distributionA/DVD.iso /mnt cp /mnt/* /media/deistributionA/poolA/ 'umount' won't need any special options to umount that device. Will have to check to see if that or orrisox best fits some personal preferences. Thank you.
Re: Extracting directories from an ISO image, command line tool?
On 2015-09-10 at 10:06, Richard Owlett wrote: > Brian wrote: > >> On Thu 10 Sep 2015 at 08:06:36 -0500, Richard Owlett wrote: >> >>> Environment: >>> Using dd I have copied physical [NO INTERNET AVAILABLE ;] Debian >>> DVD's to /media/distributionA resulting in >> I'd also dispense with the dd part and just mount the media >> somewhere. > > VIOLATES 1st line of "Environment". Please note verb tense. Actually, no; "the media" can mean "the ISO(s)", just as well as it can mean "the physical disc(s)". And if you don't have the ISOs, you certainly can't extract anything from them. -- The Wanderer The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. -- George Bernard Shaw signature.asc Description: OpenPGP digital signature
Re: Extracting directories from an ISO image, command line tool?
Hallo, * Richard Owlett [Thu, Sep 10 2015, 09:18:18AM]: > >if you need to automate it as non-root it looks like you can do that > >with orrisox (part of the xorriso package): > > > >orrisox -indev /path/to/file.iso -extract . -subdir > >/path/to/output/directory > > > > Browsing man page suggests that "-extract iso_rr_path disk_path" is > explicitly what I'm looking for. Don't have time for a detailed read right > now. Thank you. You could also try isodump for single files. Regards, Eduard.
Re: Extracting directories from an ISO image, command line tool?
The Wanderer wrote: On 2015-09-10 at 09:06, Richard Owlett wrote: Environment: Using dd I have copied physical [NO INTERNET AVAILABLE ;] Debian DVD's to /media/distributionA resulting in /media/distributionA/DVD1.iso /media/distributionA/DVD2.iso . . /media/distributionA/DVDn.iso Goal: Extract pool directory (and all of its sub-directories) resulting in /media/distributionA/poolA/ /media/distributionA/poolA/contrib /media/distributionA/poolA/main What commands should I be looking at? TIA Hmm. In Windows, I know the 7-Zip utility can open and extract ISOs, but the 7z command-line utility in Linux apparently doesn't have that ability (at least not as packaged in Debian). For most purposes, I'd just use mount and then either cp or rsync, but if you need to automate it as non-root it looks like you can do that with orrisox (part of the xorriso package): orrisox -indev /path/to/file.iso -extract . -subdir /path/to/output/directory Browsing man page suggests that "-extract iso_rr_path disk_path" is explicitly what I'm looking for. Don't have time for a detailed read right now. Thank you.
Re: Extracting directories from an ISO image, command line tool?
Brian wrote: On Thu 10 Sep 2015 at 08:06:36 -0500, Richard Owlett wrote: Environment: Using dd I have copied physical [NO INTERNET AVAILABLE ;] Debian DVD's to /media/distributionA resulting in /media/distributionA/DVD1.iso /media/distributionA/DVD2.iso . . /media/distributionA/DVDn.iso Goal: Extract pool directory (and all of its sub-directories) resulting in /media/distributionA/poolA/ /media/distributionA/poolA/contrib /media/distributionA/poolA/main What commands should I be looking at? TIA I'd use mc (midnight commander) for that. Open ISO, tag files and copy. It saves having to think about commands. :) I explicitly tried to eliminate GUI and GUI-like responses by subject line. I did however browse the man page. It might work. Besides I like to think - that's why I dumped the Windows approach of BIG DADDY knows best ;! I'd also dispense with the dd part and just mount the media somewhere. VIOLATES 1st line of "Environment". Please note verb tense.
Re: Extracting directories from an ISO image, command line tool?
On Thu, Sep 10, 2015 at 08:06:36AM -0500, Richard Owlett wrote: > Environment: > Using dd I have copied physical [NO INTERNET AVAILABLE ;] Debian DVD's to > /media/distributionA resulting in > /media/distributionA/DVD1.iso > /media/distributionA/DVD2.iso > . > . > /media/distributionA/DVDn.iso > > Goal: > Extract pool directory (and all of its sub-directories) resulting in > /media/distributionA/poolA/ > /media/distributionA/poolA/contrib > /media/distributionA/poolA/main > > What commands should I be looking at? You can mount an iso using the "-o loop" option to "mount" (see the man page under "THE LOOP DEVICE"). So, you can say, for example: mount -o loop /media/distributionA/DVD.iso /mnt cp /mnt/* /media/deistributionA/poolA/ 'umount' won't need any special options to umount that device. > TIA > > > > -- For more information, please reread. signature.asc Description: Digital signature
Re: Extracting directories from an ISO image, command line tool?
On 2015-09-10 at 09:06, Richard Owlett wrote: > Environment: > Using dd I have copied physical [NO INTERNET AVAILABLE ;] Debian > DVD's to > /media/distributionA resulting in > /media/distributionA/DVD1.iso > /media/distributionA/DVD2.iso > . > . > /media/distributionA/DVDn.iso > > Goal: > Extract pool directory (and all of its sub-directories) resulting in > /media/distributionA/poolA/ > /media/distributionA/poolA/contrib > /media/distributionA/poolA/main > > What commands should I be looking at? > TIA Hmm. In Windows, I know the 7-Zip utility can open and extract ISOs, but the 7z command-line utility in Linux apparently doesn't have that ability (at least not as packaged in Debian). For most purposes, I'd just use mount and then either cp or rsync, but if you need to automate it as non-root it looks like you can do that with orrisox (part of the xorriso package): orrisox -indev /path/to/file.iso -extract . -subdir /path/to/output/directory -- The Wanderer The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. -- George Bernard Shaw signature.asc Description: OpenPGP digital signature
Re: Extracting directories from an ISO image, command line tool?
On Thu 10 Sep 2015 at 08:06:36 -0500, Richard Owlett wrote: > Environment: > Using dd I have copied physical [NO INTERNET AVAILABLE ;] Debian DVD's to > /media/distributionA resulting in > /media/distributionA/DVD1.iso > /media/distributionA/DVD2.iso > . > . > /media/distributionA/DVDn.iso > > Goal: > Extract pool directory (and all of its sub-directories) resulting in > /media/distributionA/poolA/ > /media/distributionA/poolA/contrib > /media/distributionA/poolA/main > > What commands should I be looking at? > TIA I'd use mc (midnight commander) for that. Open ISO, tag files and copy. It saves having to think about commands. :) I'd also dispense with the dd part and just mount the media somwhere.
Extracting directories from an ISO image, command line tool?
Environment: Using dd I have copied physical [NO INTERNET AVAILABLE ;] Debian DVD's to /media/distributionA resulting in /media/distributionA/DVD1.iso /media/distributionA/DVD2.iso . . /media/distributionA/DVDn.iso Goal: Extract pool directory (and all of its sub-directories) resulting in /media/distributionA/poolA/ /media/distributionA/poolA/contrib /media/distributionA/poolA/main What commands should I be looking at? TIA