Trying to mount /var to another partition [SOLVED]

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
SprinterDriver
Level 4
Level 4
Posts: 260
Joined: Sun Jan 25, 2015 3:35 pm
Location: Norway

Trying to mount /var to another partition [SOLVED]

Post by SprinterDriver »

Hi.

Have a new install of LM Cinnamon 18.3 x64 on an Optiplex 780 desktop.

Just a brief explanation why I bother doing this:
On this computer, it is all from scratch, so no disaster if I screw up anything. I consider it a test rig.
During installation of LM, only one 320GB drive was present (cd rom and thumb drive not counting).
So I had another older drive laying around, so I figured I should make some partitions on that too and try to mount /var to one partition on that older drive. The purpose of this is mostly for my own learning, haven't done very much of this stuff lately.

What I hope to get help with, is to make this actually work and to find the cause of why LM won't boot to desktop when fstab is modified.

The partitions on second drive "sdb" was created by gparted (only additional software installed so far).

sudo blkid

Code: Select all

/dev/sda1: UUID="6260913c-da55-4e84-9bac-6b7ac187387c" TYPE="ext4" PARTUUID="f067edd7-01"
/dev/sda5: UUID="68d6544e-40d5-476e-9edc-02cfb541ebe3" TYPE="ext4" PARTUUID="f067edd7-05"
/dev/sda6: UUID="8e3bd08b-22a2-44ee-91a6-5f60039a11da" UUID_SUB="54a9f55a-79a8-4d93-b66a-4fd18a1f0366" TYPE="btrfs" PARTUUID="f067edd7-06"
/dev/sda7: UUID="492c4037-e913-4805-9e2f-902f7c010d6a" TYPE="swap" PARTUUID="f067edd7-07"
/dev/sda8: UUID="fc0039fe-b4cf-46eb-971f-47fc1b1968f3" UUID_SUB="e6cf9e09-5837-4ed6-a3ea-5d64ba26f621" TYPE="btrfs" PARTUUID="f067edd7-08"
/dev/sdb1: UUID="d9670de9-432e-4281-a546-d344865a0ff0" TYPE="swap" PARTUUID="a284861a-01"
/dev/sdb5: LABEL="tmp" UUID="96144b36-15ad-45a7-a287-9b4479cf16da" TYPE="ext2" PARTUUID="a284861a-05"
/dev/sdb6: LABEL="var" UUID="3eaa5c58-4e88-44da-9358-4d6807ffcb15" TYPE="ext4" PARTUUID="a284861a-06"
/dev/sdb7: LABEL="othercrap" UUID="41d1a156-a88d-4059-b50e-951c5c4cb18e" UUID_SUB="a12d9627-fe3c-4737-a801-e265f9c8bca8" TYPE="btrfs" PARTUUID="a284861a-07"

the fstab contents (two last line is added by me)

Code: Select all

# /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/sda5 during installation
UUID=68d6544e-40d5-476e-9edc-02cfb541ebe3 /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda1 during installation
UUID=6260913c-da55-4e84-9bac-6b7ac187387c /boot           ext4    defaults        0       2
# /home was on /dev/sda6 during installation
UUID=8e3bd08b-22a2-44ee-91a6-5f60039a11da /home           btrfs   defaults,subvol=@home 0       2
# /lager was on /dev/sda8 during installation
UUID=fc0039fe-b4cf-46eb-971f-47fc1b1968f3 /lager          btrfs   defaults        0       2
# swap was on /dev/sda7 during installation
UUID=492c4037-e913-4805-9e2f-902f7c010d6a none            swap    sw              0       0
# /dev/sdb6   PÅ gammal 80GB disk
UUID=3eaa5c58-4e88-44da-9358-4d6807ffcb15 /var            ext4    defaults,errors=remount-ro 0       1
What happens at next boot is that after the first mint logo appear, the screen goes into black with a blinking marker at upper left corner. So obviously something is not set up properly, I just does not excactly what.

Personally I suspect that either bad permission for the partition or the fact it is mounted (appears in Nemo as unmountable). But maybe you guys can push me in right direction.
I tried to mess with permission for partition /dev/sdb6 but I guess that wasn't a good idea.

To be honest I haven't fully understand the permission system for Linux file systems. Using Nemo as root (bad, yes but nothing critical on this computer so far) I was able to set permission and change owner. I think I was doing a dumb thing when setting permission for group "sprinterdriver" so it can read/change everything.

Permission - current user is "sprinterdriver"

Code: Select all

sprinterdriver@optiplex ~ $ ls -la /dev/sdb6
brw-rw---- 1 root disk 8, 22 Apr  4 22:04 /dev/sdb6
And namei - I just found this command after searching the web for commands that may inform about file permissions

Code: Select all

sprinterdriver@optiplex ~ $ namei -m /etc/sdb6
f: /etc/sdb6
 drwxr-xr-x /
 drwxr-xr-x etc
            sdb6 - No such file or directory
not sure what this actually means, and why it yelds different from the ls -a command.

Thanks
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
So I got this bright idea. But when I tried to grab the light bulb, I did not hurt my hands as expected from a warm bulb, because it turned out to be one of those LED bulbs.
WharfRat

Re: Trying to mount /var to another partition

Post by WharfRat »

I have a question which in order to answer you'll have to boot the live media and mount /dev/sdb6 to /mnt

The question is what resides on /dev/sdb6 :?:

If you're willing sudo mount /dev/sdb6 /mnt then paste back ls -lh /mnt
fabien85
Level 7
Level 7
Posts: 1877
Joined: Tue Mar 11, 2014 4:30 pm

Re: Trying to mount /var to another partition

Post by fabien85 »

Did you try to move /var on the otherl drive after the install ?

If so, you have to copy the content of the current /var to the new one. There are things in there that are needed to boot.

I'm saying that because I stumbled on this problem once : for a test/backup OS I copied my current OS to another partition, I figured I would make a separate /var, I made an empty partition for it and modified the fstab, and lo and behold it wouldnt boot. I had to copy the content of a valid /var into the partition so that it would work.
User avatar
SprinterDriver
Level 4
Level 4
Posts: 260
Joined: Sun Jan 25, 2015 3:35 pm
Location: Norway

Re: Trying to mount /var to another partition

Post by SprinterDriver »

WharfRat wrote: Wed Apr 04, 2018 9:31 pm I have a question which in order to answer you'll have to boot the live media and mount /dev/sdb6 to /mnt

The question is what resides on /dev/sdb6 :?:

If you're willing sudo mount /dev/sdb6 /mnt then paste back ls -lh /mnt
The contents is (after mounting to /mnt as suggested):

Code: Select all

sprinterdriver@optiplex /mnt $ ls -lh /mnt
total 60K
drwxr-xr-x  2 root root   4,0K Apr  4 20:09 backups
-rw-r--r--  1 root root    133 Apr  4 21:10 before
drwxr-xr-x 17 root root   4,0K Nov 24 14:13 cache
drwxrwxrwt  2 root root   4,0K Nov 24 14:05 crash
drwxr-xr-x 71 root root   4,0K Apr  4 00:18 lib
drwxrwsr-x  2 root root   4,0K Apr 12  2016 local
lrwxrwxrwx  1 root root      9 Apr  4 21:21 lock -> /run/lock
drwxrwxr-x 13 root syslog 4,0K Apr  4 21:28 log
drwxrwxrwx  2 root root    16K Apr  4 20:31 lost+found
drwxrwsr-x  2 root root   4,0K Nov 24 13:36 mail
drwxr-xr-x  2 root root   4,0K Nov 24 13:36 opt
lrwxrwxrwx  1 root root      4 Apr  4 21:21 run -> /run
drwxr-xr-x  7 root root   4,0K Nov 24 13:59 spool
drwxrwxrwt  6 root root   4,0K Apr  4 21:29 tmp
The before file 133 bytes was just one I created so I was supposed to be able to confirm if the mounting had worked. Created by me, totally.

Just for record - here is current contents of actual /var folder:

Code: Select all

sprinterdriver@optiplex /var $ ls -lh
total 40K
drwxr-xr-x  2 root root   4,0K Apr  5 23:50 backups
drwxr-xr-x 17 root root   4,0K Nov 24 14:13 cache
drwxrwxrwt  2 root root   4,0K Nov 24 14:05 crash
drwxr-xr-x 71 root root   4,0K Apr  4 00:18 lib
drwxrwsr-x  2 root staff  4,0K Apr 12  2016 local
lrwxrwxrwx  1 root root      9 Apr  3 23:56 lock -> /run/lock
drwxrwxr-x 13 root syslog 4,0K Apr  5 23:50 log
drwxrwsr-x  2 root mail   4,0K Nov 24 13:36 mail
drwxr-xr-x  2 root root   4,0K Nov 24 13:36 opt
lrwxrwxrwx  1 root root      4 Apr  3 23:56 run -> /run
drwxr-xr-x  7 root root   4,0K Nov 24 13:59 spool
drwxrwxrwt  7 root root   4,0K Apr  5 23:46 tmp
fabien85 wrote: Thu Apr 05, 2018 4:26 am Did you try to move /var on the other drive after the install ?

If so, you have to copy the content of the current /var to the new one. There are things in there that are needed to boot.
.....
Yes I did. I used Nemo (root) and copied all contents from /var to /dev/sdb6

Just as I wrote this I think I did forgot a critical thing here - I forgot to set "view hidden files" prior to copying. Ok, just tested that - I opened Nemo as root and toggled between hide/show hidden files, nothing change - is there no hidden files in /var ?

Have a question - have to be honest enough to say that coming from windows world make me feel more confident using Nemo to copy files than cp. Therefore I have a question - when using Nemo (as root) to copy files from one partition to another, does all file attributes being copied too (assuming both ext4) ?

I (not) move (but) copy the contents of /var to another disk, but want to leave all current files in the old /var directory because in case the second disk is going dead, I want to be able to revoke the mounting and then just have the old contents of /var.
So I got this bright idea. But when I tried to grab the light bulb, I did not hurt my hands as expected from a warm bulb, because it turned out to be one of those LED bulbs.
WharfRat

Re: Trying to mount /var to another partition

Post by WharfRat »

I'm getting confused here. You wrote
What happens at next boot is that after the first mint logo appear, the screen goes into black with a blinking marker at upper left corner.
yet your prompt is sprinterdriver@optiplex so obviously you're not booted to the live media.

Did you get this straightened out :?:
User avatar
SprinterDriver
Level 4
Level 4
Posts: 260
Joined: Sun Jan 25, 2015 3:35 pm
Location: Norway

Re: Trying to mount /var to another partition

Post by SprinterDriver »

Thank you for helping me forward so far.
No, I was not at live-cd when using that terminal session. Therefore the user is me - I did not use Terminal in Live-cd session to perform file copy.

That pasted text was after I managed to replace the bad (?) fstab file with the original one, and to get installed LM to boot normally.

I haven't tried again because I don't know what I do wrong, and I haven't come up with any ideas either. There must be some stupid pit fall I have stumbled into, I just are too noob to see what is wrong. There may as well be something complete else being the reason why this fails.

I just attach a screenshot of Nemo in that (not) var folder contents, and also the permission of the partition. I assume that is the actually permission of the partition and not just some mount point (automatically mounted this time):

As stated earlier - I cannot figure this out, hope some may see what is wrong or ask about int.

[kind of editd - just popped up as I wrote, but before I submitted]
Actually I did not using Live-cd session when copied files from actual /var to sdb6, can that explain why the mounting goes wrong? Will file copy of opened files - even if logged in as root - fail?
Question: Is it morte likely to work if I copy the files from /var when booted in live-cd mode?

Want to give it another try, but have not time now (have to cock up some dinner tonight) but I'll like to hear what you think about this, because I would like to have an opinion of whether it is likely to succeed next time or not before I spend more time on it (if fails = need more time to figure it out somehow).

[edit] (real edit this time)
Answer to question from fabien85:
Both drives was blanked prior to install (victim of crappy windows install) so I had to install LM prior to copying the files from within /var.
So I got this bright idea. But when I tried to grab the light bulb, I did not hurt my hands as expected from a warm bulb, because it turned out to be one of those LED bulbs.
WharfRat

Re: Trying to mount /var to another partition

Post by WharfRat »

SprinterDriver wrote:I just attach a screenshot of Nemo in that (not) var folder contents, and also the permission of the partition
You can't just go by the folder (filesystem) permissions - there are other folders/files with varying owner/group properties.

Run sudo find /var/lib \( ! -group root -or ! -user root \) -ls on the "new" /var partition and compare it to this

Code: Select all

[bill@XPS] ~ $ sudo find /var/lib \( ! -group root  -or  ! -user root \)  -ls
   232295     12 drwx------   2 _apt     root        12288 Apr  6 16:40 /var/lib/apt/lists/partial
   232255      4 drwxrwx--T   4 root     mdm          4096 Apr  6 08:10 /var/lib/mdm
   264336      4 drwx------   3 mdm      mdm          4096 Sep 28  2016 /var/lib/mdm/.dbus
   264337      4 drwx------   2 mdm      mdm          4096 Jun 19  2017 /var/lib/mdm/.dbus/session-bus
   264338      4 -rw-r--r--   1 mdm      mdm           463 Nov 10 15:25 /var/lib/mdm/.dbus/session-bus/4603ef0b0eb640e2836974a04d12e5ab-0
   262167      4 -rw-r--r--   1 mdm      mdm           465 Aug 23  2017 /var/lib/mdm/.dbus/session-bus/4603ef0b0eb640e2836974a04d12e5ab-20
   262166      4 -rw-r--r--   1 mdm      mdm           465 Jun 27  2017 /var/lib/mdm/.dbus/session-bus/4603ef0b0eb640e2836974a04d12e5ab-21
   264330      4 drwx------   5 mdm      mdm          4096 Sep 28  2016 /var/lib/mdm/.cache
   264331      4 drwx------   3 mdm      mdm          4096 Sep 28  2016 /var/lib/mdm/.cache/webkit
   264332      4 drwx------   2 mdm      mdm          4096 Sep 28  2016 /var/lib/mdm/.cache/webkit/icondatabase
   264333     16 -rw-r--r--   1 mdm      mdm         16384 Sep 28  2016 /var/lib/mdm/.cache/webkit/icondatabase/WebpageIcons.db
   264339      4 drwxr-xr-x   2 mdm      mdm          4096 Sep  2  2017 /var/lib/mdm/.cache/gstreamer-1.0
   262197    860 -rw-------   1 mdm      mdm        876719 Sep  2  2017 /var/lib/mdm/.cache/gstreamer-1.0/registry.x86_64.bin
   264334      4 drwx------   2 mdm      mdm          4096 Sep 28  2016 /var/lib/mdm/.cache/dconf
   264335      4 -rw-------   1 mdm      mdm             2 Nov 10 15:25 /var/lib/mdm/.cache/dconf/user
   197806  10836 -rw-r-----   1 root     mlocate  11095513 Apr  6 08:15 /var/lib/mlocate/mlocate.db
   232230      4 drwxr-xr-x   2 avahi-autoipd avahi-autoipd     4096 Jun 28  2016 /var/lib/avahi-autoipd
   232259      4 drwxr-xr-x   2 ntp           ntp               4096 Apr  6 15:10 /var/lib/ntp
   196864      4 -rw-r--r--   1 ntp           ntp                  7 Apr  6 15:10 /var/lib/ntp/ntp.drift
   232233      4 drwxr-xr-x   4 colord        colord            4096 Sep 28  2016 /var/lib/colord
   243883      4 -rw-r--r--   1 colord        colord            4096 Sep 28  2016 /var/lib/colord/mapping.db
   232377      4 drwxr-xr-x   2 colord        colord            4096 Jun 28  2016 /var/lib/colord/icc
   243884      8 -rw-r--r--   1 colord        colord            7168 Sep 28  2016 /var/lib/colord/storage.db
   263357      4 drwx------   2 colord        colord            4096 Sep 28  2016 /var/lib/colord/.cache
   243585      4 drwxr-xr-x   3 nm-openvpn    nm-openvpn        4096 Jun 28  2016 /var/lib/openvpn/chroot
   243586      4 drwxr-xr-x   2 nm-openvpn    nm-openvpn        4096 Jun 28  2016 /var/lib/openvpn/chroot/tmp
   331897      4 drwxr-xr-x   4 statd         nogroup           4096 Apr  3 20:04 /var/lib/nfs
   327739      0 -rw-r--r--   1 statd         root                 0 Mar 30  2017 /var/lib/nfs/state
   466228      4 drwxr-xr-x   2 statd         nogroup           4096 Mar 30  2017 /var/lib/nfs/sm.bak
   466229      4 drwxr-xr-x   2 statd         nogroup           4096 Mar 30  2017 /var/lib/nfs/sm
   328141      4 drwxr-xr-x   2 vnstat        vnstat            4096 Feb 14 19:15 /var/lib/vnstat
   332730      4 -rw-r--r--   1 vnstat        vnstat            2792 Apr  6 16:55 /var/lib/vnstat/.enp0s31f6
   327744      4 -rw-r--r--   1 vnstat        vnstat            2792 Apr  6 16:55 /var/lib/vnstat/tun0
   332728      4 -rw-r--r--   1 vnstat        vnstat            2792 Apr  6 16:55 /var/lib/vnstat/wlp2s0
   332732      4 -rw-r--r--   1 vnstat        vnstat            2792 Apr  6 16:55 /var/lib/vnstat/.wlp2s0
   332734      4 -rw-r--r--   1 vnstat        vnstat            2792 Apr  6 16:55 /var/lib/vnstat/.tun0
   328143      4 -rw-r--r--   1 vnstat        vnstat            2792 Apr  6 16:55 /var/lib/vnstat/enp0s31f6
   199610      4 -rw-r--r--   1 bill          bill               497 Oct 23 09:26 /var/lib/dpkg/info/grub-efi-amd64-signed.md5sums
   199657      4 -rwxr-xr-x   1 bill          bill               448 Oct 23 09:26 /var/lib/dpkg/info/grub-efi-amd64-signed.postinst
   199914      4 -rwxr-xr-x   1 bill          bill               268 Jul 13  2017 /var/lib/dpkg/info/shim-signed.postrm
[bill@XPS] ~ $ 
User avatar
SprinterDriver
Level 4
Level 4
Posts: 260
Joined: Sun Jan 25, 2015 3:35 pm
Location: Norway

Re: Trying to mount /var to another partition

Post by SprinterDriver »

Ok, here is the output of the command:

Code: Select all

sprinterdriver@optiplex ~ $ sudo mount /dev/sdb6 /mnt
sprinterdriver@optiplex /mnt $ sudo find /var/lib \( ! -group root -or ! -user root \) -ls
   395733   5468 -rw-r-----   1 root     mlocate   5598313 Apr  8 17:00 /var/lib/mlocate/mlocate.db
   287295      4 drwxr-xr-x   3 geoclue  geoclue      4096 Apr  4 01:58 /var/lib/geoclue
   262909      4 drwx------   2 geoclue  geoclue      4096 Apr  4 01:58 /var/lib/geoclue/.cache
   287300     16 drwx------   2 _apt     root        16384 Apr  6 19:38 /var/lib/apt/lists/partial
   811103      4 drwxr-xr-x   3 nm-openvpn nm-openvpn     4096 Nov 24 14:09 /var/lib/openvpn/chroot
   811104      4 drwxr-xr-x   2 nm-openvpn nm-openvpn     4096 Nov 24 14:09 /var/lib/openvpn/chroot/tmp
   165540      4 drwxr-xr-x   2 avahi-autoipd avahi-autoipd     4096 Nov 24 14:05 /var/lib/avahi-autoipd
   165543      4 drwxr-xr-x   4 colord        colord            4096 Apr  4 00:08 /var/lib/colord
   287302      4 drwxr-xr-x   2 colord        colord            4096 Nov 24 14:06 /var/lib/colord/icc
   151107      8 -rw-r--r--   1 colord        colord            7168 Apr  4 00:08 /var/lib/colord/storage.db
   150613      4 -rw-r--r--   1 colord        colord            4096 Apr  4 00:08 /var/lib/colord/mapping.db
   262906      4 drwx------   2 colord        colord            4096 Apr  4 00:08 /var/lib/colord/.cache
   395734      4 drwxrwx---   2 lightdm       lightdm           4096 Apr  8 16:55 /var/lib/lightdm-data/lightdm
   150238      4 drwxrwx---   2 oskar         lightdm           4096 Apr  4 00:08 /var/lib/lightdm-data/oskar
   429879      4 drwxr-xr-x   2 ntp           ntp               4096 Apr  5 00:53 /var/lib/ntp
   394284      4 -rw-r--r--   1 ntp           ntp                  8 Apr  5 00:53 /var/lib/ntp/ntp.drift
   429870      4 drwxr-x---   5 lightdm       lightdm           4096 Apr  4 00:08 /var/lib/lightdm
   393198      4 drwx------   3 lightdm       lightdm           4096 Apr  4 00:08 /var/lib/lightdm/.dbus
   394257      4 drwx------   2 lightdm       lightdm           4096 Apr  4 00:08 /var/lib/lightdm/.dbus/session-bus
   394258      4 -rw-rw-r--   1 lightdm       lightdm            463 Apr  8 16:55 /var/lib/lightdm/.dbus/session-bus/bbada5cfcc9a4a80ac8dc5ce6d9f53aa-0
   392856      4 -rw-------   1 lightdm       lightdm             55 Apr  8 16:55 /var/lib/lightdm/.Xauthority
   137118      4 drwxrwxr-x   4 lightdm       lightdm           4096 Apr  4 00:08 /var/lib/lightdm/.cache
   137119      4 drwxrwxr-x   2 lightdm       lightdm           4096 Apr  8 16:55 /var/lib/lightdm/.cache/slick-greeter
   131527      4 -rw-rw-r--   1 lightdm       lightdm             26 Apr  8 16:55 /var/lib/lightdm/.cache/slick-greeter/state
   137121      4 drwxr-xr-x   2 lightdm       lightdm           4096 Apr  4 00:08 /var/lib/lightdm/.cache/fontconfig
   137126     96 -rw-rw-r--   1 lightdm       lightdm          97584 Apr  4 00:08 /var/lib/lightdm/.cache/fontconfig/cabbd14511b9e8a55e92af97fb3a0461-le64.cache-6
   137125     12 -rw-rw-r--   1 lightdm       lightdm           9176 Apr  4 00:08 /var/lib/lightdm/.cache/fontconfig/e13b20fdb08344e0e664864cc2ede53d-le64.cache-6
   137124     16 -rw-rw-r--   1 lightdm       lightdm          14688 Apr  4 00:08 /var/lib/lightdm/.cache/fontconfig/7ef2298fde41cc6eeb7af42e48b7d293-le64.cache-6
   137123      4 -rw-r--r--   1 lightdm       lightdm            200 Apr  4 00:08 /var/lib/lightdm/.cache/fontconfig/CACHEDIR.TAG
   394408      4 drwxrwxr-x   3 lightdm       lightdm           4096 Apr  4 00:08 /var/lib/lightdm/.config
   394554      4 drwxrwxr-x   2 lightdm       lightdm           4096 Apr  8 16:55 /var/lib/lightdm/.config/dconf
   424940      4 -rw-rw-r--   1 lightdm       lightdm             32 Apr  8 16:55 /var/lib/lightdm/.config/dconf/user
What excactly does the argument "\( ! -group root -or ! -user root \)" do? Is it filtering out all entries that the user have access to?


[edit]
Oh - I wasn't supposed to go to that directory before entering the find command. Therefore:

Code: Select all

sprinterdriver@optiplex ~ $ sudo find /var/lib \( ! -group root -or ! -user root \) -ls[sudo] password for sprinterdriver: 
   395733   5468 -rw-r-----   1 root     mlocate   5598313 Apr  8 17:00 /var/lib/mlocate/mlocate.db
   287295      4 drwxr-xr-x   3 geoclue  geoclue      4096 Apr  4 01:58 /var/lib/geoclue
   262909      4 drwx------   2 geoclue  geoclue      4096 Apr  4 01:58 /var/lib/geoclue/.cache
   287300     16 drwx------   2 _apt     root        16384 Apr  8 17:06 /var/lib/apt/lists/partial
   811103      4 drwxr-xr-x   3 nm-openvpn nm-openvpn     4096 Nov 24 14:09 /var/lib/openvpn/chroot
   811104      4 drwxr-xr-x   2 nm-openvpn nm-openvpn     4096 Nov 24 14:09 /var/lib/openvpn/chroot/tmp
   165540      4 drwxr-xr-x   2 avahi-autoipd avahi-autoipd     4096 Nov 24 14:05 /var/lib/avahi-autoipd
   165543      4 drwxr-xr-x   4 colord        colord            4096 Apr  4 00:08 /var/lib/colord
   287302      4 drwxr-xr-x   2 colord        colord            4096 Nov 24 14:06 /var/lib/colord/icc
   151107      8 -rw-r--r--   1 colord        colord            7168 Apr  4 00:08 /var/lib/colord/storage.db
   150613      4 -rw-r--r--   1 colord        colord            4096 Apr  4 00:08 /var/lib/colord/mapping.db
   262906      4 drwx------   2 colord        colord            4096 Apr  4 00:08 /var/lib/colord/.cache
   395734      4 drwxrwx---   2 lightdm       lightdm           4096 Apr  8 16:55 /var/lib/lightdm-data/lightdm
   150238      4 drwxrwx---   2 oskar         lightdm           4096 Apr  4 00:08 /var/lib/lightdm-data/oskar
   429879      4 drwxr-xr-x   2 ntp           ntp               4096 Apr  5 00:53 /var/lib/ntp
   394284      4 -rw-r--r--   1 ntp           ntp                  8 Apr  5 00:53 /var/lib/ntp/ntp.drift
   429870      4 drwxr-x---   5 lightdm       lightdm           4096 Apr  4 00:08 /var/lib/lightdm
   393198      4 drwx------   3 lightdm       lightdm           4096 Apr  4 00:08 /var/lib/lightdm/.dbus
   394257      4 drwx------   2 lightdm       lightdm           4096 Apr  4 00:08 /var/lib/lightdm/.dbus/session-bus
   394258      4 -rw-rw-r--   1 lightdm       lightdm            463 Apr  8 16:55 /var/lib/lightdm/.dbus/session-bus/bbada5cfcc9a4a80ac8dc5ce6d9f53aa-0
   392856      4 -rw-------   1 lightdm       lightdm             55 Apr  8 16:55 /var/lib/lightdm/.Xauthority
   137118      4 drwxrwxr-x   4 lightdm       lightdm           4096 Apr  4 00:08 /var/lib/lightdm/.cache
   137119      4 drwxrwxr-x   2 lightdm       lightdm           4096 Apr  8 16:55 /var/lib/lightdm/.cache/slick-greeter
   131527      4 -rw-rw-r--   1 lightdm       lightdm             26 Apr  8 16:55 /var/lib/lightdm/.cache/slick-greeter/state
   137121      4 drwxr-xr-x   2 lightdm       lightdm           4096 Apr  4 00:08 /var/lib/lightdm/.cache/fontconfig
   137126     96 -rw-rw-r--   1 lightdm       lightdm          97584 Apr  4 00:08 /var/lib/lightdm/.cache/fontconfig/cabbd14511b9e8a55e92af97fb3a0461-le64.cache-6
   137125     12 -rw-rw-r--   1 lightdm       lightdm           9176 Apr  4 00:08 /var/lib/lightdm/.cache/fontconfig/e13b20fdb08344e0e664864cc2ede53d-le64.cache-6
   137124     16 -rw-rw-r--   1 lightdm       lightdm          14688 Apr  4 00:08 /var/lib/lightdm/.cache/fontconfig/7ef2298fde41cc6eeb7af42e48b7d293-le64.cache-6
   137123      4 -rw-r--r--   1 lightdm       lightdm            200 Apr  4 00:08 /var/lib/lightdm/.cache/fontconfig/CACHEDIR.TAG
   394408      4 drwxrwxr-x   3 lightdm       lightdm           4096 Apr  4 00:08 /var/lib/lightdm/.config
   394554      4 drwxrwxr-x   2 lightdm       lightdm           4096 Apr  8 16:55 /var/lib/lightdm/.config/dconf
   424940      4 -rw-rw-r--   1 lightdm       lightdm             32 Apr  8 16:55 /var/lib/lightdm/.config/dconf/user
So I got this bright idea. But when I tried to grab the light bulb, I did not hurt my hands as expected from a warm bulb, because it turned out to be one of those LED bulbs.
WharfRat

Re: Trying to mount /var to another partition

Post by WharfRat »

If you mounted the partition sudo mount /dev/sdb6 /mnt then

sudo find /mnt \( ! -group root -or ! -user root \) -ls

The \( ! -group root -or ! -user root \) is picking up any owner or group that's not root
User avatar
SprinterDriver
Level 4
Level 4
Posts: 260
Joined: Sun Jan 25, 2015 3:35 pm
Location: Norway

Re: Trying to mount /var to another partition

Post by SprinterDriver »

Update.

I searched the web, and I found this guide from 2014 for Debian:
https://unix.stackexchange.com/question ... -partition

Question is: Are all those commands usable for Mint too? From what I have being able to find on the web so far is that the command for single user mode is different ("init 1" for Debian vs. "sudo telinit 1" for LM) but what about other commands, mostly the oposite one that is "init 5" in Debian - would that be "telinit 5" in LM and do the same? - never mind, after a quick read of manpage for telinit that must be the same, and I assume it works the same way as "init" for Debian OS.

That makes my question: exept for the init/telinit name difference, is that other things that I must know when trying to follow a guide that is written for Debian? Is there some difference between Mint and Debian that may cause this manual to not work?


[edit]
Did not see your post before I posted.
WharfRat wrote: Sun Apr 08, 2018 12:23 pm If you mounted the partition sudo mount /dev/sdb6 /mnt then

sudo find /mnt \( ! -group root -or ! -user root \) -ls

The \( ! -group root -or ! -user root \) is picking up any owner or group that's not root
Ok, that is sweet - so many things to learn :D

Well, here is the output from that - is still mounted as /mnt
sprinterdriver@optiplex ~ $ sudo find /mnt \( ! -group root -or ! -user root \) -ls
[sudo] password for sprinterdriver:
2 4 drwxr-xr-x 13 root users 4096 Apr 4 21:21 /mnt
260623 4 drwxrwxr-x 13 root syslog 4096 Apr 4 21:28 /mnt/log
260647 0 -rw-r----- 1 root adm 0 Apr 4 00:08 /mnt/log/cups/page_log
260645 4 -rw-r----- 1 root adm 3454 Apr 4 21:33 /mnt/log/cups/access_log
260646 0 -rw-r----- 1 root adm 0 Apr 4 00:08 /mnt/log/cups/error_log
260661 4 -rw------- 1 root utmp 384 Apr 4 20:15 /mnt/log/btmp
260669 16 -rw-rw-r-- 1 root utmp 13056 Apr 4 21:33 /mnt/log/wtmp
21 4 drwxrwx--- 2 lightdm lightdm 4096 Apr 4 21:28 /mnt/lib/lightdm-data/lightdm
130449 4 drwxr-sr-x 35 man root 4096 Apr 4 20:10 /mnt/cache/man
130352 4 drwxrwx--- 3 root lp 4096 Apr 4 21:33 /mnt/cache/cups
130356 4 drwxrwxr-x 2 root lp 4096 Aug 23 2017 /mnt/cache/cups/rss
130538 4 -rw-r----- 1 root lp 64 Apr 4 21:28 /mnt/cache/cups/job.cache.O
130355 4 -rw-r----- 1 root lp 64 Apr 4 21:33 /mnt/cache/cups/job.cache
260683 4 drwx--x--- 3 root lp 4096 Nov 24 13:50 /mnt/spool/cups
260684 4 drwxrwx--T 2 root lp 4096 Aug 23 2017 /mnt/spool/cups/tmp
So I got this bright idea. But when I tried to grab the light bulb, I did not hurt my hands as expected from a warm bulb, because it turned out to be one of those LED bulbs.
WharfRat

Re: Trying to mount /var to another partition

Post by WharfRat »

That doesn't look the same to me :?

Unmount the partition, reformat it then mount it back to /mnt and try

Code: Select all

cd /var
sudo find . -depth -print0 | cpio --null --sparse -pvd /mnt
Then move/rename /var to /var_old, create a new /var and mount /dev/sdb6 to it

Make your change to fstab and cross your fingers.
User avatar
SprinterDriver
Level 4
Level 4
Posts: 260
Joined: Sun Jan 25, 2015 3:35 pm
Location: Norway

now stucked when trying to enter single user mode

Post by SprinterDriver »

Thanks, I try thet, but I'm stuck trying to change to single user mode:

I managed to create folder /mnt/var and then mount /dev/sdb6 at /mnt/var.

But when trying to enter single user mode - sudo telinit 1 it all go stuck, I don't know how to make it further from here.

I got to the screen that say "welcome to rescue mode", but then nothing works. Neither Enter or Ctrl+D make the terminal respond properly. It just goes pitch black for 2-3 minutes, then it get back to the same welcome message. It doesn't seem to respond to any other keyboard input.
So I got this bright idea. But when I tried to grab the light bulb, I did not hurt my hands as expected from a warm bulb, because it turned out to be one of those LED bulbs.
WharfRat

Re: Trying to mount /var to another partition

Post by WharfRat »

You don't want to mount it to /mnt/var it has to be mounted to /var.

That's why the original /var is being moved/renamed to /var_old
User avatar
SprinterDriver
Level 4
Level 4
Posts: 260
Joined: Sun Jan 25, 2015 3:35 pm
Location: Norway

Re: Trying to mount /var to another partition

Post by SprinterDriver »

ok, but no - intention is to use that path temporarly only, to have a path to copy files to. After that I will remount to /var (after renaming original /var).

But that is not the problem for now. As said in previous post, I'm not able to make any use of single user mode. That is the problem I need to solve for now.
On the web, I fing threads and guides that describe it for Debian, but there is virtually no useful information about single user mode that works for Ubuntu/Mint.
Well - I guess I could do it ust using live-cd session, but I'm also trying to learn the process, and in other cases I might not have access to such a live cd.


[edit] (kind of)
In the "welcome to resque mode" I simpy typed "sprinterdriver", and I got a new line prior to cursor that spelling:
root@optiplex ~ #

Give it another try now.

[edit]
Attempting to copy UUID using nano (opened a text filee on desktop with contents of blkid output) while in single user mode failed miserably. I was able to select text, but pressing Alt+6 went all wrong. So instaead of text being copied, the screen went dark and instead of nano, there is only a text marker blinking at upper left corner, rest is blank. Do not know how to recover from this.
But I just may be stupid, maybe I don't need the UUID to insert in fstab file ?
So I got this bright idea. But when I tried to grab the light bulb, I did not hurt my hands as expected from a warm bulb, because it turned out to be one of those LED bulbs.
User avatar
SprinterDriver
Level 4
Level 4
Posts: 260
Joined: Sun Jan 25, 2015 3:35 pm
Location: Norway

SOLVED

Post by SprinterDriver »

Problem solved, jay :D

After the blinking cursor problem, I try to hard reboot, but desktop wouldn't load - not surprisingly since /var was empty at that time (the newly created var folder, but before fstab was changed no files at /var).
Solution was to use live-cd and edit fstab file from there. Done.

Reboot and booted successfully :D

So I learned some lessons from this (from a beginners point of view, as this is probably obvious to more experienced users)
  • Nano (single user mode) may not respond properly using non-english keyboard layout. On the web, I found that copying text is supposedly done by Shift+Alt+6. That keyboard press did not made Nano give any visual signs that anything happens. Pressing Alt+6 in Nano made disaster (blank screen with blinking cursor only, no way to make it respond to any input - hard reboot was only way out). Will made a separate thread to discuss using nano in single user mode.
  • I was able to enter single user mode by entering my own user name when the shell first line yields "Welcome to recovery mode". That was a stroke of luck, and to be ones I'm not sure that will work next time.
  • I had this misconception that fstab required UUID for all entries (the reason why I start messing around using nano trying to copy a piece of text), as it worked just fine to just insert /dev/sdb6.
  • In stab, under <options>, only "defaults" are present, and it works.
  • Should have access to a live-cd. That is the easy way out.
So the added line in fstab looks like:
/dev/sdb6 /var ext4 defaults 0 0


Still need to be solved
If somehow the sdb drive goes dead (because it is an older drive) I currently don't know how to go into recovery mode from boot. This is less important because I do have access to a live-cd and may edit fstab and rename var.old folder into var to get it back.
That said - I do spend time on this to learn, so would be grateful if this last question is to be answered.
So I got this bright idea. But when I tried to grab the light bulb, I did not hurt my hands as expected from a warm bulb, because it turned out to be one of those LED bulbs.
Locked

Return to “Installation & Boot”