Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello, I would like a command that can automatically burn my folder on several volumes of 4gb without compression, prompt me load a new empty dv.
Can it be possible ?
Save this as myburn.sh. Then run 'chmod +x myburn.sh"
Use it as follows: run myburn.sh [path of folder] [device node of burner]
It's just a quick hacked together script, but it should work.
Save this as myburn.sh. Then run 'chmod +x myburn.sh"
Use it as follows: run myburn.sh [path of folder] [device node of burner]
It's just a quick hacked together script, but it should work.
It sounds a great hacked script ! I'll use it sure
Can/Does it handle the multi volume when my folder has size of 9gb (multi-volume) ?
Ah, no I misunderstood the question. I thought you meant that you had less than 4GB in a directory and wanted to burn it to multiple disks (ie, make duplicates). That is what my little script does. I'll get back soon with one that does that.
#!/bin/sh
ISO=`mktemp ../isoXXX`
TOTAL_SIZE=0
SIZE=0
TO_BURN=""
for X in *
do
SIZE=`du -b $X | tail -n 1 | cut -f 1`
if [ `expr $SIZE + $TOTAL_SIZE` -gt 4294967296 ]
then
rm $ISO
mkisofs -o $ISO $TO_BURN
cdrecord dev=$2 $ISO
eject $ISO
echo "Please input another disk, then hit enter"
read GARBAGE
TO_BURN="$X"
else
TO_BURN="$TO_BURN $X "
fi
done
mkisofs -o $ISO $TO_BURN
cdrecord dev=$2 $ISO
eject $ISO
Okay, use this exactly as the other, except that now it does what you want. :-) NOTE: use at your own risk - this script is a quick hack that does 0 error checking / recovery and has a couple other limitations.
-It assumes there is a DVD ready at the beginning
-If any one subdirectory of the burn directory is larger than 4 GB, then the script will have undefined results ( aka, it will try to burn more than 4 GB to one DVD, and I don't know how cdrecord handles that.)
-This is 100% untested, so if there are troubles, just post back. This is a temporary hack, and probably shouldn't be used as too permanent a solution.
#!/bin/sh
ISO=`mktemp ../isoXXX`
TOTAL_SIZE=0
SIZE=0
TO_BURN=""
for X in *
do
SIZE=`du -b $X | tail -n 1 | cut -f 1`
if [ `expr $SIZE + $TOTAL_SIZE` -gt 4294967296 ]
then
rm $ISO
mkisofs -o $ISO $TO_BURN
cdrecord dev=$2 $ISO
eject $ISO
echo "Please input another disk, then hit enter"
read GARBAGE
TO_BURN="$X"
else
TO_BURN="$TO_BURN $X "
fi
done
mkisofs -o $ISO $TO_BURN
cdrecord dev=$2 $ISO
eject $ISO
Okay, use this exactly as the other, except that now it does what you want. :-) NOTE: use at your own risk - this script is a quick hack that does 0 error checking / recovery and has a couple other limitations.
-It assumes there is a DVD ready at the beginning
-If any one subdirectory of the burn directory is larger than 4 GB, then the script will have undefined results ( aka, it will try to burn more than 4 GB to one DVD, and I don't know how cdrecord handles that.)
-This is 100% untested, so if there are troubles, just post back. This is a temporary hack, and probably shouldn't be used as too permanent a solution.
Quote:
67.08% done, estimate finish Mon Sep 17 19:49:35 2007
67.16% done, estimate finish Mon Sep 17 19:49:34 2007
67.25% done, estimate finish Mon Sep 17 19:49:33 2007
67.34% done, estimate finish Mon Sep 17 19:49:33 2007
67.43% done, estimate finish Mon Sep 17 19:49:34 2007
67.52% done, estimate finish Mon Sep 17 19:49:34 2007
67.61% done, estimate finish Mon Sep 17 19:49:34 2007
67.70% done, estimate finish Mon Sep 17 19:49:38 2007
67.79% done, estimate finish Mon Sep 17 19:49:40 2007
67.88% done, estimate finish Mon Sep 17 19:49:40 2007
67.97% done, estimate finish Mon Sep 17 19:49:40 2007
68.06% done, estimate finish Mon Sep 17 19:49:39 2007
68.15% done, estimate finish Mon Sep 17 19:49:41 2007
68.24% done, estimate finish Mon Sep 17 19:49:40 2007
genisoimage: No space left on device. cannot fwrite 32768*1
wodim: No write mode specified.
wodim: Asuming -tao mode.
wodim: Future versions of wodim may have different drive dependent defaults.
Device type : Removable CD-ROM
Version : 0
Response Format: 2
Capabilities :
Vendor_info : 'LITE-ON '
Identification : 'DVDRW SHM-165P6S'
Revision : 'MS0M'
Device seems to be: Generic mmc2 DVD-R/DVD-RW.
Using generic SCSI-3/mmc DVD-R(W) driver (mmc_mdvd).
Driver flags : SWABAUDIO BURNFREE
Supported modes: PACKET SAO
Speed set to 5540 KB/s
wodim: Drive needs to reload the media to return to proper status.
wodim: ERROR: Could not manage to find medium size, and more than 4.3 GB of data for a non dual layer disc.
wodim: Cannot write more than remaining DVD capacity.
eject: tried to use `../iso046' as device name but it is no block device
eject: tried to use `./../iso046' as device name but it is no block device
eject: unable to find or open device for: `../iso046'
Mon Sep 17 19:45:38 CEST 2007
I saw twice these percents :?
then saw 1.2GB (size okay of my folder)
then saw sthg 3.3 GB ..?
I got an error message... hmm something is apparently wrong.
this is the present script (tuned for debug) now.
Code:
#!/bin/sh
clear
date
if [ "$2" != "" ] ; then
echo " "
echo "-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*"
echo " Folder backup script:"
echo "-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*"
echo " "
echo " The available cdrom/dvd drives for burning are :"
ls -la "$(cat /etc/fstab | grep /media/cdrom | awk ' { print $1 } ')"
echo " Burning of the following folder: $1"
ls -la $1
du -h $1
echo " "
echo " to the following device : $2 "
echo " Nota: Maximum device size for burning set to value of: 4294967296"
echo " "
printf "Ready for burning [y/n] ?"
read THEFIRSTGARBAGE
if [ "$THEFIRSTGARBAGE" == "y" ] ; then
ISO=`mktemp ../isoXXX`
TOTAL_SIZE=0
SIZE=0
TO_BURN=""
echo "==> New burning " >> /tmp/burningscript.log
echo "$(date) :" >> /tmp/burningscript.log
for X in *
do
SIZE=`du -b $X | tail -n 1 | cut -f 1`
if [ `expr $SIZE + $TOTAL_SIZE` -gt 4294967296 ]
then
rm $ISO
echo " Value iso: $ISO"
echo " Value to_burn: $TO_BURN"
echo " Value 2: $2"
echo " $(date): mkisofs started"
echo " Value iso: $ISO" >> /tmp/burningscript.log
echo " Value to_burn: $TO_BURN" >> /tmp/burningscript.log
echo " Value 2: $2" >> /tmp/burningscript.log
echo " mkisofs started" >> /tmp/burningscript.log
mkisofs -o $ISO $TO_BURN
echo " $(date): cdrecord started" >> /tmp/burningscript.log
echo " $(date): cdrecord started"
cdrecord dev=$2 $ISO
echo " $(date): eject $ISO " >> /tmp/burningscript.log
echo " $(date): eject $ISO "
eject $ISO
echo "Please input another disk, then hit enter"
read GARBAGE
TO_BURN="$X"
else
TO_BURN="$TO_BURN $X "
fi
done
mkisofs -o $ISO $TO_BURN
cdrecord dev=$2 $ISO
eject $ISO
fi
fi
date
echo "Bye"
There is too a problem with the names, they are shortened ... to 8 chars + ext.
I mounted the burnt cdrom, and it looks that it is burnt...
It looks that I can read the cdrom
btw, I mistaken, my folder was only 1.2G...
Let's MD5 ...
Edit:
Lazy to MD5, the names are differently burnt on the device
(if you've got a way to make it longer names, I'd welcome it)
Then I'll make another small update of the script and will post.
What would you think about a MD5 checking ?
Would you by chance the error displayed above ?
thanks a lot
Last edited by frenchn00b; 09-17-2007 at 01:07 PM.
Adding "-allow-lowercase -ldots -allow-multidot -J -joliet-long -r" immediately after the word "cdrecord" should help the filename distortion. To avoid some potentially serious mistakes add "cd $1" as the first line (immediately after #!/bin/sh). Can you repost your the exact command you typed? It seems that either by a programming error or by improper usage that the script is using $ISO as the device to burn to. Did you specify a device?
eady for burning [y/n] ?y
Value iso: ../iso537
Value to_burn:
Value 2: /dev/hdb
Tue Sep 18 20:49:40 CEST 2007: mkisofs started
I: -input-charset not specified, using iso-8859-1 (detected in locale settings)
genisoimage: Missing pathspec.
Usage: genisoimage [options] -o file directory ...
Use genisoimage -help
to get a list of valid options.
Report problems to debburn-devel@lists.alioth.debian.org.
Tue Sep 18 20:49:40 CEST 2007: cdrecord started
wodim: Bad Option: -allow-lowercase.
Usage: wodim [options] track1...trackn
Use wodim -help
to get a list of valid options.
Use wodim blank=help
to get a list of valid blanking options.
Use wodim dev=b,t,l driveropts=help -checkdrive
to get a list of drive specific options.
Use wodim dev=help
to get a list of possible SCSI transport specifiers.
Tue Sep 18 20:49:40 CEST 2007: eject ../iso537
eject: unable to find or open device for: `../iso537'
Please input another disk, then hit enter
dvd1
Ready for burning [y/n] ?y
Value iso: ../iso609
Value to_burn:
Value 2: /dev/hdb
Tue Sep 18 20:53:39 CEST 2007: mkisofs started
I: -input-charset not specified, using iso-8859-1 (detected in locale settings)
genisoimage: Missing pathspec.
Usage: genisoimage [options] -o file directory ...
Use genisoimage -help
to get a list of valid options.
Report problems to debburn-devel@lists.alioth.debian.org.
Tue Sep 18 20:53:39 CEST 2007: cdrecord started
wodim: Bad Option: -ldots.
Usage: wodim [options] track1...trackn
mkisofs -o
==> New burning
Tue Sep 18 20:49:40 CEST 2007 :
Value iso: ../iso537
Value to_burn:
Value 2: /dev/hdb
mkisofs started
Tue Sep 18 20:49:40 CEST 2007: cdrecord started
Tue Sep 18 20:49:40 CEST 2007: eject ../iso537
==> New burning
Tue Sep 18 20:53:39 CEST 2007 :
Value iso: ../iso609
Value to_burn:
Value 2: /dev/hdb
mkisofs started
Tue Sep 18 20:53:39 CEST 2007: cdrecord started
Tue Sep 18 20:53:39 CEST 2007: eject ../iso609
Last edited by frenchn00b; 09-18-2007 at 01:55 PM.
Is your hard drive nearly fully, the biggest problem we seem to come upon is that 29.25% of the way through creating the ISO, your hard drive seems to run out of space.
Also, is there a reason you'd need a batch script to do this? The whole task would probably be easier with a GUI CD Burner like K3b.
Is your hard drive nearly fully, the biggest problem we seem to come upon is that 29.25% of the way through creating the ISO, your hard drive seems to run out of space.
Also, is there a reason you'd need a batch script to do this? The whole task would probably be easier with a GUI CD Burner like K3b.
Indeed I noticed afterwards... so that's why this script. K3b a bit, then I'll give a try again the nice script !
thanks
Track 01: Total bytes read/written: 3786733568/3786733568 (1848991 sectors).
eject: tried to use `../iso578' as device name but it is no block device
eject: tried to use `./../iso578' as device name but it is no block device
eject: unable to find or open device for: `../iso578'
Thu Sep 20 19:06:54 CEST 2007
Bye
and there is still a 396Mb something file iso578 prsent
it looks it burned 3.8 GB ...
dvd is readable ...
hm hm
does it work, really ...
nnot access `Photos': No such file or directory
du: cannot access `EPSON': No such file or directory
I: -input-charset not specified, using iso-8859-1 (detected in locale settings)
genisoimage: No such file or directory. Invalid node - 'My'.
wodim: No write mode specified.
wodim: Asuming -tao mode.
wodim: Future versions of wodim may have different drive dependent defaults.
Error trying to open /dev/hdb exclusively (Device or resource busy)... retrying in 1 second.
Device type : Removable CD-ROM
Version : 0
Response Format: 2
Capabilities :
Vendor_info : 'LITE-ON '
Identification : 'DVDRW SHM-165P6S'
Revision : 'MS0M'
Device seems to be: Generic mmc2 DVD-R/DVD-RW.
Using generic SCSI-3/mmc DVD-R(W) driver (mmc_mdvd).
Driver flags : SWABAUDIO BURNFREE
Supported modes: PACKET SAO
Speed set to 5540 KB/s
Starting to write CD/DVD at speed 4.0 in real unknown mode for single session.
Last chance to quit, starting real write 0 seconds. Operation starts.
Track 01: Total bytes read/written: 356352/614400 (300 sectors).
eject: tried to use `../iso128' as device name but it is no block device
eject: tried to use `./../iso128' as device name but it is no block device
eject: unable to find or open device for: `../iso128'
Thu Sep 20 19:37:41 CEST 2007
Bye
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.