[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: delete directory



Hi,

> it's possible to delete a directory from a cd rw multisession WITHOUT
> know track number , but using the directory name?
> ie. i want delete the directory /cats on my cdrw , but i don't remember
> the associate track number..

I assume you mean a ISO 9660 filesystem.

In that case the answer is Yes. But the data
would not be gone from the media. Mounting the
previous session will make them visible again.

If the filesystem contains Rock Ridge info
then xorriso will be able to perform the
task:

  xorriso -dev /dev/... -rm_r /cats

This will write a new session which contains
the directory tree of the previous session
but without directory /cats.

If you want to really erase the data then you
will have to copy the media into a session on
a different media.
Either by
  mount /media/cdrw
  mkisofs ...  cdrecord ...
or
  xorriso -indev /dev/sr0 -outdev /dev/sr1 \
          -rm_r /cats

---------------------

xorriso is available at
  http://scdbackup.sourceforge.net/xorriso-0.3.0.pl00.tar.gz

---------------------

Blanking of a track seems not to be an option
if the track with the undesired directory
is not in the last session.
MMC-5 6.2.2.4 says:
"The track to be blanked shall be in the incomplete
 session."
Mentioned are blanking types 110b "Blank the last
non-empty Session" and 101b "Unclose the last complete
session".
That looks like you could rollback the media from
the end but not pick a track out of the middle.

Whatever:
You may find out the track number by comparing
the block addresses of the files with the
block addresses of the table-of-content:

  xorriso -indev /dev/... -find /cat -exec report_lba

will report something like
  Report layout: xt , Startlba ,   Blocks , Filesize , ISO image path
  File data lba:  0 ,    31485 ,      210 ,   430046 , '/cats/lion'
  ...

The table-of-content is obtained like this:

  xorriso -indev /dev/... -toc

which will report like
  TOC layout   : Idx ,  sbsector ,       Size , Volume Id
  ISO session  :   1 ,         0 ,    115487s , ...
  ISO session  :   2 ,    115520 ,      4527s , ...
  ...

Compare the columns "Startlba" and "sbsector".
The right track will have a sbsector lower than
Startlba and the next track after it shall have
a higher sbsector than the desired Startlba.

For performing eventual partial blanking you will
have to use cdrecord which in its man page offers
blank types "session", "unclose", "track".


Have a nice day :)

Thomas


Reply to: