Trying to unmount umount a drive then mount the drive as a backup

Issues related to hardware problems
xbatx
Posts: 51
Joined: 2010/08/28 08:49:31

Trying to unmount umount a drive then mount the drive as a backup

Postby xbatx » 2018/03/19 14:55:23

I guess this could go in either hardware or software. I am not sure what I am doing incorrectly. Any pointers would be a big help.


Trying to unmount (umount) a drive then mount the drive as a backup drive I keep getting errors busy or not mounted Not sure what I am missing. I am just trying to add a backup drive - ( how would I break apart these drives the correct way?) Overall goal take one drive and rename and save it as backup and mount a backup folder.

using centos 7.4 fresh install
Ran this - (sorry for the longest I am sure there is a simple answer behind all this)


things I ran -

fdisk - l
Disk /dev/sda: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00007079

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 3907028991 1952464896 8e Linux LVM

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0002f994

Device Boot Start End Blocks Id System
/dev/sdb1 2048 3907028991 1953513472 8e Linux LVM

Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0003d7a4

Device Boot Start End Blocks Id System
/dev/sdc1 2048 3907028991 1953513472 8e Linux LVM

Disk /dev/mapper/centos-root: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos-swap: 6174 MB, 6174015488 bytes, 12058624 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos-home: 5940.2 GB, 5940241760256 bytes, 11602034688 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes



then this -

[root@localhost /]# umount /dev/sdc1
umount: /dev/sdc1: not mounted
[root@localhost /]# mount -t ext4 /dev/sdc1 /backup
mount: /dev/sdc1 is already mounted or /backup busy



and this -

[root@localhost /]# sudo pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 centos lvm2 a-- <1.82t 4.00m
/dev/sdb1 centos lvm2 a-- <1.82t 0
/dev/sdc1 centos lvm2 a-- <1.82t 0
[root@localhost /]# sudo lvdisplay /dev/centos
--- Logical volume ---
LV Path /dev/centos/swap
LV Name swap
VG Name centos
LV UUID 79NHbt-FJLu-e72U-vStR-SOTS-o2sY-mVIOAA
LV Write Access read/write
LV Creation host, time localhost, 2018-03-14 10:56:07 -0400
LV Status available
# open 2
LV Size 5.75 GiB
Current LE 1472
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1

--- Logical volume ---
LV Path /dev/centos/home
LV Name home
VG Name centos
LV UUID OLHRG7-5dit-yQeF-bHCw-dzyP-m8lU-ehK4y8
LV Write Access read/write
LV Creation host, time localhost, 2018-03-14 10:56:07 -0400
LV Status available
# open 1
LV Size 5.40 TiB
Current LE 1416264
Segments 3
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2

--- Logical volume ---
LV Path /dev/centos/root
LV Name root
VG Name centos
LV UUID 7pcE7P-nS8y-MJpe-Mmbx-QPXA-pe79-T65sOP
LV Write Access read/write
LV Creation host, time localhost, 2018-03-14 10:56:28 -0400
LV Status available
# open 1
LV Size 50.00 GiB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0


[root@localhost /]# cat /proc/mounts
rootfs / rootfs rw 0 0
sysfs /sys sysfs rw,seclabel,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
devtmpfs /dev devtmpfs rw,seclabel,nosuid,size=5895308k,nr_inodes=1473827,mode=755 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev/shm tmpfs rw,seclabel,nosuid,nodev 0 0
devpts /dev/pts devpts rw,seclabel,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,seclabel,nosuid,nodev,mode=755 0 0
tmpfs /sys/fs/cgroup tmpfs ro,seclabel,nosuid,nodev,noexec,mode=755 0 0
cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0
pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct,cpu 0 0
cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0
cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0
cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_prio,net_cls 0 0
cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
cgroup /sys/fs/cgroup/pids cgroup rw,nosuid,nodev,noexec,relatime,pids 0 0
configfs /sys/kernel/config configfs rw,relatime 0 0
/dev/mapper/centos-root / xfs rw,seclabel,relatime,attr2,inode64,noquota 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=35,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=12455 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,seclabel,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
mqueue /dev/mqueue mqueue rw,seclabel,relatime 0 0
/dev/mapper/centos-home /home xfs rw,seclabel,relatime,attr2,inode64,noquota 0 0
/dev/sda1 /boot xfs rw,seclabel,relatime,attr2,inode64,noquota 0 0
tmpfs /run/user/0 tmpfs rw,seclabel,nosuid,nodev,relatime,size=1188108k,mode=700 0 0
[root@localhost /]# mount -t ext4 /dev/sdc1 /backup
mount: /dev/sdc1 is already mounted or /backup busy
[root@localhost /]# mount /dev/sdc1 /backup
mount: unknown filesystem type 'LVM2_member'








[root@localhost /]# lvscan
ACTIVE '/dev/centos/swap' [5.75 GiB] inherit
ACTIVE '/dev/centos/home' [5.40 TiB] inherit
ACTIVE '/dev/centos/root' [50.00 GiB] inherit
[root@localhost /]# lvmdiskscan
/dev/centos/root [ 50.00 GiB]
/dev/sda1 [ 1.00 GiB]
/dev/centos/swap [ 5.75 GiB]
/dev/sda2 [ <1.82 TiB] LVM physical volume
/dev/centos/home [ 5.40 TiB]
/dev/sdb1 [ <1.82 TiB] LVM physical volume
/dev/sdc1 [ <1.82 TiB] LVM physical volume
3 disks
1 partition
0 LVM physical volume whole disks
3 LVM physical volumes
[root@localhost /]# lvdisplay
--- Logical volume ---
LV Path /dev/centos/swap
LV Name swap
VG Name centos
LV UUID 79NHbt-FJLu-e72U-vStR-SOTS-o2sY-mVIOAA
LV Write Access read/write
LV Creation host, time localhost, 2018-03-14 10:56:07 -0400
LV Status available
# open 2
LV Size 5.75 GiB
Current LE 1472
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1

--- Logical volume ---
LV Path /dev/centos/home
LV Name home
VG Name centos
LV UUID OLHRG7-5dit-yQeF-bHCw-dzyP-m8lU-ehK4y8
LV Write Access read/write
LV Creation host, time localhost, 2018-03-14 10:56:07 -0400
LV Status available
# open 1
LV Size 5.40 TiB
Current LE 1416264
Segments 3
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2

--- Logical volume ---
LV Path /dev/centos/root
LV Name root
VG Name centos
LV UUID 7pcE7P-nS8y-MJpe-Mmbx-QPXA-pe79-T65sOP
LV Write Access read/write
LV Creation host, time localhost, 2018-03-14 10:56:28 -0400
LV Status available
# open 1
LV Size 50.00 GiB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0

[root@localhost /]#





, or

tunk
Posts: 280
Joined: 2017/02/22 15:08:17

Re: Trying to unmount umount a drive then mount the drive as a backup

Postby tunk » 2018/03/19 15:13:07

I have no experience with LVM, but to me it looks like you've allocated all disk space:
53.7 + 6.2 + 5940.3 ≃ 6000GB
What's the output of df?

MartinR
Posts: 312
Joined: 2015/05/11 07:53:27
Location: UK

Re: Trying to unmount umount a drive then mount the drive as a backup

Postby MartinR » 2018/03/19 15:43:58

/dev/sdc1 is a part of the volume group centos, see the output from pvs. As such it is not mounted, but the logical volumes within the volume group are. Since it's not mounted, it can't be umounted. mount is giving a misleading error message though, "mount: /dev/sdc1 is already mounted or /backup busy" isn't quite true, the disk is not mounted but it is bound into "centos" and is therefore busy.

To remove the partition from the volume group is not trivial. Back up all filesystems fully, make a mistake during this process and you'll get a chance to test your DR plan. :twisted: You first need to ensure the volume group has enough unallocated space to accept the loss of the physical volume. To achieve this you may need to delete or shrink filesystems, then the logical volumes the filesystems were on. You can then use pvmove to move used blocks off the partition before finally using pvremove to remove /dev/sdc1 from the VG. Then you can reformat the partition and build a new filesystem on it. - Of course you do have up to date full backups don't you? :?:

The easier alternative is to add a new disk and either move the contents of /dev/sdc1 onto it (last couple of steps above), or use that for /backup. - And are your existing backups still good? ;)