[opensuse] move /home to new partition - sanity check
Guys, Looking before I leap, I just thought I would check that my thinking for moving /home to a new partition (/data below) is sound. Current partitions: 17:40 nemesis:~> df -h Filesystem Size Used Avail Use% Mounted on udev 10M 228K 9.8M 3% /dev /dev/mapper/nvidia_baaccajap5 19G 9.3G 8.2G 54% / none 4.0G 0 4.0G 0% /dev/shm /dev/mapper/nvidia_baaccajap6 114M 35M 74M 32% /boot /dev/mapper/nvidia_baaccajap7 37G 29G 6.2G 83% /home /dev/mapper/nvidia_baaccajap9 15G 5.4G 8.3G 40% /var /dev/mapper/nvidia_baaccajap10 29G 6.4G 22G 24% /srv /dev/mapper/nvidia_baaccajap12 581G 56G 496G 11% /data /dev/mapper/nvidia_baaccajap11 7.1G 145M 6.6G 3% /home/david/pvt Plan: cp -a /home /data vi /etc/inittab (change partition mounts data->home, home->data) reboot Seems incredibly simple - see any gotchas? -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2010/09/29 20:05 (GMT-0500) David C. Rankin composed:
vi /etc/inittab (change partition mounts data->home, home->data)
You know better. -- "The wise are known for their understanding, and pleasant words are persuasive." Proverbs 16:21 (New Living Translation) Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 09/29/2010 08:15 PM, Felix Miata wrote:
On 2010/09/29 20:05 (GMT-0500) David C. Rankin composed:
vi /etc/inittab (change partition mounts data->home, home->data)
You know better.
Your right - still coming out from under anesthesia from surgery this am. vi /etc/fstab :-) -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 09/29/2010 06:35 PM, David C. Rankin wrote:
On 09/29/2010 08:15 PM, Felix Miata wrote:
On 2010/09/29 20:05 (GMT-0500) David C. Rankin composed:
vi /etc/inittab (change partition mounts data->home, home->data You know better. Your right - still coming out from under anesthesia from surgery this am.
vi /etc/fstab :-)
Surgery? We hope everything's okay. Using cp for moving partitions makes me nervous, especially if there are symbolic links in the source side (by default, cp copies the contents of symlinks, rather than the symlink itself. This can lead to recursion that fills up a disk). Also, I'd want to unmount /home, then remount on /mnt, just to make sure it's quiescent. I'm rather fond of a tar pipeline for this kind of thing, as in: cd /mnt; tar cf - . | (cd /data; tar xfBp -) Also, rsync is a more modern way of safely doing the deed: rsync -av /mnt/ /data Once finished, unmount /mnt and /data, edit /etc/fstasb, then mount -a. Figuring out how to unmount /home and /data if it won't let you is an exercise left for the student. :-) Regards, Lew -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
/dev/mapper/nvidia_baaccajap7 37G 29G 6.2G 83% /home
/dev/mapper/nvidia_baaccajap12 581G 56G 496G 11% /data /dev/mapper/nvidia_baaccajap11 7.1G 145M 6.6G 3% /home/david/pvt
Plan:
cp -a /home /data
I think I'd change to -Rp or use a dual tar method... do you also want the contents of (former) data back in the data dir? I don't see a way of that getting changed. perhaps : cd / mkdir /data/MOVEIT mv /data/* /data/MOVEIT mv /home/* /data mv /data/MOVEIT /home edits... umount/mount. but a caveaqt about users logged in/processes running out of /home and/or /data.
vi /etc/inittab (change partition mounts data->home, home->data)
I assume you mean fstab, but noting here.
reboot
no real need to reboot, per se. if you login as root or create a special use user ID that doesn't have /home for home dir.. and nothing's open/running from /home (or /data) then just umount /data ; umount /home ; mount /home ; mount /data
Seems incredibly simple - see any gotchas?
-- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-- Even the Magic 8 ball has an opinion on email clients: Outlook not so good. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
perhaps : cd / mkdir /data/MOVEIT mv /data/* /data/MOVEIT mv /home/* /data mv /data/MOVEIT /home
dangit. mv /data/MOVEIT/* /home/ -- Even the Magic 8 ball has an opinion on email clients: Outlook not so good. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
zGreenfelder wrote:
/dev/mapper/nvidia_baaccajap7 37G 29G 6.2G 83% /home
/dev/mapper/nvidia_baaccajap12 581G 56G 496G 11% /data /dev/mapper/nvidia_baaccajap11 7.1G 145M 6.6G 3% /home/david/pvt
Plan:
cp -a /home /data
I think I'd change to -Rp or use a dual tar method...
Err, have you read the man page that explains what -a means? Why do people not trust cp? It's a fine program that does what it says on the tin. There's a lot more to go wrong using tar. Lew Wolfgang wrote:
Using cp for moving partitions makes me nervous, especially if there are symbolic links in the source side (by default, cp copies the contents of symlinks, rather than the symlink itself. This can lead to recursion that fills up a disk). Also, I'd want to unmount /home, then remount on /mnt, just to make sure it's quiescent. I'm rather fond of a tar pipeline for this kind of thing,
Err, have you read the man page that explains what -a means? Why do people not trust cp? It's a fine program that does what it says on the tin. There's a lot more to go wrong using tar.
Also, rsync is a more modern way of safely doing the deed:
rsync is also a fine program. But for local file copying, cp is the tool designed for the job. Cheers, Dave -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
zGreenfelder wrote:
/dev/mapper/nvidia_baaccajap7 37G 29G 6.2G 83% /home
/dev/mapper/nvidia_baaccajap12 581G 56G 496G 11% /data /dev/mapper/nvidia_baaccajap11 7.1G 145M 6.6G 3% /home/david/pvt
Plan:
cp -a /home /data
I think I'd change to -Rp or use a dual tar method...
Err, have you read the man page that explains what -a means?
Why do people not trust cp? It's a fine program that does what it says on the tin. There's a lot more to go wrong using tar.
Lew Wolfgang wrote:
Using cp for moving partitions makes me nervous, especially if there are symbolic links in the source side (by default, cp copies the contents of symlinks, rather than the symlink itself. This can lead to recursion that fills up a disk). Also, I'd want to unmount /home, then remount on /mnt, just to make sure it's quiescent. I'm rather fond of a tar pipeline for this kind of thing,
Err, have you read the man page that explains what -a means?
Why do people not trust cp? It's a fine program that does what it says on the tin. There's a lot more to go wrong using tar.
Also, rsync is a more modern way of safely doing the deed:
rsync is also a fine program. But for local file copying, cp is the tool designed for the job.
Cheers, Dave
fwiw re using cp, from an old SuSE article on moving a directory to a larger partition, using /home as an example, as root. (I couldn't find the url, 1. Make and format partition 2. cd /home 3. mkdir /newhome 4. mount <new partition> /newhome 5. cp -axv . /newhome 6. verify copy 7. mv /home /home.old 8. mkdir /home 9. edit fstab to show new partition mounted at /home 10. reboot 11. check new partition has mounted 12. cd / 13. rm -fr home.old The cp options insure the copy is recursive, keeps properties, includes symlinks, write to stdout all filenames (so could be redirected to a file for reference). -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday, 2010-09-29 at 21:20 -0400, zGreenfelder wrote:
do you also want the contents of (former) data back in the data dir? I don't see a way of that getting changed.
I do :-) Two 'mc' sessions moving in opposite directions ;-)
reboot
no real need to reboot, per se. if you login as root or create a special use user ID that doesn't have /home for home dir.. and nothing's open/running from /home (or /data) then just umount /data ; umount /home ; mount /home ; mount /data
Use runlevel 2, and work as root. If something is busy, drop to level 1. - -- Cheers, Carlos E. R. (from 11.2 x86_64 "Emerald" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) iEYEARECAAYFAkykkiMACgkQtTMYHG2NR9U0egCfVfw/RJilFUIgpTJUUbmQA2oF fqEAnjM121tK3pXb7XsGbZV5190tzTzb =XimT -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 09/30/2010 08:35 AM, Carlos E. R. wrote:
On Wednesday, 2010-09-29 at 21:20 -0400, zGreenfelder wrote:
do you also want the contents of (former) data back in the data dir? I don't see a way of that getting changed.
I do :-)
Two 'mc' sessions moving in opposite directions ;-)
reboot
no real need to reboot, per se. if you login as root or create a special use user ID that doesn't have /home for home dir.. and nothing's open/running from /home (or /data) then just umount /data ; umount /home ; mount /home ; mount /data
Use runlevel 2, and work as root. If something is busy, drop to level 1.
Guys, Worked like a champ with cp -a. I only had 9 symlinks to unlink (which were already pointing to files on /data. So I just did the cp -a /home /data, edited fstab changed home -> data; data -> home and rebooted -- huh no home no data. Edit fstab again (smack self) forgot to change ext3->ext4; ext4->ext3, rebooted again -- all working fine :p -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (7)
-
Carlos E. R.
-
Dave Howorth
-
David C. Rankin
-
dwgallien
-
Felix Miata
-
Lew Wolfgang
-
zGreenfelder