The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Copy Directories excluding files karthik82 UNIX for Dummies Questions & Answers 1 09-01-2009 06:31 AM
DD copy excluding empty blocks? Merkilo Filesystems, Disks and Memory 2 01-06-2009 06:29 PM
I've created a partition with GNU Parted, how do I mount the partition? jtp51 UNIX for Dummies Questions & Answers 1 09-18-2006 12:01 PM
How to copy single partition? siegfried Gentoo 12 08-22-2006 12:49 AM
understanding logical partition, physical partition yls177 UNIX for Dummies Questions & Answers 3 11-15-2002 10:49 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-08-2009
thegeek thegeek is offline
Registered User
  
 

Join Date: Apr 2009
Location: /usr/bin/vim
Posts: 464
copy a whole partition excluding specified.

Scenario:

I would want to copy my / to /mnt, and to avoid recursion exclude /mnt.


Code:
cp -avx / /mnt

If i use the above i believe it would run recursively, and end up in mess. So how to do it ?!
Basically this / is sda1, and /mnt is sda2 and sda1 is where only OS is available & currently booted.

Ultimately, my question is how to backup a path, by excluding a specific directory.

I cannot boot in Live CD and copy. Anybody have experience in doing this, and have some efficient way to do this ?
  #2 (permalink)  
Old 10-08-2009
dr.house dr.house is offline
Registered User
  
 

Join Date: Dec 2008
Location: Switzerland
Posts: 229
Quote:
Originally Posted by thegeek View Post
I would want to copy my / to /mnt, and to avoid recursion exclude /mnt [...] this / is sda1, and /mnt is sda2

Code:
cp -avx / /mnt
As man cp states, "x" means "stay on this file system" - meaning in turn that the command given ought to suffice.
  #3 (permalink)  
Old 10-08-2009
thegeek thegeek is offline
Registered User
  
 

Join Date: Apr 2009
Location: /usr/bin/vim
Posts: 464
Yep, cp -avx did the trick.

It is a simple confusion, thanks anyway.
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:54 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0