zoukankan      html  css  js  c++  java
  • Ubuntu remount hard drive

    Some times ubuntu user disappeared, need to create the same user again and point to the same home drive, use below command

    id -u username
    sudo useradd --home /home/username --uid 1001 --gid users username
    sudo chown -R username: ~username

    After create a user, the old mounted drive may cannot open already, need to remount again.

    Check the current mounting information:

    mount -v | grep "^/" | awk '{print "
    Partition identifier: " $1  "
     Mountpoint: "  $3}'

    Unmount the current mounting.

    sudo umount /media/sxiao/DiskD
    sudo umount /dev/sda1

    Create the mounting point again.

    sudo mkdir /media/sxiao/DiskD

    Create the mount.

    sudo mount -t ntfs /dev/sda1 /media/sxiao/DiskD

    Now the mount already created, but you may still cannot access or open the mounted disk, it is because the ower is root, check the disk information using `sudo ls -all /media/sxiao/DiskD`

    Change the ower of the folder to the current user.

    sudo chown -R username /media/sxiao/DiskD
    sudo chown -R username /media/sxiao
  • 相关阅读:
    Shared variable in python's multiprocessing
    File checksum
    Windows createprocess linux fork
    人工调用系统调用
    如何提高团队开发效率
    Redis' High Availability
    并发MD5计算方法
    开博宣言
    NYOJ 55 懒省事的小明
    HDU 1237 简单计算器
  • 原文地址:https://www.cnblogs.com/shengguang/p/12259544.html
Copyright © 2011-2022 走看看