WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: DD command used to backup; Is it backing up useless garbage!?  (Read 1487 times)

Offline xor

  • Hero Member
  • *****
  • Posts: 1268
DD command used to backup; the shadow permission of the unnecessary deleted file on the drive is also backing up!?

if the answer is yes;

what is the command to exclude deleted files from image file!?

Offline lhaley42

  • Newbie
  • *
  • Posts: 39
Re: DD command used to backup; Is it backing up useless garbage!?
« Reply #1 on: August 31, 2021, 12:15:40 PM »
do you mean the /usr/bin/backup command (which is /usr/bin/filetool.sh -b) because if so, those tools use tar and gzip to coalesce and compress the backed up content - and logically so - in its reading off the filesystem the data involved.

dd permits access at a more physical level - copying the underlying image of the source - and yes, as such, that would include free blocks as well as in use blocks - because - they're all just blocks.
Lexi

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11634
Re: DD command used to backup; Is it backing up useless garbage!?
« Reply #2 on: August 31, 2021, 10:23:03 PM »
Hi xor
The  dd  command has no concept of files, directories, file systems, ownership, or permissions. It copies bytes
of data from point A to point B in a sequential manner.

Offline xor

  • Hero Member
  • *****
  • Posts: 1268
Re: DD command used to backup; Is it backing up useless garbage!?
« Reply #3 on: September 01, 2021, 01:53:37 AM »
Is there an action that can be done for unnecessary garbage file traces before the dd operation!?

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: DD command used to backup; Is it backing up useless garbage!?
« Reply #4 on: September 01, 2021, 03:13:00 AM »
$ rm garbage.file

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11634
Re: DD command used to backup; Is it backing up useless garbage!?
« Reply #5 on: September 01, 2021, 10:18:20 AM »
Hi xor
It sounds like you want to remove the empty spaces left behind due to files being deleted.

cp -a  your files someplace safe.
Delete the original files.
cp -a  your files back to their original location.

You files contents should now occupy sequential blocks and their should be no empty spaces between files.