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

Re: write-protected filesystems [Was Re: dpkg and shadow]



> [When I mount] an Iomega Zip drive ... occasionally[,] I get the message:
>	sda: Write Protect is off
>	 sda: sda4
> ...  Is there a command out there somewhere to write protect/unprotect
> disks?

	I am not familiar with Iomega drives but strongly suspect that the
message is simply a warning that the write-protect tab is in the writable
position.

	*nix distinguishes between the drive (a device) and the filesystem,
(its data).  You can write-protect the drive (disallow control) by using
chmod a-w on its node /dev/sda?.  This is probably not what you want since
reading a device that you can't control is usually not useful.

	mount -r (see "man 8 mount for further details) will mount the
filesystem (data) read-only.  All the standard i/o drivers (see man 4 ioctl
and man 3 errno for further details) will return -1 and set errno to EROFS.
Setting the write-protect tab on the media will normally have the same effect.

						Hope this helps
-- 
						Robert Meier

FANUC Robotics North America, Inc.	Internet: meierrj@frc.com
Voice: 1-810-377-7469			Fax:      1-810-377-7363


Reply to: