18 added 30 characters in body
source | link

The old scripts that rely on umount -a contrast with currentmore recent scripts for SysVinit, for examplewhich are still available in Debian for example. /etc/init.d/umount_root explicitly remounts / as readonly. The rest of the mounts are processed individually, by /etc/init.d/umountfs and /etc/init.d/umountnfs.sh.

The old scripts that rely on umount -a contrast with current scripts for SysVinit, for example in Debian. /etc/init.d/umount_root explicitly remounts / as readonly. The rest of the mounts are processed individually, by /etc/init.d/umountfs and /etc/init.d/umountnfs.sh.

The old scripts that rely on umount -a contrast with more recent scripts for SysVinit, which are still available in Debian for example. /etc/init.d/umount_root explicitly remounts / as readonly. The rest of the mounts are processed individually, by /etc/init.d/umountfs and /etc/init.d/umountnfs.sh.

17 added 181 characters in body
source | link

(This requires there are no files open for writing. E.g. it could work when the system is running in single-user mode. Note that after running fsck, to repair thea filesystem which is still mounted in read-only mode, you must always reboot for safety reasons).

There is one other use of this special case: umount -a, used in old shutdown scripts. This is defined to simply unmount all filesystems in reverse order, finishing with the root filesystem. It makes sure all filesystems are in a consistent state on the disk, so they do not require a fsck on the next boot. The Linux kernel does not shut down any filesystem automatically; you need to have some shutdown program or "init system" that does this.

(This requires there are no files open for writing. E.g. it could work when the system is running in single-user mode. Note that after running fsck, to repair the filesystem which is still mounted in read-only mode, you must always reboot for safety reasons).

There is one other use of this special case: umount -a in old shutdown scripts. This is defined to simply unmount all filesystems in reverse order, finishing with the root filesystem. It makes sure all filesystems are in a consistent state on the disk, so they do not require a fsck on the next boot. The Linux kernel does not shut down any filesystem automatically; you need to have some shutdown program or "init system" that does this.

(This requires there are no files open for writing. E.g. it could work when the system is running in single-user mode. Note that after running fsck, to repair a filesystem which is still mounted in read-only mode, you must always reboot for safety reasons).

There is one other use of this special case: umount -a, used in old shutdown scripts. This is defined to simply unmount all filesystems in reverse order, finishing with the root filesystem. It makes sure all filesystems are in a consistent state on the disk, so they do not require a fsck on the next boot. The Linux kernel does not shut down any filesystem automatically; you need to have some shutdown program or "init system" that does this.

16 added 181 characters in body
source | link

(This requires there are no files open for writing. E.g. it could work when the system is running in single-user mode. Note that after running fsck, to repair the filesystem which is still mounted in read-only mode, you must always reboot for safety reasons).

SoIn other words, if you don't even know howthere is a command to remount a filesystem as read-only, you can desperately try the same commands as if you needed to fsck (repair) /dev/fd0 or your /home filesystem. The special case allows this to work, even though the fsck command is on the filesystem you apparently unmounted :-). It's nice that Linux can be helpful like this, when you try to repair a corrupted system.

There is a very similar code comment in early versions of Linux including 0.99.10 (1993). However, this

This does not seem to be a standard for traditional UNIX. The FreeBSD kernel returns an error instead. I'm not sure why there's a specific error check for this case, andseparate from the general error check for unmounting a filesystem that is currently in use. The FreeBSD equivalent of umount -a is aware of this issue, and stops before unmounting the first filesystem i.e. the root. (The code is here, but you need to understand how for loops and array indexes work in C :-).

The old scripts usingthat rely on umount -a contrast with current scripts for SysVinit, for example in Debian. /etc/init.d/umount_root explicitly remounts / as readonly. The rest of the mounts are processed individually, by /etc/init.d/umountfs and /etc/init.d/umountnfs.sh.

(This requires there are no files open for writing. E.g. it could work when the system is running in single-user mode. Note that after running fsck to repair the filesystem which is still mounted in read-only mode, you must always reboot for safety reasons).

So if you don't know how to remount a filesystem as read-only, you can desperately try the same commands as if you needed to fsck (repair) /dev/fd0 or your /home filesystem. The special case allows this to work, even though the fsck command is on the filesystem you apparently unmounted :-). It's nice that Linux can be helpful like this, when you try to repair a corrupted system.

There is a very similar code comment in early versions of Linux including 0.99.10 (1993). However, this does not seem to be a standard for traditional UNIX. The FreeBSD kernel returns an error instead, and the FreeBSD equivalent of umount -a stops before unmounting the first filesystem i.e. the root. (The code is here, but you need to understand how for loops and array indexes work in C :-).

The old scripts using umount -a contrast with current scripts for SysVinit, for example in Debian. /etc/init.d/umount_root explicitly remounts / as readonly. The rest of the mounts are processed individually, by /etc/init.d/umountfs and /etc/init.d/umountnfs.sh.

(This requires there are no files open for writing. E.g. it could work when the system is running in single-user mode. Note that after running fsck, to repair the filesystem which is still mounted in read-only mode, you must always reboot for safety reasons).

In other words, if you don't even know there is a command to remount a filesystem read-only, you can try the same commands as if you needed to fsck (repair) /dev/fd0 or your /home filesystem. The special case allows this to work, even though the fsck command is on the filesystem you apparently unmounted :-). It's nice that Linux can be helpful like this, when you try to repair a corrupted system.

There is a very similar code comment in early versions of Linux including 0.99.10 (1993).

This does not seem to be a standard for traditional UNIX. The FreeBSD kernel returns an error instead. I'm not sure why there's a specific error check for this case, separate from the general error check for unmounting a filesystem that is currently in use. The FreeBSD equivalent of umount -a is aware of this issue, and stops before unmounting the first filesystem i.e. the root. (The code is here, but you need to understand how for loops and array indexes work in C :-).

The old scripts that rely on umount -a contrast with current scripts for SysVinit, for example in Debian. /etc/init.d/umount_root explicitly remounts / as readonly. The rest of the mounts are processed individually, by /etc/init.d/umountfs and /etc/init.d/umountnfs.sh.

15 deleted 5 characters in body
source | link
14 deleted 5 characters in body
source | link
13 deleted 5 characters in body
source | link
12 added 1725 characters in body
source | link
11 added 1725 characters in body
source | link
10 added 1725 characters in body
source | link
9 added 1725 characters in body
source | link
8 added 1725 characters in body
source | link
7 added 1725 characters in body
source | link
6 added 1725 characters in body
source | link
5 added 1725 characters in body
source | link
4 added 6 characters in body
source | link
3 added 8 characters in body
source | link
2 deleted 31 characters in body
source | link
1
source | link