Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Operation method of ordinary user Rights Control for mounting Ubuntu16.04 ext4 format hard disk

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Use case

Due to history, there is not enough space in my Ubuntu system. I want to automatically mount an ext4 partition (/ dev/sda12) of my computer's built-in hard disk to the system in a way that users can read and write. My user's name is totoro.

Operation

Boot and mount the hard drive automatically: refer to the blog description and add to the last line of the / etc/fstab file

"UUID=XXX-XX / media/totoro/KylinData ext4 defaults 0 2" 1

Here is the partition of the specified UUID, mounted to / media/totoro/KylinData.

The first parameter is recommended to use UUID, because a partition has a unique UUID; with / dev/sdaN, but the partition number N of a partition will change with the partition of the hard disk, so it is not recommended. The console command to get UUID from / dev/sdaN is "sudo blkid (or: lsblk-f)".

However, this method is mounted as root, and the user and group in which the hard disk resides is changed to the current user:

Sudo chown-R totoro:totoro / media/totoro/KylinData/ sudo umount / media/totoro/KylinData

After reboot, it will be automatically mounted as the current user (not root)

Summary

The above is the operation method of Ubuntu16.04 ext4 format hard disk mounting ordinary user rights control introduced by Xiaobian. I hope it will be helpful to you. If you have any questions, please leave a message for me, and the editor will reply to you in time. Thank you very much for your support to the website!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 271

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report