Re: Help: disk swap

2022-08-02 Thread Chuck Zmudzinski
On 7/27/2022 1:51 PM, Erik Mathis wrote:
> I would look at the UEFI vs BIOS boot options in the "backup" server and 
> compare it to the "broken" server and make sure they are the same. Also check 
> for BIOS updates and such.
>
>
> -Erik-
>
>
> On Wed, Jul 27, 2022 at 7:59 AM tony  wrote:
>
> Hi,
>
> I turned on my main home server after a few weeks absence,  and got
> smoke from its power supply. Fortunately, I have a backup system, which
> does work; both are running Debian 10, so I swapped use to that machine.
> and am able to work with that, but some of the files and settings are a
> bit out of date.
>
> I decided to move the disk from the broken machine to the backup, but on
> booting I'm dropped into a grub screen saying disk id  not
> found. Not entirely surprising perhaps.
>
> So, how do I get it to recognize, and boot from the old disK.
>
> Cheers, Tony
>

I have used the following procedure to fix booting from a disk that
causes the system to drop to the grub shell instead of booting normally:

When in the grub shell, type ls, and you will see a list of the available
disks and partitions. You will see items like (hd0,gpt1) which would be
the first gpt partition on the first disk. Then you can list the files in that
partition using 'ls (hd0,gpt1)/'. You should then look for the partition with
the boot/grub/grub.cfg file, and then use the configfile command from
the grub shell to load the grub configuration on the disk from the broken
machine which should allow you to boot the Debian system that is on that
disk. For example, if the grub.cfg file is on (hd0,gpt1), then you do:

grub> configfile (hd0,gpt1)/boot/grub/grub.cfg

Hopefully you will see the normal grub menu giving you the option to
select on OS to boot, and hopefully you will be able to boot the Debian
that is on the disk from the broken machine.

If you can get the Debian system on the disk from the broken machine running,
then you will need to reinstall grub to update your grub so it can boot using 
the
disk from the broken machine without dropping to the grub shell. For example,
If you use efi, you will need to reinstall grub-efi-amd64-bin or maybe
grub-efi-amd64-bin-signed for secure boot, and after that it should boot the
disk from the broken machine without dropping to the grub shell.

Chuck



Re: Help: disk swap

2022-08-02 Thread mick.crane

On 2022-08-02 05:17, David wrote:


And then use something like this:
  https://www.newegg.com/sabrent-ec-dflt-dock/p/N82E16817366069
to connect disk "A" to machine "B".


StarTech external caddies/connectors seem OK.

mick



Re: Help: disk swap

2022-08-02 Thread Jude DaShiell
The second disk would need to be connected to the running linux in some
way either by a disk dock or a disk caddy such that the running linux
could find the second disk using lsblk and blkid.  Once located, parted -a
optimal /dev/xxx and then print to show the partition table then quit on
/dev/xxx could reveal boot partition information.  I have a disk caddy
here for sata disks which has its own power supply and that caddy also
boots external ssd drives once inserted correctly since the connectors for
sata and ssd are identical.



On Tue, 2 Aug 2022, David wrote:

> On Tue, 2 Aug 2022 at 13:25, David Wright  wrote:
> > On Thu 28 Jul 2022 at 14:29:32 (+0100), tony van der Hoff wrote:
> > > On 27/07/2022 16:07, Jude DaShiell wrote:
>
> > > Thanks for your help. Sadly, I'm not getting very far with this. I
> > > guess I'm not understanding your instructions too well:
> > >
> > > > Have the running linux system on the machine.  Run lsblk to locate the
> > > > name of the boot partition.
> > >
> > > I'll call the disk from the backup machine "B", and the disk I want to
> > > use "A".
>
> > The methodology below is unsuitable for you because you don't have
> > both disks in the machine at the same time.
>
> It would certainly be easier to help if that was the situation.
>
> We have been told that both machines were running Debian 10. But a
> problem is as yet we don't know if they have similar or different boot
> systems. That lack of information makes it very difficult to give advice.
>
> So trying to modify disk "A" to boot machine "B" could be tricky. But
> perhaps trying to get disk "A" to boot machine "B" is an XY problem that
> can be avoided, if maybe Tony only needs to recover some data off
> disk "A" onto disk "B".
>
> Given that Tony is not finding this easy, another approach that might
> be easier would be to keep the backup machine "B" intact and working
> and booting with its disk "B" connected as previously.
> And then use something like this:
>   https://www.newegg.com/sabrent-ec-dflt-dock/p/N82E16817366069
> to connect disk "A" to machine "B".
>
> And then the desired data can just be copied off it, and that might
> meet all Tony's needs.
>
> This method can also reveal evidence of what boot system is used by
> both machines, and would permit modifying disk "A" if that turns out
> to be necessary.
>
> I find this kind of drive dock very useful for admin flexibility and
> rescue tasks. I think they are a versatile and useful general purpose
> tool for tinkering. So, a worthwhile investment, in my opinion.
>
>



Re: Help: disk swap

2022-08-01 Thread David
On Tue, 2 Aug 2022 at 13:25, David Wright  wrote:
> On Thu 28 Jul 2022 at 14:29:32 (+0100), tony van der Hoff wrote:
> > On 27/07/2022 16:07, Jude DaShiell wrote:

> > Thanks for your help. Sadly, I'm not getting very far with this. I
> > guess I'm not understanding your instructions too well:
> >
> > > Have the running linux system on the machine.  Run lsblk to locate the
> > > name of the boot partition.
> >
> > I'll call the disk from the backup machine "B", and the disk I want to
> > use "A".

> The methodology below is unsuitable for you because you don't have
> both disks in the machine at the same time.

It would certainly be easier to help if that was the situation.

We have been told that both machines were running Debian 10. But a
problem is as yet we don't know if they have similar or different boot
systems. That lack of information makes it very difficult to give advice.

So trying to modify disk "A" to boot machine "B" could be tricky. But
perhaps trying to get disk "A" to boot machine "B" is an XY problem that
can be avoided, if maybe Tony only needs to recover some data off
disk "A" onto disk "B".

Given that Tony is not finding this easy, another approach that might
be easier would be to keep the backup machine "B" intact and working
and booting with its disk "B" connected as previously.
And then use something like this:
  https://www.newegg.com/sabrent-ec-dflt-dock/p/N82E16817366069
to connect disk "A" to machine "B".

And then the desired data can just be copied off it, and that might
meet all Tony's needs.

This method can also reveal evidence of what boot system is used by
both machines, and would permit modifying disk "A" if that turns out
to be necessary.

I find this kind of drive dock very useful for admin flexibility and
rescue tasks. I think they are a versatile and useful general purpose
tool for tinkering. So, a worthwhile investment, in my opinion.



Re: Help: disk swap

2022-08-01 Thread David Wright
On Thu 28 Jul 2022 at 14:29:32 (+0100), tony van der Hoff wrote:
> Thanks for your help. Sadly, I'm not getting very far with this. I
> guess I'm not understanding your instructions too well:
> 
> On 27/07/2022 16:07, Jude DaShiell wrote:
> > Have the running linux system on the machine.  Run lsblk to locate the
> > name of the boot partition.
> 
> I'll call the disk from the backup machine "B", and the disk I want to
> use "A".
> 
> 
> OK, on disk B:  lsblk sda9 /boot
> >  Once you have the name run blkid and copy the
> 
> sudo blkid
> /dev/sda9: LABEL="boot" UUID="3fe30767-f7d7-4e6d-b48e-f80eef2d4b71"
> 
> Now I'm lost.
> 
> Remove disk B, install disk A
> Boots into grub rescue.

The methodology below is unsuitable for you because you don't have
both disks in the machine at the same time.

> > uuid for use in the end of /etc/fstab and put in the path to the boot
> > device, the disk format ext4, defaults,nofail 1 2 on an fstab entry.
> > Next, run update-grub and you should get a new boot entry in grub.  If you
> > boot the machine on the boot screen hit down-arrow followed by enter and
> > your other disk should boot up.
> > I got a new computer with no sata tray in it and have a sata caddy and
> > some older sata disks and that's how I got those to boot.  hth.

You'd need to provide more information about both your computers and
how they boot in order to get better help. That would include whether
each one boots with EFI or the BIOS, and whether the disks are MBR
or GPT. It would help to know whether A's disk has a separate /boot
partition like B's does.

In the meantime, you could try the following commands from the Grub
Rescue prompt. It's not straightforward as only a subset of commands
will work. It's very likely to fail if the two computers boot in
different ways. All the disk and partition numbers below are just
examples: substitute according to what Grub finds present.

grub rescue> set pager=1

  in case you type a command that produces more than a page of output.

grub rescue> set

  will list the environment. The interesting ones are prefix and root,
  as these are the ones you might need to change.

grub rescue> ls

  should tell you what Grub calls your disk. It might look like:

  (hd0) (hd0,msdos4) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1)

  or ditto with msdos→gpt. If you only see:

  (hd0)

  then you should see the partitions by typing:

grub rescue> ls (hd0)

  If you know the partition layout of the disk, and where
  /boot is, then you can type:

grub rescue> set prefix=(hd0,msdos3)/grub
grub rescue> set prefix=(hd0,msdos2)/boot/grub

  The first is where /boot is separate and on the 3rd partition,
  whereas the second is where boot is in the root filesystem on
  the 2nd.

  Similarly, you need to set the root partition by typing:

grub rescue> set root=(hd0,msdos2)

  You'll notice that that would be appropriate for the second example
  above, where /boot was in the root filesystem.

  Say you don't know the layout of your disk. Then you have to poke
  around with ls, using commands like:

grub rescue> ls (hd0,msdos1)

  which, for a root filesystem, should show bin dev etc lib and so on.

  Once the prefix is set, you should be able to get more of Grub
  loaded by typing these two lines:

grub rescue> insmod normal
grub rescue> normal

  I can't remember if the prompt changes, but you should have more
  commands available now.

  At a minimum you need, for a system where /boot is not separate,
  but in the root (and first) partition:

grub> insmod linux
grub> linux /boot/vmlinuz-… root=/dev/sda1 ro single
grub> initrd /boot/initrd.img-…
grub> boot

  Filename completion should word at …, and note that the kernel
  root parameter uses kernel notation, not Grub's. (Fortunately,
  both count partitions from 1 nowadays.)

  It's possible that you need to insmod more modules, so report
  at which step it fails.

Cheers,
David.



Re: Help: disk swap

2022-07-28 Thread David
On Fri, 29 Jul 2022 at 02:32, Jude DaShiell  wrote:
>
> Then your new /etc/fstab record should
> look like:
> The email program split that line all
> of that should be on one line
> space-separated.  hth.
> 3fe30767-f7d7-4e6d-b48e-f80eef2d4b71
> /dev/sda9 ext4 defaults,nofail 1 2

Although it does no harm, "defaults," is unnecessary and can be
omitted there.

Because it specifies defaults.

And defaults are values that are used when nothing is specified.

It can be omitted because "nofail" by itself is sufficient to establish
column 4, so that later values occur in columns 5 and 6.

"defaults" in /etc/fstab should only ever be used by itself, in column
number 4, when a non-default (ie not 0) value is required for one of
the following columns. Its function is to occupy an otherwise empty
column number 4, so that what follows it on the same line occurs
in column 5.



Re: Help: disk swap

2022-07-28 Thread Jude DaShiell
Then your new /etc/fstab record should
look like:
The email program split that line all
of that should be on one line
space-separated.  hth.
3fe30767-f7d7-4e6d-b48e-f80eef2d4b71
/dev/sda9 ext4 defaults,nofail 1 2

On Thu, 28 Jul 2022, tony van der Hoff wrote:

> Thanks for your help. Sadly, I'm not getting very far with this. I guess I'm
> not understanding your instructions too well:
>
> On 27/07/2022 16:07, Jude DaShiell wrote:
> > Have the running linux system on the machine.  Run lsblk to locate the
> > name of the boot partition.
>
> I'll call the disk from the backup machine "B", and the disk I want to use
> "A".
>
>
> OK, on disk B:  lsblk sda9 /boot
> >  Once you have the name run blkid and copy the
>
> sudo blkid
> /dev/sda9: LABEL="boot" UUID="3fe30767-f7d7-4e6d-b48e-f80eef2d4b71"
>
> Now I'm lost.
>
> Remove disk B, install disk A
> Boots into grub rescue.
>
> > uuid for use in the end of /etc/fstab and put in the path to the boot
> > device, the disk format ext4, defaults,nofail 1 2 on an fstab entry.
> > Next, run update-grub and you should get a new boot entry in grub.  If you
> > boot the machine on the boot screen hit down-arrow followed by enter and
> > your other disk should boot up.
> > I got a new computer with no sata tray in it and have a sata caddy and
> > some older sata disks and that's how I got those to boot.  hth.
> >
> >
>
>
>



Re: Help: disk swap

2022-07-27 Thread Charlie Gibbs

On Wed Jul 27 10:30:05 2022 tony  wrote:

> I turned on my main home server after a few weeks absence,  and got
> smoke from its power supply. Fortunately, I have a backup system,
> which does work; both are running Debian 10, so I swapped use to that
> machine. and am able to work with that, but some of the files and
> settings are a bit out of date.
>
> I decided to move the disk from the broken machine to the backup, but
> on booting I'm dropped into a grub screen saying disk id 
> not found. Not entirely surprising perhaps.
>
> So, how do I get it to recognize, and boot from the old disK.

You might not be able to.  I once had a power supply fail
in such a way as to destroy the motherboard and the two
hard drives in the machine.  I lost about 180GB of stuff,
only some of which I was able to replace.  My backups are
_much_ better now.

Let's hope you're luckier than that.

--
/~\  Charlie Gibbs  |  Life is perverse.
\ /|  It can be beautiful -
 X   I'm really at ac.dekanfrus |  but it won't.
/ \  if you read it the right way.  |-- Lily Tomlin



Re: Help: disk swap

2022-07-27 Thread Erik Mathis
I would look at the UEFI vs BIOS boot options in the "backup" server and
compare it to the "broken" server and make sure they are the same. Also
check for BIOS updates and such.


-Erik-


On Wed, Jul 27, 2022 at 7:59 AM tony  wrote:

> Hi,
>
> I turned on my main home server after a few weeks absence,  and got
> smoke from its power supply. Fortunately, I have a backup system, which
> does work; both are running Debian 10, so I swapped use to that machine.
> and am able to work with that, but some of the files and settings are a
> bit out of date.
>
> I decided to move the disk from the broken machine to the backup, but on
> booting I'm dropped into a grub screen saying disk id  not
> found. Not entirely surprising perhaps.
>
> So, how do I get it to recognize, and boot from the old disK.
>
> Cheers, Tony
>
>


Re: Help: disk swap

2022-07-27 Thread Felix Miata
tony composed on 2022-07-27 12:37 (UTC+0100):

> I turned on my main home server after a few weeks absence,  and got
> smoke from its power supply. Fortunately, I have a backup system, which
> does work; both are running Debian 10, so I swapped use to that machine.
> and am able to work with that, but some of the files and settings are a
> bit out of date.

> I decided to move the disk from the broken machine to the backup, but on
> booting I'm dropped into a grub screen saying disk id  not
> found. Not entirely surprising perhaps.

> So, how do I get it to recognize, and boot from the old disK.

It could be as simple as striking the right key at POST. If you have two UEFI 
PCs
and the disks were installed in UEFI mode, you might be able to select the 
foreign
disk with a BBS key:

BBS Boot Keys

[*]ASRock   F11
[*]Asus F8
[*]Biostar  F9?
[*]Dell F12
[*]eCS  F10
[*]eMachinesF10
[*]EVGA F7
[*]Gigabyte F12
[*]HP   F9 or ESC or ESC,F9
[*]Lenovo   F12 or F8 or F10
[*]MSI  F11
[*]Toshiba  F12

If one PC was configured to use legacy mode while the other UEFI, you might need
to go into BIOS to enable the other mode.

There are all sorts of reasons possible for your predicament. David's reply 
covers
many ways to minimize or eliminate the inconvenience of a PC or disk failure, 
and
includes your providing information for helping us to help you.

One possible way to encounter your non-recognition situation is to add the other
disk rather than substituting. Swapping SATA cables between the two drives with
both installed at once might work around that issue.

The "name" Gene's reply refers to is called a volume label, easier for mere 
humans
to deal with than the UUIDs Grub uses by default, and referred to by Jude. Use
e2label or tune2fs to assign labels where they don't already exist on EXTn
filesystems. Volume labels are how I do all native Linux filesystem mounting and
booting, never UUIDs.
-- 
Evolution as taught in public schools is, like religion,
based on faith, not based on science.

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata



Re: Help: disk swap

2022-07-27 Thread David Christensen

On 7/27/22 04:37, tony wrote:

Hi,

I turned on my main home server after a few weeks absence,  and got
smoke from its power supply. Fortunately, I have a backup system, which
does work; both are running Debian 10, so I swapped use to that machine.
and am able to work with that, but some of the files and settings are a
bit out of date.

I decided to move the disk from the broken machine to the backup, but on
booting I'm dropped into a grub screen saying disk id  not
found. Not entirely surprising perhaps.

So, how do I get it to recognize, and boot from the old disK.

Cheers, Tony



Please provide a hardware inventory for each computer.


For each disk drive, please describe the purpose of the drive.


Please tell us how each computer is booted, what services are provided, 
and what data is stored.



Prior to the disaster, please tell us about your disaster preparedness 
measures.  Were backups, archives, images, etc., up-to-date?



Since the disaster, where is your live data?  Have your disaster 
preparedness measures changed?  Are your backups, archives, images, 
etc., up-to-date?



Have you repaired the main home server?  When the power supply failed, 
did anything else fail?



Suggestions:

1.  Install Debian onto a high quality USB 3.0 flash drive, to use for 
maintenance and troubleshooting.


2.  Buy a hardware power supply tester.

3.  Buy external drive adapters corresponding to whatever internal 
drives you use -- so that you can remove internal drives, connect them 
to the adapters, and access them using another computer.


4.  Do not be afraid to "throw money at the problem" -- e.g. maintain an 
inventory of spare parts and computers.  The last time I lost data was 
when I decided not to buy big, new, backup HDD's for a data migration.



David



Re: Help: disk swap

2022-07-27 Thread gene heskett

On 7/27/22 08:02, tony wrote:

Hi,

I turned on my main home server after a few weeks absence,  and got
smoke from its power supply. Fortunately, I have a backup system, which
does work; both are running Debian 10, so I swapped use to that machine.
and am able to work with that, but some of the files and settings are a
bit out of date.

I decided to move the disk from the broken machine to the backup, but on
booting I'm dropped into a grub screen saying disk id  not
found. Not entirely surprising perhaps.

So, how do I get it to recognize, and boot from the old disK.

Cheers, Tony

.

name the disk partition, and use that "name" in the /etc/fstab to mount it.
You may have to rerun grub install too.

Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 



Re: Help: disk swap

2022-07-27 Thread Jude DaShiell
Have the running linux system on the machine.  Run lsblk to locate the
name of the boot partition.  Once you have the name run blkid and copy the
uuid for use in the end of /etc/fstab and put in the path to the boot
device, the disk format ext4, defaults,nofail 1 2 on an fstab entry.
Next, run update-grub and you should get a new boot entry in grub.  If you
boot the machine on the boot screen hit down-arrow followed by enter and
your other disk should boot up.
I got a new computer with no sata tray in it and have a sata caddy and
some older sata disks and that's how I got those to boot.  hth.