Disk confusion (solved)

New to SolydXK? This is the place to start.
Please check the other subforums to see if there's a more suitable place for your question.
User avatar
ilu
Posts: 2677
Joined: 09 Oct 2013 12:45

Disk confusion (solved)

Postby ilu » 10 Oct 2013 22:26

I'm working on my first SolydX install and ran into a problem. After install I added another disk and the system changed disk names. This are my disks now (lsblk):
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 111,8G 0 disk
├─sda1 8:1 0 40,5G 0 part
├─sda2 8:2 0 30G 0 part /
├─sda3 8:3 0 41,3G 0 part
└─sda4 8:4 0 1M 0 part
sdb 8:16 0 465,8G 0 disk
├─sdb1 8:17 0 97,7G 0 part
├─sdb2 8:18 0 1K 0 part
├─sdb5 8:21 0 48,8G 0 part
├─sdb6 8:22 0 48,8G 0 part
├─sdb7 8:23 0 48,8G 0 part
└─sdb8 8:24 0 97,7G 0 part
sdc 8:32 0 232,9G 0 disk
├─sdc1 8:33 0 40G 0 part
├─sdc2 8:34 0 1K 0 part
├─sdc5 8:37 0 16G 0 part
├─sdc6 8:38 0 10G 0 part
├─sdc7 8:39 0 10G 0 part
├─sdc8 8:40 0 20G 0 part /home
└─sdc9 8:41 0 136,9G 0 part
sr0 11:0 1 1024M 0 rom

Before sda was sdb and sdc was sda and my fstab still uses the old names like this:
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sdb2
UUID=92fae429-32f0-4564-855d-4640b861209f / ext4 rw,errors=remount-ro 0 1
# /dev/sda8
UUID=1a9d1c50-03e1-4fe9-8321-ec5ef03ef957 /home ext4 defaults 0 2

Surprisingly everything seems to work.

Now, question is, if I want to mount /var and /tmp as separate partitions and use sdc6 and sdc7 (new name) for this, which names do I use in fstab? sda6 and sda7?
Is there a way to get everything congruent again?

toothandnail
Posts: 94
Joined: 02 Jun 2013 18:45
Location: Oxfordshire, UK

Re: Disk confusion

Postby toothandnail » 10 Oct 2013 23:31

The reason things still work is that /etc/fstab is using UUIDs to identify the active partitions:

Code: Select all

# /dev/sdb2
UUID=92fae429-32f0-4564-855d-4640b861209f / ext4 rw,errors=remount-ro 0 1
In this instance, the # /dev/sdb2 is not active in fstab, it simply provides a human-understandable identifier for the disk that was in use.

You can fix the notation (if only so that you know where things are mounted) simply by using sudo and editing the commented lines in fstab to reflect the new system designations for the partitions.

If you want to use separate partitions for /var and /tmp (personally I wouldn't bother except possibly on a server), you can either use the /dev/sdc6 and /dev/sdc7 designations in your fstab, or you can determine the UUID of each partition and use that. To determine the UUID, use this command:

Code: Select all

 ls -l /dev/disk/by-uuid
You can then cut and paste the correct UUID to your fstab. You should be aware that, if you change any of the partitions (reformat or change their size), the UUID will change, which will cause your system to fail.

I'm less than fond of the use of UUID when it comes to partition designation. While it does get round the problem that some machines have with SATA drives (the drive may change its position in the chain, as has happened in your case), it is a pain in the neck for systems having only a single drive. IMHO it would be better if identification was done by label instead of UUID, and left with the old /dev/sdXY designations for single drive systems. Much less potentially troublesome. For any machine I use which does have multiple drives, I always try to use labels for partition identification, and avoid UUIDs.

Paul.

User avatar
ilu
Posts: 2677
Joined: 09 Oct 2013 12:45

Re: Disk confusion

Postby ilu » 10 Oct 2013 23:47

Thank your for your profound explanation. i will fix the fstab labels.

I wasn't aware that you can still do this stuff without using the UUIDs (there was nothing like that when I started my first Linux experience about 15 years ago). I will think about which way to go.

Regarding /tmp and /var: I want them on a different HD because / is on a SSD and I want to minimize writing on the SSD.

toothandnail
Posts: 94
Joined: 02 Jun 2013 18:45
Location: Oxfordshire, UK

Re: Disk confusion

Postby toothandnail » 11 Oct 2013 00:10

ilu wrote:Thank your for your profound explanation. i will fix the fstab labels.

I wasn't aware that you can still do this stuff without using the UUIDs (there was nothing like that when I started my first Linux experience about 15 years ago). I will think about which way to go.
UUIDs came in fairly recently. Certainly when I started with Linux, they weren't in use. I think they started to be generally used when SATA drives became common, simply because the relationship between drives is much less clearly defined than in the case of PATA drives (primary channel master, slave, secondary channel master, slave). Some machines seem to keep a constant designation for SATA drives as well as PATA, but some change quite unpredictably. Since quite a few modern motherboards have 6 SATA connectors, there are quite a few possibilities....

I still think labels would be more useful, but many installers don't give you any control over partition labelling, so it gets complicated to use them in a lot of situations.
Regarding /tmp and /var: I want them on a different HD because / is on a SSD and I want to minimize writing on the SSD.
:) That was a reason I hadn't thought of, but certainly a good one.

Paul.

kyodev
Posts: 505
Joined: 06 Jul 2013 09:47
Location: Lyon, France

Re: Disk confusion

Postby kyodev » 11 Oct 2013 06:10

toothandnail wrote:change their size, the UUID will change
I do not believe or I"m lucky.
gparted ou kde partition manager preserve Uuid.
For reformat, I dont know.


Return to “Newbie Questions”

Who is online

Users browsing this forum: No registered users and 2 guests