Книга: Fedora™ Unleashed, 2008 edition

Mounting a Partition as Read-Only on a Running System

Mounting a Partition as Read-Only on a Running System

Remember that to do almost any kind of file system manipulation (formatting, checking, and so on), you should unmount the file system; by doing so, you avoid having any writes made to the file system, which would corrupt it.

How do you remount partitions on a running system? For example, to remount the /home partition (assuming that it is on a separate physical partition from root) as read-only to run fsck on it and then remount it as read-write, use the remount option for mount:

# mount -o ro,remount /home

NOTE

Remounting does not work if a normal user is logged in because /home is busy (in use). You might need to switch to runlevel 1 (init 1), which is single-user mode, to remount /home.

Now you can run fsck on the partition. When done,

# mount -o rw,remount /home

puts it back in service.

If you reboot your system to mount the root file system read-only for maintenance (enter the maintenance mode, s, as described in Chapter 11),

# mount -o rw,remount /

will remount it read-write and you can continue on. That's easier than unmounting and remounting the device.

Оглавление книги


Генерация: 1.116. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз