3

I am using Ubuntu 14.04 dual booting Windows 10. I had one hard drive and now I've added another. I've allocated around 840GB for Ubuntu. In the past I've been able to mount this drive to

/media/mynewdrive 

But now my needs are changing. I will be needing more space in the first drive (sda) and want to create separate partitions for /usr, /var, /opt and /tmp. I have a few questions:

  • I want to create physical volumes and volume groups in /dev/sdb3. Before that I'll need to mount it, but I get the error message that /dev/sdb3 can't be mounted as it's busy. I find the processes that are running and then kill them. One volume group is good enough for me and then within that logical volume I want to put - /usr, /opt, /var and /tmp
  • When I am creating them, as /usr is already existing within /, what will happen? I think I need to move all the /usr contents into a new one(/usr of the logical volume), right?

Here is some additional information. This is the /dev/sdb drive, and this is the /dev/sda drive.

My LVM User Interface isn't of much use, but here it is anyways. Most of the posts I see are about when folks used LVM at the time of the install rather than post-install, which is not helping me. Found some good resources on this website. I got some success in this but not 100% success that I was looking for. I wanted to move out:

/home 11G
/opt 9G
/usr 7G
/var 3G
/tmp 1.1G

To my second hard drive so that my Ubuntu can grow in future without any issues. I never used LVM in the past so I learnt from these sources:

The issue that I was facing is that a good number of folks made use of LVM at the time of install, but not later, which is my case. I did the steps in the following order:

1st- Create physical volume on /dev/sdb3
2nd- Volume group 3rd- Logical volumes (home, var, opt, usr and tmp)

I then executed:

mkfs -t ext4 /dev/vgall/opt
cp -r -R /opt/* /temp-opt
mount -t ext4 /dev/vgall/opt /temp-opt

I then made this entry into the /etc/fstab:

#this is volume-opt
UUID=b3d302be-68f6-4804-abb1-ab806326b5a4   /opt    ext4    defaults    0   2

After that I restarted. My /etc/fstab was like this: (before LVM changes)

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda7 during installation
UUID=54458154-6f44-44c9-be44-f91d093d63e6 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda2 during installation
UUID=E467-1A3B  /boot/efi       vfat    defaults        0       1
# swap was on /dev/sda6 during installation
UUID=74a0518b-2eed-404a-aaa1-a302dbf9f18c none            swap    sw              0       0
/dev/sdb3    /media/mynewdrive   ext4    defaults     0        2
(rw,nosuid,nodev,uhelper=hal,shortname=mixed,uid=1000,utf8,umask=077,flush)

Afterwards, it became like this:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda7 during installation
UUID=54458154-6f44-44c9-be44-f91d093d63e6 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda2 during installation
UUID=E467-1A3B  /boot/efi       vfat    defaults        0       1
# swap was on /dev/sda6 during installation
UUID=74a0518b-2eed-404a-aaa1-a302dbf9f18c none            swap    sw              0       0
#/dev/vgall/tmp     /tmp        ext4    defaults    0 2
#this is volume-opt
UUID=b3d302be-68f6-4804-abb1-ab806326b5a4   /opt    ext4    defaults    0   2
#/dev/mapper/vgall-var
#UUID=35d84c0b-d29b-4677-bc0f-26ef945d1ebf  /var    ext4    defaults    0   1
#/dev/mapper/vgall-usr
#UUID=e67910d0-09c9-4249-ba20-c4e471b30e63  /usr    ext4    defaults    0   2
#/dev/vgall/home
#UUID=5d610ba0-5ed4-4d08-99dd-946fed50ddd0  /home   ext4    defaults    0   2   

I tried one LV (/opt) at a time, but for me only I can use the /opt to be in LVM. Others failed (home, tmp, usr and var) to work for me, and I don't know why. For others (home, tmp, usr and var) either I cannot login(login loop), or my sidebar disappeared and Ubuntu crashed. What could be the reason for others not to work? I also followed these links:

This is the view from LVM, and this is the view from gparted

This is the output of lvdisplay command:

root@ashu-700-430qe:/home/ashu# lvdisplay
  --- Logical volume ---
  LV Path                /dev/vgall/tmp
  LV Name                tmp
  VG Name                vgall
  LV UUID                gXLwJk-afuW-PXd3-c32p-IhnF-mlpm-zj8WrZ
  LV Write Access        read/write
  LV Creation host, time ashu-700-430qe, 2016-02-05 19:56:26 -0700
  LV Status              available
  # open                 0
  LV Size                60.00 GiB
  Current LE             15360
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0

  --- Logical volume ---
  LV Path                /dev/vgall/var
  LV Name                var
  VG Name                vgall
  LV UUID                iifcKK-2wmd-2XIy-wPOj-cwot-yltu-xtyPP3
  LV Write Access        read/write
  LV Creation host, time ashu-700-430qe, 2016-02-05 19:57:50 -0700
  LV Status              available
  # open                 0
  LV Size                150.00 GiB
  Current LE             38400
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:1

  --- Logical volume ---
  LV Path                /dev/vgall/usr
  LV Name                usr
  VG Name                vgall
  LV UUID                BDJfs6-beZl-aXjU-YbgC-loep-cJHw-Nn624e
  LV Write Access        read/write
  LV Creation host, time ashu-700-430qe, 2016-02-05 20:02:11 -0700
  LV Status              available
  # open                 0
  LV Size                210.00 GiB
  Current LE             53760
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:2

  --- Logical volume ---
  LV Path                /dev/vgall/opt
  LV Name                opt
  VG Name                vgall
  LV UUID                K2Nq7v-sleg-ZUeN-vjyf-uuOh-NRjk-ezGydd
  LV Write Access        read/write
  LV Creation host, time ashu-700-430qe, 2016-02-05 20:02:26 -0700
  LV Status              available
  # open                 1
  LV Size                210.27 GiB
  Current LE             53828
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:3

  --- Logical volume ---
  LV Path                /dev/vgall/home
  LV Name                home
  VG Name                vgall
  LV UUID                Egm5cB-9k2N-LTw4-xyav-nl24-ed3K-ay5yOD
  LV Write Access        read/write
  LV Creation host, time ashu-700-430qe, 2016-02-05 20:08:07 -0700
  LV Status              available
  # open                 0
  LV Size                211.00 GiB
  Current LE             54016
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:4

root@ashu-700-430qe:/home/ashu#

Here is the output of mount command:

root@ashu-700-430qe:/home/ashu# mount
/dev/sda7 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/cgroup type tmpfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /sys/firmware/efi/efivars type efivarfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
none on /sys/fs/pstore type pstore (rw)
/dev/mapper/vgall-opt on /opt type ext4 (rw)
/dev/sda2 on /boot/efi type vfat (rw)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd)
vmware-vmblock on /run/vmblock-fuse type fuse.vmware-vmblock (rw,nosuid,nodev,default_permissions,allow_other)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=ashu)
/dev/sr0 on /media/ashu/CD0001 type iso9660 (ro,nosuid,nodev,uid=1000,gid=1000,iocharset=utf8,mode=0400,dmode=0500,uhelper=udisks2)

I finally tried this combination also in /etc/fstab:

/dev/mapper/vgall-home /home   ext4    defaults        0       2

After that I ran

sudo update-initramfs -u 

In order to make the device mappings available during boot, but no fix...only /opt is working fine, but others are not. How should I proceed in resolving this issue.

0

You must log in to answer this question.

Browse other questions tagged .