Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #228878 > unrolled thread

adding a second HDD in debian

Started byAntonio Barragan <ajbg96r@gmail.com>
First post2020-11-21 23:40 +0100
Last post2020-11-22 00:30 +0100
Articles 5 — 5 participants

Back to article view | Back to linux.debian.user


Contents

  adding a second HDD in debian Antonio Barragan <ajbg96r@gmail.com> - 2020-11-21 23:40 +0100
    Re: adding a second HDD in debian Andy Smith <andy@strugglers.net> - 2020-11-22 00:00 +0100
    Re: adding a second HDD in debian Keith Bainbridge <ke1thozgroups@gmx.com> - 2020-11-22 00:10 +0100
    Re: adding a second HDD in debian Joe <joe@jretrading.com> - 2020-11-22 00:10 +0100
    Re: adding a second HDD in debian David Wright <deblis@lionunicorn.co.uk> - 2020-11-22 00:30 +0100

#228878 — adding a second HDD in debian

FromAntonio Barragan <ajbg96r@gmail.com>
Date2020-11-21 23:40 +0100
Subjectadding a second HDD in debian
Message-ID<BdJHX-195-3@gated-at.bofh.it>
Hi
I have a PC with Debian 10 installed (on dev/sda), and working properly.
Now I would like to add to it a second, 150 GB HDD (SATA), taken from
another machine.
It is already partitioned with a combination of ntfs and ext4 partitions,
and I would like to keep it that way, because I want the info stored in it.
I have seen several posts in the web on this subject, but almost all
talk about formating and
repartitioning the second HDD, which I'd rather not do.
How could that be done?
Any clue will be greatly appreciated

[toc] | [next] | [standalone]


#228880

FromAndy Smith <andy@strugglers.net>
Date2020-11-22 00:00 +0100
Message-ID<BdK1n-1gf-15@gated-at.bofh.it>
In reply to#228878
Hello,

On Sat, Nov 21, 2020 at 06:31:53PM -0400, Antonio Barragan wrote:
> I have a PC with Debian 10 installed (on dev/sda), and working properly.
> Now I would like to add to it a second, 150 GB HDD (SATA), taken from
> another machine.

[…]

> How could that be done?

If you don't have hot swap drive bays:

- Power off your computer
- Fit the new drive in the chassis and plug it into a free SATA port
- Boot your computer again

If you do have hot swap drive bays:

- Insert the new drive into a spare drive slot

Then:

- cat /proc/partitions to see what new partitions have appeared
- check /var/log/syslog and dmesg to see what new drives have been
  seen

Most likely the partitions from the new drive just appear and can be
mounted somewhere, put in /etc/fstab and so on.

A possible failure mode is that your computer reorders its drives
and the new one becomes sda. This may interfere with your boot
process. Hopefully you referred to everything by UUID or label so
that this doesn't happen. If it does cause problems just take the
new drive out again and things should return to normal. Then you may
have to consider swapping cables between ports, or adjusting BIOS
boot order, or similar.

Most of the time though, just plugging the new drive in goes fine.

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting

[toc] | [prev] | [next] | [standalone]


#228882

FromKeith Bainbridge <ke1thozgroups@gmx.com>
Date2020-11-22 00:10 +0100
Message-ID<BdKaZ-1zH-1@gated-at.bofh.it>
In reply to#228878
Antonio

If you aer using a USB connection (eg caddy), just plug it in. Linux
will recognise it and generally mount the partitions under /media/antonio/

If you are connecting direct to the main board, you'll need to power of,
then attach and reboot. It should mount under /media/antoino/

You can specify a better mount piint in /etc/fstab if you prefer.


On 22/11/20 9:31 am, Antonio Barragan wrote:


Hi

> I have a PC with Debian 10 installed (on dev/sda), and working properly.
> Now I would like to add to it a second, 150 GB HDD (SATA), taken from
> another machine.
> It is already partitioned with a combination of ntfs and ext4 partitions,
> and I would like to keep it that way, because I want the info stored in it.
> I have seen several posts in the web on this subject, but almost all
> talk about formating and
> repartitioning the second HDD, which I'd rather not do.
> How could that be done?
> Any clue will be greatly appreciated
>
--
Keith Bainbridge

ke1thozgroups@gmx.com

[toc] | [prev] | [next] | [standalone]


#228885

FromJoe <joe@jretrading.com>
Date2020-11-22 00:10 +0100
Message-ID<BdKb0-1zH-23@gated-at.bofh.it>
In reply to#228878
On Sat, 21 Nov 2020 18:31:53 -0400
Antonio Barragan <ajbg96r@gmail.com> wrote:

> Hi
> I have a PC with Debian 10 installed (on dev/sda), and working
> properly. Now I would like to add to it a second, 150 GB HDD (SATA),
> taken from another machine.
> It is already partitioned with a combination of ntfs and ext4
> partitions, and I would like to keep it that way, because I want the
> info stored in it. I have seen several posts in the web on this
> subject, but almost all talk about formating and
> repartitioning the second HDD, which I'd rather not do.
> How could that be done?
> Any clue will be greatly appreciated
> 

Just connect it and boot up. The system will find the drive and
partitions by itself, and various utilities will be able to see them,
but they will not get mounted automatically. If you want the partitions
to be mounted at future boots, you need to add entries to the
/etc/fstab file. It is also possible to automount them when you try to
read them rather than at boot time, but you still need fstab entries.
You can also mount partitions from the command line when required, but
this gets tedious quite quickly.

You need to create a mount point in the filesystem, which is simply an
empty directory somewhere, positioned and named according to what the
data is and who will use it. If it's just you, you might create a
directory in your home directory named 'HDD2' and inside it, an
appropriately-named directory for each partition on the new drive. Or
you could just create the mount points directly within your home if it
makes sense to do so.

Then you need /etc/fstab entries for each partition, linking the device
name of the partition with the mount point, as well as the filesystem
type, who will use it, default permissions on new files and a few other
things. Look at the existing entries in the file, and also open a
terminal and look at man fstab for exact details.

It's a bit of fiddling around to organise the mounting of your new
partitions, but there's no formatting or partition editing needed. Only
a new blank drive would need that.

-- 
Joe

[toc] | [prev] | [next] | [standalone]


#228887

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2020-11-22 00:30 +0100
Message-ID<BdKum-1Ge-3@gated-at.bofh.it>
In reply to#228878
On Sat 21 Nov 2020 at 18:31:53 (-0400), Antonio Barragan wrote:
> I have a PC with Debian 10 installed (on dev/sda), and working properly.
> Now I would like to add to it a second, 150 GB HDD (SATA), taken from
> another machine.
> It is already partitioned with a combination of ntfs and ext4 partitions,
> and I would like to keep it that way, because I want the info stored in it.
> I have seen several posts in the web on this subject, but almost all
> talk about formating and
> repartitioning the second HDD, which I'd rather not do.

Make sure that your current /etc/fstab is using LABELs or UUIDs to
specify the mounts. This will make sure that when you add the second
drive, your computer still finds the correct partitions to boot etc.

Having added the second drive, just add more lines to /etc/fstab
according to what you want mounted, using LABELs or UUIDs again,
and mkdir the corresponding mount points.

I write lines like

LABEL=olaf04 /ya ext4 defaults,errors=remount-ro,nofail 0 2

so that things don't stall if you remove the disk again.
For ntfs, you might also want to set masks/ownerships etc,
and you can also add noauto if you want to only mount the
partitions manually.

Cheers,
David.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web