Want to mount some LVs with yast.

I’m migrating from one SATA disk to another with a fresh install on the new disk.
The old disk is 1TB and seems to losing stability. So I’ve installed 11.3 on the new 500 GB disk and want to mount the old /home partition using yast but I keep on getting back a message that I cannot edit partition because it is in use so it won’t mount.
I guess I’ll have to use the CLI to tell it otherwise, but could use some advice. I’m a GUI guy and I like to run a lot of hardware.
Yast does recognize the old hard drive and all of the partitions it will add the partitions to a new logical volume, but won’t let me mount or edit settings to tell it to mount.
I dunno.

don’t get too fancy trying to fix it yet…because it sounds to me
like it is mounted already… can you do these in a terminal


df -h
sudo /sbin/fdisk -l
cat /proc/partitions
cat /etc/fstab
mount

and then copy paste them back to here using the instructions here:
http://goo.gl/i3wnr

then we can help more…


DenverD
CAVEAT: http://is.gd/bpoMD
[NNTP posted w/openSUSE 11.3, KDE4.5.5, Thunderbird3.0.11, nVidia
173.14.28 3D, Athlon 64 3000+]
“It is far easier to read, understand and follow the instructions than
to undo the problems caused by not.” DD 23 Jan 11

:~> df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/system-root
                       20G  4.0G   15G  22% /
devtmpfs              1.9G  296K  1.9G   1% /dev
tmpfs                 2.0G  4.0K  2.0G   1% /dev/shm
/dev/sda1             152M   28M  116M  20% /boot
/dev/mapper/system-home
                      437G  401M  415G   1% /home

:~> sudo /sbin/fdisk -l

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

root's password:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009017e

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          21      159744   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              21       60802   488225792   8e  Linux LVM

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0006e47a

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1           9       72261   83  Linux
/dev/sdb2              10        1967    15727635   8e  Linux LVM
/dev/sdb3            1968      121601   960960105   8e  Linux LVM

Disk /dev/dm-0: 476.3 GB, 476317745152 bytes
255 heads, 63 sectors/track, 57909 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/dm-1 doesn't contain a valid partition table

Disk /dev/dm-2: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/dm-2 doesn't contain a valid partition table

:~> cat /proc/partitions
major minor  #blocks  name

   8        0  488386584 sda
   8        1     159744 sda1
   8        2  488225792 sda2
   8       16  976762584 sdb
   8       17      72261 sdb1
   8       18   15727635 sdb2
   8       19  960960105 sdb3
 253        0  465154048 dm-0
 253        1   20971520 dm-1
 253        2    2097152 dm-2

sdb3 is my old /home partition that I want to mount.
I don’t know what dm-0 dm-1 dm-2 are for.

:~> cat /etc/fstab 
/dev/system/swap     swap                 swap       defaults              0 0
/dev/system/root     /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-WDC_WD5000AADS-00S9B0_WD-WCAV9A100021-part1 /boot                ext4       acl,user_xattr        1 2
/dev/system/home     /home                ext4       acl,user_xattr        1 2
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

:~> mount
/dev/mapper/system-root on / type ext4 (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
devtmpfs on /dev type devtmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,mode=1777)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/sda1 on /boot type ext4 (rw,acl,user_xattr)
/dev/mapper/system-home on /home type ext4 (rw,acl,user_xattr)
securityfs on /sys/kernel/security type securityfs (rw)

I think that’s it thanks. and if you need something else…

I also get a message saying that it is not allowed to assign a mount point to a device with nonexistent or unknown file system.
That’s when I try to tell it to mount. Without formatting. Because formatting would defeat the purpose.

i’ve had a horrible last 24, headache, sore throat, temperature, aches
and pains, etc etc etc…

i can’t help…hope some one else will…any way now see you are deep
into LVMs, and i don’t ‘do’ those…good luck.


DenverD
CAVEAT: http://is.gd/bpoMD
[NNTP posted w/openSUSE 11.3, KDE4.5.5, Thunderbird3.0.11, nVidia
173.14.28 3D, Athlon 64 3000+]
“It is far easier to read, understand and follow the instructions than
to undo the problems caused by not.” DD 23 Jan 11

ConfederacyOfDunces wrote:
> I think that’s it thanks. and if you need something else…

Hi,

So am I correct in understanding that you have 11.3 installed and
running from one VG ‘system’ and you want to use the old ‘home’ LV on
your old disk instead of the ‘home’ LV on your new disk?

I think I know what is going on but please supply the output from the
following commands (run as root) just in case:

pvscan
vgscan
lvscan

If my assumption aout your system setup is correct and if you are logged
in as a user whose home directory is a subdirectory of /home, then you
will not be able to unmount the existing home LV in order to mount your
previous one.

You will need to logout and login again as a user with admin privileges
and whose home directory is not within /home. That user is normally
known as root!

You can login with a graphics session (although I’m not sure if that’s
prevented by default?) or you can login with a terminal session (type
CTRL-ALT-F2 to get a login prompt, and CTRL_ALT-F7 to get back to the
graphics screen). If you use a terminal session, you can still use YaST
by typing yast2.

HTH, Dave

Actually, I just want to mount the old /home partition as regular old storage.
That way I can copy what I need to the new /home partition.
It should be simple, but yast doesn’t want to detect the type and it doesn’t make a place to enter it unless you want to format.
I do not want to format.
I guess I’ll need to try the CLI, but I’m not sure what utility to use.
mount will do it I’m guessing but I want to be careful not to guess wrong.

ConfederacyOfDunces wrote:
> Actually, I just want to mount the old /home partition as regular old
> storage.

OK, that’s a simpler situation at least :slight_smile:

> That way I can copy what I need to the new /home partition.
> It should be simple, but yast doesn’t want to detect the type and it
> doesn’t make a place to enter it unless you want to format.
> I do not want to format.
> I guess I’ll need to try the CLI, but I’m not sure what utility to use.
> mount will do it I’m guessing but I want to be careful not to guess
> wrong.

Please supply the output of

pvscan
vgscan
lvscan

 # pvscan
  /dev/sdc: open failed: No medium found
  /dev/sdc: open failed: No medium found
  Couldn't find device with uuid CSGXpY-YEJ7-4qsf-KtdC-ft1u-IOaN-QSecuY.
  PV /dev/sdb3        VG OLDhdd   lvm2 [916.44 GiB / 0    free]
  PV /dev/sdb2        VG system   lvm2 [15.00 GiB / 0    free]
  PV unknown device   VG system   lvm2 [916.44 GiB / 0    free]
  PV /dev/sda2        VG system   lvm2 [465.61 GiB / 0    free]
  Total: 4 [2.26 TiB] / in use: 4 [2.26 TiB] / in no VG: 0 [0   ]

K so I see here that it scans for sdc… I am using no sdc…
The device it claims not found. I have no idea what that might be.

 # vgscan
  Reading all physical volumes.  This may take a while...
  /dev/sdc: open failed: No medium found
  Found volume group "OLDhdd" using metadata type lvm2
  /dev/sdc: open failed: No medium found
  Couldn't find device with uuid CSGXpY-YEJ7-4qsf-KtdC-ft1u-IOaN-QSecuY.
  Found volume group "system" using metadata type lvm2
  Found volume group "system" using metadata type lvm2

# lvscan
  ACTIVE            '/dev/OLDhdd/OLD' [916.44 GiB] inherit
  /dev/sdc: open failed: No medium found
  Couldn't find device with uuid CSGXpY-YEJ7-4qsf-KtdC-ft1u-IOaN-QSecuY.
  inactive          '/dev/system/home' [895.00 GiB] inherit
  inactive          '/dev/system/root' [34.44 GiB] inherit
  inactive          '/dev/system/swap' [2.00 GiB] inherit


So you can see here that I used yast to assign the sdb3 to a LVG called OLDhdd and tried to call it OLD.

This is from man:

The auto type  may  be  useful  for  user-mounted
              floppies.   Creating  a file /etc/filesystems can
              be useful to change the probe order (e.g., to try
              vfat  before msdos or ext3 before ext2) or if you
              use a kernel  module  autoloader.   Warning:  the
              probing  uses a heuristic (the presence of appro-
              priate `magic'), and could  recognize  the  wrong
              filesystem  type, possibly with catastrophic con-
              sequences. If your data is  valuable,  don't  ask
              mount to guess.

I think he means it.

ConfederacyOfDunces wrote:
> This is from man:
>
> Code:
> --------------------
> The auto type may be useful for user-mounted
> floppies. Creating a file /etc/filesystems can
> be useful to change the probe order (e.g., to try
> vfat before msdos or ext3 before ext2) or if you
> use a kernel module autoloader. Warning: the
> probing uses a heuristic (the presence of appro-
> priate `magic’), and could recognize the wrong
> filesystem type, possibly with catastrophic con-
> sequences. If your data is valuable, don’t ask
> mount to guess.
>
> --------------------
>
> I think he means it.

Sorry I don’t understand the relevance of this?

ConfederacyOfDunces wrote:
> Code:
> --------------------
> # pvscan
> /dev/sdc: open failed: No medium found
> /dev/sdc: open failed: No medium found
> Couldn’t find device with uuid CSGXpY-YEJ7-4qsf-KtdC-ft1u-IOaN-QSecuY.
> PV /dev/sdb3 VG OLDhdd lvm2 [916.44 GiB / 0 free]
> PV /dev/sdb2 VG system lvm2 [15.00 GiB / 0 free]
> PV unknown device VG system lvm2 [916.44 GiB / 0 free]
> PV /dev/sda2 VG system lvm2 [465.61 GiB / 0 free]
> Total: 4 [2.26 TiB] / in use: 4 [2.26 TiB] / in no VG: 0 [0 ]
> --------------------
>
> K so I see here that it scans for sdc… I am using no sdc…
> The device it claims not found. I have no idea what that might be.

LVM keeps its own copies of metadata (/etc/lvm) so I would guess that at
some point in history there was a /dev/sdc with a PV on it and LVM is a
bit confused.

What I don’t understand is sdb2 and sdb3 having different VGs. I thought
you were running on a new disk and wanted to mount something from an old
disk? What that looks like is you have the ‘system’ VG split between two
disks, which doesn’t match my understanding of what you’ve previously said.

> Code:
> --------------------
> # vgscan
> Reading all physical volumes. This may take a while…
> /dev/sdc: open failed: No medium found
> Found volume group “OLDhdd” using metadata type lvm2
> /dev/sdc: open failed: No medium found
> Couldn’t find device with uuid CSGXpY-YEJ7-4qsf-KtdC-ft1u-IOaN-QSecuY.
> Found volume group “system” using metadata type lvm2
> Found volume group “system” using metadata type lvm2
> --------------------
>
> Code:
> --------------------
> # lvscan
> ACTIVE ‘/dev/OLDhdd/OLD’ [916.44 GiB] inherit
> /dev/sdc: open failed: No medium found
> Couldn’t find device with uuid CSGXpY-YEJ7-4qsf-KtdC-ft1u-IOaN-QSecuY.
> inactive ‘/dev/system/home’ [895.00 GiB] inherit
> inactive ‘/dev/system/root’ [34.44 GiB] inherit
> inactive ‘/dev/system/swap’ [2.00 GiB] inherit
> --------------------
>
> So you can see here that I used yast to assign the sdb3 to a LVG called
> OLDhdd and tried to call it OLD.

What I don’t understand is that the LVs in the system VG are all
inactive. That doesn’t match the df output that you showed in response
to DenverD’s request, which showed them in use.

Either I’m being very stupid or something has been changed. It’s
impossible to help with inconsistent data. Please start again and
provide an explanation of the current state and the output from all the
commands DenverD and I requested run at the same time.

PS Just ignore the dm-* stuff. That’s just the LVs.

:~> cat /proc/partitions
major minor  #blocks  name

   8        0  488386584 sda
   8        1     159744 sda1
   8        2  488225792 sda2
   8       16  976762584 sdb
   8       17      72261 sdb1
   8       18   15727635 sdb2
   8       19  960960105 sdb3
 253        0  465154048 dm-0
 253        1   20971520 dm-1
 253        2    2097152 dm-2
 253        3  960958464 dm-3
:~> cat /etc/fstab 
/dev/system/swap     swap                 swap       defaults              0 0
/dev/system/root     /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-WDC_WD5000AADS-00S9B0_WD-WCAV9A100021-part1 /boot                ext4       acl,user_xattr        1 2
/dev/system/home     /home                ext4       acl,user_xattr        1 2
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0
:~> mount
/dev/mapper/system-root on / type ext4 (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)                   
devtmpfs on /dev type devtmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,mode=1777)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/sda1 on /boot type ext4 (rw,acl,user_xattr)
/dev/mapper/system-home on /home type ext4 (rw,acl,user_xattr)
securityfs on /sys/kernel/security type securityfs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
gvfs-fuse-daemon on /home/borelli/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=borelli)

  # pvscan
  /dev/sdc: open failed: No medium found
  /dev/sdc: open failed: No medium found
  Couldn't find device with uuid CSGXpY-YEJ7-4qsf-KtdC-ft1u-IOaN-QSecuY.
  PV /dev/sdb3        VG OLDhdd   lvm2 [916.44 GiB / 0    free]
  PV /dev/sdb2        VG system   lvm2 [15.00 GiB / 0    free]
  PV unknown device   VG system   lvm2 [916.44 GiB / 0    free]
  PV /dev/sda2        VG system   lvm2 [465.61 GiB / 0    free]
  Total: 4 [2.26 TiB] / in use: 4 [2.26 TiB] / in no VG: 0 [0   ]
  # vgscan
  Reading all physical volumes.  This may take a while...
  /dev/sdc: open failed: No medium found
  Found volume group "OLDhdd" using metadata type lvm2
  /dev/sdc: open failed: No medium found
  Couldn't find device with uuid CSGXpY-YEJ7-4qsf-KtdC-ft1u-IOaN-QSecuY.
  Found volume group "system" using metadata type lvm2
  Found volume group "system" using metadata type lvm2
 # lvscan
  ACTIVE            '/dev/OLDhdd/OLD' [916.44 GiB] inherit
  /dev/sdc: open failed: No medium found
  Couldn't find device with uuid CSGXpY-YEJ7-4qsf-KtdC-ft1u-IOaN-QSecuY.
  inactive          '/dev/system/home' [895.00 GiB] inherit
  inactive          '/dev/system/root' [34.44 GiB] inherit
  inactive          '/dev/system/swap' [2.00 GiB] inherit

I can see that it is doing something a little different than before.
The partitions that are being called inactive are being used right now. And the one that’s being called ACTIVE is the one I am trying to mount /dev/OLDhdd/OLD’ [916.44 GiB]

or this is the same:

PV unknown device VG system lvm2 [916.44 GiB / 0 free]

Still not using any sdc.

and Total: 4 [2.26 TiB] / in use: 4 [2.26 TiB] / in no VG: 0 [0 ]

Is incorrect. I only have 1.5TiB worth of disk.

Thanks again.

I think it’s actually correct. It doesn’t show the free space on disks but the free space that can still be redistributed among LV’s.

Best regards,
Greg

ConfederacyOfDunces wrote:
> --------------------
> :~> mount
> /dev/mapper/system-root on / type ext4 (rw,acl,user_xattr)
> proc on /proc type proc (rw)
> sysfs on /sys type sysfs (rw)
> debugfs on /sys/kernel/debug type debugfs (rw)
> devtmpfs on /dev type devtmpfs (rw,mode=0755)
> tmpfs on /dev/shm type tmpfs (rw,mode=1777)
> devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
> /dev/sda1 on /boot type ext4 (rw,acl,user_xattr)
> /dev/mapper/system-home on /home type ext4 (rw,acl,user_xattr)
> securityfs on /sys/kernel/security type securityfs (rw)
> nfsd on /proc/fs/nfsd type nfsd (rw)
> rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
> fusectl on /sys/fs/fuse/connections type fusectl (rw)
> gvfs-fuse-daemon on /home/borelli/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=borelli)
> --------------------
>
>
> Code:
> --------------------
>
> # pvscan
> /dev/sdc: open failed: No medium found
> /dev/sdc: open failed: No medium found
> Couldn’t find device with uuid CSGXpY-YEJ7-4qsf-KtdC-ft1u-IOaN-QSecuY.
> PV /dev/sdb3 VG OLDhdd lvm2 [916.44 GiB / 0 free]
> PV /dev/sdb2 VG system lvm2 [15.00 GiB / 0 free]
> PV unknown device VG system lvm2 [916.44 GiB / 0 free]
> PV /dev/sda2 VG system lvm2 [465.61 GiB / 0 free]
> Total: 4 [2.26 TiB] / in use: 4 [2.26 TiB] / in no VG: 0 [0 ]
> --------------------
>
>
> Code:
> --------------------
> # vgscan
> Reading all physical volumes. This may take a while…
> /dev/sdc: open failed: No medium found
> Found volume group “OLDhdd” using metadata type lvm2
> /dev/sdc: open failed: No medium found
> Couldn’t find device with uuid CSGXpY-YEJ7-4qsf-KtdC-ft1u-IOaN-QSecuY.
> Found volume group “system” using metadata type lvm2
> Found volume group “system” using metadata type lvm2
> --------------------
>
>
> Code:
> --------------------
> # lvscan
> ACTIVE ‘/dev/OLDhdd/OLD’ [916.44 GiB] inherit
> /dev/sdc: open failed: No medium found
> Couldn’t find device with uuid CSGXpY-YEJ7-4qsf-KtdC-ft1u-IOaN-QSecuY.
> inactive ‘/dev/system/home’ [895.00 GiB] inherit
> inactive ‘/dev/system/root’ [34.44 GiB] inherit
> inactive ‘/dev/system/swap’ [2.00 GiB] inherit
> --------------------
>
>
> I can see that it is doing something a little different than before.

That’s just plain weird! :frowning:

mount is showing that your running root filesystem is
/dev/mapper/system-root whilst pvscan is showing /dev/system/root as
inactive. I’m afraid I have no idea how that is even possible, let alone
what to do about it.

> The partitions that are being called inactive are being used right now.
> And the one that’s being called ACTIVE is the one I am trying to mount
> /dev/OLDhdd/OLD’ [916.44 GiB]
>
> or this is the same:
>
> PV unknown device VG system lvm2 [916.44 GiB / 0 free]

I think you’ve somehow managed to do something that’s got LVM well
confused. It seems desirable that YaST and/or the underlying LVM tools
should have stopped you, but for whatever reason they haven’t. The end
result is that LVMs tables and totals are all messed up.

I’d guess, but it’s only a guess, that this “PV unknown device” is
imaginary and is a ghost of sdb3.

> Still not using any sdc.
>
> and Total: 4 [2.26 TiB] / in use: 4 [2.26 TiB] / in no VG: 0 [0 ]
>
> Is incorrect. I only have 1.5TiB worth of disk.

If you subtract the imaginary 916.44 from 2.26, it gives a more
plausible total.

I’m out of my depth here. I don’t want to suggest what to do because I
might make it worse. So I suggest that you go ask the experts.

AFAIK, the best docs on LVM are at <http://tldp.org/HOWTO/LVM-HOWTO/>
and they should help you interpret things. In particular there’s a page
<http://tldp.org/HOWTO/LVM-HOWTO/maillists.html>

I suggest you join the linux-lvm mailing list and ask for advice there.
You should start by saying what your h/w and s/w situation is, what
you’ve done so far and what you’re trying to do. Then list all the
output just like your most recent message here. Somebody there should be
able to interpret exactly what’s happened and help you sort it out.

HTH, Dave

Thanks anyway.
I’m doggone glad I asked cause I need to keep the data there and it turns out the disk wasn’t destabilizing at all.
It turned out to be a very small bit of grime got under my processor somehow and was bridging two pins. Therefore, I can still boot the OLD disk.

That’s great to hear.

It turned out to be a very small bit of grime got under my processor somehow and was bridging two pins. Therefore, I can still boot the OLD disk.

I think you’d still be well-advised to:
(a) set up SMART monitoring of your disks
(b) investigate enough to get the output from the LVM commands to look sane and to match what mount tells you.

Both should help minimise any problems in the future.

Cheers, Dave

I may have an idea about how to solve this.

It occurred to me that the LV that I want to mount is identified by the same name as my current /dev/home. In this state the partitions will have to remain inactive until I can assign them to somewhere else in /dev/.

That is my quick thought and I may be incorrect, but I’d like to hear any thoughts.

I don’t know how to remedy this so if anyone has instructions I would gladly try.

Thanks,
AARON