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

Re: Write protect access on USB port [WORKS]



Pascal Hambourg <pascal <at> plouf.fr.eu.org> writes:

> 
> Amit a écrit :
> > Pascal Hambourg <pascal <at> plouf.fr.eu.org> writes:
> > 
> >> That's because the filesystem is on a partition, not on the whole disk,
> >> an the partition block device is still read-write.
> >> The read-only flag must be set on the disk and all its partitions. I
> >> guess udev can do this.
> > 
> > I did this for the block device and the partitions as well.
> 
> Are you sure ?
> I set the partition read-only too. When I mounted the ext4 filesystem on
> it, mount detected the flag and mounted the volume read-only. Then I
> unmounted the volume. The md5sum remained the same at each step.
> 

Thanks for checking your set up.

After reading your mail and seeing that it works for you, it got me
looking at my set up. I am using Linux 3.6.0 from upstream so I reverted
back to current debian wheezy 3.2.x and it worked! So I dug deeper and
found out that 3.6.0 and 3.6.1 had the behavior I described with the
wrong checksums. Kernel 3.6.2 has a bunch of ext4 patches that fixes the
issue (although not sure which patch exactly).

So this solution is good enough for now. Although, I would like to note
that doing an sg_dd (even with readonly flag set) still allows you to
write to the drive.

Thanks for all your help!



Reply to: