-3

i want not to let specific files to be deleted even after formatting the hard disk ? what is the possible change(s) that i should make to the files so as these files would not be deleted during formatting and how i would recognize these files after formatting?

i have googled, but no hope.

Thanks in advance.

  • upload your file to cloud storage(google drive, dropbox etc.) – Aditya_kr Jul 10 '17 at 19:52
  • 1
    If you are willing, reduce the filesystem, use the freed blocks and mark them as bad blocks. Your file will not be anywhere in the filesystem and not accessible by any non privileged application. You will need to run your code in privileged mode and access the file using direct access to the blocks. – alvits Jul 10 '17 at 20:10
  • This website is for questions about programming. I suggest you ask this question on https://superuser.com/ – Alex Jul 10 '17 at 23:31
  • @alvits thanks. it can be done this way.but how can i keep the map of bad blocks which i will make for the specific file(s) to recognize these files again after formatting for reuse? i don't wanna use any external file for keeping track of the bad blocks map. – Muhammad Uzman Jul 11 '17 at 19:32
  • @alvits Can i use the Host protected Area for keeping track of the bad blocks? if yes, then how? any suggested reading ? – Muhammad Uzman Jul 11 '17 at 19:40
  • Your code will be running inside an operating system. The host protected area (HPA) is not visible to the operating system. You cannot use it. This area is usually used by firmware. When you access a block device, your code will be governed by the limits set forth by the operating systems. I would suggest using the lowest or the highest block to store the information of the blocks used by you. This block will serve as the metadata for your block allocations. – alvits Jul 11 '17 at 21:47
  • @alvits it seems my problem is solved now. Thank You! – Muhammad Uzman Jul 12 '17 at 19:04

2 Answers2

0

No, this is not possible since formatting destroys ALL data on a disk (including meta data like information regarding the used file system which would be needed to read the file)

Martin S
  • 814
  • 2
  • 11
  • 24
0

a file can never truly be undeletable. A reformat, removal of the security software, or change in permissions can always bypass tricks . The best you can do is limit the scope of who can access or delete the content.

moh89
  • 133
  • 1
  • 2
  • 12