Need a CLI command to recursively copy my home folder.

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

Need a CLI command to recursively copy my home folder.

Postby Alex01UK » Thu Oct 31, 2013 11:57 am

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.
Chrome OS: Samsung ARM Series 3 Chromebook XE303C12
Acer Aspire 5551: AMD Athlon P320 (2.1 GHz), 3GB RAM, ATI HD 425o Graphics.
64bit Windows 7 Home Premium, 64bit Ubuntu Studio 14.o4, 32bit Mint 17 MATE.

''I am what I am, because we are what we are.''
User avatar
Alex01UK
LXF regular
 
Posts: 233
Joined: Thu Jun 14, 2012 4:31 pm
Location: Scarborough, North Yorkshire, United Kingdom

Postby nelz » Thu Oct 31, 2013 12:26 pm

Moving /home to the new partition makes more sense.

Code: Select all
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: Select all
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)
User avatar
nelz
Site admin
 
Posts: 8493
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby Nuke » Thu Oct 31, 2013 4:14 pm

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?
User avatar
Nuke
LXF regular
 
Posts: 217
Joined: Wed Feb 09, 2011 12:11 pm
Location: Chepstow, UK

Postby nelz » Thu Oct 31, 2013 4:25 pm

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)
User avatar
nelz
Site admin
 
Posts: 8493
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby Alex01UK » Sun Nov 03, 2013 11:30 pm

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. ;)
Chrome OS: Samsung ARM Series 3 Chromebook XE303C12
Acer Aspire 5551: AMD Athlon P320 (2.1 GHz), 3GB RAM, ATI HD 425o Graphics.
64bit Windows 7 Home Premium, 64bit Ubuntu Studio 14.o4, 32bit Mint 17 MATE.

''I am what I am, because we are what we are.''
User avatar
Alex01UK
LXF regular
 
Posts: 233
Joined: Thu Jun 14, 2012 4:31 pm
Location: Scarborough, North Yorkshire, United Kingdom

Postby Alex01UK » Sun Nov 03, 2013 11:40 pm

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.
Chrome OS: Samsung ARM Series 3 Chromebook XE303C12
Acer Aspire 5551: AMD Athlon P320 (2.1 GHz), 3GB RAM, ATI HD 425o Graphics.
64bit Windows 7 Home Premium, 64bit Ubuntu Studio 14.o4, 32bit Mint 17 MATE.

''I am what I am, because we are what we are.''
User avatar
Alex01UK
LXF regular
 
Posts: 233
Joined: Thu Jun 14, 2012 4:31 pm
Location: Scarborough, North Yorkshire, United Kingdom

Postby lok1950 » Mon Nov 04, 2013 4:11 am

, 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 :D A check on the fedora forums would have turned that up :wink:

Enjoy the Choice :)
User avatar
lok1950
LXF regular
 
Posts: 1032
Joined: Tue May 31, 2005 5:31 am
Location: Ottawa


Return to Help!

Who is online

Users browsing this forum: No registered users and 4 guests