Siduction Forum

Siduction Forum => Installation - Support => Topic started by: grady on 2012/02/21, 06:23:17

Title: movimg home: sda>sdb
Post by: grady on 2012/02/21, 06:23:17
Greetings, all:

Several days ago I migrated an installation of latest aptosid on my 1,0 TB SATA hdd sdb to siduction(KDE). All went well.

Now I ask for instruction, please, in moving home from my sda in same machine. sda is a 0,5 TB SATA hdd.

And, yes, I have read the manual page a number of times.

To best of my knowledge, there's nothing wrong with my sdb installation, nor with my home directory in sda.

I'll be grateful to be told simply what code to write. Having finished the job, I'll review the results and the process, and then I'll learn.
I hope that's acceptable.

If I've understood correctly, in init1 I need to write:
2 lines of mkdir,
2 lines of mount,
1 line of cp,
and finally, do a simple comment and uncomment in fstab using mcedit.

Quote
root@debAboxbox:~# cat /etc/fstab
UUID=0538-1408                                /media/disk1part1    vfat         auto,users,rw,quiet,umask=000,shortname=lower 0    0  
UUID=B5C9-10B5                                /media/disk1part3    vfat         auto,users,rw,quiet,umask=000,shortname=lower 0    0  
UUID=73ccddf9-aa69-4b04-b99b-1009d49fb3c3     /media/disk1part5    ext4         auto,users,rw,exec,relatime                   0    0  
UUID=78ad61a6-7ead-40a2-aa7a-632a59516c27     none                 swap         sw                                            0    0  
UUID=63bc3d23-a769-4c93-bf56-98fe1817d824     /media/disk1part7    ext4         auto,users,rw,exec,relatime                   0    0  
UUID=9a4e2463-cca2-40e0-b4a6-dda302cf57c6     /media/disk1part8    ext4         auto,users,rw,exec,relatime                   0    0  
UUID=7127-52FE                                /media/disk2part1    vfat         auto,users,rw,quiet,umask=000,shortname=lower 0    0  
UUID=7A83-B029                                /media/disk2part3    vfat         auto,users,rw,quiet,umask=000,shortname=lower 0    0  
UUID=89befc00-4bff-4a99-934a-a045001b1739     /                    ext4         defaults,relatime,errors=remount-ro           0    1  
UUID=94a20c59-0b6d-470c-ab3e-81861871e995     none                 swap         sw                                            0    0  
UUID=ce12f4ef-8570-4b1a-9ad4-5474293d99e3     /home                ext4         defaults,relatime,errors=remount-ro           0    2  
UUID=07a2d7bd-c7b5-4f3c-834b-5292bc4f82f9     /media/disk2part8    ext4         auto,users,rw,exec,relatime                   0    0  
root@debAboxbox:~#
root@debAboxbox:~# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=511916k,nr_inodes=127979,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=103452k,mode=755)
/dev/disk/by-uuid/89befc00-4bff-4a99-934a-a045001b1739 on / type ext4 (rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,size=206900k)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,relatime,size=206900k)
/dev/sda1 on /media/disk1part1 type vfat (rw,nosuid,nodev,noexec,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=utf8,shortname=lower,quiet,utf8,errors=remount-ro)
/dev/sda3 on /media/disk1part3 type vfat (rw,nosuid,nodev,noexec,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=utf8,shortname=lower,quiet,utf8,errors=remount-ro)
/dev/sda5 on /media/disk1part5 type ext4 (rw,nosuid,nodev,relatime,user_xattr,acl,barrier=1,data=ordered)
/dev/sda7 on /media/disk1part7 type ext4 (rw,nosuid,nodev,relatime,user_xattr,acl,barrier=1,data=ordered)
/dev/sda8 on /media/disk1part8 type ext4 (rw,nosuid,nodev,relatime,user_xattr,acl,barrier=1,data=ordered)
/dev/sdb1 on /media/disk2part1 type vfat (rw,nosuid,nodev,noexec,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=utf8,shortname=lower,quiet,utf8,errors=remount-ro)
/dev/sdb3 on /media/disk2part3 type vfat (rw,nosuid,nodev,noexec,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=utf8,shortname=lower,quiet,utf8,errors=remount-ro)
/dev/sdb7 on /home type ext4 (rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered)
/dev/sdb8 on /media/disk2part8 type ext4 (rw,nosuid,nodev,relatime,user_xattr,barrier=1,data=ordered)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
root@debAboxbox:~#


If any further information is needed, I'll of course be happy to try to provide it.

grady
Title: Re: movimg home: sda>sdb
Post by: michaa7 on 2012/02/21, 19:10:19
Quote from: "grady"
Greetings, all:

Several days ago I migrated an installation of latest aptosid on my 1,0 TB SATA hdd sdb to siduction(KDE). All went well.

Now I ask for instruction, please, in moving home from my sda in same machine. sda is a 0,5 TB SATA hdd.


I assume nobody really understands what you are trying to do, nor do I.

First, your installation isn't really on sdb, it is somewhere on hdd sdb on one of its *partitions*. I could tell you on which partition it is, but do you know? I am asking because your  request looks as if your completely in the dark regarding the different naming of disks and partitions. This makes it hart to impossible to help.

So you first should study the output of

# fdisk -l
# blkid

compared to
# cat /etc/fstab

If you then understand the partitioning of your system you should provide questions and info like this (with "?" being the right number):

I have an old-home on partiton sdx? and want to copy the old settings (do you, or only personal files, music, doc, videos etc.?) to the already existing new home on sdb?

But maybe you want something else?
Title: movimg home: sda>sdb
Post by: grady on 2012/02/21, 23:22:45
@michaa7:

Quote

I assume nobody really understands what you are trying to do, nor do I.


Thank you for replying. I apologize for my lack of understanding.



Quote
First, your installation isn't really on sdb, it is somewhere on hdd sdb on one of its *partitions*. I could tell you on which partition it is, but do you know?


Yes, I believe I do. It is distributed over a number of partitions. And I think that the information provided above and below makes that clear.

Quote
root@debAboxbox:~# fdisk -l                                                                                                                                                                          
                                                                                                                                                                                                 
Disk /dev/sda: 500.1 GB, 500106780160 bytes                                                                                                                                                          
255 heads, 63 sectors/track, 60801 cylinders, total 976771055 sectors                                                                                                                                
Units = sectors of 1 * 512 = 512 bytes                                                                                                                                                              
Sector size (logical/physical): 512 bytes / 512 bytes                                                                                                                                                
I/O size (minimum/optimal): 512 bytes / 512 bytes                                                                                                                                                    
Disk identifier: 0x00056e57                                                                                                                                                                          
                                                                                                                                                                                                     
   Device Boot      Start         End      Blocks   Id  System                                                                                                                                      
/dev/sda1              63    81931499    40965718+   b  W95 FAT32                                                                                                                                    
/dev/sda2        81931500   788486264   353277382+   5  Extended                                                                                                                                    
/dev/sda3       788486265   880651169    46082452+   b  W95 FAT32                                                                                                                                    
/dev/sda5   *    81931563   351470069   134769253+  83  Linux                                                                                                                                        
/dev/sda6       351470133   355566644     2048256   82  Linux swap / Solaris                                                                                                                        
/dev/sda7       355566708   683694269   164063781   83  Linux                                                                                                                                        
/dev/sda8       683694333   788486264    52395966   83  Linux                                                                                                                                        
                                                                                                                                                                                                     
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes                                                                                                                                                        
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors                                                                                                                              
Units = sectors of 1 * 512 = 512 bytes                                                                                                                                                              
Sector size (logical/physical): 512 bytes / 512 bytes                                                                                                                                                
I/O size (minimum/optimal): 512 bytes / 512 bytes                                                                                                                                                    
Disk identifier: 0x9037f6ae                                                                                                                                                                          
                                                                                                                                                                                                     
   Device Boot      Start         End      Blocks   Id  System                                                                                                                                      
/dev/sdb1              63   122881184    61440561    b  W95 FAT32                                                                                                                                    
/dev/sdb2       122881185  1536006779   706562797+   5  Extended
/dev/sdb3      1536006780  1689604244    76798732+   b  W95 FAT32
/dev/sdb5   *   122881248   348160679   112639716   83  Linux
/dev/sdb6       348160743   356353829     4096543+  82  Linux swap / Solaris
/dev/sdb7       356353893  1380369059   512007583+  83  Linux
/dev/sdb8      1380369123  1536006779    77818828+  83  Linux
root@debAboxbox:~#


# blkid
Quote
root@debAboxbox:~# blkid
/dev/sda1: UUID="0538-1408" TYPE="vfat"
/dev/sda3: UUID="B5C9-10B5" TYPE="vfat"
/dev/sda5: UUID="73ccddf9-aa69-4b04-b99b-1009d49fb3c3" TYPE="ext4"
/dev/sda7: UUID="63bc3d23-a769-4c93-bf56-98fe1817d824" TYPE="ext4"
/dev/sda8: UUID="9a4e2463-cca2-40e0-b4a6-dda302cf57c6" TYPE="ext4"
/dev/sdb1: LABEL="WINDOWS" UUID="7127-52FE" TYPE="vfat"
/dev/sdb3: LABEL="FAT ARCHIVE" UUID="7A83-B029" TYPE="vfat"
/dev/sdb8: LABEL="archive" UUID="07a2d7bd-c7b5-4f3c-834b-5292bc4f82f9" TYPE="ext4"
/dev/sda6: UUID="78ad61a6-7ead-40a2-aa7a-632a59516c27" TYPE="swap"
/dev/sdb5: UUID="89befc00-4bff-4a99-934a-a045001b1739" TYPE="ext4"
/dev/sdb6: LABEL="swap" UUID="94a20c59-0b6d-470c-ab3e-81861871e995" TYPE="swap"
/dev/sdb7: LABEL="/home" UUID="ce12f4ef-8570-4b1a-9ad4-5474293d99e3" TYPE="ext4"
root@debAboxbox:~#



Quote

If you then understand the partitioning of your system you should provide questions and info like this (with "?" being the right number):


The home that I want to copy to sdb7 in my new seduction installation is in sda7.
My one "question" is as I wrote above:

Quote
Now I ask for instruction, please, in moving home from my sda in same machine. sda is a 0,5 TB SATA hdd.


And if (I hope) that is an acceptable request, I'll of course be pleased to provide any more needed information.

grady
Title: movimg home: sda>sdb
Post by: michaa7 on 2012/02/22, 00:08:32
as root in RL3 (Ctrl-ALT-F1, then "init 3")

"cp -ax /media/disk1part7/<user>/. /media/disk2part7/<user>/"
 
or

"cp -ax /media/disk1part7/home/<user>/. /media/disk2part7/home/<user>/"

depending on whether or not *your* path will contain "/home" or not. "-ax" will preserve all attributes and not follow symlinks to other partitions.

This copies all files from the old home partition to the new partition. You should consider to delete all existing files of the new home (/media/disk2part7/<user>/) beforehand.
Title: movimg home: sda>sdb
Post by: grady on 2012/02/22, 08:16:15
@michaa7:

Thank you again. That certainly looks simple.

Last first:

Quote
You should consider to delete all existing files of the new home (/media/disk2part7/<user>/) beforehand.


As root in root in RL3, I tried to do this:
Code: [Select]
rm -rf home/
"ls -al" showed that didn't work.

Next, as root in /home, I did:
Code: [Select]
userdel -r myusername
Reply:
Quote
userdel: user myusername is currently logged in


michaa7: will you comment, please?

grady
Title: movimg home: sda>sdb
Post by: michaa7 on 2012/02/22, 08:56:49
Quote from: "grady"
@michaa7:

Thank you again. That certainly looks simple.

Last first:

Quote
You should consider to delete all existing files of the new home (/media/disk2part7/<user>/) beforehand.


As root in root in RL3, I tried to do this:
Code: [Select]
rm -rf home/


Did you run this command with this typo home/ ? Can't work.

New home is:
Quote
/dev/sdb7 on /home type ext4 (rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered)

You only want to remove the *content* of
/home/<user>/
not the folder or the user.

Therefore run (depending on the right path):

Code: [Select]
rm -r /home/<user>/*.*


And never ever use "rm" with the "-f" option again unless you 100% know what you're doing.


The path used with my copy command in my previous post was wrong. Sorry for that, I was confused, too. It should be (as root in RL3):

Code: [Select]
cp -ax /media/disk1part7/home/<user>/. /home/<user>/

or

Code: [Select]
cp -ax /media/disk1part7/<user>/. /home/<user>/


Quote

Next, as root in /home, ...


Why?



And if it still does not work show me

Code: [Select]
ls -la /home/
and
Code: [Select]
ls -la /media/disk1part7/
Title: movimg home: sda>sdb
Post by: grady on 2012/02/23, 01:22:49
@michaa7:

I sincerely want neither to offend you nor to frustrate you.
I really am as IT-ignorant as I appear.

As you have described it, this task can be accomplished with only two lines of code. So let's please get it done.
I'm not at all concerned about breaking something in my new installation. Re-doing it will only take me an hour.

Given choices to make, I can be relied on to blunder.
I reported I tried to find how to clear my new user directory. I found and applied two options, and neither was correct.

Still unclear on how the "rm" line ought to be written, I have tried another four ways. And all were refused by my system. Another four wrong moves.
My system has refused all four. But that doesn't appear to have broken anything.
Can we please stop hoping that I can think my way through this? I cannot.
My telling you that I am seventy-five may help. My peers of that vintage, and I, are perfectly comfortable following clear, simple instructions.

Will you do me the kindness, please:
-of dictating precisely how the "rm" line (including path) ought to read, and,
-telling me which of the two "cp" choices you've given me will best conform with the "siduction way".

The reports you told me to provide:

Quote
ubdino@debAboxbox:~$ su
Password:
root@debAboxbox:/home/ubdino# cd
root@debAboxbox:~# ls -la /home/
total 28
drwxr-xr-x  4 root   root    4096 Feb  4 05:51 .
drwxr-xr-x 23 root   root    4096 Feb 17 06:30 ..
drwx------  2 root   root   16384 Feb  4 04:43 lost+found
drwx------ 20 ubdino ubdino  4096 Feb 21 03:18 ubdino
root@debAboxbox:~# ls -la /media/disk1part7/
total 36
drwxr-xr-x  6 root   root    4096 Feb  5 07:40 .
drwxr-xr-x 10 root   root    4096 Feb 17 06:23 ..
drwxr-xr-x  3 root   root    4096 Feb  5 07:10 home
drwx------  2 root   root   16384 May  9  2010 lost+found
drwx------ 49 ubdino ubdino  4096 Jan  8 19:26 ubdino
drwxr-xr-x 46 ubdino ubdino  4096 Apr  7  2011 udino-old
root@debAboxbox:~#


To clarify: just above I have shown my true usernames; I haven't disguised them.
I trust that's in order.
And I thank you for continuing to try to help.

grady
Title: movimg home: sda>sdb
Post by: ralul on 2012/02/23, 01:47:32
@grady,
just login root directly - not a normal user firstly. That way no underneath user files are locked.

I don't know what you aim for, because your first message was too complicated for my poor english skills. But the clean siduction - or better linux - way would be to just use a seperate /home partition. I myself use that same /home partition for three linux installations in parallel. All with the same user,group. But different /home/User-directiories. That way I can use common data files in /home/for_all for several programs like firefox and thunderbird.
Title: movimg home: sda>sdb
Post by: michaa7 on 2012/02/23, 04:19:52
Quote
Still unclear on how the "rm" line ought to be written, I have tried another four ways. And all were refused by my system. Another four wrong moves.
 My system has refused all four. But that doesn't appear to have broken anything.
 Can we please stop hoping that I can think my way through this? I cannot.
 My telling you that I am seventy-five may help. My peers of that vintage, and I, are perfectly comfortable following clear, simple instructions.


This is useless info.
Usefull would be:
- the *exact* command
- the error message

You only see something if something is wrong. And i only suggested the remove command as a precaution.


Both as root in runlevel3 (init 3), do *not* login as "ubdino" in RL3.

Code: [Select]
rm -r /home/ubdino/*.*
(But maybe there is nothing to delete? And BTW, what do you expect to see? )

Code: [Select]
cp -ax /media/disk1part7/ubdino/. /home/ubdino/
Title: movimg home: sda>sdb
Post by: clubex on 2012/02/23, 12:00:55
OT:
Is it just me or are there posts missing from this thread?

eg I don't see a post from grady saying he was seventy-five nor a post from michae7 saying "You should consider to delete all existing files of the new home (/media/disk2part7/<user>/) beforehand."
Title: movimg home: sda>sdb
Post by: devil on 2012/02/23, 12:54:24
huh?
Nothing is missing from this thread afaik.
Where did you get the info, the above facts should be in this thread?

greetz
devil
Title: movimg home: sda>sdb
Post by: bevo on 2012/02/23, 14:51:53
All is there see post 4 and 7
Title: movimg home: sda>sdb
Post by: clubex on 2012/02/23, 15:32:57
So it was just me. I should have done a proper paste and search on the page.

My apologies for going OT.
Title: movimg home: sda>sdb
Post by: grady on 2012/02/23, 22:18:07
@michaa7:  Thank you for your continued patience.



Quote
And i only suggested the remove command as a precaution.


michaa7: Dein Wunsch ist mir Befehl !

Since you have given me an option, I am forced to decide whether or not to remove the "ubdino" account in my new installation. Without inviting comment, that is my preference.

So, yes, I prefer to do the "rm"




Quote
Both as root in runlevel3 (init 3), do *not* login as "ubdino" in RL3.



Right !
I felt sure that that was going to be our "Sesame öffne dich".
So. I rebooted. At the KDE-login window, I did: ctrl-alt-f1. The console window displayed. I logged in as root; I entered init 3.
I issued the command:
Code: [Select]
rm -r /home/ubdino/*.*
reply: "rm: cannot remove '/home/ubdino/*.*' : No such file or directory"
There was a second way to get to init 3, so I (stupidly or not) tried it.
I rebooted. At the KDE login window, I clicked the menu icon, then console login, logged in as root, and entered init 3.

I then issued the same "rm" command. And got the same refusal.
And I can only ask: "What now?"

michaa7: I do thank you very much for writing these two lines of code explicitly.

grady
Title: movimg home: sda>sdb
Post by: michaa7 on 2012/02/24, 00:23:22
Quote from: "grady"

So. I rebooted. At the KDE-login window, I did: ctrl-alt-f1. The console window displayed. I logged in as root; I entered init 3.
I issued the command:
Code: [Select]
rm -r /home//*.*
reply: "rm: cannot remove '/home/ubdino/*.*' : No such file or directory"


ok, very good info. It seems there is nothing to delete!

So again, go init 3 (it does *not* matter which way you go there), login as root, and run:

Code: [Select]
# ls -la /home/mh/test/
something *similar* like the lines below but with different numbers should appear:
Quote
insgesamt 16
drwxr-xr-x   2  ubdino ubdino 4096 Feb 24 00:09 .
drwxr-xr-x 191 ubdino ubdino 12288 Feb 24 00:09 ..


If so then run:
Code: [Select]

cp -ax /media/disk1part7/ubdino/. /home/ubdino/
Title: movimg home: sda>sdb
Post by: grady on 2012/02/24, 02:09:41
@michaa7:



Quote
ok, very good info. It seems there is nothing to delete!

So again, go init 3 (it does *not* matter which way you go there), login as root, and run:

      Code:
# ls -la /home/mh/test/

something *similar* like the lines below but with different numbers should appear:


michaa7, as my Jewish friends sometimes say: "You should live so long!"

Result:


Quote
root@debAboxbox:~# ls -la /home/mh/test/
ls: cannot access /home/mh/test/: No such file or directory


grady
Title: movimg home: sda>sdb
Post by: michaa7 on 2012/02/24, 02:28:32
Quote from: grady
@michaa7:



Quote
ok, very good info. It seems there is nothing to delete!

So again, go init 3 (it does *not* matter which way you go there), login as root, and run:

      Code:
# ls -la /home/mh/test/

something *similar* like the lines below but with different numbers should appear:


michaa7, as my Jewish friends sometimes say: "You should live so long!"

Result:


Quote
root@debAboxbox:~# ls -la /home/mh/test/
ls: cannot access /home/mh/test/: No such file or directory


It would not hurt if you try to understand the meaning of "path" because, stupid me, this was an incident caused by copy and past. Should be your path, not mine, so run (this only proves the existence of this path on your system):
Code: [Select]
# ls -la /home/ubdino/

and if this shows the result similar to the one demonstrated in the previous posting you then run:
Code: [Select]
cp -ax /media/disk1part7/ubdino/. /home/ubdino/
Title: movimg home: sda>sdb
Post by: grady on 2012/02/24, 21:30:58
@michaa7:

I think ...success (!)



Quote
     Quote:
root@debAboxbox:~# ls -la /home/mh/test/
ls: cannot access /home/mh/test/: No such file or directory


It would not hurt if you try to understand the meaning of "path" because, stupid me,


Keine Sorge. But please let's keep our identities clear here. You're the leader, I'm the "stupid me" (smile).


Quote
so run (this only proves the existence of this path on your system):
      Code:
# ls -la /home/ubdino/


Done. Report showed 1GB of content, and displayed 29 lines.First line: "drwx------29 ubdino ubdino" (etc-etc)
So I thought that proved.
Perhaps useless info: I then did:
 [code]ls -la /home/ubdino/test/[code]
System reply: "ls: cannot access" .."No such file or directory"

I then did:
 [/code]cp -ax /media/disk1part7/ubdino/. /home/ubdino/ [code]

System took over five minutes to return a root prompt.
So. I think ... we now have two ubdino accounts on hdb.

And I think that's progress. Lead on, please.

grady
Title: movimg home: sda>sdb
Post by: michaa7 on 2012/02/24, 21:49:39
Quote from: "grady"
...Lead on, please.


Lead to what?  Old user home is transferred to new user home. So if you now login as ubdino, you should see all your files in your home. That's what you wanted to do. Mission accomplished.
Title: movimg home: sda>sdb
Post by: hinto on 2012/02/25, 00:13:07
^As for me, I would have booted a siduction liveCD and straighted all the disk partition stuff out from there.  I've done it before, and it certainly seems much easier.
-Hinto
Title: movimg home: sda>sdb
Post by: grady on 2012/02/25, 08:51:39
@michaa7:

Mission accomplished !

You now know my rig better than I do.

I was expecting one more step. So I hadn't even bothered to cycle back and open KDE.

It was a very pleasant surprise when I did open KDE after reading your message.

I've done a large dist-upgrade which went perfectly.
Everything is in order.

So take a victory lap.
And please accept my profuse thanks.
I'm very grateful.

grady
As to the efficiency of your solution: putting aside a couple of mis-steps, I can't see how another solution could be simpler.
Well done !
Title: movimg home: sda>sdb
Post by: ralul on 2012/02/25, 09:47:52
Herzlichen Glückwunsch!
Gott sei Dank,
I mean, everyone having seen these "rm" commands in conjunction with "a couple of mis-steps" is happy your system survived :)
Title: movimg home: sda>sdb
Post by: michaa7 on 2012/02/25, 15:42:45
Quote from: "grady"
...I did open KDE after reading your message.

I've done a large dist-upgrade which went perfectly.
Everything is in order.

So take a victory lap.
And please accept my profuse thanks.
I'm very grateful. ...


you're welcome

Have fun!