You are not logged in.
Pages: 1
When I set up my install I underestimated how much I'd need for /home. (Which is just a directory on root partition, currently nothing is mounted there).
I set my system partitions up in a weird way. I never repeated the mistake in other installs. But I never fixed it on my main system.
>I have a 20GB root,
>8gb swap
>500mb boot,
and then a 450gb partition just mounted to an arbitary place I called /massStorage.
Will I run into any issues (ownership, permission, etc...) if, as root, I run;
cp -R /home /massStorage.
umount /dev/sdb4 (massStorage)
mount /dev/sdb4 /home
genfstab > /etc/fstab
Offline
cp -R /home /massStorage. umount /dev/sdb4 (massStorage) mount /dev/sdb4 /home genfstab > /etc/fstab
That look ok. Here's some tips:
I'm not sure "cp -R /home /massStorage" is what you mean to do. Instead, consider:
mkdir /massStorage/storage
mv /massStorage/* /massStorage/storage/ # Which, of course, won't actually move the "storage/" directory, which is a good thing
cp -r /home/* /massStorage/
Tell me if any of that doesn't make sense.
Don't forget that, after you finish copying the "/home" directory, the contents are STILL there. So before you do the mount command, consider moving "/home" to "/home.BAK" and remaking the "/home" directory.
Instead of the "cp" command, consider using "rsync -av". It will preserve the date stamps and permissions and guarantee that the copy finishes successfully. Also, it allows you to stop and restart the copy process. rsync is my new favorite command.
Sooo... When was the last time you made an external backup?
Offline
Hmm...
mkdir /massStorage/storage
mv /massStorage/* /massStorage/storage/
I have emptied /massStorage - so I don't see the point of doing this?
So. New order
mkdir /home.BAK
mv /home /home.BAK
mkdir /home
umount /dev/sdb4
mount /dev/sdb4 /home
rsync -av /home.BAK/home /home
genfstab > /etc/fstab
Look okay?
And, yeah - I've backed anything worthwhile to an external drive...
Last edited by AndyWM (2015-10-30 18:11:24)
Offline
mkdir /massStorage/storage mv /massStorage/* /massStorage/storage/ # Which, of course, won't actually move the "storage/" directory, which is a good thing cp -r /home/* /massStorage/
Just in case you have some hidden files in /massStorage:
mv /massStorage/{,.[!.]}* /massStorage/storage/
Alternatively you could use `shopt -s dotglob' and `shopt -u dotglob' bevore calling `mv'
Additionally, I would recommend using `cp' with the --preserve=all and the --no-dereference options.
This is what I use in my backup script.
Offline
All previous content of /massStorage should land into /home/USERNAME, not /home only, cause this area is reserved for root.
The second important thing - /etc/fstab. There should be line with /home, but not with /massStorage. Previous massStorage will be new /home. After /etc/fstab edition generate new initramfs:
mkinitcpio -p linux
Offline
Look okay?
Sure, except for "rsync -av /home.BAK/home /home". rsync has a funny way of handling directories (so make sure you test this before making any big commitments):
rsync -av /home.BAK/home /home # Create the directory "/home/home/" and copy the contents
rsync -av /home.BAK/home/ /home # Copy the contents of "/home.BAK/home/" to the destination directory
Do you see the difference? Actually, I'm not even quite sure I got that right...
Other than that it looks fine I think.
@Fixxer: Why is a new initramfs needed?
Last edited by drcouzelis (2015-10-30 18:29:23)
Offline
Why is a new initramfs needed?
Many many years ago I have had some errors with similar operation. Maybe now it isn't necessary ... File is empty:
lsinitcpio initramfs-linux.img | grep fstab
./etc/fstab
Offline
You can use cp, but you have to "cp -a" ; which will conserve file attributes. It's better to pass the options -avH if you use rsync, without -H, hardlinks won't be preserved.
Last edited by olive (2015-10-30 19:36:49)
Offline
Pages: 1