User avatar
nl3prc
Posts: 176
Joined: Sun Jul 24, 2016 12:39 pm
Location: Den Helder the netherlands

Re: drive name changsing

Sun Sep 19, 2021 9:47 am

Code: Select all

root@raspberrypi:/# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        30G  9.3G   19G  34% /
devtmpfs        181M     0  181M   0% /dev
tmpfs           186M     0  186M   0% /dev/shm
tmpfs           186M   17M  169M   9% /run
tmpfs           5.0M   12K  5.0M   1% /run/lock
tmpfs           186M     0  186M   0% /sys/fs/cgroup
/dev/mmcblk0p1   63M   23M   41M  36% /boot
/dev/sda4        80G   50G   27G  65% /media/root
tmpfs            38M     0   38M   0% /run/user/0
root@raspberrypi:/# blkid
/dev/mmcblk0p1: SEC_TYPE="msdos" LABEL="boot" UUID="2D2D-CD16" TYPE="vfat" PARTUUID="914ba946-01"
/dev/mmcblk0p2: LABEL="nl3prc" UUID="c6d7eacf-06eb-4fec-8919-ff040ba15171" TYPE="ext4" PARTUUID="914ba946-02"
/dev/sda3: TYPE="swap" PARTUUID="22582257-03"
/dev/sda4: UUID="852d2220-1675-4680-8ad3-622ec57b42e9" TYPE="ext3" PARTUUID="22582257-04"
/dev/mmcblk0: PTUUID="914ba946" PTTYPE="dos"
/dev/sda2: PARTUUID="22582257-02"
root@raspberrypi:/#
yes that works fine but i think that the ide drive that i connected via a usb poort is not initiolizing before fstab so fstab can't find the drive

User avatar
scruss
Posts: 4360
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: drive name changsing

Sun Sep 19, 2021 9:18 pm

This is a long shot, but if the USB-IDE interface is taking a long time to come up, perhaps adding the _netdev device option would help. _netdev is meant for network devices, but every USB device should be enumerated by the time the network is up
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

GlowInTheDark
Posts: 2035
Joined: Sat Nov 09, 2019 12:14 pm

Re: drive name changsing

Sun Sep 19, 2021 10:06 pm

Wouldn't it be easier to just scrap fstab - which seems to be on ongoing source of pain and frustration - and just setup some kind of user-space run-this-stuff-sometime-after-system-boot process to handle mounting the drive?

That's what I always do. It works well and keeps things under user-control (for when things go wrong, as they always, inevitably, do).
Poster of inconvenient truths.

Linux zealot and proud of it.

"nokcid" wants to date me.

User avatar
thagrol
Posts: 5764
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: drive name changsing

Mon Sep 20, 2021 12:30 am

GlowInTheDark wrote:
Sun Sep 19, 2021 10:06 pm
Wouldn't it be easier to just scrap fstab - which seems to be on ongoing source of pain and frustration - and just setup some kind of user-space run-this-stuff-sometime-after-system-boot process to handle mounting the drive?

That's what I always do. It works well and keeps things under user-control (for when things go wrong, as they always, inevitably, do).
Like systemd mount units? fstab gets converted to those then mounts get done by systemd.
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

User avatar
thagrol
Posts: 5764
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: drive name changsing

Mon Sep 20, 2021 12:43 am

scruss wrote:
Sun Sep 19, 2021 9:18 pm
This is a long shot, but if the USB-IDE interface is taking a long time to come up, perhaps adding the _netdev device option would help. _netdev is meant for network devices, but every USB device should be enumerated by the time the network is up
Or add x-systemd.device-timeout=N where N is the number of seconds to wait for the device to show up and x-systemd.mount-timeout=N where N is the number of seconds to wait for the mount to complete. If either timeout the mount will be treated as failed.

See https://www.freedesktop.org/software/sy ... mount.html and use nofail with those in fstab to avoid the previously described (several times, in fact) boot behaviour if the mount fails.

It may be worth considering x-systemd.automount too (also in the link above)
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

GlowInTheDark
Posts: 2035
Joined: Sat Nov 09, 2019 12:14 pm

Re: drive name changsing

Mon Sep 20, 2021 3:24 am

Like systemd mount units?
No. I don't do systemd (*). As you well know.

(*) If I can help it...
Poster of inconvenient truths.

Linux zealot and proud of it.

"nokcid" wants to date me.

geffers
Posts: 528
Joined: Sun Jun 24, 2012 6:25 am
Location: UK
Contact: Website

Re: drive name changsing

Mon Sep 20, 2021 7:49 am

DougieLawson wrote:
Thu Sep 16, 2021 3:38 pm
nl3prc wrote:
Thu Sep 16, 2021 3:22 pm
Hi all i run rasbian jesse 2016
Why? What possible reasons do you have for running an OS that was launched in Sept 2015 and went end-of-life in Sept 2017?
What is stopping you upgrading to RaspiOS Buster and getting six years of bug fixes and enhancements installed on your system?

Drive letters changing is always due to an insufficient power supply to keep the drive spinning.
Sometimes a drive ID may alter for reasons other than voltage.

On my Ubuntu laptop the built in hard drive is obviously sda but if I plug in an external USB that has an operating system on it that becomes sda and my internal becomes sdb- can be frustrating for grub updates.

Guess the operating system device is always (or normally) sda

It may be a better idea to use partition uuid - that way matters not if it is sda - sdb or SDZ 😎

Useful command if you was to maybe use uuid or partuuid as follows;

ls -l /dev/disk/by-uuid
ls -l /dev/disk/by-partuuid

But, as Dougie said, upgrade, why use an old system unless for retro reasons.

Geoff


Probably best to use uuid or partition uuid.

GlowInTheDark
Posts: 2035
Joined: Sat Nov 09, 2019 12:14 pm

Re: drive name changsing

Mon Sep 20, 2021 9:13 am

But, as Dougie said, upgrade, why use an old system unless for retro reasons.
There is a very simple, obvious, and incontrovertible answer to that question:

Because there is no supported way to upgrade from one version to the next.

Let that sink in.

Now, that should be enough. That should be all that needs to be said. But people will say, "Oh, but you can upgrade".

Those people are wrong. They are flat-earthers. EOS.
Poster of inconvenient truths.

Linux zealot and proud of it.

"nokcid" wants to date me.

User avatar
thagrol
Posts: 5764
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: drive name changsing

Mon Sep 20, 2021 11:47 am

geffers wrote:
Mon Sep 20, 2021 7:49 am

Sometimes a drive ID may alter for reasons other than voltage.

On my Ubuntu laptop the built in hard drive is obviously sda but if I plug in an external USB that has an operating system on it that becomes sda and my internal becomes sdb- can be frustrating for grub updates.
Device nodes for a drive can change for many reasons: enumerated in a different order, plugged into a different SATA port, a different USB port, different connector on the cable (for IDE devices), etc. Voltage alone isn't really a factor
Guess the operating system device is always (or normally) sda
Nope. In your example the USB bootable media probably enumerates the USB bus first. The system drive is not "locked" to sda, on most Pi it's mmcblk0. On some it's sda, on others it's on NFS. Same applies to any linux computer.
Probably best to use uuid or partition uuid.
As already suggested by several of us. And please, stop with the giant smilies.
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

bjtheone
Posts: 1502
Joined: Mon May 20, 2019 11:28 pm
Location: The Frozen North (AKA Canada)

Re: drive name changsing

Mon Sep 20, 2021 1:53 pm

GlowInTheDark wrote:
Mon Sep 20, 2021 9:13 am
But, as Dougie said, upgrade, why use an old system unless for retro reasons.
There is a very simple, obvious, and incontrovertible answer to that question:

Because there is no supported way to upgrade from one version to the next.

Let that sink in.

Now, that should be enough. That should be all that needs to be said. But people will say, "Oh, but you can upgrade".

Those people are wrong. They are flat-earthers. EOS.
For anything connected in any way to an external network, you really NEED to do system maintenance. In my books, said maintenance contains system upgrades to stay on a supported/patched release. YMMV

Been involved with computers for a long time (including a fair amount of time getting paid to do it for large corporations), and honestly Linux is one of the easier OSs to deal with release upgrades on.

User avatar
nl3prc
Posts: 176
Joined: Sun Jul 24, 2016 12:39 pm
Location: Den Helder the netherlands

Re: drive name changsing

Mon Sep 20, 2021 2:28 pm

sins i have a ax25 sartup file that comes at the end of bootup i placed the folowing line at the bottem
and that works fine for me

Code: Select all

mount PARTUUID="22582257-04" /media/root -w   

User avatar
nl3prc
Posts: 176
Joined: Sun Jul 24, 2016 12:39 pm
Location: Den Helder the netherlands

Re: drive name changsing

Mon Sep 20, 2021 3:37 pm

I have made a mistake instead of editen the fstab file i edit the .fstab witch is a hidden file he now even checks de hd after a number of mounts 8-)

User avatar
thagrol
Posts: 5764
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: drive name changsing

Mon Sep 20, 2021 4:41 pm

nl3prc wrote:
Mon Sep 20, 2021 3:37 pm
I have made a mistake instead of editen the fstab file i edit the .fstab witch is a hidden file he now even checks de hd after a number of mounts 8-)
That explains an awful lot.
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

GlowInTheDark
Posts: 2035
Joined: Sat Nov 09, 2019 12:14 pm

Re: drive name changsing

Mon Sep 20, 2021 6:42 pm

For anything...
I think this comment should have been posted as a standalone comment (perhaps in a separate thread), since it had nothing to do with the text that it quoted. I assume this was just an oversight on the part of the poster.
Poster of inconvenient truths.

Linux zealot and proud of it.

"nokcid" wants to date me.

GlowInTheDark
Posts: 2035
Joined: Sat Nov 09, 2019 12:14 pm

Re: drive name changsing

Mon Sep 20, 2021 6:43 pm

That explains an awful lot.
Indeed. Is .fstab (i.e., fstab with a leading dot) even "a thing" ?
Poster of inconvenient truths.

Linux zealot and proud of it.

"nokcid" wants to date me.

User avatar
thagrol
Posts: 5764
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: drive name changsing

Mon Sep 20, 2021 7:33 pm

GlowInTheDark wrote:
Mon Sep 20, 2021 6:43 pm
That explains an awful lot.
Indeed. Is .fstab (i.e., fstab with a leading dot) even "a thing" ?
AFAIK it's a thing to the extent that it is a valid filename and a file with that name can exist. It's not a thing in terms of configuring which partitions get mounted where.
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

GlowInTheDark
Posts: 2035
Joined: Sat Nov 09, 2019 12:14 pm

Re: drive name changsing

Mon Sep 20, 2021 8:26 pm

The definition of being "a thing" is being a significant thing. And you have adequately answered that in the negative.
Poster of inconvenient truths.

Linux zealot and proud of it.

"nokcid" wants to date me.

User avatar
nl3prc
Posts: 176
Joined: Sun Jul 24, 2016 12:39 pm
Location: Den Helder the netherlands

Re: drive name changsing

Tue Sep 21, 2021 8:57 am

I hoppe this also solf the change from sda to sdb

User avatar
thagrol
Posts: 5764
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: drive name changsing

Tue Sep 21, 2021 9:00 am

nl3prc wrote:
Tue Sep 21, 2021 8:57 am
I hoppe this also solf the change from sda to sdb
Probably not but if you're yusing UUID or PARTUUID to mount that won't matter.
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

emma1997
Posts: 1646
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: drive name changsing

Fri Sep 24, 2021 4:45 pm

I'm guessing that even if desktop mounts with UUID then, unlike some utils, dd will not recognize it? It would be great if it did and could skip perusing lsblk step every time before restoring.

I would test it out now but this setup I use for internet is not my own and can't risk bricking anything ATM. Too many others depend on it for access. I just need to remember to log out every time or else...

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

Re: drive name changsing

Fri Sep 24, 2021 5:09 pm

emma1997 wrote:
Fri Sep 24, 2021 4:45 pm
I'm guessing that even if desktop mounts with UUID then, unlike some utils, dd will not recognize it?
dd neither knows nor cares about such things. You give it an input file/device and an output file/device and off it goes. You provide the names of those files.
Unreadable squiggle

emma1997
Posts: 1646
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: drive name changsing

Fri Sep 24, 2021 5:16 pm

I was talking about the destination device not the source when restoring images. It would be nice to use volume name or even UUID if they do not change instead of that sdx BS to avoid catastrophe. Not me (yet, knock on wood) but I know of more than a few who killed their main drive by accident. It is however my biggest remaining concern switching from Wintel to Nixieland.

User avatar
thagrol
Posts: 5764
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: drive name changsing

Fri Sep 24, 2021 5:24 pm

emma1997 wrote:
Fri Sep 24, 2021 5:16 pm
I was talking about the destination device not the source when restoring images. It would be nice to use volume name or even UUID if they do not change instead of that sdx BS to avoid catastrophe. Not me (yet, knock on wood) but I know of more than a few who killed their main drive by accident. It is however my biggest remaining concern switching from Wintel to Nixieland.
Try looking in /dev/disk-by/ and check that path as I'm on a mobile ATM. It'll be a symlink to the device node so in theory it'll work with dd but it's not something I've tested.
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

User avatar
dickon
Posts: 2028
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, in Towcester

Re: drive name changsing

Fri Sep 24, 2021 5:33 pm

thagrol wrote:
Fri Sep 24, 2021 5:24 pm
Try looking in /dev/disk-by/ and check that path as I'm on a mobile ATM. It'll be a symlink to the device node so in theory it'll work with dd but it's not something I've tested.
It works.
As it is apparently board policy to disallow any criticism of anything, as it appears to criticise something is to criticise all the users of that something, I will no longer be commenting in threads which are not directly relevant to my uses of the Pi.

emma1997
Posts: 1646
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: drive name changsing

Fri Sep 24, 2021 5:41 pm

Not sure about symlink because I can't play with too many things I don't understand ATM but ls or cat /dev/disk-by/, as often happens, gets me "No such file or directory". Even with pretty-sudo. There is considerable confusion in my mind between /media/pi and /dev so IDK.

Would be nice have some way of using dd to restore images w/less risk.

Return to “Advanced users”