[lug] adding a new disk to a system

D. Stimits stimits at idcomm.com
Sat Sep 1 17:06:29 MDT 2001


The following may be totally useless, but it is a possibility.

A while back I was working on migration of a partition, and the
following was given (by Alan Robertson), based on the /dev directory. It
should apply to any directory if you replace the "/dev". Basically,
normal mechanisms were not copying everything exactly, this version did
work though:
find /dev -print | cpio -pdm .

If you use the above, it will create a new subdirectory "dev" to your
current directory; you could change the "." to name some other
destination. If you were in /some/temp, and ran the above command, it
would produce /some/temp/dev, and that would be an exact duplicate of
/dev. You may find this is necessary for special files such as character
device files, pipes, so on. This *might* work better than the tar
mechanism. A second possible problem is that some database formats try
to do raw access, and node numbers matter, rather than file names, so dd
would be the only way to do a proper copy, and then only if the two
disks had the same block size. If you run a non-ext2 partition, and
ACL's are enabled (advanced permissions of some filesystems, "Access
Control List"), I think samba will use ACL's, and thus you'd need to
copy not just regular files and permissions, but also preserve ACL's (I
have no idea if your current system has anything to do with this).

D. Stimits, stimits at idcomm.com

Hugh Brown wrote:
> 
> I have a system that I added a new disk to and I want to move /home/samba
> to be on this new disk.  I also want to move /var to the new disk.
> 
> The new disk has two partitions /dev/sdb1 and /dev/sdb5
> 
> I tried the following:
> 
> init 1
> mount /dev/sdb1 /mnt/var
> mount /dev/sdb5 /mnt/samba
> cd /var
> tar -cf - *|(cd /mnt/var; tar -xf -)
> cd /home/samba
> tar -cf - *|(cd /mnt/samba; tar -xf -)
> umount /mnt/var
> umount /mnt/samba
> mount /dev/sdb1 /var
> mount /dev/sdb5 /home/samba
> init 3
> 
> The server is doing file serving and print serving for about 7 windows
> ME/2000 clients.  After it gets back to run level 3, the printing no longer
> works and a program which functions as a resume database claims that its
> database is in need of rebuilding.
> 
> /var/log/messages doesn't have anything interesting in it.
> 
> What am I doing wrong?
> 
> Hugh
> ------------------------------------
> System Administrator/Unix Consultant
> hugh at vecna.com
> Vecna Technologies, Inc
> 6525 Belcrest Rd, Suite 612
> Hyattsville MD, 20782
> 301.864.7253
> http://www.vecna.com
> 
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug



More information about the LUG mailing list