Slackware - InstallationThis forum is for the discussion of installation issues with Slackware.
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.
[EDIT] Looks like we were typing at the same time. You have already done some of this.
First, note that your "df -m /dev/sda" and "df -m /dev/sdb" are incorrect usage. df works on mounted filesystems, not devices. What you are seeing are the statistics for the devfs virtual filesystem where the inodes for /dev/sda and /dev/sdb reside.
Right now, your /dev/sdb2 is apparently not mounted, at least not on /home. You can confirm this by running "mount | grep sdb2" and observing that there is no output. You need to make sure there is an ext4 filesystem on /dev/sdb2. Run "blkid /dev/sdb2" and see if it finds an ext4 filesystem there. If it does not, you need to run
Code:
mkfs.ext4 /dev/sdb2
Next, your /etc/fstab is wrong. There is a missing field in that /dev/sdb2 line, and an fstab entry cannot have any empty fields. Presumably that line should read:
Code:
/dev/sdb2 /home ext4 defaults 1 2
Don't do that until there is an ext4 filesystem there or your system will fail to boot. (Right now it just complains about the bad line and does not do the mount.)
Moving the contents of /home is fairly straightforward. As root:
Now reboot, and the system should come up with /dev/sdb2 mounted on /home. Once you are satisfied that all is well, you can run (as root) "rm -r /oldhome" to free up that space in the root filesystem.
Last edited by rknichols; 01-09-2015 at 05:14 PM.
Reason: Add [EDIT]...
And now, whatever was in the original /home directory in the root filesystem is still there hidden under the mount point. What you need to do next depends on whether you want to preserve that or not.
Code:
# mkdir /tmp/tmproot
# mount --bind / /tmp/tmproot
Now you can look in /tmp/tmproot/home and see what, if anything, is there. If you want to save it
> And now, whatever was in the original /home directory in the root filesystem is still there hidden under the mount point.
Yes, it sure was. And that caused me some trouble. I was not able to log in as anybody.
I rebooted with the startup CD, then chrooted over and changed my /etc/fstab file so the /home file system would not mount, then rebooted again.
I created a temporary mount point called /home2, and mounted /dev/sdb2 on home2. But I cannot copy anything to /home2. Even when logged in as root.
I opened a terminal, su-ed to root, and I tried to copy the files from /home to /home2 but that is not working. I tried cp -a and cp -R ; but I keep getting:
cp: cannot create directory ‘./walter’: Read-only file system
Code:
# ls -ld home2
drwxr-xr-x 5 root root 4096 Jan 9 16:53 home2
Since I am logged in as root, it seems like I should be able to write to it, but I cannot.
I'm not sure how you got to where you are with /home2 mounted read-only. With /etc/fstab changed so that no mount occurs on /home, boot your system normally, then do the steps I laid out at the end of #4, changing "newhome" to the "home2" you've already created:
Code:
# mount /dev/sdb2 /home2
# cp -a /home/* /home2
# umount /home2
# mv /home /oldhome
# mv /home2 /home
Then change /etc/fstab so that /dev/sdb2 does get mounted on /home and reboot.
Clean up by "rm -r /oldhome" once you're sure that all is well.
Last edited by rknichols; 01-09-2015 at 07:26 PM.
Reason: Oops, left out the "mount" command
PS: lsblk lists information about all or the specified block devices. The lsblk command reads the sysfs filesystem to gather information. Thus it doesn't need that the device be properly created in the /dev tree to operate.
Last edited by Didier Spaier; 01-10-2015 at 11:48 AM.
Reason: PS added.
Device names are not going to be consistent. They can change according to what other hardware is plugged in, and occasionally from the phase of the moon or conjunctions of Mars with Jupiter. (OK, it's really the timing of multiple simultaneous threads discovering the hardware.)
This is supposed to be ext4 file system, not an ext2 system. I am not sure if that matters.
Code:
# e2fsck /dev/sdg
e2fsck 1.42.8 (20-Jun-2013)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/sdg
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
This is supposed to be ext4 file system, not an ext2 system. I am not sure if that matters.
That doesn't matter, despite its name e2fsck is intended for all ext file systems. Read "man e2fsck" to know all options, but i'm afraid that you drive needs to be replaced.
EDIT. Hasty conclusion, your command was wrong, see post #16
Last edited by Didier Spaier; 01-10-2015 at 03:40 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.