now I can't login to root

Post here if you are a new Porteus member and you're looking for some help.
Bob1414
Black ninja
Black ninja
Posts: 33
Joined: 28 Mar 2021, 15:35
Distribution: Cinnamon 4 kernel5.11.13 p

now I can't login to root

Post#1 by Bob1414 » 12 Apr 2021, 11:05

I boot from a FAT32 USB into guest.

When I logout and try to then login to root, I drop out to the text screen, then get right back to the graphic screen at the login prompt.

The pwd is still good, as I can su in a terminal

I have restored porteussave.dat from a working backup USB. The contents of /modules is the same for each USB.

Do I need to start from scratch with a fresh USB install (then copy into that porteussave.dat), or can I hopefully try some maneuvers to attempt to fix the problem in place?

What else on the USB changes, besides porteussave.dat and the contents of /modules?

Thanks.

Bob1414
Black ninja
Black ninja
Posts: 33
Joined: 28 Mar 2021, 15:35
Distribution: Cinnamon 4 kernel5.11.13 p

now I can't login to root

Post#2 by Bob1414 » 12 Apr 2021, 11:25

and all works well if I choose to start in Always Fresh from the bad USB

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

now I can't login to root

Post#3 by Ed_P » 12 Apr 2021, 19:05

Bob1414 wrote:
12 Apr 2021, 11:05
Do I need to start from scratch with a fresh USB install (then copy into that porteussave.dat)
No, but you may need to start with a fresh porteussave.dat file.
Bob1414 wrote:
12 Apr 2021, 11:05
What else on the USB changes, besides porteussave.dat and the contents of /modules?
If the drive is FAT32 formatted nothing, unless you intentionally save something to it. But save.dat files save lots of stuff. My save.dat is 183 MB full. My changes.xzm module which is files of apps and changes I value and manually backup is 13.5 MB. Maybe your old save.dat file has a changed result of something you haven't run yet on the new drive and it's causing problems.

With your new drive start with a fresh porteussave.dat file rather than your old one. And yes that can be a PITA. To minimize the size of the save.dat usage I use this /etc/changes-exit.conf file.

Code: Select all

# Folders listed in this config file will be saved during reboot and shutdown when 'changes=EXIT:' cheatcode is used.
# Folders starting with '!' are omitted. This is useful if you want to save whole folder except for particular subfolder(s).
# An example is inclued in default config below: Porteus will save whole /var folder except for /var/run and /var/tmp subfolders.
# Other example: "!/home/guest/.mozilla/firefox/c3pp43bg.default/Cache" will skip saving of Firefox caches from guest account.
# Thanks to Rava for suggesting implementation of '!' exceptions.

/bin
/etc
/home
/lib
/lib64
/opt
/root
/sbin
/usr
/var
!/var/run
!/var/tmp
!/home/guest/.cache/thumbnails/normal
!/home/guest/.cache/mozilla/firefox/dxsqumip.default/thumbnails/
!/home/guest/.mozilla/firefox/Crash?Reports/pending/
#/home/guest/.mozilla/firefox/dxsqumip.default/storage/default/
!/home/guest/.mozilla/firefox/dxsqumip.default/datareporting/archived
!/home/guest/.java/deployment/cache/6.0/
!/root/.local/share/Trash/
!/root/.cache/thumbnails/normal
And to check the size the file I use this spaceck.sh script:

Code: Select all

#!/bin/sh
# Add to /etc/rc.d/rc.local_shutdown.  And make rc.local_shutdown executable.
#                                      sudo chmod +x /etc/rc.d/rc.local_shutdown
# Bogomips help: https://forum.porteus.org/viewtopic.php?f=140&t=6069&p=47591#p47589
#                https://forum.porteus.org/viewtopic.php?f=140&t=6069&p=47614#p47598

# du -BM -d3 /mnt/live/memory/images/changes 

# Color definitions
txtbld=$(tput bold)               # Bold
txtred=${txtbld}$(tput setaf 1)   # Red
rst=$(tput sgr0)                  # Reset

function redwarning() {
echo -e $txtred "$1" $rst
}

#set -x;

if [ -a /mnt/live/memory/images/changes ]; then
   SDspace=$(df -BM --output=size,used,avail,pcent /mnt/live/memory/images/changes | tail -n1)
   Changes=/mnt/live/memory/images/changes
else
   BOOTDEV=`grep -A1 "Booting" /var/log/porteus-livedbg|tail -n1|sed 's^//^/^g'`
   if [ "$BOOTDEV" == "/mnt/isoloop" ]; then
      BOOTDEV=`grep -A1 "ISO=" /var/log/porteus-livedbg`
      BOOTDEV=${BOOTDEV:4:9}
   fi
   VERSION=$(cat /etc/porteus-version)
   FOLDER=porteus${VERSION:9:3}
   Changes=$BOOTDEV/$FOLDER/changes
   if [ ! -d $Changes ]; then 
      Changes="$BOOTDEV/changes"
   fi
   if [ ! -f $Changes/porteussave.dat ]; then
      echo "No $Changes/porteussave.dat file."
      read
      exit
   fi
#   echo "When prompted, enter guest's password."   https://forum.porteus.org/viewtopic.php?p=63884#p63884
   echo guest | sudo -S -u root mloop $Changes/porteussave.dat &>/dev/null        
   SDspace=$(df -BM --output=size,used,avail,pcent /mnt/loop | tail -n1)
   Changes=$Changes/porteussave.dat
   echo guest | sudo -S -u root uloop &>/dev/null
fi
# echo $SDspace
read size used avail percent <<< $SDspace
if [ ${percent%\%} -ge 85 ]; then
#   echo 
#   redwarning "Warning! save.dat file $percent full.  Used: $used  Free: $avail"
#   echo 
   if [ "$(which kdialog &>/dev/null)" ]; then
#      kdialog --msgbox "save.dat file $percent FULL....Used: $used....FREE: $avail" 
       kdislog --rc-file /home/guest/Savedat/redbg.rc --title $Changes --msgbox "save.dat file $percent FULL....Used: $used....FREE: $avail"
      exit
   else
#     Xdialog --msgbox "save.dat file $percent full.  Used: $used  Free: $avail" 33 128 
      Xdialog --rc-file /home/guest/Savedat/redbg.rc --title $Changes --msgbox "save.dat file $percent FULL - Used: $used - FREE: $avail" 5 60
      exit
   fi
   sleep 5
else
#   echo "save.dat file $percent full.  Used: $used  Free: $avail"
   if [ "$(which kdialog &>/dev/null)" ]; then
      kdialog --msgbox "save.dat file $percent full....Used: $used....Free: $avail"  
      exit
   else
#     Xdialog --msgbox "save.dat file $percent full.  Used: $used  Free: $avail" 33 128 
      Xdialog --rc-file /home/guest/Savedat/bluetxt.rc --title $Changes --msgbox "save.dat file $percent full - Used: $used - Free: $avail" 5 60
      exit
   fi
# http://xdialog.free.fr/doc/common.html#RCFILE
# http://www.murga-linux.com/puppy/viewtopic.php?p=523767&#523767
# guest@porteus:~$ Xdialog --colorsel 0 0 0
fi
Do not let all the code scare you, I boot ISOs and different versions of Porteus but the basic code should run for you as is.
Ed

Post Reply