DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I think you should replace the device name for its UUID (you can get its UUID with blkid). Also, make sure that it's actually formatted in ext4 and not in any other FS type.
Last edited by Hungry ghost; 02-15-2015 at 07:06 PM.
When you format a partition the format program may change the UUID. Check to make sure that the UUID in fstab is the same as the UUID actually on the partition.
The last time I tried I booted the PC with Knoppix 7.4 and performed the copy with Dolphin in su mode.
Problem 1: I get more files on the new partition than the one I copied from! (Using Properties, maybe counting 500,000+ files is not totally accurate)
Ugh. I hate using GUI tools - use cp/rsync from the cli and you'll know what's actually happening. Maybe links are being mishandled - but that many files in /usr ? (edit - I read it as 500,000 extra).
Quote:
Problem2: When I set the new partition to mount on /usr I get errors during startup.
Do the fsck manually yourself - same as above, you need to know what's happening.
I replaced "/dev/sdb8" bu the UUID of the partition. No improvement and the fsck error still talks about not finding /dev/sdb8
The partition is formatted as ext4. I checked with df -T
Jailbait wrote
Quote:
When you format a partition the format program may change the UUID. Check to make sure that the UUID in fstab is the same as the UUID actually on the partition.
I don't understand this. I generated the UUID using blkid. What checks can I make? (And is this still relevant since I generated the UUID after the format?)
Sygoo: On the old (trouble free) usr I have 554,598 files in 56,045 sub folders. There's a lot on this machine, which is why I felt the need to upgrade the hard discs.
Manual fsck
I have not managed to do this. I pass the parameter Linux single to LILO. The boot sequence goes through the same errors as I described in my original post and then I end up in maintenence mode. I can log in but cannot unmount /usr to fsck it. Am I missing something out?
Thoughts: This is the first time I am using ext4, also having /usr on a different disc to my boot disc. Could either of these be a cause of the problem?
cp command won't work. You'll have to use the mv command.
Since you used the cp command your /usr should still be intact on sda6.
Check sda6 to confirm.
If it's ok then you'll have to removed everything that is in sdb8.
The way I did it was just like what you're attempting, but had to do it from live-cd, because after move was made I couldn't complete because all of the tools that are necessary are in /usr.
Quote:
mkdir /usr1
from live-cd I used
Quote:
mv /media/UUID#/usr /media/UUID#/usr1
then rename usr1 to usr
Not to forget to make change to fstab.
I have examined my initrd file with lsinitramfs and usr is not mentioned at all.
From the above-referenced link I cannot tell if there is, in fact a problem.
One possible solution would be to boot with the new usr, then update-initramfs. This might then include the info for fsck to find usr during the boot process.
I don't want to destroy my setup so I am considering:
1. Backup the initrd file.
2. Run update-initramfs
3. reboot.
4. If this does not help, restore the initrd file.
cp command won't work. You'll have to use the mv command.
Since you used the cp command your /usr should still be intact on sda6.
Check sda6 to confirm.
If it's ok then you'll have to removed everything that is in sdb8.
The way I did it was just like what you're attempting, but had to do it from live-cd, because after move was made I couldn't complete because all of the tools that are necessary are in /usr.
from live-cd I used
then rename usr1 to usr
Not to forget to make change to fstab.
Don't use move 'mv' command. Otherwise you loose original copy.
I should have added remove everything from rm -fr /usr1/* and then try cp.
It seems that there are known issues with having usr in an "unusual" location.
I have had problems with systed and mounting partitions. systemd tries to do as much as possible in parallel. As a result bugs in systemd are often intermittent depending on the timing of events happening asynchronously. If you have changed a UUID on a partition check to make sure that fstab reflects the change. Also when systemd gets confused it will go into an arbitrary 1 minute 30 second wait in the hopes that things will straighten themselves out while it counts down the wait.
I also encountered intermittent systemd problems when I switch /usr to a new partition on Debian jessie. I just switched to using Debian wheezy until systemd patched that bug.
With the mv command you don't lose anything, it just moves /usr & renames it. You could always move it back to the original partition.
If you wanted to you could use gparted to copy the actual data from 1 partition to another.
That presumes everything works. A half-/usr will not be pretty to fix.
Copy means you always have a backup. Deleting the original source later to reclaim the space is much easier than attempting to re-build it. Especially system critical data.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.