Sdb would be removed with sda?

General support questions
yeknafar
Posts: 13
Joined: 2018/07/12 21:13:09

Sdb would be removed with sda?

Post by yeknafar » 2021/04/10 15:25:35

Hello Dude


Where should sdb be mounted?

I mounted it in /mnt/sdb.
mnt is part of sda. When we reinstall the server sda would be removed does it effect sdb too and remove it?

Thanks

tunk
Posts: 1204
Joined: 2017/02/22 15:08:17

Re: Sdb would be removed with sda ?

Post by tunk » 2021/04/10 16:15:34

Where it should be mounted depends on what you're using it for.
Are you sure it's sdb and not sdb1?
When you reinstall the OS, you have to remount it, either manually or add it to /etc/fstab.

yeknafar
Posts: 13
Joined: 2018/07/12 21:13:09

Re: Sdb would be removed with sda ?

Post by yeknafar » 2021/04/10 16:24:29

Dear Tunk thank you for your reply. Yest it's sdb I checked it with "blkid" command now to be sure,

Did I do sth wrong and it should be sdb1?

Thanks for your attention and answer

tunk
Posts: 1204
Joined: 2017/02/22 15:08:17

Re: Sdb would be removed with sda ?

Post by tunk » 2021/04/10 17:53:20

From what you write it sounds like you haven't created partition(s) and file system(s)?
What's the output from this:
fdisk -l
And how did you mount it?

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Sdb would be removed with sda ?

Post by TrevorH » 2021/04/10 17:58:55

An excellent guide for users that are new to Linux can be found at https://rute.gerdesas.com - while this is not official project documentation it is a well-regarded general introduction to Linux and may be of help. For an introduction to the bash shell take a look at http://linuxcommand.org/lc3_learning_the_shell.php
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Whoever
Posts: 1357
Joined: 2013/09/06 03:12:10

Re: Sdb would be removed with sda ?

Post by Whoever » 2021/04/10 18:50:08

yeknafar wrote:
2021/04/10 15:25:35
Hello Dude


Where should sdb be mounted?

I mounted it in /mnt/sdb.
mnt is part of sda. When we reinstall the server sda would be removed does it effect sdb too and remove it?

Thanks
You probably have an entry in /etc/fstab that mounts the drive in this location. It's not a good idea to mount based on device names (like /dev/sda) -- I typically use filesystem labels, something like

Code: Select all

LABEL=<label on sdb>     /mnt/sdb          ext4         noatime 0 2


You can find or set the label with the command "e2label /dev/sdb". Note that this assumes an ext2/3/4 type filesystem. It also assumes that /dev/sdb is not partitioned, which if fine, as long as you don't ever want to boot from that drive.

yeknafar
Posts: 13
Joined: 2018/07/12 21:13:09

Re: Sdb would be removed with sda ?

Post by yeknafar » 2021/04/10 21:45:00

Thanks from all of you.

I mounted this way:
1. mkdir /mnt/sdb
2. sudo mount /dev/sdb /mnt/sdb
3.and added a line to fstb: /dev/sdb /mnt/sdb ext4 defaults 0 0

I learnt it here: https://sh-tsang.medium.com/partitionin ... 4b7634d1e0

I rebooted too, it's there.

--------------------------------------------------
And fdisk -l is:

fdisk -l

Disk /dev/sdb: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 85.9 GB, 85899345920 bytes, 167772160 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000940fd

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 167772159 83885056 83 Linux

------------
Thanks

tunk
Posts: 1204
Joined: 2017/02/22 15:08:17

Re: Sdb would be removed with sda?

Post by tunk » 2021/04/10 23:43:28

AFAIK that is ok.
But, when you use sdb there's no need to partition it (normally, when you
partition it creates /dev/sdb1 which should then be used when creating the
file system). And the limit for fdisk is 2TB, not 2GB. So the instructions in
the link isn't the very best.

Whoever
Posts: 1357
Joined: 2013/09/06 03:12:10

Re: Sdb would be removed with sda ?

Post by Whoever » 2021/04/11 00:48:29

yeknafar wrote:
2021/04/10 21:45:00
Thanks from all of you.

I mounted this way:
1. mkdir /mnt/sdb
2. sudo mount /dev/sdb /mnt/sdb
3.and added a line to fstb: /dev/sdb /mnt/sdb ext4 defaults 0 0
The problem with that approach is that device names may change. You can also use a UUID, but the label allows you to show the purpose of the filesystem.

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Sdb would be removed with sda?

Post by TrevorH » 2021/04/11 01:15:39

But to go back to the original question:
Where should sdb be mounted?
The answer to that is : where do you need the space? It's quite unusual to mount a drive under /mnt at all and even more unusual to mount it on a directory named after the drive itself. So, for example, if this is a database server running mysql and you wanted to use the space for that, then you could just mount it on /var/lib/mysql.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply