1) rsync:       rsync -av /usr/ /usrnew
    It will preserve everything.. easy

2)  Just use 'mv' ..    mv /usr /usrold          mv /usrnew /usr   ..
it's just a rename..

3)  rsync -avn   /usr /usrnew

Would show you what rsync would do - but not really do it (the -n option)...
but there may be better ways to get what you want here -- I'm sure others
will kick in.

Scott

On Wed, Jan 6, 2010 at 9:04 AM, Slaughter, Dale <dslaugh...@aegonusa.com>wrote:

> To increase the size of /usr, the VM guys have added a disk for me, which
> has been formatted and mounted as /usrnew.  I then ran the command "cp -Rv
> --preserve /usr/* /usrnew" as root from the "/" directory'.  However, the
> USED space is different - 1.9G for /usr and 2.1G for /usrnew.  I've looked
> on the web, and see that some recommend using switches -dpr or -a also.
>  Using the --preserve switch kept the file/directory dates, but the dates on
> the symlink's were today's date.
>
>
> output of "df -h":
>
> Filesystem            Size  Used Avail Use% Mounted on
> /dev/dasdb1           1.2G  158M 1016M  14% /
> udev                  184M  200K  184M   1% /dev
> /dev/dasda1            69M   14M   52M  21% /boot
> /dev/dasdh1           2.3G   85M  2.3G   4% /home
> /dev/dasdg1           1.2G  843M  331M  72% /opt
> /dev/dasdc1           2.3G  1.9G  366M  84% /usr
> /dev/dasdd1           1.1G  321M  713M  32% /var
> /dev/mapper/tmpvg-tmpvol
>                       14G   98M   14G   1% /tmp
> /dev/dasdq1           2.3G   33M  2.3G   2% /unused
> /dev/dasdp1           4.6G  2.1G  2.6G  45% /usrnew
>
>
>
> Snippet of "mount":
>
> /dev/dasdc1 on /usr type reiserfs (rw,acl,user_xattr)
> /dev/dasdp1 on /usrnew type reiserfs (rw,acl,user_xattr)
>
>
>
>
>
> Question 1.  Is "cp" to correct command to do the copy, and if so what are
> the correct switches?  Beside keeping the symlinks, I'd also want to copy
> any files that start with ".", and any other file types I may not be aware
> of.  I also considered using "tar" to backup and restore the files, and
> possibly "rsync".
>
> Question 2.  I then want to rename the /usr directory to /usrold , and then
> rename /usrnew to /usr, and then I will update fstab and reboot.  What is
> the correct way to do the two renames above - is it the "mv" command, and if
> so what switches would I want to use so I copy all files types and preserve
> dates, permissions, etc.?
>
> Question 3.  Is there a command that will compare /usr and /usrnew for
> differences, or that will show number of files and exact space used?
>
>
>
> |-----Original Message-----
> |From: Linux on 390 Port [mailto:linux-...@vm.marist.edu] On Behalf Of
> |Mark Post
> |Sent: Monday, January 04, 2010 9:00 PM
> |To: LINUX-390@VM.MARIST.EDU
> |Subject: Re: SLES 10 SP2 upgrade to SLES 10 SP3 error
> |
> |>>> On 1/4/2010 at  5:36 PM, "Slaughter, Dale" <dslaugh...@aegonusa.com>
> |wrote:
> |-snip-
> |> What is the solution to this problem?
> |
> |You need to add more space to /usr, or remove enough packages (that
> |contain files in /usr).
> |
> |
> |Mark Post
> |
> |----------------------------------------------------------------------
> |For LINUX-390 subscribe / signoff / archive access instructions,
> |send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or
> |visit
> |http://www.marist.edu/htbin/wlvindex?LINUX-390
>
> ----------------------------------------------------------------------
> For LINUX-390 subscribe / signoff / archive access instructions,
> send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or
> visit
> http://www.marist.edu/htbin/wlvindex?LINUX-390
>

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to