DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Ports and Packages

FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 11th May 2008
mfaridi's Avatar
mfaridi mfaridi is offline
Spam Deminer
 
Join Date: May 2008
Location: Afghanistan
Posts: 320
Default very easy and powerfull way for make ISO file

which way is best and powerful way for make ISO file from directories ????
Reply With Quote
  #2   (View Single Post)  
Old 11th May 2008
erno erno is offline
Port Guard
 
Join Date: May 2008
Location: Finland
Posts: 12
Default

You can use mkisofs to create iso files. It's included in cdrtools package.

Last edited by erno; 11th May 2008 at 04:47 PM.
Reply With Quote
  #3   (View Single Post)  
Old 11th May 2008
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
ISO Quartermaster
 
Join Date: Apr 2008
Location: NYC
Posts: 652
Default

The man page has various examples as well, including one that does exactly what you're asking.
Reply With Quote
  #4   (View Single Post)  
Old 11th May 2008
hydra's Avatar
hydra hydra is offline
Port Guard
 
Join Date: May 2008
Location: Slovakia (Europe)
Posts: 41
Default

http://www.freebsd.org/doc/en_US.ISO...ating-cds.html
Reply With Quote
  #5   (View Single Post)  
Old 11th May 2008
ephemera's Avatar
ephemera ephemera is offline
Knuth's homeboy
 
Join Date: Apr 2008
Posts: 537
Default

if you want something easy and powerful go with 'k3b'.
its a front end for the various cd/dvd tools like mkisofs, cdrecord etc.
Reply With Quote
  #6   (View Single Post)  
Old 12th May 2008
mfaridi's Avatar
mfaridi mfaridi is offline
Spam Deminer
 
Join Date: May 2008
Location: Afghanistan
Posts: 320
Default

Thanks Guys
Can I make ISO file with dd and cat ???
Reply With Quote
  #7   (View Single Post)  
Old 12th May 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

Yes, both will work:

# cat /dev/acd0 > myimage.iso
# dd if=/dev/acd0 of=anotherimage.iso
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #8   (View Single Post)  
Old 12th May 2008
mfaridi's Avatar
mfaridi mfaridi is offline
Spam Deminer
 
Join Date: May 2008
Location: Afghanistan
Posts: 320
Default

Quote:
Originally Posted by Carpetsmoker View Post
Yes, both will work:

# cat /dev/acd0 > myimage.iso
# dd if=/dev/acd0 of=anotherimage.iso
So I understand I can use dd and cat for make ISO files from CDROM and CD

IS this true ???
Reply With Quote
  #9   (View Single Post)  
Old 12th May 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

No, it's not true, I was lying earlier. (<-- joke)

An "ISO file" or "disk image" is just a filesystem inside a file, cat and dd will both just make a "raw copy" of anything, here are some example uses (Not very useful, just proof of concept):

Make a floppy image and write put it to another floppy
# cat /dev/fd0 > floppy.img
# cat floppy.img > /dev/fd1

Copy a partition:
# cat /dev/ad0s1a > /dev/ad1s1a

Copy CDROM to disk and mount it
# cat /dev/acd0 > /dev/ad0s1d
# mount_cd9660 /dev/ad0s1d /mnt/cdrom

"Secure" erase a disk
# cat /dev/random > /dev/ad0

Make a backup
# cat /dev/ad0 | gz > backup.img.gz
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
Old 12th May 2008
Oliver_H's Avatar
Oliver_H Oliver_H is offline
Real Name: Oliver Herold
UNIX lover
 
Join Date: May 2008
Location: Germany
Posts: 427
Default

@Carpetsmoker

How could I check the image after burning?
Reply With Quote
Old 12th May 2008
tuck's Avatar
tuck tuck is offline
Shell Scout
 
Join Date: May 2008
Posts: 99
Default

Oliver: isovfy is part of cdrecord.

Last edited by tuck; 12th May 2008 at 09:26 AM.
Reply With Quote
Old 12th May 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

tar(1) supports ISO9660:
% tar tf image.iso
% tar tf /dev/acd0

More reliable would be:
Code:
# mdconfig -at vnode -f image.iso
# mount -t cd9660 /dev/md0 /mnt/md0
# cd /mnt/md0

# find . -type f -exec md5 {} \; > ~/MD5.img[/cmd]
# cd -
# umount /mnt/md0; mdconfig -du0

[burn image]

# mount -t cd9660 /dev/acd0 /mnt/acd0
# cd /mnt/acd0
# find . -type f -exec md5 {} \; > ~/MD5.disc
# diff -u ~/MD5.img MD5.disc
If I remember correctly, the GNU version of md5 can read a file and check the files automatically, but it seems BSD md5 doesn't have this functionality...
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
Old 12th May 2008
tuck's Avatar
tuck tuck is offline
Shell Scout
 
Join Date: May 2008
Posts: 99
Default

Ah uh oh shame on me... I thought verifying if the .iso isn't broken or else like that, not verifying if the data is correctly writen...
Reply With Quote
Old 12th May 2008
Oliver_H's Avatar
Oliver_H Oliver_H is offline
Real Name: Oliver Herold
UNIX lover
 
Join Date: May 2008
Location: Germany
Posts: 427
Default

Thx

>not verifying if the data is correctly writen...

Yes this was my intention.
__________________
use UNIX or die :-)
Reply With Quote
Old 12th May 2008
ephemera's Avatar
ephemera ephemera is offline
Knuth's homeboy
 
Join Date: Apr 2008
Posts: 537
Default

Quote:
Originally Posted by Carpetsmoker View Post
More reliable would be:
Code:
# mdconfig -at vnode -f image.iso
# mount -t cd9660 /dev/md0 /mnt/md0
# cd /mnt/md0

# find . -type f -exec md5 {} \; > ~/MD5.img[/cmd]
# cd -
# umount /mnt/md0; mdconfig -du0

[burn image]

# mount -t cd9660 /dev/acd0 /mnt/acd0
# cd /mnt/acd0
# find . -type f -exec md5 {} \; > ~/MD5.disc
# diff -u ~/MD5.img MD5.disc
this method has the advantage that you would know which files are corrupted.

but if you just want to check if the cd is an corrupted or not:

$ md5 < image.iso > image.md5

[burn image]

$ dd < /dev/acd0 bs=2k | md5 | cmp - image.md5 && echo Ok
Reply With Quote
Old 12th May 2008
ephemera's Avatar
ephemera ephemera is offline
Knuth's homeboy
 
Join Date: Apr 2008
Posts: 537
Default

actually, no need to use md5 this would likely be much faster:

$ dd < /dev/acd0 bs=2k | cmp - image.iso && echo Ok


btw, calculating the checksum of all the files being burned (similiar to what carpetsmoker suggested) and storing it in a file on the cd (say file.md5) is IMO a good idea. so that if the cd develops problems in the future you can easily tell which files are ok by comparing the files on the cd with their md5sums in file.md5.
Reply With Quote
Old 12th May 2008
18Googol2's Avatar
18Googol2 18Googol2 is offline
Real Name: whoami
Spam Deminer
 
Join Date: Apr 2008
Location: pwd
Posts: 283
Default

Quote:
Originally Posted by ephemera View Post
btw, calculating the checksum of all the files being burned (similiar to what carpetsmoker suggested) and storing it in a file on the cd (say file.md5) is IMO a good idea.
Sure it is, especially for a big one. Thats what I do if I need to seed a torrent file

It also a good idea if you enclose a SHA256 checksum in the package as well
__________________
The power of plain text? It can control an entire OS
Reply With Quote
Old 12th May 2008
mfaridi's Avatar
mfaridi mfaridi is offline
Spam Deminer
 
Join Date: May 2008
Location: Afghanistan
Posts: 320
Default

thanks all guys you help to learn many information abut ISO .
Reply With Quote
Old 12th May 2008
ephemera's Avatar
ephemera ephemera is offline
Knuth's homeboy
 
Join Date: Apr 2008
Posts: 537
Default

Quote:
Originally Posted by 18Googol2 View Post
It also a good idea if you enclose a SHA256 checksum in the package as well
while sha1/sha256 are crypographically more secure than md5 they more expensive to calculate - something to keep in mind for checksumming large files.

Last edited by ephemera; 12th May 2008 at 01:11 PM.
Reply With Quote
Old 12th May 2008
18Googol2's Avatar
18Googol2 18Googol2 is offline
Real Name: whoami
Spam Deminer
 
Join Date: Apr 2008
Location: pwd
Posts: 283
Default

Yeah, nobody cares to spoof my torrent's MD5s, my torrents are crap btw

The fact is, an algorithm is said to be secure if its impossible to generate identical hash strings, from different source, which is not the case of MD5. Also MD5 hash can be decrypted with rainbow table. I reakon we will be moving to SHA256 in near future, so what I was saying is to get yourself be familiar with SHA256 is not a bad idea
__________________
The power of plain text? It can control an entire OS
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP read file contents - Maximum file size cksraj Programming 1 21st September 2009 11:38 AM
Simple/easy ircd Weaseal FreeBSD Ports and Packages 0 17th July 2008 12:31 PM
cannot make back up file seadog109 Other BSD and UNIX/UNIX-like 5 4th June 2008 10:36 PM
KDE app for easy Wireless connection coppermine FreeBSD Ports and Packages 4 17th May 2008 07:33 PM
Should be easy.... Keyboard copy n paste WeakSauceIII OpenBSD General 4 11th May 2008 07:32 PM


All times are GMT. The time now is 02:02 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick