LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-18-2017, 04:11 PM   #1
WFV
Member
 
Registered: Apr 2012
Location: CA
Distribution: Arch
Posts: 169

Rep: Reputation: Disabled
move /usr to /home/usr


Have read several websites on doing this but getting stuck at reboot "can't find sbin/init, you're on your own" to a # prompt. I'm guessing that /usr isn't binding in time for the kernel to finish booting up?
1. boot guest with live cd (in this case its an iso in a VirtualBox guest on a Linux host)
Code:
 lsblk
mkdir /mnt/ARCH
mount /dev/sda1 /mnt/ARCH
mount /dev/sda3 /mnt/ARCH/home
cd /mnt/ARCH
mount -t proc proc proc/
mount -o bind /sys sys/
mount -o bind /dev dev/
cd /
chroot /mnt/ARCH
nano /etc/fstab
# Binds (under the /home mount)
/home/var /var none bind 0 0
/home/usr /usr none bind 0 0
#save + exit
rsync -aAXhv /var /home/
rysnc -aAXhv /usr /home/
exit (chroot)
rm -rfv /mnt/ARCH/var/*
rm -rfv /mnt/ARCH/usr/*
mount -o bind /mnt/ARCH/home/var /mnt/ARCH/var
mount -o bind /mnt/ARCH/home/usr /mnt/ARCH/usr
chroot /mnt/ARCH
# check to see that all is intact in /var and /usr
# check to see that commands work (the above line will do that)
exit (chroot)
umount -l -a
reboot
fails to boot on "can't find sbin/init" however, from the prompt /sbin contains init. So I'm guessing the failure is due to the symlinks in sbin to /usr/bin are needed and the bind /usr hasn't completed yet?
This one in particular can't initiate systemd?
Should the bind in fstab be passed with -f?
Thanks anyone.

Last edited by WFV; 06-18-2017 at 04:12 PM.
 
Old 06-18-2017, 04:22 PM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1.2 on Lenovo Thinkpad W520
Posts: 8,957

Rep: Reputation: Disabled
I know neither Arch nor systemd but this message can be displayed if the partition mounted as / is not the good one, i.e. is not the root partition of the system you want to boot.
 
Old 06-18-2017, 04:38 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,271

Rep: Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943
Heed the warning from the Arch Linux Partitioning Guide:
Warning: Directories essential for booting (except for /boot) must be on the same partition as / or mounted in early userspace by the initramfs. These essential directories are: /etc and /usr [1]
and the linked-to warning from freedesktop.org: "Booting Without /usr is Broken".

If you insist on a separate /usr partition, you must make provision in the initramfs to mount it in the early stages of the boot process. That may require that you disable any automatic fsck of your /usr partition lest it always fail because the partition is mounted.
 
1 members found this post helpful.
Old 06-18-2017, 05:03 PM   #4
WFV
Member
 
Registered: Apr 2012
Location: CA
Distribution: Arch
Posts: 169

Original Poster
Rep: Reputation: Disabled
Thank you rknichols, that link sums it up. maybe i try the initramfs tweaks, but probably over my head. Its just a vbox guest and have a good backup to replace it with

EDIT: I'm going to mark this solved as I went back and only moved /var (needed a little extra room in / of the vbox guest and didn't want to grow the vdi). Shutdown fails to unmount the var bind, but the guest boots up normal and everything works. Thanks for the replies all.

Last edited by WFV; 06-19-2017 at 12:16 AM.
 
Old 06-19-2017, 10:56 AM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,271

Rep: Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943
Quote:
Originally Posted by WFV View Post
maybe i try the initramfs tweaks, but probably over my head.
It might not be difficult, but for what you are doing you would also have to mount /home early. In Red Hat 6, all I would need to do is to create a file /etc/fstab-sys with two lines like:
Code:
/dev/sda3   /home ext4  defaults     0 0
/home/usr   /usr  none  bind         0 0
and change the "/usr" and "/home" lines in /etc/fstab to have "0" in the last field so that the init scripts wouldn't try to run an fsck on those mounted filesystems. Then, a run of mkinitrd would include that /etc/fstab-sys in the initramfs. I had one system set up in a similar way (separate /usr, not part of any other filesystem, mounted read-only), but got tired of having to remember to remount /usr read/write every time I did an update.

Since my /usr was getting mounted read-only, I wasn't too concerned about turning off the boot fsck. For your case, I don't think doing that for /home is a good idea, so the whole plan falls apart on that note.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirect an app resource folder from system /usr/share to /home/user/[app]/usr/share minyor Linux - Software 2 04-23-2013 06:44 AM
echo $PATH = /home/g3rc4n/bin:/usr/local/bin:/usr/bin:/bin:/usr/games ? i_heart_pandas Linux - Software 7 09-18-2009 08:33 AM
FreeBSD 6.2, no /usr/src/tools and /usr/src/usr.bin, failed to build world. Mr_Shameless *BSD 4 05-16-2008 08:43 AM
softlink /usr to /home/usr ??? mlsfit Linux - General 4 11-09-2003 12:16 AM
usr space from /usr for /home ? chanys Linux - Newbie 2 08-26-2003 11:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration