Re: Add a hard drive to existing system??

2021-01-18 Thread Keith Bainbridge

On 19/1/21 7:18 am, David Christensen wrote:

I set PS1 in my Bash profile to print a blank line, print useful
contextual information, and then print the prompt.  This makes it easier
to read, understand, and/or reproduce the session:

2021-01-18 12:01:50 root@tinkywinky ~
# cat /etc/debian_version
9.13

2021-01-18 12:13:41 root@tinkywinky ~
# uname -a
Linux tinkywinky 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05)
x86_64 GNU/Linux

2021-01-18 12:13:43 root@tinkywinky ~
# grep PS1 .profile
export PS1='\n\D{%Y-%m-%d %H:%M:%S} '${USER}'@\h \w\n\$ '



Thanks for this.

I'll just add that if you make this change, run

source .profile

to activate it.

--
Keith Bainbridge

ke1thozgro...@gmx.com



Re: Add a hard drive to existing system??

2021-01-18 Thread David Christensen

On 2021-01-18 09:33, Jerry Mellon wrote:

The fstab with the new drive now reads,

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name
devices
# that works even if disks are added and removed. See fstab(5).
#
#
# / was on /dev/sda1 during installation
UUID=7748059d-ecc3-42ba-919b-e95202920927
/   ext4errors=remount-ro 0   1
# swap was on /dev/sda5 during installation
UUID=5efd2441-adab-4d4f-9356-9671964198f7
noneswapsw  0   0
/dev/sr0/media/cdrom0   udf,iso9660 user,noauto 0   0

# sdb1 ext4 e68b74c4-1cee-43a6-8ce6-50e97a65d976

UUID=e68b74c4-1cee-43a6-8ce6-
50e97a65d976   /data ext4 errors=remount-ro 02
jerry@UNIX:~\>


Much better.  :-)


Here is an example console session.  I set PS1 in my Bash profile to 
print a blank line, print useful contextual information, and then print 
the prompt.  This makes it easier to read, understand, and/or reproduce 
the session:


2021-01-18 12:01:50 root@tinkywinky ~
# cat /etc/debian_version
9.13

2021-01-18 12:13:41 root@tinkywinky ~
# uname -a
Linux tinkywinky 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) 
x86_64 GNU/Linux


2021-01-18 12:13:43 root@tinkywinky ~
# grep PS1 .profile
export PS1='\n\D{%Y-%m-%d %H:%M:%S} '${USER}'@\h \w\n\$ '


David



Re: Add a hard drive to existing system??

2021-01-18 Thread Jerry Mellon
The fstab with the new drive now reads,

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name
devices
# that works even if disks are added and removed. See fstab(5).
#
#
# / was on /dev/sda1 during installation
UUID=7748059d-ecc3-42ba-919b-e95202920927
/   ext4errors=remount-ro 0   1
# swap was on /dev/sda5 during installation
UUID=5efd2441-adab-4d4f-9356-9671964198f7
noneswapsw  0   0
/dev/sr0/media/cdrom0   udf,iso9660 user,noauto 0   0

# sdb1 ext4 e68b74c4-1cee-43a6-8ce6-50e97a65d976

UUID=e68b74c4-1cee-43a6-8ce6-
50e97a65d976   /data ext4 errors=remount-ro 02 
jerry@UNIX:~\> 













-Original Message-
From: David Christensen 
To: debian-user@lists.debian.org
Subject: Re: Add a hard drive to existing system??
Date: Mon, 18 Jan 2021 01:23:30 -0800

On 2021-01-18 01:00, Keith Bainbridge wrote:
> On 18/1/21 9:44 am, Jerry Mellon wrote:
> > Currently the fstab file
> > reads as follows.
> > 
> > 
> > 
> > Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
> > Disk model: ST9500325AS
> > Units: sectors of 1 * 512 = 512 bytes
> > Sector size (logical/physical): 512 bytes / 512 bytes
> > I/O size (minimum/optimal): 512 bytes / 512 bytes
> > Disklabel type: dos
> > Disk identifier: 0x0d0d6868
> > 
> > Device Boot Start   End   Sectors   Size Id Type
> > /dev/sda1  * 2048 951703551 951701504 453.8G 83 Linux
> > /dev/sda2   951705598 976771071  2506547412G  5 Extended
> > /dev/sda5   951705600 976771071  2506547212G 82 Linux swap /
> > Solaris
> 
> Before OP installs the new drive, hadn't we better sort out the
> claimed
> fstab. I think it is output from fdisk, but if grub is looking for
> sda1
> to boot from and the new disk is assigned /dev/sda, he won't boot.

D'oh!  Yes, that is fdisk(8) output.


Jerry -- please run the following command as root and post the complete 
console session -- prompt, command entered, and output obtained:

# cat /etc/fstab


David




Re: Add a hard drive to existing system??

2021-01-18 Thread Jerry Mellon
All,
New drive install this morning, appears tobe functioning without a
problem. I had some hicups with the fstab file at to the layout, but got
it after some head scratching as to the layout of the file.

Again thanks to all for the great help.

Jerry

-- 
Jerry Mellon
501 Los Caminos St.
St. Augustine, FL 32095
(407)461.9216

-Original Message-
From: Dan Ritter 
To: Stefan Monnier 
Cc: debian-user@lists.debian.org
Subject: Re: Add a hard drive to existing system??
Date: Sun, 17 Jan 2021 18:33:58 -0500

Stefan Monnier wrote: 
> > No, this drive will be recognized, after you plug it in, as
> > /dev/sdb, and will have whatever partitions you create on it.
> 
> Hmm... actually, there's a risk that the new drive gets assigned the
> name `sda` and the "old" one gets renamed to `sdb`.
> 

Yes, or stranger things -- which is why 'cat /proc/partitions'
is first on my list of instructions.

-dsr-




Re: Add a hard drive to existing system??

2021-01-18 Thread David Christensen

On 2021-01-18 01:00, Keith Bainbridge wrote:

On 18/1/21 9:44 am, Jerry Mellon wrote:

Currently the fstab file
reads as follows.



Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST9500325AS
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0d0d6868

Device Boot Start   End   Sectors   Size Id Type
/dev/sda1  * 2048 951703551 951701504 453.8G 83 Linux
/dev/sda2   951705598 976771071  25065474    12G  5 Extended
/dev/sda5   951705600 976771071  25065472    12G 82 Linux swap /
Solaris



Before OP installs the new drive, hadn't we better sort out the claimed
fstab. I think it is output from fdisk, but if grub is looking for sda1
to boot from and the new disk is assigned /dev/sda, he won't boot.


D'oh!  Yes, that is fdisk(8) output.


Jerry -- please run the following command as root and post the complete 
console session -- prompt, command entered, and output obtained:


# cat /etc/fstab


David



Re: Add a hard drive to existing system??

2021-01-18 Thread David Christensen

On 2021-01-17 10:52, Jerry Mellon wrote:

Hello, New to Debian, but have gotten Debian 10.7 loaded on to my
system. I have an ASUS gaming laptop(dont use it for gaming) with
12gb of memory and intel corei7 and a 500gb hard drive.

My question is what is the best(use dummy for linus statements
please) way to add a second hard drive with 2T of space. I wiil use
this to store photos and documents etc.



On 2021-01-17 14:44, Jerry Mellon wrote:

Hi, The Asus that I have is G75V series. It has 2 hdd bays onboard.
The 500mv is the drive that is current installed and Debian 10.7 is 
installed. I have purchased another 2T Segate drive that will go

into the empty bay.

I don't want to do anything fancy, just install and update fstat.
The question is what do I do in fstat to set it up. Currently the
fstab file reads as follows.



Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors Disk
model: ST9500325AS Units: sectors of 1 * 512 = 512 bytes Sector size
(logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal):
512 bytes / 512 bytes Disklabel type: dos Disk identifier:
0x0d0d6868

Device Boot Start   End   Sectors   Size Id Type 
/dev/sda1  * 2048 951703551 951701504 453.8G 83 Linux 
/dev/sda2   951705598 976771071  2506547412G  5 Extended 
/dev/sda5   951705600 976771071  2506547212G 82 Linux swap / 
Solaris



Do I set the new drive as /dev/sda6 , 7 , 8  and would it be a 
single partition?



I am curious why your fstab(5) uses "/dev/sd..." values for the fs_spec 
field, rather than "LABEL=..." or "UUID=..." values.  Did a the Debian 
10.7 installer create these entries?



As other readers have pointed out, "/dev/sd*" device nodes are assigned 
by the Linux kernel during the boot process and can change whenever 
drives are added or removed.  Adding another drive (including an 
external drive) could cause the system drive device nodes to change, 
which could break boot.



It might be possible to rework the fstab(5) entries to use "LABEL=...", 
"UUID=...", and/or "/dev/disk/by-id/..." values, and then run 
update-initramfs(8) and update-grub(8).  If the first attempt fails, it 
may be necessary to boot the d-i into a rescue shell, mount the root 
filesystem read-write, edit /etc/fstab, invoke chroot(8), run the 
updates, and try again.



Once you install the second drive and boot successfully, you will need 
to apply a partitioning scheme, create a partition, format the 
partition, create a mount point, and create an fstab(5) entry.  There 
are a variety of tools for first two steps; I use parted(8) 'mklabel' 
and 'mkpart'.  There are a variety of filesystems available; I suggest 
ext4 and using mkfs.ext4(8).



David



Re: Add a hard drive to existing system??

2021-01-18 Thread Keith Bainbridge

On 18/1/21 9:44 am, Jerry Mellon wrote:

Currently the fstab file
reads as follows.



Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST9500325AS
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0d0d6868

Device Boot Start   End   Sectors   Size Id Type
/dev/sda1  * 2048 951703551 951701504 453.8G 83 Linux
/dev/sda2   951705598 976771071  2506547412G  5 Extended
/dev/sda5   951705600 976771071  2506547212G 82 Linux swap /
Solaris



Before OP installs the new drive, hadn't we better sort out the claimed
fstab. I think it is output from fdisk, but if grub is looking for sda1
to boot from and the new disk is assigned /dev/sda, he won't boot.

--
Keith Bainbridge

ke1thozgro...@gmx.com



Re: Add a hard drive to existing system??

2021-01-17 Thread Andrei POPESCU
On Du, 17 ian 21, 17:44:28, Jerry Mellon wrote:
> Hi,
> The Asus that I have is G75V series. It has 2 hdd bays onboard. The
> 500mv is the drive that is current installed and Debian 10.7 is
> installed. I have purchased another 2T Segate drive that will go into
> the empty bay.
> 
> I don't want to do anything fancy, just install and update fstat. The
> question is what do I do in fstat to set it up. Currently the fstab file
> reads as follows.

1. Install GParted

2. Install the new drive

3. Open GParted and partition the new drive as you choose

   Be very careful to select the correct drive, it should be the large 
   empty one ;)

   Make sure you set a label for every (new) partition, e.g. depending 
   on what you intend to store on that partition. Labels should be 
   unique among all your partitions, choose carefully.

4. Add the new partition(s) to fstab with something like

LABEL=big-downloads   /media/big-dl   ext4   defaults   01

5. mkdir /media/big-stuff

6. Test with 'mount /media/big-dl'

7. Reboot and check the new partition(s) are where you expect them to be

8. Enjoy!

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser


signature.asc
Description: PGP signature


Re: Add a hard drive to existing system??

2021-01-17 Thread Keith Bainbridge

On 18/1/21 10:09 am, Stefan Monnier wrote:

No, this drive will be recognized, after you plug it in, as
/dev/sdb, and will have whatever partitions you create on it.


Hmm... actually, there's a risk that the new drive gets assigned the
name `sda` and the "old" one gets renamed to `sdb`.


 Stefan




YES

This has happened to me. I suspect because the system recognises the
conventional drive before the m.2, but not positive.

I had to set the m.2 as the boot in cmos.  And remove the conventional
drive when I want to install a new OS.

--
Keith Bainbridge

ke1thozgro...@gmx.com



Re: Add a hard drive to existing system??

2021-01-17 Thread Dan Ritter
Stefan Monnier wrote: 
> > No, this drive will be recognized, after you plug it in, as
> > /dev/sdb, and will have whatever partitions you create on it.
> 
> Hmm... actually, there's a risk that the new drive gets assigned the
> name `sda` and the "old" one gets renamed to `sdb`.
> 

Yes, or stranger things -- which is why 'cat /proc/partitions'
is first on my list of instructions.

-dsr-



Re: Add a hard drive to existing system??

2021-01-17 Thread Stefan Monnier
> No, this drive will be recognized, after you plug it in, as
> /dev/sdb, and will have whatever partitions you create on it.

Hmm... actually, there's a risk that the new drive gets assigned the
name `sda` and the "old" one gets renamed to `sdb`.


Stefan



Re: Add a hard drive to existing system??

2021-01-17 Thread Dan Ritter
Jerry Mellon wrote: 
> Hi,
> The Asus that I have is G75V series. It has 2 hdd bays onboard. The
> 500mv is the drive that is current installed and Debian 10.7 is
> installed. I have purchased another 2T Segate drive that will go into
> the empty bay.
> 
> I don't want to do anything fancy, just install and update fstat. The
> question is what do I do in fstat to set it up. Currently the fstab file
> reads as follows.
> 
> Device Boot Start   End   Sectors   Size Id Type
> /dev/sda1  * 2048 951703551 951701504 453.8G 83 Linux
> /dev/sda2   951705598 976771071  2506547412G  5 Extended
> /dev/sda5   951705600 976771071  2506547212G 82 Linux swap /
> Solaris
> 
> 
> Do I set the new drive as /dev/sda6 , 7 , 8  and would it be a
> single partition?
> 

No, this drive will be recognized, after you plug it in, as
/dev/sdb, and will have whatever partitions you create on it.

To see what it gets called by the operating system:

cat /proc/partitions

To create a new partition

sudo fdisk /dev/sdb

and follow the prompts to write a partition table and create a
partition. The defaults will go to a single giant partition,
sdb1.

To create a filesystem on sdb1:

sudo mkfs.ext4 /dev/sdb1

To mount the partition temporarily:

sudo mkdir /mnt/tmp
sudo mount /dev/sdb1 /mnt/tmp

to unmount it:

sudo umount /dev/sdb1

To make it a normal part of your system, create a directory
where you want it to be -- /data ? /storage ? /backup ?
and then edit /etc/fstab.

-dsr-



Re: Add a hard drive to existing system??

2021-01-17 Thread Jerry Mellon
Hi,
The Asus that I have is G75V series. It has 2 hdd bays onboard. The
500mv is the drive that is current installed and Debian 10.7 is
installed. I have purchased another 2T Segate drive that will go into
the empty bay.

I don't want to do anything fancy, just install and update fstat. The
question is what do I do in fstat to set it up. Currently the fstab file
reads as follows.



Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST9500325AS 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0d0d6868

Device Boot Start   End   Sectors   Size Id Type
/dev/sda1  * 2048 951703551 951701504 453.8G 83 Linux
/dev/sda2   951705598 976771071  2506547412G  5 Extended
/dev/sda5   951705600 976771071  2506547212G 82 Linux swap /
Solaris


Do I set the new drive as /dev/sda6 , 7 , 8  and would it be a
single partition?

As always any help is greatly appreciated.

Thanks
Jerry





-Original Message-
From: Jerry Mellon 
To: debian-user@lists.debian.org
Subject: Add a hard drive to existing system??
Date: Sun, 17 Jan 2021 13:52:06 -0500

Hello,
New to Debian, but have gotten Debian 10.7 loaded on to my system. I
have an ASUS gaming laptop(dont use it for gaming) with 12gb of memory
and intel corei7 and a 500gb hard drive.

My question is what is the best(use dummy for linus statements please)
way to add a second hard drive with 2T of space. I wiil use this to
store photos and documents etc.

Thanks





Re: Add a hard drive to existing system??

2021-01-17 Thread Marc Auslander
Jerry Mellon  writes:

>Hello,
>New to Debian, but have gotten Debian 10.7 loaded on to my system. I
>have an ASUS gaming laptop(dont use it for gaming) with 12gb of memory
>and intel corei7 and a 500gb hard drive.
>
>My question is what is the best(use dummy for linus statements please)
>way to add a second hard drive with 2T of space. I wiil use this to
>store photos and documents etc.
>
>Thanks

A possible alternative is to see if your router supports storage, and if
not consider an upgrade.  Many modern routers support an attached disk
and provide network storage. Of course a major advantage of this is that
you will be able to carry the laptop around and maintain access to the
storage. An issue is that the storage will probably be Windows
formatted, and thus you will have to deal with incompatible meta
data. And you will have to configure debian access to a windows share.
To be honest, I've never tried this.  My linux sever is the NAS and
windows machines access it.

I think creating a linux nas may be too much for you, at least for now. 



Re: Add a hard drive to existing system??

2021-01-17 Thread Alexander V. Makartsev

On 17.01.2021 23:52, Jerry Mellon wrote:

Hello,
New to Debian, but have gotten Debian 10.7 loaded on to my system. I
have an ASUS gaming laptop(dont use it for gaming) with 12gb of memory
and intel corei7 and a 500gb hard drive.

My question is what is the best(use dummy for linus statements please)
way to add a second hard drive with 2T of space. I wiil use this to
store photos and documents etc.

Thanks


If you tell us exact model of your laptop, I'll look for information 
about possible storage upgrades.
Some laptops have internal compartments and different kinds of 
connectors (M.2, NGFF, SATA connectors with variety of form factors, etc.),
so upgrading storage could be possible by purchasing few extra parts, 
like flat cable and drive caddy, or in some cases just by installing 
extra drive as is.


Personally, I always prefer storage to be internal, because of the 
mobility, so I buy laptops only with possible future upgrades to storage 
in mind.
I also have external HDD in a case with USB 3.0 interface, which I bring 
along on rare occasions.



--
With kindest regards, Alexander.

⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄



Re: Add a hard drive to existing system??

2021-01-17 Thread Charles Curley
On Sun, 17 Jan 2021 13:52:06 -0500
Jerry Mellon  wrote:

> I
> have an ASUS gaming laptop(dont use it for gaming) with 12gb of memory
> and intel corei7 and a 500gb hard drive.
> 
> My question is what is the best(use dummy for linus statements please)
> way to add a second hard drive with 2T of space. I wiil use this to
> store photos and documents etc.

I'm guessing you want an external drive for this, even if you have an
empty hard drive bay in the laptop. I'd get a USB 3 external drive. I
have several Seagate Backup Pluses that I use for offsite backups.

I highly recommend you encrypt the partitions on any external drive.

For how to do that, see:
https://charlescurley.com/blog/posts/2019/Nov/29/encrypting-an-external-partition/

Once you've done it, you'll want scripts to mount and unmount the
drive. https://charlescurley.com/blog/tag/backups.html

To back up to the external drive, consider rsnapshot. It will detect a
removable drive and only run if the partition is mounted.

-- 
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/



Re: Add a hard drive to existing system??

2021-01-17 Thread Joe
On Sun, 17 Jan 2021 18:59:18 +
Alain D D Williams  wrote:

> On Sun, Jan 17, 2021 at 01:52:06PM -0500, Jerry Mellon wrote:
> > Hello,
> > New to Debian, but have gotten Debian 10.7 loaded on to my system. I
> > have an ASUS gaming laptop(dont use it for gaming) with 12gb of
> > memory and intel corei7 and a 500gb hard drive.
> > 
> > My question is what is the best(use dummy for linus statements
> > please) way to add a second hard drive with 2T of space. I wiil use
> > this to store photos and documents etc.  
> 
> It is often hard to change the hardware on a laptop. Probably the
> easiest way is to get an external disk with a USB interface, then
> plug the disk in when you need to get/put files to the disk. 
> 

Probably so. But I have a netbook containing a hard-wired SSD but also
a space for a standard drive. That was not advertised by the seller, who
presumably didn't know about it, and it isn't obvious without removing
the bottom cover plate. I had to buy an adaptor cable for the
proprietary interface, but then was able to fit a standard SSD.

But that is probably not a common feature. Look for a USB/drive
interface that uses USB3 and whatever the latest SATA is (seems to
change every week) for maximum speed. Depending on the drive, it may or
may not need an additional power supply. Some can be powered from the
USB connection, but they are likely to be the slowest.

-- 
Joe



Re: Add a hard drive to existing system??

2021-01-17 Thread Alain D D Williams
On Sun, Jan 17, 2021 at 01:52:06PM -0500, Jerry Mellon wrote:
> Hello,
> New to Debian, but have gotten Debian 10.7 loaded on to my system. I
> have an ASUS gaming laptop(dont use it for gaming) with 12gb of memory
> and intel corei7 and a 500gb hard drive.
> 
> My question is what is the best(use dummy for linus statements please)
> way to add a second hard drive with 2T of space. I wiil use this to
> store photos and documents etc.

It is often hard to change the hardware on a laptop. Probably the easiest way
is to get an external disk with a USB interface, then plug the disk in when you
need to get/put files to the disk. 

-- 
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT 
Lecturer.
+44 (0) 787 668 0256  https://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: 
https://www.phcomp.co.uk/Contact.html
#include