码迷,mamicode.com
首页 > 系统相关 > 详细

Ubuntu remount hard drive

时间:2020-02-04 15:35:05      阅读:92      评论:0      收藏:0      [点我收藏+]

标签:mount   ready   check   isa   disk   for   and   pen   create   

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 "\nPartition identifier: " $1  "\n 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

 

Ubuntu remount hard drive

标签:mount   ready   check   isa   disk   for   and   pen   create   

原文地址:https://www.cnblogs.com/shengguang/p/12259544.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!