Linux mint монтировать ntfs

Linux Mint Forums

Forum rules
Before you post please read how to get help. Topics in this forum are automatically closed 6 months after creation.

[Solved] How to mount NTFS partitions?

Post by Erased » Tue Dec 20, 2016 3:11 am

I can just right click a partition and press Mount. But how do I do that in terminal?

I tried
sudo mkdir /media/zoran/Data
sudo mount -t auto -v /dev/sda6 /media/zoran/Data
but when I do this I have to enter a password when unmounting because it says the partition was mounted by another user, so I assume this is not the correct way.
What command should I be using instead?

I’m searching for this because I want to set it to run on startup.

Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.

all41 Level 18
Posts: 8925 Joined: Tue Dec 31, 2013 9:12 am Location: Computer, Car, Cage

Re: How to mount partitions?

Post by all41 » Tue Dec 20, 2016 3:39 am

this part is correct—good.
If you want this to mount automatically at startup then you have to make an entry for it in etc/fstab.
Not really hard to do.
In a terminal run:

that will show the mounted partitions with their respective UUID designations.
Here is an example entry in etc/fstab for a partition on my second hard drive:
UUID=9f665aa7-1724-42f5-8209-15011de9080e /media/uno/archival ext4 defaults,noatime 0 2
The UUID is what you get from sudo blkid—after that you will see the mount point (mine is: /media/uno/archival) , then the file system type, the rest is fairly standard.
After entering this line in etc/fstab run:

Читайте также:  Qt creator valgrind linux

this will verify your syntax that you just added to fstab—if it returns no errors you will be good to go. Reboot and the partition should be mounted

I will refer you to this thread:
viewtopic.php?f=46&t=154670#p802950
where I was tutored in this matter.
Best of luck your way and Merry Christmas

Re: How to mount partitions?

Post by Erased » Wed Dec 21, 2016 12:31 am

Cool, let me just run this by you.

/dev/sda4: LABEL="TI10664800H" UUID="BA26CF4D26CF08F9" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="c204b4eb-1a72-11e3-bafb-ceadba28250e" /dev/sda6: LABEL="Data" UUID="72AC4FFFAC4FBBFB" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="d190fc94-f80c-4b9e-615a-24cc8c223e0a"
# Windows partition on /dev/sda4 UUID=BA26CF4D26CF08F9 /media/zoran/TI10664800H ntfs defaults 0 2 # Common data partition on /dev/sda6 UUID=72AC4FFFAC4FBBFB /media/zoran/Data ntfs defaults 0 2

Re: How to mount partitions?

Post by WharfRat » Wed Dec 21, 2016 12:55 am

Since these are ntfs partitions, some other options will be helpful especially with permissions

Also if zoran is the user name then don’t create the mountpoints there, use /media/TI10664800H and /media/Data instead.

These are the entries you can use:

UUID=BA26CF4D26CF08F9 /media/TI10664800H ntfs-3g noatime,user,nls=utf8,windows_names,dmask=002,fmask=111,uid=1000,gid=1000 0 0 UUID=72AC4FFFAC4FBBFB /media/Data ntfs-3g noatime,user,nls=utf8,windows_names,dmask=002,fmask=111,uid=1000,gid=1000 0 0 

Since ntfs partitions don’t store file mode bits and owner/groups etc. it has to be globally set with the fstab options. You can check man ntfs-3g for more information about this.

Re: How to mount partitions?

Post by Erased » Wed Dec 21, 2016 1:20 am

Re: [Solved] How to mount NTFS partitions?

Post by Erased » Thu Dec 22, 2016 6:49 pm

I use /mnt instead of /media
And after coding some stuff I realized I cannot run my apps anymore, since the source&project files (shared by win & linux) are all on the data partition.
I tried setting the options nouser,exec but that didn’t help, so I did umask=000
Is this ok?

Re: [Solved] How to mount NTFS partitions?

Post by WharfRat » Thu Dec 22, 2016 10:17 pm

If you mean the ntfs-3g umask fstab mount option then it will only affect the files on the windows partition so it’s fine.

Re: [Solved] How to mount NTFS partitions?

Post by Erased » Sun Dec 25, 2016 12:02 am

A few more questions..
Now that I’m mounting the windows partition how should I prevent access to specific system folders?
At least how should I prevent it without root?

Re: [Solved] How to mount NTFS partitions?

Post by WharfRat » Sun Dec 25, 2016 2:08 am

When mounting an ntfs partition, all folder options are controlled with dmask.

Читайте также:  Git linux kernel source

You can’t set individual folder permissions like you can on linux partition because there is no such permissions on an ntfs partition.

If you set dmask=077 then only the user will be able to access the folders.

Re: [Solved] How to mount NTFS partitions?

Post by Erased » Sun Dec 25, 2016 6:26 am

I guess I’ll just use umask=177 for now
It’s annoying that ntfs-3g driver doesn’t have a separate option for windows system files.

BTW why would you normally use different permissions for files and directories? I don’t see a reason for this.

Note to self: this is what the mask means http://askubuntu.com/a/429858

Re: [Solved] How to mount NTFS partitions?

Post by altair4 » Sun Dec 25, 2016 8:40 am

umask isn’t that hard to understand and it would appear that you are using it incorrectly.

All files and folders in an NTFS partition are born with permissions of 777. Read, Write, and execute to everyone and your Aunt Agnes. Umask represents the permissions that you want to remove .

So a umask of 000 removes nothing. A umask of 077 removes everthing from groups and others:

777 — Starting permissions
077 — umask value
===
700 — Resulting permissions. The ability of the owner to Read ( Octal value of 4 ), Write ( 2 ), and Execute ( 1 ). 4+2+1=7. But no access ( 0 ) to anyone else.

A umask of 177 doesn’t do what you want since the result will be:

777
177
===
600 — You will not be able to traverse the folder to read or write to it.

BTW why would you normally use different permissions for files and directories? I don’t see a reason for this.

Folders have to have the execute bit enabled or you will not be able to traverse them. A umask is indiscriminate and applies itself to both files and folders. You may not want all your files to be executable but you do want your folders to be so umask was split into a mask for files ( fmask ) and a mask for directories ( dmask ).

Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

Источник

Как смонтировать раздел NTFS в Linux

img

NTFS — это система хранения файлов, стандартная для компьютеров Windows, но системы Linux также используют ее для организации данных.

Читайте также:  Linux mint удалить flatpack

Большинство систем Linux монтируют диски автоматически. Однако в конфигурациях с двойной загрузкой, где требуется обмен файлами между двумя системами с разделами NTFS, эта процедура выполняется вручную.

Эта статья покажет вам, как смонтировать раздел NTFS в Linux с разрешениями только для чтения или чтения и записи.

Как смонтировать раздел NTFS в Linux

Смонтировать раздел NTFS с разрешением только для чтения

Выполните следующие действия, чтобы смонтировать раздел NTFS с доступом только для чтения.

Примечание. Раздел только для чтения позволяет пользователям читать файлы. Чтобы включить запись в раздел NTFS, обратитесь ко второму разделу статьи.

Определить раздел NTFS

Перед монтированием раздела NTFS определите его с помощью команды parted :

sudo parted -l

В приведенном выше примере два раздела NTFS находятся на диске /dev/sdb . Прежде чем продолжить, запишите номер раздела, который вы хотите смонтировать.

Вы также можете использовать команды fdisk и grep , чтобы показать на диске только разделы NTFS:

Создать точку монтирования и смонтировать раздел NTFS

В этом примере мы смонтируем раздел /dev/sdb1 с разрешением только для чтения.

Сначала создайте точку монтирования с помощью команды mkdir :

Затем смонтируйте раздел в созданный вами каталог. Используйте команду mount и путь к разделу, который вы указали ранее:

sudo mount -t ntfs /dev/sdb1 /mnt/ntfs1

Используйте инструмент для освобождения диска, чтобы проверить подробную информацию обо всех файловых системах и убедиться, что вы успешно смонтировали раздел:

df -hT

Раздел /dev/sdb1 отображается как смонтированный в нижней части списка. Теперь у вас есть доступ только для чтения к этому разделу NTFS.

Смонтировать раздел NTFS с разрешениями на чтение и запись

Чтобы смонтировать раздел NTFS с разрешениями на чтение и запись, вам необходимо установить fuse и ntfs-3 в вашей системе.

Выполните следующие действия, чтобы завершить процесс монтирования.

Обновить репозитории пакетов

Выполните следующую команду, чтобы загрузить и обновить репозитории пакетов:

sudo apt update

Установите Fuse и ntfs-3g

Чтобы установить fuse в вашей системе Linux из репозитория по умолчанию, используйте соответствующий менеджер пакетов. В нашем примере мы используем apt в Ubuntu.

Когда установка завершится, установите ntfs-3g , запустив:

В случае, если fuse и ntfs-3g уже установлены, вывод выглядит примерно так, как показано ниже:

sudo apt install ntfs-3g

Смонтировать раздел NTFS

После установки пакетов программного обеспечения fuse и ntfs-3g смонтируйте раздел NTFS.

Сначала создайте точку монтирования с помощью команды mkdir :

Затем используйте команду mount , чтобы смонтировать нужный раздел. Например, /dev/sdb2 :

sudo mount -t ntfs-3g /dev/sdb2 /mnt/ntfs2/

Чтобы проверить, смонтирован ли раздел, выполните команду df :

df -hT

Теперь у вас есть права на чтение и запись для подключенного раздела NTFS.

Источник

Оцените статью
Adblock
detector