Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need a CLI command to recursively copy my home folder.

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help!
View previous topic :: View next topic  
Author Message
Alex01UK
LXF regular


Joined: Thu Jun 14, 2012 5:31 pm
Posts: 198
Location: Scarborough, North Yorkshire, United Kingdom

PostPosted: Thu Oct 31, 2013 11:57 am    Post subject: Need a CLI command to recursively copy my home folder. Reply with quote

Hi folks. Happy Halloween! I've been ''playing'' with my system, installing the 64 bit Ubuntu Studio 13.10 distribution, and have ended up with the following:

sda2 - ntfs, 181 GB
sda6 - ext4, 73 GB
sda7 - ntfs, 63 GB

sda2 is my Windows 7 Home Premium partition, working perfectly.
sda7 has no OS installed on it, and has been created because sda2 is getting full.
sda6 has UB Studio 13.10 installed, but I can only login as guest. I can Ctrl Alt 2 and login as alex, so I know my password is being entered correctly, but then startx doesn't work.

What I'd like to do, is copy all the contents of home/alex to sda7 then remove sda6, move sda7 so that it is next to sda2 and install UB13.10 from scratch.

So I figure I can login as guest, CTRL ALT 2, login as alex, mount sda7, and then use a single cli command to copy everything in my home partition to sda7, but I don't know what the commands to do this are.

I'm not looking to have my home partition on sda7, I just want to backup all my pics / videos /music / downloads so I can start again. I figured this would be easier than fixing the password issue.

Any help appreciated; thanks in advance, from Alex.
_________________
Acer Aspire 5551: AMD Athlon P320 (2.1 GHz), 3GB RAM, ATI HD 425o Graphics.
64bit Windows 7 Home Premium, 64bit Ubuntu Studio 13.1o, 32bit Lubuntu 13.o4

''I am what I am, because we are what we are.''
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8375
Location: Warrington, UK

PostPosted: Thu Oct 31, 2013 12:26 pm    Post subject: Reply with quote

Moving /home to the new partition makes more sense.

Code:
mkdir -p /mnt/newhome
mount /dev/sda7 /mnt/newhome
rsync -a /home/ /mnt/newhome/


Edit /etc/fstab to add a line for /home and reboot. Then, when you are sure everything is working file

Code:
mount --bind / /mnt/newhome
rm -fr /mnt/newhome/*


to free up the space taken by the old /home/
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
Nuke
LXF regular


Joined: Wed Feb 09, 2011 12:11 pm
Posts: 217
Location: Chepstow, UK

PostPosted: Thu Oct 31, 2013 4:14 pm    Post subject: Reply with quote

Take care. Netz refers to a "new partition" but I don't read that Alex is proposing any new partition. Looks like he is proposing to delete sda6 and expand his existing sda7 into its place.

With sda6 gone it is not clear where Alex means to re-install UB. sda7 is a Windows ntfs partition which, by the sound of it, is not empty but has overflow Windows data on it.

Surely Netz's rsync command will mix the UB data in with the existing Windows data, or even delete the Windows data - I'm not sure? And in its trip via an ntfs file system, the Linux data will lose its permissions metadata and I am not sure that will lead to a happy ending.

Another point is that some of what Netz suggests would require root privileges - oh hang on this is Ubuntu! But this stuff is probably best done from a live disk, seeing that the existing installation sounds crippled. Not sure what "can only log in a guest" means - is that a Ubuntu thing?

Alex, where are you going to put the new UB installation? What other partitions do you have?
_________________
Unsolved mysteries of the Universe, No 13 :-
How many remakes of Anna Karenina does the World need?
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8375
Location: Warrington, UK

PostPosted: Thu Oct 31, 2013 4:25 pm    Post subject: Reply with quote

I missed the part about sda7 being NTFS, it needs to be reformatted as ext4 before doing any of the above.

But if you just want somewhere to keep your photos and videos, put them on sda7 and mount it somewhere in your home directory.
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
Alex01UK
LXF regular


Joined: Thu Jun 14, 2012 5:31 pm
Posts: 198
Location: Scarborough, North Yorkshire, United Kingdom

PostPosted: Sun Nov 03, 2013 11:30 pm    Post subject: Reply with quote

Nuke wrote:
Take care.

Alex, where are you going to put the new UB installation? What other partitions do you have?


Fixed the password issue with:
sudo apt-get install gdm
sudo dpkg-reconfigure gdm

Then copied all my stuff to the ntfs sda7, removed sda6, moved sda7 so it was right next to sda2, and installed Ubuntu 13.1o Studio to the remaining free space. Lovely jubbly. Wink
_________________
Acer Aspire 5551: AMD Athlon P320 (2.1 GHz), 3GB RAM, ATI HD 425o Graphics.
64bit Windows 7 Home Premium, 64bit Ubuntu Studio 13.1o, 32bit Lubuntu 13.o4

''I am what I am, because we are what we are.''
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
Alex01UK
LXF regular


Joined: Thu Jun 14, 2012 5:31 pm
Posts: 198
Location: Scarborough, North Yorkshire, United Kingdom

PostPosted: Sun Nov 03, 2013 11:40 pm    Post subject: Reply with quote

Nuke wrote:
Not sure what "can only log in a guest" means - is that a Ubuntu thing?


On my Ubuntu system, I can login with my normal user account, which has full SU priviledges, or, I can login as ''Guest'', which doesn't require a password. You are limited in what you can do though if you login as Guest unless you know the SU password. ie you can run apps, but can't change any settings.

I don't have any experience of using any Linux other than Ubuntu, or more specifically Ubuntu Studio, so I don't know if this is something specific to Ubuntu. I tell a lie! My first experience of Linux was Fedora 10, and it was wicked! Much better than XP Pro, but somebody skanked my XP disk, so I put Fedorra 10, off the LXF magazine on that had just been released. No matter what I tried though, I couldn't get it to play mp3s or dvds.
_________________
Acer Aspire 5551: AMD Athlon P320 (2.1 GHz), 3GB RAM, ATI HD 425o Graphics.
64bit Windows 7 Home Premium, 64bit Ubuntu Studio 13.1o, 32bit Lubuntu 13.o4

''I am what I am, because we are what we are.''
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
lok1950
LXF regular


Joined: Tue May 31, 2005 6:31 am
Posts: 1016
Location: Ottawa

PostPosted: Mon Nov 04, 2013 4:11 am    Post subject: Reply with quote

Quote:
, I couldn't get it to play mp3s or dvds.


You just did not add the right source for non-free apps I started with Fedora core 3 and had no problems with either Very Happy A check on the fedora forums would have turned that up Wink

Enjoy the Choice Smile
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help! All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast