• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to enable block writing on root volume's disk
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to enable block writing on root volume's disk


  • Subject: Re: How to enable block writing on root volume's disk
  • From: Dan Markarian <email@hidden>
  • Date: Fri, 3 Jul 2009 09:27:34 -0700

Hey Thomas,

You want to use O_SHLOCK.

Dan

On 2 Jul 2009, at 2:36 PM, Thomas Tempelmann wrote:

I'm writing a disk repair tool (iBored) and wonder if I can get OS X
to let my tool write to "safe" blocks on the root vol's disk (usually
/dev/disk0, but not always).

I like to modify blocks _outside_ the mounted root file system, e.g.
the partition table or other blocks not appearing as sub-partitions
(such as "disk0sN"). Therefore, I need to open the "disk0" device.

Now, even if my app is running as root, it can't get a read/write
permission, it seems. I am using code like this:

  fd = open ("/dev/disk0", O_RDWR);

This results in an error ('fd' is -1)

Any ideas how to circumvent this?

I mean, I do not mind not being allowed to write to any mounted
partitions, but I should be able to write outside of them, shouldn't
I?

--
Thomas Tempelmann, http://www.tempel.org/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Filesystem-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >How to enable block writing on root volume's disk (From: Thomas Tempelmann <email@hidden>)

  • Prev by Date: root volume's device can be read without being root!
  • Next by Date: Re: root volume's device can be read without being root!
  • Previous by thread: How to enable block writing on root volume's disk
  • Next by thread: root volume's device can be read without being root!
  • Index(es):
    • Date
    • Thread