On 11 January 2009 c. 06:46:59 Ted Unangst wrote:
> On Sat, Jan 10, 2009 at 5:27 PM, Jim Barchuk <j...@jbarchuk.com> wrote:
> > /dev/wd1j       /home-b ext2fs  rw,nodev,nosuid 1 2
> > /dev/wd0i       /400    ext2fs  rw,nodev,nosuid 1 2
> >
> > Sounds good?
>
> I would not recommend using ext2fs for long term storage.  It's fine
> for migration, but not intended to be a primary store.
>
> > Would it be 'better' to migrate /etc/passwd as described in
> > http://openbsd.rt.fm/faq/faq9.html#passwd, which I have already
> > built files for but not installed, or should I adduser them all from
> > scratch and let the system take care of UIDs and groups.
>
> Certainly, you are less likely to screw anything up by running adduser
> a few times compared to trying a bulk update, but then the user IDs
> aren't likely to match the ones on disk and fixing that later may pose
> trouble (wrong permissions).  But at least the system is always likely
> to work.  Messing with master.passwd yourself (by forgetting a > in

You can specify exact UIDs for each user you create with adduser.
Problems start to arrive only when existing (old) UIDs or GIDs interfere
with (new) system ones. And even in this case something like this will
do the job:

 set -e
 cd /home
 for U in alex joe paul; do
   set -- `ls -nld $U`
   OLDUID=$3
   OLDGID=$4
   groupadd $U
   useradd $U
   NEWUID=`id -u $U`
   NEWGID=`id -g $U`
   find $U -user $OLDUID -print0 | xargs -0r chown $NEWUID
   find $U -group $OLDGID -print0 | xargs -0r chown $NEWGID
 done

--
  Best wishes,
    Vadim Zhukov

Reply via email to