[LUNA] Partition question

Michael Hall hallmw at att.net
Sat Jun 22 14:39:21 CDT 2019


 Bob, Thanks for the reply.  My old $HOME is showing up as /media/michael/UUID/hallmw when I click the HD.  All my old data seems to be there.  I thought that it was getting mounted as a removable drive.  Just want to make sure I do this right and not screw this up since I just got it back.  So does that mean I am good?  I since it is showing up at that I should not have /home/home..... when I follow the steps?

    On Saturday, June 22, 2019, 1:07:21 PM CDT, Bob Nance <bob.nance at novationsys.com> wrote:  
 
 I think that the "/media" implies that the OS thinks it's a removable drive. It is also mounting it in your user context and not under the system's auspices. Is your old $HOME showing up under /media/Michael/[UUID]/home/mwhall and reflecting what you think is the correct data? If that's the case, you're good. All your data is still available.

Beware that I have really dug deep into the weeds in my answer. Please forgive an old man's ramblings.

The first thing you need to do is determine the actual hardware device that the media manager is finding. You can pore through the kernel log, dmesg or the like. It may even be in the syslog. Since it's not mounting it until you login (I am 99% sure), it should be pretty easy to find; just look for the login messages and you should see events posted by "udisk" or some version of that name.

If you want to discover which device is actually being mounted, you can, again, look at the disk messages in the kernel log, dmesg, or other logs. Another way is to stuff that UUID into your brain and then type:

    ls -al /dev/disk/by-uuid/ 

And look for that UUID. The UUID will actually be a link to the relative hardware device. The name should look something like ../../sdc2. That last part is your actual relative hardware device name.  (by the way, under the abstraction layer that the disk driver produces, you can actually trust the UUID information, since it is written in the volume label, it won't change and is unique, so you don't need to find the /dev/sdXn designator, if you don't want to).

Now that you have that, you can tell the OS that you want to mount that drive onto the system at a specific location. The system mounts occur before you login, so "udisk" will not find an unmounted disk, so you don't have to worry about it mounting it before your file system initialization.

The system stores the mounted drive information in the file /etc/fstab. Simply add the drive information into that file to force the system initialization to mount the volume before udisk can find it. Look at "man 5 fstab" or just read the file to see what goes into it.

There are two ways to enter the information into the fstab file.

Use the hardware device name (white space can be spaces or tabs). 

    /dev/sdc3        /home     ext4    rw    0    0

OR use the volume label to designate the disk volume

    LABEL=[UUID]    /home    ext4    defaults    0    0

The first field is either the label or the device. 

The second field is the directory onto which you want to mount the volume.

The third field is the file system format that determines which system driver will be used to talk to the volume.

The fourth field is a comma-separated list of options for the file system. Here, I have listed "read-write" for a mounting option. You can also put any of these. Don't use spaces between commas and options. I stole this from the man page.

              defaults
                    use default options: rw, suid, dev, exec, auto, nouser, and async.

              noauto do not mount when "mount -a" is given (e.g., at boot time)

              user  allow a user to mount

              owner  allow device owner to mount

              comment
                    or x-<name> for use by fstab-maintaining programs

              nofail do not report errors for this device if it does not exist.


The second to last number is what dump level you want to prescribe to it (don't back this up unless you are performing a "dump 0" is what's there now).

The last number is what order you want this disk checked when an fsck is performed. If everyone is zero, the init process will simply check them in order that they appear in the file.

CAVEAT EMPTOR
Now that I completely over-explained this answer, let me warn you that, if the previous volume was formatted to be the "/" mounted drive, then it already has path information on it that will mess up the mount. If your home directory was on /home/mwhall and that drive was mounted as "/" AND you mount the drive as "/home" then you will find your home directory at "/home/home/mwhall" If you want it to appear at /home/mwhall, you will have to move it. I recommend at "piped tar" for moving data from one folder to another.

    # cd /home/home ; tar cf - mwhall | (cd /home ; tar xvf - )

Also, be aware that it's possible that your own UID may be different on your new system than it was on the last. If that is the case, after you mount this drive, you will need to change ownership to match the new UID.

    # chmod -R mwhall.mwhall /home/mwhall

will probably fix that for you.


On 6/22/19, 12:22 PM, "LUNA on behalf of Michael Hall" <luna-bounces_bob.nance=novationsys.com at lunagroup.us on behalf of hallmw at att.net> wrote:

    I have my machine back up and running.  Finally got fed up and took it to gigaparts to just check out the hardware.  All that was ok.  They put the latest of Ubuntu Mate (18.04) on the machine.  I created my account that I was using.  I noticed that my second drive a 1 TB HD is mounted as /media/michael/<some number that looks like a guid>.  I want to mount this drive as /home and my old hallmw directory is on it with my data.  Can someone help me out on how to do that and not loose my data.  I am going to copy it to my USB stick before I start.
    Thanks,Michael
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <https://lunagroup.us/pipermail/luna/attachments/20190622/07fc0049/attachment.html>
    _______________________________________________
    LUNA mailing list
    LUNA at lunagroup.us
    http://lunagroup.us/mailman/listinfo/luna
    

_______________________________________________
LUNA mailing list
LUNA at lunagroup.us
http://lunagroup.us/mailman/listinfo/luna
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lunagroup.us/pipermail/luna/attachments/20190622/84ab8d7f/attachment.html>


More information about the LUNA mailing list