# can't open lock file /etc/mtab~

## otti

Hi,

I have a really strange problem; I switched a while ago from devfs to udev and everything just worked as it should work.

But from time to time I get strange error-messages on the boot-process (it seems to occur randomly):

```
* Mounting local filesystems ...

can't open lock file /etc/mtab~: Read-only file system (use -n flag to override)

 * Some local filesystem failed to mount

  [ !! ]

 * Mounting USB device filesystem (usbfs) ...

Cannot create link /etc/mtab~

Perhaps there is a stale lock file?

 * Failed to mount USB device filesystem

  [ !! ]

```

Then I remove /etc/mtab~ and reboot. Now I suddenly get other error messages:

```
Reiserfs super block in block 16 on 0x305 of format 3.6 with standard journal

Blocks (total/free): 1247037/207344 by 4096 bytes

Filesystem is NOT clean

Filesystem seems mounted read-only. Skipping journal replay.

Checking internal tree..finished

  [ ok ]

 * Remounting root filesystem read/write ...

  [ ok ]

Cannot create link /etc/mtab~

Perhaps there is a stale lock file?

Cannot create link /etc/mtab~

Perhaps there is a stale lock file?

Cannot create link /etc/mtab~

Perhaps there is a stale lock file?

Cannot create link /etc/mtab~

Perhaps there is a stale lock file?

 * Setting hostname to mini ...

  [ ok ]

 * Using /etc/modules.autoload.d/kernel-2.6 as config:

 *   Loading module b44 ...

  [ ok ]

 *   Loading module acerhk ...

  [ ok ]

 *   Loading module fglrx ...

  [ ok ]

 *   Loading module ide-scsi ...

  [ ok ]

 * Autoloaded 4 module(s)

 * Checking all filesystems ...

  [ ok ]

 * Mounting local filesystems ...

can't create lock file /etc/mtab~1621: Read-only file system (use -n flag to override)

 * Some local filesystem failed to mount

  [ !! ]

 * Mounting USB device filesystem (usbfs) ...

  [ ok ]

```

What happens here? My next step is to remove all /etc/mtab* and again to reboot. Now no error messages occur, but before I see the login-prompt, the system reboots again. But after that everything is ok. Now I can boot again for some time without error messages, but then, randomly it seems, I get again this error messages at the beginning...

Thanks for any help.

----------

## vladgrigorescu

The only /etc/mtab* I have is /etc/mtab.  /etc/mtab~ would be a file emacs creates if you edit mtab with it, and can be safely deleted.

----------

## otti

Please read the whole post - In the normal case I have no /etc/mtab~ either...

----------

## vladgrigorescu

I did read the entire post, and was just letting you know that they could be safely deleted.  So... why don't you just write a script to delete them at shutdown?

----------

## otti

Because I want to know why the error messages appear sometime and sometime not; and I am not even shure when the mtab~ files are created. I do not edit /etc/mtab, so which program/process creates these files, or are they created at the boot-process??

----------

## otti

I finally semi-solved the problem  :Smile: ; I downgraded baselayout from 1.12.0_pre13-r1.ebuild to 1.11.13-r1 (stable). So the error-messages have not reappeared so far...

----------

## kevinzyguo

 *otti wrote:*   

> I finally semi-solved the problem ; I downgraded baselayout from 1.12.0_pre13-r1.ebuild to 1.11.13-r1 (stable). So the error-messages have not reappeared so far...

 

hello，do you know how it is created?

----------

