Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Nov 07, 2003 4:26 am 
Offline
Senior Newbie

Joined: Mon Nov 03, 2003 6:59 am
Posts: 12
Website: http://palaci.fr/
Location: Paris, France
Thanks to the help of other users (special thanks go to EFudd), I succeeded yesterday to create a disk image and move the /usr directory onto it. I did it with a Debian (small) install, but I guess it should work with just any distribution and with any other subdirectory of /, as long as the directory you want to move is not a mount but a regular subdir of the root file system.

I'm new to Linux and to UML hosting, so there might be better ways to procede. Criticisms and tips are welcome!

NB: In the following instructions, you will obvisouly want to adapt usr and udbc to your own case!

Step 1: Create a hard drive image and update your configuration profile accordingly.

Step 2: Log in as user root, and use the following commands:
    - mkdir /newusr
    - mount /dev/ubdc /newusr
    - cd /usr
    - find . -print | cpio -pdmuv /newusr (that's the trick! take care with -v as it may take a _long_ time)
    - cd /
    - mv usr usr.old
    - umount newusr
    - rmdir newusr && mkdir usr
    - mount /dev/ubdc /usr
Step 3: Edit /etc/fstab and add the following line: /dev/ubdc /usr ext3 defaults 0 0

Step 4: Reboot and make sure everything works fine

Step 5: Delete usr.old

I hope it will help :)

_________________
Francois Palaci


Top
   
 Post subject:
PostPosted: Fri Nov 07, 2003 11:13 am 
Offline
Junior Member

Joined: Sun Jul 27, 2003 7:24 pm
Posts: 42
Website: http://opencurve.org/~sunny
Location: New York, NY
tar, the 8th wonder of the world, can do the above too :^)

Code:
( cd $OLD_DIR ; tar cf - . ) | ( cd $NEW_DIR ; tar xvfpB - )


Also, some of you guys might lack the diskspace to copy around large directories and such. So you can simply use tar and ssh to copy large files home, and then back to your linode

Code:
Linode --> Some other computer on earth
cd $SOME_DIR ; tar -cf - . | ssh host.com tar -xf - -C /destination


Just use it the same command to transfer files back to your linode.

Sunny Dubey


Top
   
 Post subject:
PostPosted: Fri Nov 07, 2003 3:46 pm 
Offline
Senior Newbie

Joined: Sun Jun 22, 2003 6:28 am
Posts: 8
Thanks wap and Sunny - I was just about to figure out how to do this, read the latest messages in the forums, and there it is :D

I now have /usr, /var and /home directories on their own disk images

Geoff


Top
   
 Post subject:
PostPosted: Sat Nov 08, 2003 4:22 am 
Offline
Senior Newbie

Joined: Mon Nov 03, 2003 6:59 am
Posts: 12
Website: http://palaci.fr/
Location: Paris, France
I'm glad I could help :)

_________________
Francois Palaci


Top
   
 Post subject:
PostPosted: Sat Nov 08, 2003 9:13 pm 
Offline
Senior Newbie

Joined: Mon Oct 27, 2003 5:33 pm
Posts: 17
sunny wrote:
tar, the 8th wonder of the world, can do the above too :^)

Code:
( cd $OLD_DIR ; tar cf - . ) | ( cd $NEW_DIR ; tar xvfpB - )


Also, some of you guys might lack the diskspace to copy around large directories and such. So you can simply use tar and ssh to copy large files home, and then back to your linode

Code:
Linode --> Some other computer on earth
cd $SOME_DIR ; tar -cf - . | ssh host.com tar -xf - -C /destination

Just use it the same command to transfer files back to your linode.

Sunny Dubey


Fok tar. gnutar version X != X.1 != X3, etc. Not to mention non gnu versions of tar.

the cpio and find scenario i gave to wap will work on every unix i've ever seen.....

-e


Top
   
 Post subject:
PostPosted: Sun Nov 09, 2003 7:06 am 
Offline
Junior Member

Joined: Sun Jul 27, 2003 7:24 pm
Posts: 42
Website: http://opencurve.org/~sunny
Location: New York, NY
efudd wrote:
Fok tar. gnutar version X != X.1 != X3, etc. Not to mention non gnu versions of tar.

the cpio and find scenario i gave to wap will work on every unix i've ever seen.....

-e


Once again, get a clue, the above *DO* work in this magical thing called "UNIX". You think the GNU guys pulled obscure and illogical tar options out of their asses, or used what already existed ?

You should go back to your hole, where you can have your UNIX, your standardized csh*COUGH**COUGH*, with nice wiff of CDE, nasty looking Motif, near dead X implementations, lousy C compilers, non dynamically-linkable binaries, obscure and outright illogical package management, and a world where telnet is still the defacto standard. *cough*

Sunny Dubey

csh .... bahahaha .. oh please stop!!


Top
   
 Post subject:
PostPosted: Sun Nov 09, 2003 1:04 pm 
Offline
Senior Member

Joined: Thu Aug 28, 2003 12:57 am
Posts: 273
sunny wrote:
efudd wrote:
Fok tar. gnutar version X != X.1 != X3, etc. Not to mention non gnu versions of tar.

the cpio and find scenario i gave to wap will work on every unix i've ever seen.....

-e


Once again, get a clue, the above *DO* work in this magical thing called "UNIX". You think the GNU guys pulled obscure and illogical tar options out of their asses, or used what already existed ?

You should go back to your hole, where you can have your UNIX, your standardized csh*COUGH**COUGH*, with nice wiff of CDE, nasty looking Motif, near dead X implementations, lousy C compilers, non dynamically-linkable binaries, obscure and outright illogical package management, and a world where telnet is still the defacto standard. *cough*

Sunny Dubey

csh .... bahahaha .. oh please stop!!


Well I guess the Linode message boards have fully come of age, it looks like we have our first real flame. How repulsive.

I was going to respond to efudd and note that I have been using Unix/Linux for over 12 years and have never, ever once ran into compatibility problems between tar or gzip, gnu or otherwise.

I would just suggest that you use whatever you are most comfortable with, tar or cpio, just keep in mind that both are equally good for the job. Compatibility issues are generally not a problem.


Top
   
 Post subject:
PostPosted: Sun Nov 09, 2003 2:23 pm 
Offline
Junior Member

Joined: Thu Sep 18, 2003 1:44 pm
Posts: 46
Website: http://www.officemechanic.com
AOL: schof@mac.com
Location: Los Angeles
sunny wrote:
efudd wrote:
Fok tar. gnutar version X != X.1 != X3, etc. Not to mention non gnu versions of tar.

the cpio and find scenario i gave to wap will work on every unix i've ever seen.....

-e


Once again, get a clue, the above *DO* work in this magical thing called "UNIX". You think the GNU guys pulled obscure and illogical tar options out of their asses, or used what already existed ?

You should go back to your hole, where you can have your UNIX, your standardized csh*COUGH**COUGH*, with nice wiff of CDE, nasty looking Motif, near dead X implementations, lousy C compilers, non dynamically-linkable binaries, obscure and outright illogical package management, and a world where telnet is still the defacto standard. *cough*

Sunny Dubey

csh .... bahahaha .. oh please stop!!


After rereading this, I got the feeling Sunny thought it would be funnier than it is. (I've had the same thing happen with a lot of things I write.)

At least, I hope it was an error in tone. Sunny's been real cool elsewhere in these forums.


Schof

_________________
John Schofield
Apple Certified Technical Coordinator
Office Mechanic Consulting
Mac, Unix, and PC Computer Support
www.officemechanic.com


Top
   
 Post subject:
PostPosted: Mon Nov 24, 2003 8:29 am 
Offline
Senior Member

Joined: Mon Nov 10, 2003 5:23 am
Posts: 57
AOL: aGoodBoy13
Location: Japan
I did this before I found this thread, but instead of:

- find . -print | cpio -pdmuv /newusr (that's the trick! take care with -v as it may take a _long_ time)

I did:

# cd /var
# cp -ax * /mnt/var.new

It seems to have worked fine, any thoughts? Did I screw something up that I find out later?

Thanks from a genuine newbie running Debian...

- j

_________________
Programs that crash have been proven to be less useful than those that don't.
• Apple TechNote 117 •


Top
   
 Post subject:
PostPosted: Mon Nov 24, 2003 2:35 pm 
Offline
Senior Member

Joined: Thu Aug 28, 2003 12:57 am
Posts: 273
wazdog wrote:
I did this before I found this thread, but instead of:

- find . -print | cpio -pdmuv /newusr (that's the trick! take care with -v as it may take a _long_ time)

I did:

# cd /var
# cp -ax * /mnt/var.new

It seems to have worked fine, any thoughts? Did I screw something up that I find out later?

Thanks from a genuine newbie running Debian...

- j


Your simpler command works just fine. The tar/cpio method has some advantages as it is a streaming method which can be used to copy files from one system to another over ssh, and do other neat tricks, but if you're just copying files from one directory/partition on a host to another on the same host, the cp -ax will have the same effect, and it's much easier to type. I think that people (me included) like to use the more complicated tar/cpio commands even when copying within a single host, because it's simpler to use the same (more complicated) command in all situations, with slight variations, then to use a different command depending upon the situation. But it doesn't really matter either way, use whatever you find easiest and most comfortable.


Top
   
 Post subject:
PostPosted: Mon Nov 24, 2003 2:38 pm 
Offline
Senior Member
User avatar

Joined: Sun Nov 23, 2003 1:40 pm
Posts: 79
Website: http://www.whitehouse.gov/history/presidents/bc42.html
wazdog wrote:
# cd /var
# cp -ax * /mnt/var.new


The problem with this is that cp will not copy special files, sockets, etc. This is why tar or cpio is used.

I personally suggest using tar because tar is not limited to a 2 gig transfer size as UNIX cpio is.

Bill Clinton


Top
   
 Post subject:
PostPosted: Mon Nov 24, 2003 6:12 pm 
Offline
Junior Member
User avatar

Joined: Tue Jul 22, 2003 1:57 am
Posts: 32
ICQ: 148043
Website: http://linuxbin.net
WLM: vitre0us@yahoo.com
Yahoo Messenger: vitre0us
AOL: vitre0us
Location: Southern California
Bill Clinton wrote:
wazdog wrote:
# cd /var
# cp -ax * /mnt/var.new


The problem with this is that cp will not copy special files, sockets, etc. This is why tar or cpio is used.

I personally suggest using tar because tar is not limited to a 2 gig transfer size as UNIX cpio is.

Bill Clinton



So Mr President, I assume you have taken up Linux System Administration as a hobby in your retirement? :twisted:


Top
   
 Post subject:
PostPosted: Tue Nov 25, 2003 12:32 pm 
Offline
Senior Newbie

Joined: Wed Sep 03, 2003 2:58 pm
Posts: 19
I'll bet I know the reason:

Babes!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group