I want to move my home folder to my second hard drive. How can I accomplish this task? please provide detailed steps as I am newbee for command line or if possible with Yast.
I forgot this step during install… :’(
Thank you
I want to move my home folder to my second hard drive. How can I accomplish this task? please provide detailed steps as I am newbee for command line or if possible with Yast.
I forgot this step during install… :’(
Thank you
Do you now have a separate home partition? Or is /home on root?
Makes a bit of a difference for detailed instructions. Also is there anything on home you want to keep?
On 2013-12-14 01:36, nilesh suse wrote:
>
> I want to move my home folder to my second hard drive. How can I
> accomplish this task? please provide detailed steps as I am new bee for
> command line or if possible with Yast.
> I forgot this step during install… :’(
Perhaps:
http://www.tldp.org/HOWTO/Hard-Disk-Upgrade/index.html
It is old, but this has not changed much.
–
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)
I think you can just do this (someone correct me if I am wrong):
cp /etc/fstab /etc/fstab.BAK
nano /etc/fstab
Mine looks something like this, yours will be different but the important part is the area where it marks the partition as /home. I suggest trying this in a VM first until you are comfortable enough to do it on the host. You just need to know the name of each partition (which you should be able to find out from something like gparted)
/dev/disk/by-id/ata-KINGSTON_SH103S3120G_50026B722A0480DC-part2 swap swap defaults 0 0
UUID=bc9a8b77-7e43-44b1-9d57-95b15dfff6b3 / btrfs defaults 0 0
/dev/disk/by-id/ata-KINGSTON_SH103S3120G_50026B722A0480DC-part4 /home xfs defaults 1 2
Then once you have gotten it to work, just mount the partition that used to be /home and copy over the data you need.
That will replace the current home media with the new home media but th OP may want to tranfer data from the old home to the new home. If the old home is on root then he is simply overloading the old home and it is not easy to get to any more at least on a normal running system, I guess you could get to it from a level 1 boot but if the first rename old home before mounting the new home they can then just copy the data. But if the old home is on its own partition then what you show is fine since the old home can be gotten to and any data copied.
I guess they could copy the contents of /home (not home itself just the stuff in home) to the new partition and then doo s you suggest or maybe easier for a newbie to do it in Yast - partition manager to mount the new. But honestly I’d like more detail from he OP before a detailed step by step is done. I’d have no problem winging it but some one not comfortable with Linux concepts might need a true step by step
Subscribed. I am also a linux noob and I also need to move my home onto my second partition. In my case the second partition was already created during install except there’s not much on it (There’s a folder with my name that seems to be a shortcut to home on the other partition and a folder called lost + found) because my music folder, documents, dropbox, etc all seem to be on the little 20gb partition that the system is. Bad news because I only have a couple hundred megabytes left.
You are right about YaST being easier, I had never actually used YaST to do partitioning but I checked the utility after I had posted and I realized it was easier for a newbie. And yeah you are right about the details, it does depend on the setup and how much you know about Linux concepts.
I’m not sure I understand what your current setup is like. You have links to another partition from your home folder? Or are you simply saying that /home is on another partition than the root directory?
On 2013-12-14 04:06, quadrunner750 wrote:
>
> Subscribed. I am also a linux noob and I also need to move my home onto
> my second partition. In my case the second partition was already created
> during install except there’s not much on it (There’s a folder with my
> name that seems to be a shortcut to home on the other partition and a
> folder called lost + found) because my music folder, documents, dropbox,
> etc all seem to be on the little 20gb partition that the system is. Bad
> news because I only have a couple hundred megabytes left.
Please, both of you, show here the output of:
mount -l | egrep -v vmware-\|gvfsd-fuse\|fusectl\|/sys/fs/cgroup\|tmpfs
df -h | egrep -v vmware-\|gvfsd-fuse\|fusectl\|/sys/fs/cgroup\|tmpfs
Please paste it complete, from initial prompt to final prompt, using
code tags (the ‘#’ button).
Posting in
Code Tags - A Guide
–
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)
First command
brendan@linux-wca6:~> mount -l | egrep -v vmware-\|gvfsd-fuse\|fusect1\|/sys/fs/cgroup\|tmpfs
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
/dev/sda2 on / type ext4 (rw,relatime,data=ordered)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=26,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
/dev/sda3 on /home type ext4 (rw,relatime,data=ordered)
none on /var/lib/ntp/proc type proc (ro,nosuid,nodev,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
brendan@linux-wca6:~>
Second command
brendan@linux-wca6:~> df -h | egrep -v vmare-\|gvfsd-fuse\|fusect1\|/sys/fs/cgroup\|tmpfs
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 20G 18G 667M 97% /
/dev/sda3 437G 19G 417G 5% /home
brendan@linux-wca6:~>
On 2013-12-14 05:06, quadrunner750 wrote:
> First command
>
> Code:
> --------------------
> /dev/sda2 on / type ext4 (rw,relatime,data=ordered)
> /dev/sda3 on /home type ext4 (rw,relatime,data=ordered)
> --------------------
>
>
> Second command
>
> Code:
> --------------------
> brendan@linux-wca6:~> df -h | egrep -v vmare-|gvfsd-fuse|fusect1|/sys/fs/cgroup|tmpfs
> Filesystem Size Used Avail Use% Mounted on
> /dev/sda2 20G 18G 667M 97% /
> /dev/sda3 437G 19G 417G 5% /home
> brendan@linux-wca6:~>
>
> --------------------
Then I don’t understand what you want, it doesn’t match the question of
the original poster. You already have home on a separate and big
partition, just 5% filled.
Let’s read it again.
> Subscribed. I am also a linux noob and I also need to move my home onto
> my second partition. In my case the second partition was already created
> during install except there’s not much on it (There’s a folder with my
> name that seems to be a shortcut to home on the other partition and a
> folder called lost + found) because my music folder, documents, dropbox,
> etc all seem to be on the little 20gb partition that the system is. Bad
> news because I only have a couple hundred megabytes left.
Please run this (as your user, not root), let’s see where is your home:
grep `whoami` /etc/passwd
You should see at least an entry like this:
cer:x:1000:100:Carlos:/home/cer:/bin/bash
What I’m interested in is the 6th field, in my case “/home/cer”. Then
lets see the contents of that directory like this one - the listing of
directories for that 6th field:
cer@Telcontar:~> l -dl /home/cer2/*
drwx------ 2 cer2 users 4096 Oct 15 2011 /home/cer2/Desktop/
drwx------ 2 cer2 users 4096 Oct 15 2011 /home/cer2/Documents/
drwxr-xr-x 2 cer2 users 6 Feb 5 2008 /home/cer2/Download/
drwxr-xr-x 4 cer2 users 35 Feb 20 2007 /home/cer2/GNUstep/
drwx------ 2 cer2 users 68 Mar 4 2007 /home/cer2/Mail/
drwxr-xr-x 2 cer2 users 6 Feb 5 2008 /home/cer2/Music/
drwxr-xr-x 2 cer2 users 6 Feb 5 2008 /home/cer2/Pictures/
drwxr-xr-x 2 cer2 users 6 Feb 5 2008 /home/cer2/Public/
drwxr-xr-x 2 cer2 users 6 Feb 5 2008 /home/cer2/Templates/
drwxr-xr-x 2 cer2 users 6 Feb 5 2008 /home/cer2/Videos/
drwxr-xr-x 2 cer2 users 40 Feb 17 2011 /home/cer2/bin/
-rw------- 1 cer2 users 310 Mar 4 2007 /home/cer2/dead.letter
drwxr-xr-x 2 cer2 users 38 Feb 16 2007 /home/cer2/download/
drwx------ 2 cer2 users 6 Apr 24 2007 /home/cer2/mail/
-rw------- 1 cer2 users 7577 Feb 17 2011 /home/cer2/mbox
-rw-r--r-- 1 cer2 users 4022 Mar 4 2007 /home/cer2/notas.pgp4pine
-rw-r--r-- 1 cer2 users 1096 Mar 4 2007 /home/cer2/notas.pgp4pine~
-rw-r--r-- 1 cer2 users 2872 Mar 4 2007 /home/cer2/pgp4pine.debug
drwxr-xr-x 2 cer2 users 23 Feb 16 2007 /home/cer2/public_html/
drwxr-xr-x 3 cer2 users 31 Feb 26 2011 /home/cer2/tmp/
lrwxrwxrwx 1 root root 3 Dec 14 14:08 /home/cer2/tmps -> tmp/
What interests me are entries like the last line, where there is a
redirection or link.
–
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)
I have /home partition on root and backed all my file (pictures, documents) to external HD (not sure if any system files/folder like “.kde” I need to backup)
Thanks
[QUOTE=robin_listas;2608110]On 2013-12-14 04:06, quadrunner750 wrote:
>
> Subscribed. I am also a linux noob and I also need to move my home onto
> my second partition. In my case the second partition was already created
> during install except there’s not much on it (There’s a folder with my
> name that seems to be a shortcut to home on the other partition and a
> folder called lost + found) because my music folder, documents, dropbox,
> etc all seem to be on the little 20gb partition that the system is. Bad
> news because I only have a couple hundred megabytes left.
Please, both of you, show here the output of:
mount -l | egrep -v vmware-\|gvfsd-fuse\|fusectl\|/sys/fs/cgroup\|tmpfs
df -h | egrep -v vmware-\|gvfsd-fuse\|fusectl\|/sys/fs/cgroup\|tmpfs
Please paste it complete, from initial prompt to final prompt, using
code tags (the ‘#’ button).
nilesh_suse@linux-4ism:~> mount -l | egrep -v vmware-|gvfsd-fuse|fusectl|/sys/fs/cgroup|tmpfs
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
/dev/sda2 on / type ext4 (rw,relatime,data=ordered)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=25,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
nilesh_suse@linux-4ism:~> df -h | egrep -v vmware-|gvfsd-fuse|fusectl|/sys/fs/cgroup|tmpfs
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 35G 7.8G 26G 23% /
On 2013-12-15 05:36, nilesh suse wrote:
>> Please paste it complete, from initial prompt to final prompt, using
>> code tags (the ‘#’ button).
You did not use code tags. Not quote tags, but code tags. The ‘#’ button
in your editor.
> nilesh_suse@linux-4ism:~> df -h | egrep -v vmware-\|gvfsd-fuse\|fusectl\|/sys/fs/cgroup\|tmpfs
> Filesystem Size Used Avail Use% Mounted on
> /dev/sda2 35G 7.8G 26G 23% /
Ok, so you only have a main root partition, no home partition to move.
I’ll assume you have a second disk, or free space on your first disk.
Create a partition on it using the yast Partitioner module. Use the
filesystem type of your choice (for instance, ext4 or xfs). Assign it to
the mount point “/newhome”.
So now you have “/home” (a directory) and “/newhome” (a directory).
Install the program ‘mc’ (midnight commander).
Log out of graphic mode.
Type [Ctrl][Alt][F1] - you get to a text console. Log in as root. Start
‘mc’. You see that it is a text mode file manager. Browse to “/home” on
the left hand panel, and to “/newhome” on the right hand panel, like this:
> Left File Command Options Right
> ┌<─ / ──────────────────────────.^]>┐┌<─ / ───────────────────────────.^]>┐
> │'n Name │ Size │Modify time ││'n Name │ Size │Modify time │
> │/bin │ 4096│Dec 10 20:48││/etc │ 12288│Dec 15 12:50│
> │/boot │ 4096│Dec 10 20:48││/home │ 4096│Oct 19 20:49│
> │/data │ 4096│Oct 20 22:27││/lib │ 4096│Nov 10 03:09│
> │/dev │ 4200│Dec 15 12:50││/lib64 │ 4096│Dec 15 02:56│
> │/etc │ 12288│Dec 15 12:50││/lost+found │ 16384│Oct 19 18:17│
> │/home *** │ 4096│Oct 19 20:49││/media │ 4096│Nov 29 23:12│
> │/lib │ 4096│Nov 10 03:09││/mnt │ 4096│Sep 27 22:24│
> │/lib64 │ 4096│Dec 15 02:56││/newhome *** │ 4096│Dec 15 12:51│
> │/lost+found │ 16384│Oct 19 18:17││/opt │ 4096│Sep 27 22:24│
> │/media │ 4096│Nov 29 23:12││/proc │ 0│Dec 15 13:49│
> │/mnt │ 4096│Sep 27 22:24││/root │ 4096│Dec 15 12:51│
> │/newhome │ 4096│Dec 15 12:51││/run │ 640│Dec 15 12:51│
> │/opt │ 4096│Sep 27 22:24││/sbin │ 12288│Dec 10 20:48│
> ├────────────────────────────────────┤├─────────────────────────────────────┤
> │/home ││/newhome │
> └──────────────── 7154M/7931M (90%) ─┘└───────────────── 7154M/7931M (90%) ─┘
> Hint: Need to quote a character? Use Control-q and the character.
> Eleanor4:/ # ^]
> 1Help 2Menu 3View 4Edit 5Copy 6Re~ov 7Mkdir 8Delete 9PullDn10Quit
The '***' indicates the selected entries (they are not in the real
program). Just Press "F5' while on the left panel to copy "/home" to
"/newhome".
Once that is done, use "F6" to rename "/home" to "/oldhome" (for this it
is absolutely essential that no one, not even you, is logged as their
users on the machine. This is why you need to do this in text mode as
root, not using 'su').
Start a second root terminal on [Ctrl][Alt][F2], log in as root, and run:
umount /newhome
Get back to [Ctrl][Alt][F1]
Navigate to the directory /etc/, select the file "fstab", and use "F4"
to edit it. Find the "/newhome" entry:
LABEL=c_home /newhome xfs defaults 1 2
Yours will be different. Just replace "/newhome" with "/home". Save the
file.
Switch again to the second terminal, and run:
mount /home
Now switch to the third terminal, and login as your user. Does it work?
You can see if your files are present by using 'mc' in there. If all
seems correct, switch to graphical mode ([Ctrl][Alt][F7] or perhaps
[F8]), and login as your normal user.
When you are absolutely sure everything is right, then delete the
directory "/oldhome".
--
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 "Dartmouth" at Telcontar)
Sorry … forgot to use code tags. I followed your steps and worked ! Thank you so much for your help. You are genius
On 2013-12-16 03:06, nilesh suse wrote:
> Sorry … forgot to use code tags. I followed your steps and worked !
> Thank you so much for your help. You are genius
Welcome.
No genius
I simply did this many times before you.
–
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)
I don’t see any links. I still don’t know why I only have 500 mb free on that 20gb partition.
brendan@linux-wca6:~> l -dl /home/brendan/*
drwxr-xr-x 2 brendan users 4096 Nov 6 2012 /home/brendan/bin/
drwxr-xr-x 2 brendan users 4096 Nov 7 19:36 /home/brendan/Desktop/
drwxr-xr-x 3 brendan users 4096 Dec 13 16:29 /home/brendan/Documents/
drwxr-xr-x 2 brendan users 4096 Dec 27 01:16 /home/brendan/Downloads/
drwx------ 34 brendan users 12288 Dec 26 21:58 /home/brendan/Dropbox/
drwxr-xr-x 2 brendan users 4096 Nov 7 2012 /home/brendan/dropbox-servicemenu-kde/
-rw-r--r-- 1 brendan users 169799 Dec 4 2012 /home/brendan/hs_err_pid10710.log
drwxr-xr-x 2 brendan users 4096 Nov 6 2012 /home/brendan/logs/
drwxr-xr-x 3 brendan users 4096 Dec 26 22:16 /home/brendan/Music/
drwxr-xr-x 2 brendan users 4096 Oct 31 23:20 /home/brendan/Pictures/
drwxr-xr-x 2 brendan users 4096 Nov 6 2012 /home/brendan/Public/
drwxr-xr-x 2 brendan users 4096 Nov 6 2012 /home/brendan/public_html/
drwxr-xr-x 2 brendan users 4096 Nov 6 2012 /home/brendan/Templates/
drwxr-xr-x 2 brendan users 4096 Nov 6 2012 /home/brendan/Videos/
-rw------- 1 brendan users 3319478272 Oct 24 2012 /home/brendan/Win7SP1x64Ultimate.iso
-rw-r--r-- 1 brendan users 9890 Dec 15 2012 /home/brendan/Xmodmap.customized
-rw-r--r-- 1 brendan users 9890 Dec 15 2012 /home/brendan/Xmodmap.standard
On 2013-12-28 06:06, quadrunner750 wrote:
> I don’t see any links. I still don’t know why I only have 500 mb free on
> that 20gb partition.
>
>
> Code:
> --------------------
> brendan@linux-wca6:~> l -dl /home/brendan/*
> drwxr-xr-x 2 brendan users 4096 Nov 6 2012 /home/brendan/bin/
> drwxr-xr-x 2 brendan users 4096 Nov 7 19:36 /home/brendan/Desktop/
> drwxr-xr-x 3 brendan users 4096 Dec 13 16:29 /home/brendan/Documents/
> drwxr-xr-x 2 brendan users 4096 Dec 27 01:16 /home/brendan/Downloads/
> drwx------ 34 brendan users 12288 Dec 26 21:58 /home/brendan/Dropbox/
> drwxr-xr-x 2 brendan users 4096 Nov 7 2012 /home/brendan/dropbox-servicemenu-kde/
> -rw-r–r-- 1 brendan users 169799 Dec 4 2012 /home/brendan/hs_err_pid10710.log
> drwxr-xr-x 2 brendan users 4096 Nov 6 2012 /home/brendan/logs/
> drwxr-xr-x 3 brendan users 4096 Dec 26 22:16 /home/brendan/Music/
> drwxr-xr-x 2 brendan users 4096 Oct 31 23:20 /home/brendan/Pictures/
> drwxr-xr-x 2 brendan users 4096 Nov 6 2012 /home/brendan/Public/
> drwxr-xr-x 2 brendan users 4096 Nov 6 2012 /home/brendan/public_html/
> drwxr-xr-x 2 brendan users 4096 Nov 6 2012 /home/brendan/Templates/
> drwxr-xr-x 2 brendan users 4096 Nov 6 2012 /home/brendan/Videos/
> -rw------- 1 brendan users 3319478272 Oct 24 2012 /home/brendan/Win7SP1x64Ultimate.iso
> -rw-r–r-- 1 brendan users 9890 Dec 15 2012 /home/brendan/Xmodmap.customized
> -rw-r–r-- 1 brendan users 9890 Dec 15 2012 /home/brendan/Xmodmap.standard
> --------------------
>
>
But your 20 Gig partition is not home, it is root. You already have home in a separate partition,
437gigs size and 95% empty:
You posted this data:
brendan@linux-wca6:~> df -h | egrep -v vmare-\|gvfsd-fuse\|fusect1\|/sys/fs/cgroup\|tmpfs
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 20G 18G 667M 97% /
/dev/sda3 437G 19G 417G 5% /home
brendan@linux-wca6:~>
Your problem is the system or root partition, “/”, it is filled up. This is a very different problem
than what is treated in this thread.
You can install and use ‘kdirstat’ (kde) or baobab (gnome) to find out visually where is diskspace
used. Other utilities are ‘filelight’, or plain CLI ‘du’. I prefer using midnight comander, ‘mc’, a
terminal mode file browser with tons of features (yes, text). One of them is calculating directory
sizes.
Use one of those tools to find out where your space is spent - and if you have more questions about
that, please start a new thread with that subject, as your problem is different from the OP here
(nilesh_suse) and we confuse things for him.
–
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 “Bottle” (Elessar))