Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
writeprotection for a usbstick
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
flo89
n00b
n00b


Joined: 27 Mar 2008
Posts: 29

PostPosted: Mon Oct 05, 2009 9:50 am    Post subject: writeprotection for a usbstick Reply with quote

Hi - i am searching for a solution to declare a usb stick as "write protected" - like a cdrom device.
in the moment you are trying to mount - the kernel drops a msg: "volume is writeprotected - mounting read only."

any idea? i do not mean, that you can lock the stick with a switch on the case. It should be a digital/software solution.

yours sincerly,

flo89

edit:\
dmesg output: Here should be a "Write Protect is On"

Quote:
sd 7:0:0:0: [sda] 1002496 512-byte hardware sectors (513 MB)
sd 7:0:0:0: [sda] Write Protect is off
sd 7:0:0:0: [sda] Mode Sense: 03 00 00 00
sd 7:0:0:0: [sda] Assuming drive cache: write through
sd 7:0:0:0: [sda] 1002496 512-byte hardware sectors (513 MB)
sd 7:0:0:0: [sda] Write Protect is off
sd 7:0:0:0: [sda] Mode Sense: 03 00 00 00
sd 7:0:0:0: [sda] Assuming drive cache: write through
Back to top
View user's profile Send private message
costel78
Guru
Guru


Joined: 20 Apr 2007
Posts: 414

PostPosted: Mon Oct 05, 2009 10:41 am    Post subject: Reply with quote

I don't know if it fit your needs but what about use readonly (ro) option in fstab ?
Something like: /dev/[...] [mountpoint] auto ro 0 0
Of course, this restriction could be avoided using manual mount.
_________________
Sorry for my English. I'm still learning this language.
Back to top
View user's profile Send private message
flo89
n00b
n00b


Joined: 27 Mar 2008
Posts: 29

PostPosted: Mon Oct 05, 2009 11:02 am    Post subject: Reply with quote

sure - this is possible.
put i plan to use the stick on different systems and it should be unwriteable everytime.

but thank you for your try :-)
Back to top
View user's profile Send private message
disi
Veteran
Veteran


Joined: 28 Nov 2003
Posts: 1354
Location: Out There ...

PostPosted: Mon Oct 05, 2009 11:29 am    Post subject: Reply with quote

I have actual seen sticks with a switch on it to turn on/off write protection.

Which operating systems? If it's all NIX-like you could put on another filesystem like ext2, then set the permissions to only root can write to it? (or ntfs, but that requires the ntfs driver in linux)
_________________
Gentoo on Uptime Project - Larry is a cow
Back to top
View user's profile Send private message
flo89
n00b
n00b


Joined: 27 Mar 2008
Posts: 29

PostPosted: Mon Oct 05, 2009 11:52 am    Post subject: Reply with quote

it should protect the mbr too, so the filesystemrights are irrelevant.

is there no flag which i can set with a hex editor or sth. else?
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Mon Oct 05, 2009 12:17 pm    Post subject: Reply with quote

I do remember there was a DOS virus which set my harddrive readonly once upon time. Have no clue how it did it, though. :?
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
flo89
n00b
n00b


Joined: 27 Mar 2008
Posts: 29

PostPosted: Mon Oct 05, 2009 1:36 pm    Post subject: Reply with quote

hoho - let's run a 80er virus =)
ok ehm - it does not have to protect the mbr too - it's my fault, sorry.

it could be nice to be able to protect the parition with sth. like fdisk.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum