What is the proper procedure to mount/unmount SD card with SD library?

I am having some doubts that I did mount/unmount of SD card correctly. I often get errors when using Sd cards on adafruit data logger shield, such as not able to begin.

I suspect that just inserting the SD card and pulling it out is not the proper procedure.

Before I can unmount an SD card, do I need to call any function to stop it?
If I insert the card again, do I need to start it before reading from it?
If I have opened a file to write on the SD card and then remove the SD card, when I insert the card again, will I be able to just continue to write on the same file or do I need to reopen it?

I wish someone has answered my question about the whereabout of the SD library manual.

Before I can unmount an SD card, do I need to call any function to stop it?

You need to close any open files.

If I insert the card again, do I need to start it before reading from it?

No. The device has no way of knowing that the card has been inserted/removed.

If I have opened a file to write on the SD card and then remove the SD card, when I insert the card again, will I be able to just continue to write on the same file or do I need to reopen it?

Neither. Removing the card without closing the file corrupted it.

I wish someone has answered my question about the whereabout of the SD library manual.

There are a number of variations of "the SD library". You weren't specific enough.

In any case, nothing that the library does differs in any radical way from reading/writing files on a PC, except that the media is removable.

Thank you Paul. I will make some changes to my code to see if closing and reopening the file will eliminate all the errors.

I am using this library from adafruit:

I looked "everywhere" but can't find a documentation. Hope someone can point me to it.

Something I got from adafruit forum:

Once you remove the card the serial connection is broken / severed and you must re initialize the connection.

Documentation: SD - Arduino Reference