LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 05-22-2019, 12:54 AM   #1
vgnsh333
LQ Newbie
 
Registered: May 2019
Posts: 3

Rep: Reputation: Disabled
linux from scratch backup doesnt boot properly after restoration


I made a tar backup of the LFS partition after completing the LFS 8.4 book, while doing BLFS I messed up somewhere. So I decided to format the LFS partition and extract the backup on the partition, then I updated the grub which found LFS on partition.

While booting it says:
mount: only superuser can use mount.
mount: /run only root can use "--option"....
and
/run : read only file system...

I tried adding rw in the grub file, but then the only root can use error is still there
I don't know where it went wrong
I'd appreciate any hints or comments.
Thanks.
 
Old 05-22-2019, 03:48 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Welcome top LQ, vgnsh333.

All the boot stuff, /proc, /sys, /run & /dev must all be root owned and group. To look at the errors, it appears it's trying to mount them as a luser

The safe way to backups is with rsync. Back up while the system is off, otherwise the directories above will be filled with crap.

Last edited by business_kid; 05-22-2019 at 03:49 AM.
 
Old 05-22-2019, 06:53 AM   #3
vgnsh333
LQ Newbie
 
Registered: May 2019
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
Welcome top LQ, vgnsh333.

All the boot stuff, /proc, /sys, /run & /dev must all be root owned and group. To look at the errors, it appears it's trying to mount them as a luser

The safe way to backups is with rsync. Back up while the system is off, otherwise the directories above will be filled with crap.
Thanks business_kid, but is there a way to fix this? I tried so many things like changing fstab n changing permission of the files.
The LFS book I was using was for systemv, now I started building systemd so that I can use Gnome in LFS.
If there's a way to get the mount command while booting working properly?
 
Old 05-22-2019, 07:44 PM   #4
sr_ls_boy
Member
 
Registered: Apr 2015
Posts: 105

Rep: Reputation: Disabled
I remember doing this a long time ago. I found that permissions don't always duplicate when tarring and untarring.
Re-read sec. 6.5 of the LFS book and make sure that your permission are correct. That's one thing.

Now, about your tarball, /run is suppose to be an empty directory. See that it is. It gets mounted virtually
via /etc/fstab at boot or by the following command with chroot. It's possible that you tarred virtual files that
get in the way by untarring. The same with /dev, /sys, and /proc.

mount -vt tmpfs tmpfs $LFS/run

You might need a live CD to fix this.
 
1 members found this post helpful.
Old 05-22-2019, 09:47 PM   #5
ordealbyfire83
Member
 
Registered: Oct 2006
Location: Leiden, Netherlands
Distribution: LFS, Ubuntu Hardy
Posts: 302

Rep: Reputation: 89
Was this tar backup made as the root user?

As sr_ls_boy mentioned, permissions are not always preserved when making tar archives - unless you make the archive as root AND use the 'p' option. cd to the parent directory for which you wish to archive, and then

tar cfp /path/to/tarball.tar .

You need to be cd'ed to the appropriate directory that you are backing up. This will not work if you cd to the directory where you want the resulting tarball to be.

At this point your best bet is to boot from a live cd and start changing permissions manually.
 
1 members found this post helpful.
Old 05-24-2019, 01:37 AM   #6
Luridis
Member
 
Registered: Mar 2014
Location: Texas
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616

Rep: Reputation: 167Reputation: 167
First, if you're on a dual-boot system make certain $LFS/boot/efi is not mounted before restoring the system.

To backup, assuming $LFS is mounted and you are running as root from your build host and/or bootable thumb drive or CDROM. I recommend backing up /sources separately as a normal archive. [ tar -cJvf ~/lfs-8.3-sources.tar.xz sources ]

Code:
cd $LFS
tar -cJvp --xattrs --numeric-owner --exclude=./sources \
--exclude=./tmp/* -f ~/lfs-8.3-base-system.tar.xz .
The numeric-owner is necessary because accounts may exist on the LFS system that don't exist on the build host or backup system. Additionally, if there are accounts with the same name on both, they may not have the same UIDs/GIDs.

To restore, make sure you create directories for and mount any sub-partitions of the LFS system root.

Code:
cd $LFS
tar -xvpf ~/lfs-8.3-base-system.tar.xz  --xattrs-include='*.*' --numeric-owner
I've never had a system fail to boot or function normally using this method.

Last edited by Luridis; 05-24-2019 at 01:39 AM.
 
1 members found this post helpful.
Old 05-24-2019, 04:31 AM   #7
vgnsh333
LQ Newbie
 
Registered: May 2019
Posts: 3

Original Poster
Rep: Reputation: Disabled
I'm gonna start looking through the permissions and the virtual filesystems, next time I'll remember to make a tar with -p option.
Thanks for your help guys!
 
  


Reply



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
Backup and restoration of directory in pen/external drive viveksikarwar Linux - Newbie 2 09-04-2017 02:55 AM
Whole system backup and restoration newbie_adm Linux - Newbie 7 01-09-2007 09:30 AM
Restoring MBR :partitions are detected only after the reboot after MBR restoration? sharathksin Linux - Newbie 2 04-14-2006 07:48 AM
grub floppy backup and restoration chocloman Linux - Software 3 02-02-2006 03:06 PM
ali aladdin v agp stinks :scratch: :scratch: :scratch: Mr Marmmalade Linux - Hardware 1 07-08-2003 05:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 05:04 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
Open Source Consulting | Domain Registration