How to move vi to /bin

Matthew Seaman m.seaman at infracaninophile.co.uk
Fri May 15 07:17:43 UTC 2009


Manish Jain wrote:
> Mel Flynn wrote:
>> On Wednesday 13 May 2009 09:21:46 manish jain wrote:
>>
>>> I want to move vi to /bin so that I have an editor available in
>>> single-user mode.
>>
>> The only reason to need an editor and not have /usr and /var available 
>> is to edit /etc/fstab. It is trivial to spot errors with /rescue/cat 
>> and fix with /rescue/sed, without having to worry about a terminal.
>>
>> In all other cases:
>> fsck -p
>> /etc/rc.d/mountcritlocal start
>> /etc/rc.d/ldconfig start
>>
>> And one can use any editor one would want. Don't forget to export or 
>> setenv TERM to cons25 from 'dumb'.
>>
> 
>  From all the discussion I have walked through on the issue of where to 
> place vi, it does appear FreeBSD has a skewed policy on the issue. There 
> are plenty of reasons you might need access an editor in single-user 
> mode - editing  fstab is just one. Having to use the workarounds 
> suggested in place of vi is not so good, and manually moving vi to /bin 
> is not simply a matter of 'mv /usr/bin/vi /bin/'.
> 
> One of the things I would dearly like to see in a future release is vi 
> being placed under /bin.
> 

There is an alternative means of achieving the same effect which I have been
occasionally known to advocate on this and other lists: the all-in-one partition
layout. Simply put, when installing the system instead of creating separate /,
/usr, /var etc. etc. partitions, you create only two partitions: a swap area and
(covering all the rest of the disk) one big partition mounted at /.

This means that in single user mode, dynamically linked programs like vi(1)
are available as normal.  It's easy to implement and it works well.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20090515/c2882eb4/signature.pgp


More information about the freebsd-questions mailing list