Mac OS X automount not mounting fstab entries correctly

172

There's a bit of confusion here. mount reads /etc/fstab, and is used for things that should be mounted when the system boots.

automount reads /etc/auto_master, and is used to mount things only when the directory is used, and not before. It's typically used for things like NFS home directories, which should only be mounted when the user actually needs them. You can do that, too, but /etc/fstab is not where to do it.

If you just want to have your smb share mounted when the machine starts up, all you need is what you already have in /etc/fstab, with a couple of gotchas that you should be aware of.

  1. use the soft option - otherwise, if you're not networked, the mount will hang and prevent your system from booting correctly
  2. it looks like you're connecting without credentials. If you actually do need credentials in the fstab entry, be careful, since /etc/fstab is usually readable by anyone on the system, so your username and password used for the smb system will be exposed. There are ways around that by editing ~/Library/Preferences/nsmb.conf
Share:
172

Related videos on Youtube

Anondude Friendlierthanmost
Author by

Anondude Friendlierthanmost

Updated on September 17, 2022

Comments

  • Anondude Friendlierthanmost
    Anondude Friendlierthanmost almost 2 years

    I have this code in a model:

    $this->db->insert($this->transaction_tbl, $data);
    if($this->db->affected_rows() == 1){
       $new_balance = $result['balance'] + $data['amount'];
       $this->db->update($this->account_tbl, array('balance' => $new_balance), array('id' => $data['account_id']));
       if($this->db->affected_rows() == 1){
           return $data;
       }
    }
    return "error";
    

    The code is doing what it is supposed to do (creates a new deposit transaction and updates account balance).

    My question is: What if another insert/update query occurs (and does not affect any rows) right after the insert and just before the if? Will $this->db->affected_rows() still return 1 and continue with the update correctly?

    In other words: Will 2 or 3 consecutive queries be executed consecutively even if a new one occurs among them?

    If the answer is in the lines of: since $this->db is a different instance then it will not be affected then sorry for your time reading a not so smart question.

    I am not familiar with the concept of time and priority in databases so i am not sure if the question is even about the codeigniter active record or a general database question with similar concerns

    I am testing this in mysql if it matters.

    • Tiffany
      Tiffany almost 10 years
      $this->db->affected_rows() always returns the number of rows affected from the last query......if an updtae/insert query doesnt affect any rows it returns '0'
  • cachvico
    cachvico over 13 years
    Thankyou for your reply. Even just with fstab, I get a startup error from launchd and automount. I've edited my original post again to explain my problem in more detail.
  • malcolmpdx
    malcolmpdx about 13 years
    @darren - sorry I haven't had a chance to test this. I plan to, and I'll let you know what I find out.