# Place single file on USB key, make it undeletable



## LightlySalted

For promotional purposes, I want to distribute 4GB usb keys with our brand printed on them to clients containing a showreel of our work. The file, (an h264 mov file) must be undeletable. Access is for everyone (because obviously we want everyone to watch our showreel) but deletion must be impossible.

I want to achieve this whilst still making the remaining 3 point something gigs of capacity read/writeable, only the movie file should have any restriction applied to it. How can I achieve this?


----------



## Headrush

What format is the usb key formatted with?

If it's HFS+ your probably best bet is using the extended ACL privileges and removing the delete ability. (root even)
Most users aren't going to know how to remove this.

More info/example here: http://aplawrence.com/MacOSX/acl.html

Of course a reformat can always remove the file.


----------



## LightlySalted

thanks, the keys are formatted in FAT32 and will probably need to remain so to ensure maximum compatibility across platforms.

Can windows systems read/write o HFS+? Or is that just unix? If so I could maybe reformat to HFS+


----------



## Headrush

LightlySalted said:


> thanks, the keys are formatted in FAT32 and will probably need to remain so to ensure maximum compatibility across platforms.
> 
> Can windows systems read/write o HFS+? Or is that just unix? If so I could maybe reformat to HFS+


Nope.

With FAT32 I'm not sure you can accomplish that, even my HFS+ method isn't perfect either.


----------



## LightlySalted

This is so confusing. I've had this response now from a few different people in different forums and it's baffling. Certainly it's fast starting to look that way, but I've seen this done albeit with files that were added by the manufacturer of the key.

The producer who's tasked me with locking the files on to the disk says she's seen this done specifically as in a movie file added to a USB key that is locked and undeletable. HOW do they DO this?


----------



## Headrush

My guess is what you saw was an U3 smart drive which has a readonly partition that appears as a CDROM.

You sure what you saw only had a single partition, was FAT32 and it was ONLY a single file that couldn't be deleted?


----------



## LightlySalted

Yes the u3 thing is likely what I saw or maybe the sandisk utility or whatever it was called. It was something quite infuriating as I recall as it also tended to run whatever it was upon insertion. But also the impression that's being relayed to me by the person who asked me to do this is that a single file appeared on a 'normal' usb key which was 'locked' the vagary of this might indicate that it was something more like the read only partition but even if that's the case this would be fine also.

I've tried this approach also but i can't seem to figure it out. I've successfully partitioned the disk but there's no option to make a partition read only in Mac Os disk utility that I can see. I tried to work around this by making a read only iso of the movie file sitting on the smaller partition I'd set aside for this and then writing this image to that same partition so that upon mounting the partition, the iso would mount, the file would appear but would be unwriteable Unfortunately this only succeeded in reducing the capacity of the disk by the size of the small partition, which was now unmountable, It seems that the partition information of the image file was being overwritten by the partition information of the disk or vice versa. Anyway this arrangement rendered the partition unreadable.

Do you know how I could achieve my aims using partitioning as the solution? This would be acceptable if only I could figure out how to do it.


----------



## Headrush

LightlySalted said:


> Yes the u3 thing is likely what I saw or maybe the sandisk utility or whatever it was called. It was something quite infuriating as I recall as it also tended to run whatever it was upon insertion. But also the impression that's being relayed to me by the person who asked me to do this is that a single file appeared on a 'normal' usb key which was 'locked' the vagary of this might indicate that it was something more like the read only partition but even if that's the case this would be fine also.


Yes Sandisk made U3 sticks. Autorun was a a feature since it appeared as a CDROM it used Windows ability to autoplay CDs. So I no doubt that is what you saw.

More info: http://www.everythingusb.com/u3.html



LightlySalted said:


> I've tried this approach also but i can't seem to figure it out. I've successfully partitioned the disk but there's no option to make a partition read only in Mac Os disk utility that I can see. I tried to work around this by making a read only iso of the movie file sitting on the smaller partition I'd set aside for this and then writing this image to that same partition so that upon mounting the partition, the iso would mount, the file would appear but would be unwriteable Unfortunately this only succeeded in reducing the capacity of the disk by the size of the small partition, which was now unmountable, It seems that the partition information of the image file was being overwritten by the partition information of the disk or vice versa. Anyway this arrangement rendered the partition unreadable.


The problem is the FAT32 filesystem doesn't have extended properties that would really do us any good for this.



LightlySalted said:


> Do you know how I could achieve my aims using partitioning as the solution? This would be acceptable if only I could figure out how to do it.


Let me think about it today and I will get back to you.


----------



## LightlySalted

Thanks, you're a gentleman and a scholar. By the way just to add another complication to the mix. I'm aiming to find a solution that will be compatible between mac and PC,


----------



## Headrush

Well after much searching and reading I can't come up with anything that meets your criteria.

To get that CDFS filesystem that appears as a CDROM you HAVE to have a U3 device with its extra hardware.

Best bet would try this with NTFS permissions: http://www.technibble.com/forums/showthread.php?t=6736

Not full proof since USB drive can be reformatted at any time.


----------



## LightlySalted

This has got to be one of the most deceptively difficult problems one can encounter. I know MAC OS can natively read NTFS but it can't write to it, thus making the whole thing read only which I could already do with a .iso writing solution someone gave me in a mac forum which would succesfully boot like a cd but unfortuntately render the whole stick unwritable, worse still even if I had these U3 disks (which I don't) they only have all their functionality on windows.

Somehow I just can't believe there's no way around this. But certainly I've not come up with anything so far.


----------



## Headrush

LightlySalted said:


> This has got to be one of the most deceptively difficult problems one can encounter. I know MAC OS can natively read NTFS but it can't write to it, thus making the whole thing read only which I could already do with a .iso writing solution someone gave me in a mac forum which would succesfully boot like a cd but unfortuntately render the whole stick unwritable


Yes you can copy an iso of a filesystem to a partition but this doesn't mean it can't be removed easily.



LightlySalted said:


> , worse still even if I had these U3 disks (which I don't) they only have all their functionality on windows.
> 
> Somehow I just can't believe there's no way around this. But certainly I've not come up with anything so far.


From what I understand, using these U3 sticks like the SanDisk Cruzer Micro, the read-only partition will work in OS X. It's extra hardware on the stick that causes the OS to see the CDFS partition on it.

The part that is not compatible is the LaunchPad software. So you would have to do all the prep work on Windows and additionally the autorun part would not work on OS X.

I think that is the closest fit you are going to find.

It's just an unusual request: removing functionality from parts of a device that was made to provide that functionality and doing it cross platform.


----------



## LightlySalted

But if one writes an iso to the disk then is not the iso itself read only? It's read as a cd is it not? Thus if I make a an iso of the disk with a file on it and then write that iso to the disk, the image file will be the size of the entire disk and thus there wouldn't be any capacity left and the whole thing would be read only which is not what I want. The way around this I thought would be to make an image file of a smaller partition of the disk with the file inside and then write this resulting image to that small partition leaving the rest intact but the result was that the parition became unmountable and thus the file unreadable and so the disk was exactly as normal except smaller in capacity.

Having no autorun is no problem don't want it anyway. In order to do what I'm specifically needing to do though, should I take it that I need a U3 disk and U3 software to make a CD read only partition and then if these two needs are satisfied it would result in a section of the disk being mounted as a CD which is read only and this would contain my file which would now be undeletable and that this effect would be seen across Mac and Windows platforms?

I guess when the steps are broken down and you describe it as you are it does seem an unusual request. Then again, think about the original need that led me down this path. I have a disk, I want to put a file on it, but I don't want people to delete the file. That doesn't seem unusual at all to me, in fact it seemed this was something that was bound to happen when people use USB sticks, but in the solutions we've explored it's come down to removing functionality as a workaround to the inability to perform this seemingly very simple task.


----------



## DoubleHelix

I would assume that commercial movies or software that ship on USB drives that can't be deleted are probably physically manufactured differently than consumer flash dives.


----------



## Headrush

LightlySalted said:


> But if one writes an iso to the disk then is not the iso itself read only? It's read as a cd is it not? Thus if I make a an iso of the disk with a file on it and then write that iso to the disk, the image file will be the size of the entire disk and thus there wouldn't be any capacity left and the whole thing would be read only which is not what I want. The way around this I thought would be to make an image file of a smaller partition of the disk with the file inside and then write this resulting image to that small partition leaving the rest intact but the result was that the parition became unmountable and thus the file unreadable and so the disk was exactly as normal except smaller in capacity.


Yes I worded what I said a little incorrectly above. An image file isn't necessarily read-only but an iso usually is. As you've found out you can't burn an iso just to a partition since the iso contains a complete Volume description. It's a CD filesystem and doesn't work with a HD partitioning scheme.



LightlySalted said:


> In order to do what I'm specifically needing to do though, should I take it that I need a U3 disk and U3 software to make a CD read only partition and then if these two needs are satisfied it would result in a section of the disk being mounted as a CD which is read only and this would contain my file which would now be undeletable and that this effect would be seen across Mac and Windows platforms?


You'll have to check out the the U3 details yourself since I don't know if they have software allowing you to modify the CDFS partition of the USB key or if you are stuck with their specific data. I just know that those sticks have additional hardware to enable the one partition to appear as a CDFS volume.



LightlySalted said:


> I guess when the steps are broken down and you describe it as you are it does seem an unusual request. Then again, think about the original need that led me down this path. I have a disk, I want to put a file on it, but I don't want people to delete the file. That doesn't seem unusual at all to me, in fact it seemed this was something that was bound to happen when people use USB sticks, but in the solutions we've explored it's come down to removing functionality as a workaround to the inability to perform this seemingly very simple task.


What makes it unusual is the cross platform requirement and trying to turn a naturally read/write device into a read-only device for a single file. (many would say use a CDROM for read-only distribution, cheaper anyways) 
You can see why U3 had to add extra hardware to accomplish this.

I've been trying every combination i can, using hdiutil and dd, and I've yet to come up with anything myself. Might try a little longer and than think might give up on this one.


----------



## LightlySalted

Right then. Well that is a bummer. Thanks for trying for me. I'll keep trying too if I can think of anything at all. Let me know if you come up with anything otherwise thanks for your diligence.


----------

