You are not logged in.

#1 2020-05-24 19:23:36

Velcrone
Member
Registered: 2020-05-24
Posts: 14

[SOLVED] Swap names of /dev/sda and /dev/sdb

Hi!
So I just installed arch and have been trying to get up and running. I saved my old home folder on what used to be /dev/sdb and installed arch on what used to be /dev/sda. somewhere in the installation process though, these two drives flipped names. How would I rename them back to there normal names?

I tried finding the answer online but all the threads were super old and they all linked to another article about udev which had been last updated in 2008.

Here is the output of lsblk and fstab.
lsblk:

sda      8:0    0 931.5G  0 disk 
├─sda1   8:1    0  39.1G  0 part 
└─sda2   8:2    0 878.9G  0 part 
sdb      8:16   0 465.8G  0 disk 
├─sdb1   8:17   0     1G  0 part /boot
├─sdb2   8:18   0    16G  0 part [SWAP]
├─sdb3   8:19   0   420G  0 part /
└─sdb4   8:20   0    16G  0 part 

fstab:

# /dev/sda3
UUID=c6384300-8211-47891
-b020-2c0584b4d55f	/         	ext4      	rw,relatime	0 1

# /dev/sda1
UUID=AC83-45C9      	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro	0 2

# /dev/sda2
UUID=4fc03dad-16bb-456d-8092-89d63d14e13a	none      	swap      	defaults  	0 0

Any help would be much appreciated!

Last edited by Velcrone (2020-05-24 20:36:11)

Offline

#2 2020-05-24 19:29:43

loqs
Member
Registered: 2014-03-06
Posts: 19,070

Re: [SOLVED] Swap names of /dev/sda and /dev/sdb

Why not use Persistent_block_device_naming which will not change instead?
Edit:
You are using persistent block device naming so you need to fix the fstab.  There is no entry in the fstab for /home so will need to create one.

Last edited by loqs (2020-05-24 19:34:30)

Offline

#3 2020-05-24 19:34:28

Velcrone
Member
Registered: 2020-05-24
Posts: 14

Re: [SOLVED] Swap names of /dev/sda and /dev/sdb

Thanks! I'll try that!

Last edited by Velcrone (2020-05-24 19:35:20)

Offline

#4 2020-05-24 19:38:30

loqs
Member
Registered: 2014-03-06
Posts: 19,070

Re: [SOLVED] Swap names of /dev/sda and /dev/sdb

See the link I provided to fstab in my edit.  You need to identify which partition on sda has /home.  Then you can add an entry for it to the fstab.  The complication will be if you added any users while /home was not mounted.
Edit:
Users created on the new system would need their home directories moved to the separate home filesystem.
Users created on the old system would need their account creating (useradd (specify the uid and gid or chown the directory to the newly assigned uid and gid) and no home directory creation)
Users exists in both systems the home directories contents need to merged ensuring the uid and gid from the new system is used.

Last edited by loqs (2020-05-24 19:57:18)

Offline

#5 2020-05-24 20:35:46

Velcrone
Member
Registered: 2020-05-24
Posts: 14

Re: [SOLVED] Swap names of /dev/sda and /dev/sdb

Worked like a charm! Thank you for your help and fast replies!

Offline

Board footer

Powered by FluxBB