You are not logged in.

#1 2021-09-24 03:41:12

0xl1ickster
Member
Registered: 2021-09-24
Posts: 5

[SOLVED] Mounting new SSD (for extra space)

Hello, i have a new SSD which i'd like to mount for extra space capacity. I already have Arch linux installed on an SSD and just trying to mount this new one for more space and confused on how to do this. I think i want to use fstab but i'm a noob and not really sure how to do this, I have used google for help but all the results are for installing arch on a SSD which ive already done.

Here's my output for

fdisk -l

:

Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 860 
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: 0x99067fe8

Device     Boot    Start       End   Sectors   Size Id Type
/dev/sda1           2048   2099199   2097152     1G 83 Linux
/dev/sda2        2099200  10487807   8388608     4G 82 Linux swap / Solaris
/dev/sda3       10487808 976773167 966285360 460.8G 83 Linux


Disk /dev/sdb: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: SPCC Solid State
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Any help will be appreciated, thanks!



EDIT:
To noobs of the future that come across this wondering the same here is how I did it:

View the drives/disks find the one you want to add

fdisk -l

then run the following command to create a partition for the desired drive/disk:

sudo fdisk

while in fdisk use the m command for any help, but ideally you want to create a new partion with `n` and I just went with all the defaults then press `w` to save it. Then you want to create a filesystem I went with ext.4 with the following command

sudo mkfs.ext4 [*name of your drive/disk*]

Then run the command `blkid` to get the UUID of the drive/disk and edit your /etc/fstab file to add it in there with your desired options. I accidentally set the mount directory to /home at first which was a bad idea and did not allow me to log in after restarting so i had to open terminal from desktop manager and make a new directory and mount it there. Hopes this helps any one shout out to the guy who helped me in the replies down below!

Last edited by 0xl1ickster (2021-09-24 05:00:30)

Offline

#2 2021-09-24 03:48:12

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Mounting new SSD (for extra space)

Format /dev/sdb (create a partition and/or filesystem) and then check the UUID using `blkid`. You can then use the UUID to create an entry in /etc/fstab and mount it where you like (/home/data, for example).

If you are wanting to create system space, the you'll need a diffeent approach...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2021-09-24 03:51:15

0xl1ickster
Member
Registered: 2021-09-24
Posts: 5

Re: [SOLVED] Mounting new SSD (for extra space)

jasonwryan wrote:

Format /dev/sdb (create a partition and/or filesystem) and then check the UUID using `blkid`. You can then use the UUID to create an entry in /etc/fstab and mount it where you like (/home/data, for example).

If you are wanting to create system space, the you'll need a diffeent approach...

How do I create a partition and/or filesystem? like what commands would i run sorry im a noob

Offline

#4 2021-09-24 03:53:37

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Mounting new SSD (for extra space)

You use exactly the same commands that you used when you installed Arch. There is no magic about it:

https://wiki.archlinux.org/title/Partitioning

https://wiki.archlinux.org/title/File_systems


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2021-09-24 04:02:13

0xl1ickster
Member
Registered: 2021-09-24
Posts: 5

Re: [SOLVED] Mounting new SSD (for extra space)

jasonwryan wrote:

You use exactly the same commands that you used when you installed Arch. There is no magic about it:

https://wiki.archlinux.org/title/Partitioning

https://wiki.archlinux.org/title/File_systems

Ok thanks for your help btw smile , so i think i created the partition successfully heres the output of `fdisk -l` now:

Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 860 
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: 0x99067fe8

Device     Boot    Start       End   Sectors   Size Id Type
/dev/sda1           2048   2099199   2097152     1G 83 Linux
/dev/sda2        2099200  10487807   8388608     4G 82 Linux swap / Solaris
/dev/sda3       10487808 976773167 966285360 460.8G 83 Linux


Disk /dev/sdb: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: SPCC Solid State
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: 0xea488cd4

Device     Boot Start        End    Sectors   Size Id Type
/dev/sdb1        2048 1000215215 1000213168 476.9G 83 Linux

but when i run `blkid` i dont get a UUID for this drive heres my output on that command:

/dev/sdb1: PARTUUID="ea488cd4-01"
/dev/sda2: UUID="8ebadb72-2098-4109-9fb8-5db52c29a930" TYPE="swap" PARTUUID="99067fe8-02"
/dev/sda3: UUID="4fd53cb2-4042-4ca4-bb42-d90579d478c8" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="99067fe8-03"
/dev/sda1: UUID="e4d8fa8e-52dd-413d-b363-60bce8a58d69" BLOCK_SIZE="4096" TYPE="ext2" PARTUUID="99067fe8-01"

Offline

#6 2021-09-24 04:13:11

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Mounting new SSD (for extra space)


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2021-09-24 04:16:46

0xl1ickster
Member
Registered: 2021-09-24
Posts: 5

Re: [SOLVED] Mounting new SSD (for extra space)

jasonwryan wrote:

You use exactly the same commands that you used when you installed Arch. There is no magic about it:

https://wiki.archlinux.org/title/Partitioning

https://wiki.archlinux.org/title/File_systems

ahh nvm im stupid lol disregard last reply i forgot to create filesystem, but final questions can i mount this anywhere for example /work even though thats not a premade directory? like will it automatically create said directory ?

ohh and what should i make the options and dump, pass?

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/sdb1
UUID=bfd00092-bf79-4e1b-8e3d-d60103774b5c /work         ext4           ???             ?  ? 

# /dev/sda3
UUID=4fd53cb2-4042-4ca4-bb42-d90579d478c8	/         	ext4      	rw,relatime	0 1

# /dev/sda1
UUID=e4d8fa8e-52dd-413d-b363-60bce8a58d69	/boot     	ext2      	rw,relatime	0 2

# /dev/sda2
UUID=8ebadb72-2098-4109-9fb8-5db52c29a930	none      	swap      	defaults  	0 0

Last edited by 0xl1ickster (2021-09-24 04:20:07)

Offline

#8 2021-09-24 04:24:34

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Mounting new SSD (for extra space)

Yes, you can mount it at any pre-existing mountpoint.

See man fstab for a description of all of the fields.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#9 2021-09-24 04:34:44

0xl1ickster
Member
Registered: 2021-09-24
Posts: 5

Re: [SOLVED] Mounting new SSD (for extra space)

jasonwryan wrote:

Yes, you can mount it at any pre-existing mountpoint.

See man fstab for a description of all of the fields.


Alright got it up and running thanks for the help my friend!

Offline

#10 2021-09-24 04:46:06

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Mounting new SSD (for extra space)

Cool. Please remember to mark your thread as [Solved] by editing your first post and prepending it to the title.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#11 2021-09-24 11:54:42

Wild Penguin
Member
Registered: 2015-03-19
Posts: 320

Re: [SOLVED] Mounting new SSD (for extra space)

Another small tip: use bind mounts to have a directory available somewhere else (transparently for all software). Read the mount man page and fstab man page. I.e. something like this in fstab:

# Binds from other HDDs to /data...
/from/some/path                 /to/some/path  none  user,bind 0 0
/from/another/path             /to/some/other/path   none  user,bind 0 0

In practice, the need to do this may arise sooner or later. Another alternative is to use symlinks, but some software might not like it. Bind mounts are more reliable in my experience.

LVM is another handy alternative to have a filesystem on several block devices - but keep in mind that if a filesystem resides on several block devices, if any one of them fails you will lose all data (unless you've configured some redundancy).

Offline

#12 2021-09-25 05:42:37

Fmamarksman
Member
Registered: 2021-09-25
Posts: 11

Re: [SOLVED] Mounting new SSD (for extra space)

I know your topic is already solved but I hate the fstab syntax. I tried adding some other drives to it and it destroyed my system, I had to chroot into it and remove those drives from the file. I don't know why it happened, but now i just use the arch-install-scripts package and use the genfstab command after I have the drives mounted, to avoid that happening again.

Offline

Board footer

Powered by FluxBB