SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I want to copy my /home partition over to a new disc as I am running short of space.
The existing /home is on /dev/hdb2 ,is Rieser3 and the new one will probably be on /dev/sda5 and Reiser3
I am unsure whether to use cp or dd to do this . Most of what I have read seems indicate dd is better for this sort of task, but I am still unsure what command switches/options I should use.
I think that this would work for cp:
boot using Slax
mount existing partition as /mnt/hdb2
mount new (formatted) partition as /mnt/sda5
cp -dpR /mnt/hdb2/ /mnt/sda5/
I have no idea how use dd - the options confuse me. I do know that I want to copy the contents of the partition, not the actual partition, if possible.
I assume changing the fstab entry to point at /dev/sda5 is enough or does anything else need changing
Last edited by Eternal_Newbie; 11-26-2006 at 12:21 PM.
(cd /home_old; tar cf - .)|(cd /home_new; tar pxvf -)
It does the same thing as "cp -a":
* preserves mode, ownership, timestamp
* copys symolic links as links
* includes subdirectories and hidden files
Please pay close attention to the ownership of files and directories, because it is preserved as *numerical* value (=UID). In your case this doesen't seem to be a problem, but if you transfer partitions between different Systems, on the same machine, or even on different machines, this is will sureley get in your way.
Trust me. 8-(
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705
Rep:
The only thing I would add is that when making a tar and if space is at a premium, use bzip2 compression (j switch). For less compression and faster processing, use gzip (z switch)
well I think under this circumstances, transfering the contents of one directory to another directory on the same machine, compression is not only unnecessary but obstructive.
The only thing it does is to compress bits (slow), move them from harddisk to harddisk (fast) (or partition to partition, fast too) and then decompress bits (slow). If you get rid of compression here there is only one fast step left. 8-)
When it comes to archiving data, compression is a must! Well, mostly a must. ;-)
while this is Your life and You do as You please, there is one thing I want to tell. ;-)
In Linux and Unix as a whole, there are no such beasts as "extensions" in filenames. The dot is simply a part of the filename.
Take a look at /etc/rc.d/ and at the files therein. "rc.inet1" has its "filetype" at the beginning! (It is a "rc-script".) And what about "/etc/ssh/ssh_conf"? Look Ma, no extension! ;-)
"ls *.*" is very different from "ls *" which is what you actually meant.
"*.*" means "all things with names containing a dot", while "*" means "all things, with a name at all". Try it for yourself and please be sure that really all files have been transferred!
And the partitions can be checked with "fdisk -l" (as root) or, even much nicer, with "parted" (also root required) which shows the filesystems on the partitions too.
I was trying to do this with dd and cp one day. The target and source directories didn't have the same number of files or innode count or something when i did ls -a. rsync is what i ended up using.
cp won't copy hidden files unless you use the -a option, which also preserves all permissions and ownership of the files if possible.
cp -av is what the Slackware ZipSlack HOWTO recommends for 'migrating' your installation to a linux partition. Works fine if you don't need any compression during transfer.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.