Can't log in desktop environment after moving `/` and `/home` into different LVs and enlarge swap
I enlarged LV swap
from 1G to 4G. I also moved /
and /home
in a single PV to two different LVs, by shrinking LV root
and create LV home
on the freed space, and then following https://askubuntu.com/a/923943/1471
$ sudo mkdir /mnt/home
$ sudo mount /dev/mapper/lubuntu--vg-home /mnt/home/
$ sudo cp -r /home/* /mnt/home/
$ sudo mv /home /home-orig
$ sudo mkdir /home
and modified /etc/fstab
into the following content, where I renamed /dev/mapper/lubuntu--vg-swap_1
to /dev/mapper/lubuntu--vg-swap
(because I have renamed LV from default name swap_1
to swap
by lvrename
), and add a line for mounting /dev/mapper/lubuntu--vg-home
at /home
.
$ cat /etc/fstab
# /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>
/dev/mapper/lubuntu--vg-root / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=0C1E-EE69 /boot/efi vfat umask=0077 0 1
/dev/mapper/lubuntu--vg-swap none swap sw 0 0
# my change:
/dev/mapper/lubuntu--vg-home /home ext4 defaults 0 2
After I reboot, it seems that LV home
is correctly mounted at /home
:
$ pwd
/home/t
t@olive:~$ df .
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/lubuntu--vg-home 425480640 180336 403617312 1% /home
but there are two problems
- although I can still login in virtual console, I can't log in LXDE of Lubuntu.
free
shows that the swap size is still 1GB.
$ free -h
total used free shared buff/cache available
Mem: 3.3G 196M 2.9G 5.3M 239M 2.9G
Swap: 979M 0B 979M
$ cat /proc/swaps
Filename Type Size Used Priority
/dev/dm-1 partition 1003516 0 -2
$ ls /dev/mapper/ -la
total 0
drwxr-xr-x 2 root root 120 Feb 23 16:47 .
drwxr-xr-x 22 root root 4260 Feb 23 16:47 ..
crw------- 1 root root 10, 236 Feb 23 16:47 control
lrwxrwxrwx 1 root root 7 Feb 23 16:52 lubuntu--vg-home -> ../dm-2
lrwxrwxrwx 1 root root 7 Feb 23 16:52 lubuntu--vg-root -> ../dm-0
lrwxrwxrwx 1 root root 7 Feb 23 16:52 lubuntu--vg-swap -> ../dm-1
How can I solve the problems? Thanks.
ubuntu filesystems partition lvm swap
add a comment |
I enlarged LV swap
from 1G to 4G. I also moved /
and /home
in a single PV to two different LVs, by shrinking LV root
and create LV home
on the freed space, and then following https://askubuntu.com/a/923943/1471
$ sudo mkdir /mnt/home
$ sudo mount /dev/mapper/lubuntu--vg-home /mnt/home/
$ sudo cp -r /home/* /mnt/home/
$ sudo mv /home /home-orig
$ sudo mkdir /home
and modified /etc/fstab
into the following content, where I renamed /dev/mapper/lubuntu--vg-swap_1
to /dev/mapper/lubuntu--vg-swap
(because I have renamed LV from default name swap_1
to swap
by lvrename
), and add a line for mounting /dev/mapper/lubuntu--vg-home
at /home
.
$ cat /etc/fstab
# /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>
/dev/mapper/lubuntu--vg-root / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=0C1E-EE69 /boot/efi vfat umask=0077 0 1
/dev/mapper/lubuntu--vg-swap none swap sw 0 0
# my change:
/dev/mapper/lubuntu--vg-home /home ext4 defaults 0 2
After I reboot, it seems that LV home
is correctly mounted at /home
:
$ pwd
/home/t
t@olive:~$ df .
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/lubuntu--vg-home 425480640 180336 403617312 1% /home
but there are two problems
- although I can still login in virtual console, I can't log in LXDE of Lubuntu.
free
shows that the swap size is still 1GB.
$ free -h
total used free shared buff/cache available
Mem: 3.3G 196M 2.9G 5.3M 239M 2.9G
Swap: 979M 0B 979M
$ cat /proc/swaps
Filename Type Size Used Priority
/dev/dm-1 partition 1003516 0 -2
$ ls /dev/mapper/ -la
total 0
drwxr-xr-x 2 root root 120 Feb 23 16:47 .
drwxr-xr-x 22 root root 4260 Feb 23 16:47 ..
crw------- 1 root root 10, 236 Feb 23 16:47 control
lrwxrwxrwx 1 root root 7 Feb 23 16:52 lubuntu--vg-home -> ../dm-2
lrwxrwxrwx 1 root root 7 Feb 23 16:52 lubuntu--vg-root -> ../dm-0
lrwxrwxrwx 1 root root 7 Feb 23 16:52 lubuntu--vg-swap -> ../dm-1
How can I solve the problems? Thanks.
ubuntu filesystems partition lvm swap
add a comment |
I enlarged LV swap
from 1G to 4G. I also moved /
and /home
in a single PV to two different LVs, by shrinking LV root
and create LV home
on the freed space, and then following https://askubuntu.com/a/923943/1471
$ sudo mkdir /mnt/home
$ sudo mount /dev/mapper/lubuntu--vg-home /mnt/home/
$ sudo cp -r /home/* /mnt/home/
$ sudo mv /home /home-orig
$ sudo mkdir /home
and modified /etc/fstab
into the following content, where I renamed /dev/mapper/lubuntu--vg-swap_1
to /dev/mapper/lubuntu--vg-swap
(because I have renamed LV from default name swap_1
to swap
by lvrename
), and add a line for mounting /dev/mapper/lubuntu--vg-home
at /home
.
$ cat /etc/fstab
# /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>
/dev/mapper/lubuntu--vg-root / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=0C1E-EE69 /boot/efi vfat umask=0077 0 1
/dev/mapper/lubuntu--vg-swap none swap sw 0 0
# my change:
/dev/mapper/lubuntu--vg-home /home ext4 defaults 0 2
After I reboot, it seems that LV home
is correctly mounted at /home
:
$ pwd
/home/t
t@olive:~$ df .
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/lubuntu--vg-home 425480640 180336 403617312 1% /home
but there are two problems
- although I can still login in virtual console, I can't log in LXDE of Lubuntu.
free
shows that the swap size is still 1GB.
$ free -h
total used free shared buff/cache available
Mem: 3.3G 196M 2.9G 5.3M 239M 2.9G
Swap: 979M 0B 979M
$ cat /proc/swaps
Filename Type Size Used Priority
/dev/dm-1 partition 1003516 0 -2
$ ls /dev/mapper/ -la
total 0
drwxr-xr-x 2 root root 120 Feb 23 16:47 .
drwxr-xr-x 22 root root 4260 Feb 23 16:47 ..
crw------- 1 root root 10, 236 Feb 23 16:47 control
lrwxrwxrwx 1 root root 7 Feb 23 16:52 lubuntu--vg-home -> ../dm-2
lrwxrwxrwx 1 root root 7 Feb 23 16:52 lubuntu--vg-root -> ../dm-0
lrwxrwxrwx 1 root root 7 Feb 23 16:52 lubuntu--vg-swap -> ../dm-1
How can I solve the problems? Thanks.
ubuntu filesystems partition lvm swap
I enlarged LV swap
from 1G to 4G. I also moved /
and /home
in a single PV to two different LVs, by shrinking LV root
and create LV home
on the freed space, and then following https://askubuntu.com/a/923943/1471
$ sudo mkdir /mnt/home
$ sudo mount /dev/mapper/lubuntu--vg-home /mnt/home/
$ sudo cp -r /home/* /mnt/home/
$ sudo mv /home /home-orig
$ sudo mkdir /home
and modified /etc/fstab
into the following content, where I renamed /dev/mapper/lubuntu--vg-swap_1
to /dev/mapper/lubuntu--vg-swap
(because I have renamed LV from default name swap_1
to swap
by lvrename
), and add a line for mounting /dev/mapper/lubuntu--vg-home
at /home
.
$ cat /etc/fstab
# /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>
/dev/mapper/lubuntu--vg-root / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=0C1E-EE69 /boot/efi vfat umask=0077 0 1
/dev/mapper/lubuntu--vg-swap none swap sw 0 0
# my change:
/dev/mapper/lubuntu--vg-home /home ext4 defaults 0 2
After I reboot, it seems that LV home
is correctly mounted at /home
:
$ pwd
/home/t
t@olive:~$ df .
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/lubuntu--vg-home 425480640 180336 403617312 1% /home
but there are two problems
- although I can still login in virtual console, I can't log in LXDE of Lubuntu.
free
shows that the swap size is still 1GB.
$ free -h
total used free shared buff/cache available
Mem: 3.3G 196M 2.9G 5.3M 239M 2.9G
Swap: 979M 0B 979M
$ cat /proc/swaps
Filename Type Size Used Priority
/dev/dm-1 partition 1003516 0 -2
$ ls /dev/mapper/ -la
total 0
drwxr-xr-x 2 root root 120 Feb 23 16:47 .
drwxr-xr-x 22 root root 4260 Feb 23 16:47 ..
crw------- 1 root root 10, 236 Feb 23 16:47 control
lrwxrwxrwx 1 root root 7 Feb 23 16:52 lubuntu--vg-home -> ../dm-2
lrwxrwxrwx 1 root root 7 Feb 23 16:52 lubuntu--vg-root -> ../dm-0
lrwxrwxrwx 1 root root 7 Feb 23 16:52 lubuntu--vg-swap -> ../dm-1
How can I solve the problems? Thanks.
ubuntu filesystems partition lvm swap
ubuntu filesystems partition lvm swap
edited Feb 23 at 22:39
Tim
asked Feb 23 at 22:04
TimTim
27.7k78265483
27.7k78265483
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
For starters your cp
hasn't retained permissions or ownerships. Use cp -a
instead of cp -r
.
To be going on, you haven't resized swap itself, just the LV where swap is stored. You'll need to rerun mkswap
.
Thanks.cp -a
works. Strange. before that, why could I log into virtual console but not desktop environment?
– Tim
Feb 23 at 23:18
The GUI environment probably needs to write/create files in your home directory. A console login definitely doesn't.
– roaima
Feb 23 at 23:44
What files are written to or create if I may ask?
– Tim
Feb 24 at 0:12
A console login usually runs a shell, which usually needs to write command history to your $HOME.
– 炸鱼薯条德里克
Feb 24 at 7:07
炸鱼薯条德里克 a console login doesn't need to write command history. The session won't fail if the write fails.
– roaima
Feb 24 at 8:44
|
show 1 more comment
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f502586%2fcant-log-in-desktop-environment-after-moving-and-home-into-different-lvs%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
For starters your cp
hasn't retained permissions or ownerships. Use cp -a
instead of cp -r
.
To be going on, you haven't resized swap itself, just the LV where swap is stored. You'll need to rerun mkswap
.
Thanks.cp -a
works. Strange. before that, why could I log into virtual console but not desktop environment?
– Tim
Feb 23 at 23:18
The GUI environment probably needs to write/create files in your home directory. A console login definitely doesn't.
– roaima
Feb 23 at 23:44
What files are written to or create if I may ask?
– Tim
Feb 24 at 0:12
A console login usually runs a shell, which usually needs to write command history to your $HOME.
– 炸鱼薯条德里克
Feb 24 at 7:07
炸鱼薯条德里克 a console login doesn't need to write command history. The session won't fail if the write fails.
– roaima
Feb 24 at 8:44
|
show 1 more comment
For starters your cp
hasn't retained permissions or ownerships. Use cp -a
instead of cp -r
.
To be going on, you haven't resized swap itself, just the LV where swap is stored. You'll need to rerun mkswap
.
Thanks.cp -a
works. Strange. before that, why could I log into virtual console but not desktop environment?
– Tim
Feb 23 at 23:18
The GUI environment probably needs to write/create files in your home directory. A console login definitely doesn't.
– roaima
Feb 23 at 23:44
What files are written to or create if I may ask?
– Tim
Feb 24 at 0:12
A console login usually runs a shell, which usually needs to write command history to your $HOME.
– 炸鱼薯条德里克
Feb 24 at 7:07
炸鱼薯条德里克 a console login doesn't need to write command history. The session won't fail if the write fails.
– roaima
Feb 24 at 8:44
|
show 1 more comment
For starters your cp
hasn't retained permissions or ownerships. Use cp -a
instead of cp -r
.
To be going on, you haven't resized swap itself, just the LV where swap is stored. You'll need to rerun mkswap
.
For starters your cp
hasn't retained permissions or ownerships. Use cp -a
instead of cp -r
.
To be going on, you haven't resized swap itself, just the LV where swap is stored. You'll need to rerun mkswap
.
answered Feb 23 at 22:43
roaimaroaima
45.6k757124
45.6k757124
Thanks.cp -a
works. Strange. before that, why could I log into virtual console but not desktop environment?
– Tim
Feb 23 at 23:18
The GUI environment probably needs to write/create files in your home directory. A console login definitely doesn't.
– roaima
Feb 23 at 23:44
What files are written to or create if I may ask?
– Tim
Feb 24 at 0:12
A console login usually runs a shell, which usually needs to write command history to your $HOME.
– 炸鱼薯条德里克
Feb 24 at 7:07
炸鱼薯条德里克 a console login doesn't need to write command history. The session won't fail if the write fails.
– roaima
Feb 24 at 8:44
|
show 1 more comment
Thanks.cp -a
works. Strange. before that, why could I log into virtual console but not desktop environment?
– Tim
Feb 23 at 23:18
The GUI environment probably needs to write/create files in your home directory. A console login definitely doesn't.
– roaima
Feb 23 at 23:44
What files are written to or create if I may ask?
– Tim
Feb 24 at 0:12
A console login usually runs a shell, which usually needs to write command history to your $HOME.
– 炸鱼薯条德里克
Feb 24 at 7:07
炸鱼薯条德里克 a console login doesn't need to write command history. The session won't fail if the write fails.
– roaima
Feb 24 at 8:44
Thanks.
cp -a
works. Strange. before that, why could I log into virtual console but not desktop environment?– Tim
Feb 23 at 23:18
Thanks.
cp -a
works. Strange. before that, why could I log into virtual console but not desktop environment?– Tim
Feb 23 at 23:18
The GUI environment probably needs to write/create files in your home directory. A console login definitely doesn't.
– roaima
Feb 23 at 23:44
The GUI environment probably needs to write/create files in your home directory. A console login definitely doesn't.
– roaima
Feb 23 at 23:44
What files are written to or create if I may ask?
– Tim
Feb 24 at 0:12
What files are written to or create if I may ask?
– Tim
Feb 24 at 0:12
A console login usually runs a shell, which usually needs to write command history to your $HOME.
– 炸鱼薯条德里克
Feb 24 at 7:07
A console login usually runs a shell, which usually needs to write command history to your $HOME.
– 炸鱼薯条德里克
Feb 24 at 7:07
炸鱼薯条德里克 a console login doesn't need to write command history. The session won't fail if the write fails.
– roaima
Feb 24 at 8:44
炸鱼薯条德里克 a console login doesn't need to write command history. The session won't fail if the write fails.
– roaima
Feb 24 at 8:44
|
show 1 more comment
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f502586%2fcant-log-in-desktop-environment-after-moving-and-home-into-different-lvs%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown