[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: disk labels mismatch



pavicic wrote:
> I've added a new disk in a hurry and now I have several mismatches.
> Would anyone care to help me to sort them out. Below I'm giving fstab,
> fdisk -l, df -la (apparently "/" (root) is duplicated ??, etc.). I
> also enclose relevant sections from /var/log/system and grub. Each
> section starts with ***

Only the fstab data was useful.  All of the rest of that data you sent
is pretty much useless data.  None of it will help us or you determine
anything useful.  Sorry.

The /etc/fstab you sent included (with some readability fixup by me):

# / was on /dev/sda1 during installation
UUID=2b4e1ed6-4b09-4c42-a958-9493cffa7f58 / ext3 errors=remount-ro 0 1
# /home was on /dev/sda3 during installation
UUID=a3cb2cbb-d6db-46e1-a0e7-73f264d255a1 /home ext3 defaults 0 2
# swap was on /dev/sda2 during installation
UUID=25c7fb6d-47a4-4594-9cfd-20e9680f5e0b none swap sw 0 0 /dev/scd0

That is unambiguous!  The partitions with those UUIDs are mounted as
shown.

  UUID=2b... is mounted on /.
  UUID=a3... is mounted on /home
  UUID=25... is used as swap.

The entire purpose of the UUIDs is to handle just the case you are
asking about.  The case where you have installed a system on two
different disks and then install both disks in the same system.
Without the UUIDs it is ambiguous.  But since the UUIDs will be unique
it means that the correct disk will be mounted.

Use the blkid program to print out the UUIDs of the disks on your
system.  Example:

  $ blkid
  /dev/sda1: LABEL="boot" UUID="a72b4b9b-eb92-49a3-b64c-29e47ad8ba0d" TYPE="ext2" 
  /dev/sda2: UUID="e515fbe8-0ac0-4bdf-95f2-573eacdd286a" TYPE="swap" 
  /dev/sda5: UUID="cf27b371-bb12-44bb-a5f2-deca5d65cb20" TYPE="ext3" 

Line up the UUIDs with the ones from your fstab.  Those are the ones
in use.

> The system works without apparent problems but I do not have a clear
> correspondence between disks sda, sdb. sdc and directories / , /run/,
> etc. I would like to establish correspondence (and, e.g., have only
> sda, sdb, and sdc in fstab, and have only one "/") so as to be able to
> optimally use the space on the disks and avoid possible duplication of
> system files. For instance, does the appearance of two "/" mean that

Your question confuses me very much.

If you are noticing that your 'df' command produces two lines for "/"
this is due to a change from using /etc/mtab as a file to being a
symlink to /proc/mounts.  If you look in /proc/mounts you will see
that the "/" filesystem is listed twice.

  $ awk '$2=="/"' /proc/mounts
  rootfs / rootfs rw 0 0
  /dev/mapper/v1-root / ext3 rw,relatime,errors=remount-ro,barrier=1,data=ordered 0 0

Since it is listed twice it is reported twice.  This is a minor
regression in behavior due to the change to the symlink.  This will
eventually get improved but for the moment just ignore it.

> optimally use the space on the disks and avoid possible duplication of
> system files. For instance, does the appearance of two "/" mean that
> systems files are written on both sda and sdb? If so, how can sort
> that out.

No.  It does not.

> Some more details. sdb is not mounted but I can easily mount
> it. Then I'll have two "/" two "/home" etc.

What?  No.

> This is because sdb is from an old system.

Just because it is an old system does not cause it to be a duplicate.

> The problem is that I'm afraid to reformat sdb because it has a
> bootable label

So?  What does a bootable label matter?  It does not matter at all.
Please unlearn that piece of incorrect knowledge.

> and sdc as well.

Why mention sdc here?  You clearly have a system installed on
/dev/sda{1,2,3}.  That is all that is relevant here.

> So, the first thing I would like to find out is which disk the
> system boots from: sdb or sdc?

Neither.  It is booting from sda.  And your fstab unambiguously states
that your system will mount the specified UUIDs.  If you need help in
tracking down which UUID maps to which disk see the output of the
blkid program.

> The next thing is: If sdb, where is the boot sector? in the master
> boot sector (outside of the partions of the disk) or in the volume
> boot sector (inside the first partition of the disk)? If the later I
> must not reformat the disk.

It isn't booting from sdb or sdc or sdz.  (Hopefully you did not chain
them into the boot process.)  You can verify this by unplugging sdb
and sdc from your system and booting it without them.

> The third question is: How can I move the boot sectors?
> I would like to move the boot sector to sda

You don't "move" the MBR.  You "install" the MBR.

  # grub-install /dev/sda

But I am sure that is already the case since that is the default.

> and remove boot labels from sdb and sdc.

Use a partition editor such as gparted, sfdisk, cfdisk, fdisk or other
to change labels and bootable flags.

> But sdc also hosts Windoze 7?  Is that a problem.

Of course!  MS-Windows is always a problem.  :-)

> So, I should change grub, fstab, and what else?  And how?

You have asked very many questions based upon incorrect assumptions!
Because of this most of the questions and comments were not useful.

I suggest that you find a user group in your area and go to a
meeting.  Meet up with others that can help you face to face.  I
believe that an hour of direct help face to face will help 100x better
than thrashing around on any mailing list asking about phase of the
moon and ocean tides.

As for mailing list questions I suggest that the first simple question
be asked by itself.  Then work through it.  Then ask a follow-on
question.  Don't try to get so far ahead of yourself.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: