Changing Root Passwords without a Live CD

Robert Brockway robert-5LEc/6Zm6xCUd8a0hrldnti2O/JbrIOy at public.gmane.org
Tue Feb 9 20:42:29 UTC 2010


On Tue, 9 Feb 2010, Lennart Sorensen wrote:

> On Tue, Feb 09, 2010 at 02:40:52PM -0500, Robert Brockway wrote:
>> -n may be necessary to account for a read-only mtab file:
>>
>> mount -n -o remount,rw /
>
> mount updates /etc/mtab after doing its work, so in this case it isn't
> necesary.

/etc/mtab is on a read-only filesystem (/) hence the need for -n.  It's a 
catch-22 otherwise.

I've had to use -n many time over the years to avoid this problem. 
Perhaps mount has become smarter recently but I hadn't notice any change 
in behaviour.

>> mount -n -o remount,ro /
>
> Yes, or at least do a sync first.  reboot does seem to tell the kernel
> to do a reboot, which does sync the filesystem at least, but it never
> hurts to be paranoid.

Setting the filesystem read-only will sync the disk, it must.

Cheers,

Rob

-- 
Email: robert-5LEc/6Zm6xCUd8a0hrldnti2O/JbrIOy at public.gmane.org
IRC: Solver
Web: http://www.practicalsysadmin.com
I tried to change the world but they had a no-return policy
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list