Results 1 to 6 of 6

Thread: can i change mount point without data loss ?

  1. #1
    Join Date
    Sep 2019
    Beans
    1

    can i change mount point without data loss ?

    Hi,
    i am new to linux, i have a question: can i change disk's mount point, without data loss ?

  2. #2
    Join Date
    Apr 2011
    Location
    Mystletainn Kick!
    Beans
    13,613
    Distro
    Ubuntu

    Re: can i change mount point without data loss ?

    Depends.
    Explain what mount point needs to change.
    Splat Double Splat Triple Splat
    Earn Your Keep
    Don't mind me, I'm only passing through.
    Once in a blue moon, I'm actually helpful
    .

  3. #3
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    2,022
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: can i change mount point without data loss ?

    if it is just temporarily mounted, like a plug-in device, just unmount it and then mount it where you want it to be. there must be no open files there to be able to unmount it.

    if it is permanently mounted (e.g. always there when you boot up) you cat do this by changing file /etc/fstabs but doing this can break many things. if you want to move the main disk that is mounted at / then explain what you want to accomplish since that cannot be done.
    Mask wearer, Social distancer, System Administrator, Programmer, Linux advocate, Command Line user, Ham radio operator (KA9WGN/8, tech), Photographer (hobby), occasional tweetXer

  4. #4
    Join Date
    Sep 2019
    Beans
    1

    Re: can i change mount point without data loss ?

    I have datadisk, it is not system disk. I suspect mount point got changed, since i have dual boot with windows. I need to change it to one mount point i want like sdd2. But i am unsure when i do that, if it wouldn't cause data loss. I need to be 100% sure.

  5. #5
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: can i change mount point without data loss ?

    It depends.

    But disks aren't what OSes care about. OSes mount partitions or logical volumes, not "disks", so it could lead to massive data loss of the disk was part of a volume group that was used for logical volumes. BTRFS, ZFS, and LVM can make things much more complicated.

    We can't tell from the question asked. Best to be 100% certain, right?

    If you can connect everything up and run a few commands, it should be very clear, quickly, if you'll have issues.
    Code:
    df -hT -x squashfs -x tmpfs -x devtmpfs
    lsblk
    sudo fdisk -l
    Please post using code tags, like I have, so the columns line up.

  6. #6
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: can i change mount point without data loss ?

    In general, the answer is yes, assuming you unmount the device cleanly with "sudo umount /dev/xxx".

    To insure that disks get mounted to the same locations each time, you can use UUIDs. Each device or partition has a unique UUID. You can see them by running the command "sudo blkid". In /etc/fstab, use the syntax:
    Code:
    UUID=8be7c7b3-5d34-4ce2-95f1-5e86de1ebc79   /home     ext4    defaults 0 0
    instead of /dev/xxx at the beginning of the line.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •