Mtl_Biker
Posts: 52
Joined: Tue Jun 04, 2019 9:05 pm
Location: Montreal, Canada

Is reboot safe?

Mon Jun 10, 2019 1:54 pm

In terms of possible uSD card corruption, is reboot as safe as a shutdown?

(I was logged into my RPi via VNC and from the menu issued a reboot. Now I can't get back onto the RPi with VNC or even with a Terminal (Putty). I'm going to have to connect a keyboard, mouse and monitor to the RPi to see if it's still alive.)

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5775
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Is reboot safe?

Mon Jun 10, 2019 1:58 pm

Mtl_Biker wrote: In terms of possible uSD card corruption, is reboot as safe as a shutdown?
Yes, it goes through the same process.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 4998
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Is reboot safe?

Mon Jun 10, 2019 2:29 pm

Mtl_Biker wrote:
Mon Jun 10, 2019 1:54 pm
...
(I was logged into my RPi via VNC and from the menu issued a reboot. Now I can't get back onto the RPi with VNC or even with a Terminal (Putty). I'm going to have to connect a keyboard, mouse and monitor to the RPi to see if it's still alive.)
Do you normally boot to command-line or to the Desktop? Why did you need to reboot? (eg. had you installed some additional/new software - if so, what?)
Trev.
Still running Raspbian Jessie on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) but Stretch on my 2xP3A+, P3B+, P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

Mtl_Biker
Posts: 52
Joined: Tue Jun 04, 2019 9:05 pm
Location: Montreal, Canada

Re: Is reboot safe?

Mon Jun 10, 2019 2:35 pm

I normally reboot to the desktop. And I had to reboot because I'd made a mistake... I was connected via VNC and found my mouse (actually a Wacom tablet) wasn't working and I couldn't navigate around the RPi. My mistake was thinking something was wrong with the RPi, instead of what it actually was... my cat had walked over the Wacom tablet and hit the button that turns off the touch pad. Duh. (I've punished the cat. :) No tv for a week.)

Anyway, after the reboot I wasn't able to connect to the RPi via VNC or Terminal. I attached USB keyboard and mouse and the monitor and there was no action at all... even the screen was blank. So, fearing the worst (corrupted uSD card) I pulled the power plug, waited a minute and reapplied power. All appears to be back to normal again. <BIG SIGH OF RELIEF>

Thank you.

gkaiseril
Posts: 627
Joined: Mon Aug 08, 2016 9:27 pm
Location: Chicago, IL

Re: Is reboot safe?

Mon Jun 10, 2019 2:40 pm

Can you clearify "cannot login?"

Can you get to the login prompt?

It is possible that the Pi has been reassigned a new IP address.
f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 4998
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Is reboot safe?

Mon Jun 10, 2019 2:47 pm

Mtl_Biker wrote:
Mon Jun 10, 2019 2:35 pm
I normally reboot to the desktop. And I had to reboot because I'd made a mistake... I was connected via VNC and found my mouse (actually a Wacom tablet) wasn't working and I couldn't navigate around the RPi. My mistake was thinking something was wrong with the RPi, instead of what it actually was... my cat had walked over the Wacom tablet and hit the button that turns off the touch pad. Duh. (I've punished the cat. :) No tv for a week.)

Anyway, after the reboot I wasn't able to connect to the RPi via VNC or Terminal. I attached USB keyboard and mouse and the monitor and there was no action at all... even the screen was blank. So, fearing the worst (corrupted uSD card) I pulled the power plug, waited a minute and reapplied power. All appears to be back to normal again. <BIG SIGH OF RELIEF>

Thank you.
I'm guessing the cat's walk had also instigated some odd "commands" that upset the subsequent reboot. Our cat (Fudge, to the right of my head in the avatar) thinks that all tablets, netbooks etc. in the household have a "pet" mouse within them and sometimes manages to get it to appear ;)
Trev.
Still running Raspbian Jessie on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) but Stretch on my 2xP3A+, P3B+, P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

fanoush
Posts: 460
Joined: Mon Feb 27, 2012 2:37 pm

Re: Is reboot safe?

Mon Jun 10, 2019 2:48 pm

Mtl_Biker wrote:
Mon Jun 10, 2019 2:35 pm
way, after the reboot I wasn't able to connect to the RPi via VNC or Terminal. I attached USB keyboard and mouse and the monitor and there was no action at all... even the screen was blank. So, fearing the worst (corrupted uSD card) I pulled the power plug, waited a minute and reapplied power. All appears to be back to normal again. <BIG SIGH OF RELIEF>
Did you do 'sudo apt-get dist-upgrade' recently? This happened to me after kernel/firmware upgrade. I had to powerdown and boot so that it would boot properly. Just doing reboot to newer firmware/kernel would hang the device like this. It was very rare and not typical but happened few times.

Mtl_Biker
Posts: 52
Joined: Tue Jun 04, 2019 9:05 pm
Location: Montreal, Canada

Re: Is reboot safe?

Mon Jun 10, 2019 9:02 pm

gkaiseril wrote:
Mon Jun 10, 2019 2:40 pm
Can you clearify "cannot login?"

Can you get to the login prompt?

It is possible that the Pi has been reassigned a new IP address.
As I said 5 minutes before your reply, all is back to normal again. After the reboot I was able to log in locally, remotely through Real VNC and through Terminal. I have no idea what was wrong before, but all is well. Thanks for trying to help.

Mtl_Biker
Posts: 52
Joined: Tue Jun 04, 2019 9:05 pm
Location: Montreal, Canada

Re: Is reboot safe?

Mon Jun 10, 2019 9:06 pm

fanoush wrote:
Mon Jun 10, 2019 2:48 pm
Mtl_Biker wrote:
Mon Jun 10, 2019 2:35 pm
way, after the reboot I wasn't able to connect to the RPi via VNC or Terminal. I attached USB keyboard and mouse and the monitor and there was no action at all... even the screen was blank. So, fearing the worst (corrupted uSD card) I pulled the power plug, waited a minute and reapplied power. All appears to be back to normal again. <BIG SIGH OF RELIEF>
Did you do 'sudo apt-get dist-upgrade' recently? This happened to me after kernel/firmware upgrade. I had to powerdown and boot so that it would boot properly. Just doing reboot to newer firmware/kernel would hang the device like this. It was very rare and not typical but happened few times.
No, not recently. Actually, never. "dist-upgrade"? I've done 'sudo apt-get upgrade' and 'update' but I don't (yet) know what dist-upgrade is.

User avatar
rpdom
Posts: 14746
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Is reboot safe?

Tue Jun 11, 2019 4:38 am

Mtl_Biker wrote:
Mon Jun 10, 2019 9:06 pm
Actually, never. "dist-upgrade"? I've done 'sudo apt-get upgrade' and 'update' but I don't (yet) know what dist-upgrade is.
"dist-upgrade" is very rarely needed on Raspbian.

The main differences is that "upgrade" will upgrade all installed packages - as long as that does not require the removal of any packages, or the installation of additional packages.

"dist-upgrade" will remove packages and install additional packages.

For example, say you had "bob" version 1.0 installed and version 1.1 was released - however "bob" 2.0 now requires "harry" 2.0 to be installed, but "harry" is currently not installed at all. "upgrade" would refuse to upgrade "bob" because it would mean installing the additional package "harry". "dist-upgrade" would install "harry". Additionally, if "bob" 1.0 required "steve" 1.0, so that was installed, but "bob" 2.0 won't work with "steve" installed, "upgrade" would leave "bob" at 1.0, while "dist-upgrade" would upgrade "bob" and remove "steve".

This sort of situation rarely occurs, typically when upgrading from one release to another (jessie to stretch, or stretch to buster), but as the general Raspbian way seems to be "start again with a new download", you'll almost never hit this scenario.

You'll know when you do. When you do an "upgrade" on the command line, you get a message like this:

Code: Select all

14 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
If the "not upgraded" count is not zero, that's when a "dist-upgrade" is probably required.

fanoush
Posts: 460
Joined: Mon Feb 27, 2012 2:37 pm

Re: Is reboot safe?

Tue Jun 11, 2019 8:42 am

rpdom wrote:
Tue Jun 11, 2019 4:38 am
This sort of situation rarely occurs, typically when upgrading from one release to another (jessie to stretch, or stretch to buster), but as the general Raspbian way seems to be "start again with a new download", you'll almost never hit this scenario.
While it occurs rarely it depends only on package maintainers and can happen anytime so basically if one wants to update to latest, dist-upgrade is the only sensible way to do it without breaking stuff.
check e.g. this https://askubuntu.com/questions/194651/ ... st-upgrade

IMO unless you are skilled administrator dist-upgrade is the normal way to upgrade. apt-get upgrade can give you more headache and is almost never what you want.

fruitoftheloom
Posts: 20150
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Is reboot safe?

Tue Jun 11, 2019 8:52 am

fanoush wrote:
Tue Jun 11, 2019 8:42 am
rpdom wrote:
Tue Jun 11, 2019 4:38 am
This sort of situation rarely occurs, typically when upgrading from one release to another (jessie to stretch, or stretch to buster), but as the general Raspbian way seems to be "start again with a new download", you'll almost never hit this scenario.
While it occurs rarely it depends only on package maintainers and can happen anytime so basically if one wants to update to latest, dist-upgrade is the only sensible way to do it without breaking stuff.
check e.g. this https://askubuntu.com/questions/194651/ ... st-upgrade

IMO unless you are skilled administrator dist-upgrade is the normal way to upgrade. apt-get upgrade can give you more headache and is almost never what you want.

Code: Select all

sudo apt update
sudo apt full-upgrade
adieu

Asus CS10 Chromebit / HP Envy 4500 Wireless Printer / Raspberry Pi Model 2B v1.1 / RealVNC Software...

User avatar
B.Goode
Posts: 8046
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Is reboot safe?

Tue Jun 11, 2019 8:53 am

"dist-upgrade" is very rarely needed on Raspbian



The detailed workings of apt and dpkg are too arcane for me, so you may be right.

But in that case can you persuade the Raspberry Pi Foundation that their documentation is wrong?

To update software in Raspbian, you can use the apt tool in a terminal. Open a terminal window from the taskbar or application menu:


First, update your system's package list by entering the following command:

sudo apt-get update
Next, upgrade all your installed packages to their latest versions with the following command:

sudo apt-get dist-upgrade
Generally speaking, doing this regularly will keep your installation up to date, in that it will be equivalent to the latest released image available from raspberrypi.org/downloads.
Ref: https://www.raspberrypi.org/documentati ... pdating.md

User avatar
rpdom
Posts: 14746
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Is reboot safe?

Tue Jun 11, 2019 8:55 am

fanoush wrote:
Tue Jun 11, 2019 8:42 am
rpdom wrote:
Tue Jun 11, 2019 4:38 am
This sort of situation rarely occurs, typically when upgrading from one release to another (jessie to stretch, or stretch to buster), but as the general Raspbian way seems to be "start again with a new download", you'll almost never hit this scenario.
While it occurs rarely it depends only on package maintainers and can happen anytime so basically if one wants to update to latest, dist-upgrade is the only sensible way to do it without breaking stuff.
check e.g. this https://askubuntu.com/questions/194651/ ... st-upgrade

IMO unless you are skilled administrator dist-upgrade is the normal way to upgrade. apt-get upgrade can give you more headache and is almost never what you want.
That may apply to Ubuntu where things often break in my experience, but not to Debian or Raspbian where a more conservative approach to package releases is used.

User avatar
davidcoton
Posts: 3945
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Is reboot safe?

Tue Jun 11, 2019 8:58 am

fanoush wrote:
Tue Jun 11, 2019 8:42 am
rpdom wrote:
Tue Jun 11, 2019 4:38 am
This sort of situation rarely occurs, typically when upgrading from one release to another (jessie to stretch, or stretch to buster), but as the general Raspbian way seems to be "start again with a new download", you'll almost never hit this scenario.
While it occurs rarely it depends only on package maintainers and can happen anytime so basically if one wants to update to latest, dist-upgrade is the only sensible way to do it without breaking stuff.
check e.g. this https://askubuntu.com/questions/194651/ ... st-upgrade

IMO unless you are skilled administrator dist-upgrade is the normal way to upgrade. apt-get upgrade can give you more headache and is almost never what you want.
That is not quite true. There is a (marginally) better way.

The apt-get commands are optimised for use in scripts. They have been supplemented by shorter commands optimeised for command-line use:

Code: Select all

sudo apt update # instead of sudo apt-get update
sudo apt upgrade # instead of sudo apt-get upgrade

sudo apt update
sudo apt full-upgrade # instead of sudo apt-get dist-upgrade
The choice of upgade or full-upgrade is largely a matter of choice -- as posted by rpdom, one option is to use upgrade first and then use full-upgrade if there are problems. The other is to use full-upgrade always.
Signature retired

User avatar
rpdom
Posts: 14746
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Is reboot safe?

Tue Jun 11, 2019 8:59 am

B.Goode wrote:
Tue Jun 11, 2019 8:53 am
"dist-upgrade" is very rarely needed on Raspbian



The detailed workings of apt and dpkg are too arcane for me, so you may be right.

But in that case can you persuade the Raspberry Pi Foundation that their documentation is wrong?

To update software in Raspbian, you can use the apt tool in a terminal. Open a terminal window from the taskbar or application menu:


First, update your system's package list by entering the following command:

sudo apt-get update
Next, upgrade all your installed packages to their latest versions with the following command:

sudo apt-get dist-upgrade
Generally speaking, doing this regularly will keep your installation up to date, in that it will be equivalent to the latest released image available from raspberrypi.org/downloads.
Ref: https://www.raspberrypi.org/documentati ... pdating.md
It wouldn't hurt to use dist-upgrade, so the documentation isn't wrong as such, but it is rare that it is needed. I can't remember the last time I had to use it on a Pi, other then when I've upgraded from one release to another, or have run a mixed system with say Stretch and Buster packages, or in one extreme case I currently have some Stretch, Buster and Sid packages installed.

fanoush
Posts: 460
Joined: Mon Feb 27, 2012 2:37 pm

Re: Is reboot safe?

Tue Jun 11, 2019 10:09 am

rpdom wrote:
Tue Jun 11, 2019 8:59 am
It wouldn't hurt to use dist-upgrade, so the documentation isn't wrong as such, but it is rare that it is needed.
So you are only trying to save typing few letters (and so if 'dist-upgrade' would be renamed to 'u' you would start using it immediatelly) or do you believe the 'upgrade' is somehow safer or quicker?

What I tried to say is that for newbies 'dist-upgrade' is safer and that's why it is perhaps also mentioned in the docs instead of upgrade. There is no reason for newbies not to use it by default. It will solve all the dependencies and do the right thing for whole distribution to stay up to date even if it means adding or removing packages (which are often unknown and opaque to typical user).

Mtl_Biker
Posts: 52
Joined: Tue Jun 04, 2019 9:05 pm
Location: Montreal, Canada

Re: Is reboot safe?

Tue Jun 11, 2019 12:30 pm

rpdom wrote:
Tue Jun 11, 2019 4:38 am

"dist-upgrade" is very rarely needed on Raspbian.

The main differences is that "upgrade" will upgrade all installed packages - as long as that does not require the removal of any packages, or the installation of additional packages.

"dist-upgrade" will remove packages and install additional packages.

For example, say you had "bob" version 1.0 installed and version 1.1 was released - however "bob" 2.0 now requires "harry" 2.0 to be installed, but "harry" is currently not installed at all. "upgrade" would refuse to upgrade "bob" because it would mean installing the additional package "harry". "dist-upgrade" would install "harry". Additionally, if "bob" 1.0 required "steve" 1.0, so that was installed, but "bob" 2.0 won't work with "steve" installed, "upgrade" would leave "bob" at 1.0, while "dist-upgrade" would upgrade "bob" and remove "steve".

This sort of situation rarely occurs, typically when upgrading from one release to another (jessie to stretch, or stretch to buster), but as the general Raspbian way seems to be "start again with a new download", you'll almost never hit this scenario.

You'll know when you do. When you do an "upgrade" on the command line, you get a message like this:

Code: Select all

14 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
If the "not upgraded" count is not zero, that's when a "dist-upgrade" is probably required.
Great explanation! Thanks!

Return to “Beginners”