WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline xor

  • Hero Member
  • *****
  • Posts: 1262
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, 09:15:40 AM »
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: 11221
Re: DD command used to backup; Is it backing up useless garbage!?
« Reply #2 on: August 31, 2021, 07: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: 1262
Re: DD command used to backup; Is it backing up useless garbage!?
« Reply #3 on: August 31, 2021, 10:53:37 PM »
Is there an action that can be done for unnecessary garbage file traces before the dd operation!?

Offline Greg Erskine

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

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11221
Re: DD command used to backup; Is it backing up useless garbage!?
« Reply #5 on: September 01, 2021, 07: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.