[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Problem moving /usr to new partition



Quoting Larry Elmore (ljelmore@montana.campuscwix.net):
> I've got potato installed on a 1.5GB partition, and have another hard drive
> with an available 2GB partition (type 82 Linux, formatted ext2fs) on to
> which I want to move /usr. I copied the contents of /usr on to the new
> partition, then edited /etc/fstab, moved the original /usr to /usr-old and
> created a new /usr. When I rebooted, most everything seemed to work, but I
> noticed a handful of error messages scrolling by. The only one I had time to
> read was that /usr/bin/aumix couldn't be found (because it's called when the
> sound module is loaded into the kernel (to turn the volume on my SB16 down
> to 50%), but /usr hadn't been mounted yet.

Hm, I'm not sure why it would have worked before. My modules load
before /usr is mounted as you can see in this snippet:

 opl3sa ad1848/cs4248 codec driver Copyright (C) by Hannu Savolainen 1993-1996
 Checking all file systems...
 Parallelizing fsck version 1.12 (9-Jul-98)
 /dev/sda3: clean, 50931/153600 files, 512638/613966 blocks
 /dev/sda4: clean, 11560/395264 files, 1385686/1577457 blocks
 Mounting local file systems...
 /dev/sda3 on /usr type ext2 (rw)

> I couldn't find it or any of the
> other failures to load something from /usr in any of the log files in
> /var/log, so I'm not sure what's missing. _Most_ things seem to work
> properly, but a few things fail miserably (for example, 'man' tells me it
> can't setuid properly and aborts). I commented out the line in /etc/fstab
> and moved contents of /usr-old back to /usr and everything works properly
> now.
> 
> My question is: what else do I need to do to move /usr onto a new partition
> and have Linux boot properly? I re-read the HOWTOs and can't find any
> mention of anything other than what I tried. Help!

At risk of starting a religious discussion, I've been very happy with

cd /usr
ls -lR > /path-to/old-listing
mount /dev/XXX /mnt
find -xdev | cpio -damp /mnt        (-vdamp if you want to watch)
cd /mnt
ls -lR > /path-to/new-listing

You don't have to do the listings, but I did, and ran them through a
python filter to blank out the modification dates on directories.
I then ran diff -u on the resulting output and the only differences
were the bigger directories on the source as they had once contained
more entries. Finally I checked that the hard linked /usr/X11R6/bin
and /usr/bin/X11/ had the same inode number.

If you do all this with /, you also have to prune any mounted
filesystems from old-listing as I don't know how to make -xdev apply
to ls. However, it coped with all the stuff in /dev such as pipes
and sockets, and also links broken or otherwise.

Take care with /etc/fstab. There was a recent example on this list where
someone had overlooked the fact that its lines are obeyed in sequence.

Cheers,

-- 
Email:  d.wright@open.ac.uk   Tel: +44 1908 653 739  Fax: +44 1908 655 151
Snail:  David Wright, Earth Science Dept., Milton Keynes, England, MK7 6AA
Disclaimer:   These addresses are only for reaching me, and do not signify
official stationery. Views expressed here are either my own or plagiarised.


Reply to: