LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-11-2015, 02:29 PM   #1
kktsuri
LQ Newbie
 
Registered: Jan 2014
Distribution: Mint
Posts: 22

Rep: Reputation: Disabled
Upgrading ntfs-3g for TRIM support without changing system?


I have some new SSDs with data on them formatted as NTFS (they are multi-purpose), and would like to TRIM in Linux to improve their lifespan and performance (they are also accessed from Windows XP which doesn't support TRIM). ntfs-3g added support for FSTRIM ioctl in 2015.3.14 (March 31, 2015).

I am using Linux Mint 17.1 and obviously it doesn't support TRIM on its native ntfs-3g, my question is if there is a way to update the new ntfs-3g without affecting my system or making system-wide changes. I don't want to recompile/rebuild kernel or any other system-wide change, just to issue fstrim once in a while and have it work, do I have to make system changes at all?

Basically I'd rather not take the risk of screwing up my system (I rely on other NTFS mount points right now that are crucial), I'd rather live without TRIM than that, however if there's an easy way to have the new ntfs-3g live alongside the other just for TRIM (I have no qualms with the native ntfs-3g I currently have other than lack of TRIM), I'd feel stupid without asking.

(yes, I can unmount the native ntfs-3g on the specific SSD and mount it with new ntfs-3g, if that was a concern, then trim it, and mount it back to native etc; I really don't mind as long as it makes it possible to not affect my native ntfs-3g built in kernel -- safety is my primary concern right now).

Thanks for help in advance.

Last edited by kktsuri; 06-11-2015 at 02:30 PM.
 
Old 06-11-2015, 07:55 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,253

Rep: Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160Reputation: 4160
I would have to say any potential benefit isn't worth the grief.
Usually you would just add a ppa from a dev that has something available, but even that is the 2014.2.1 code.

FWIW Fedora 22 has the code you mentioned, so with luck the Ubuntu/Mint devs will get something out soon-ish. Mint tends to be a little behind the curve on package releases.
 
Old 06-12-2015, 04:08 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by kktsuri View Post
I really don't mind as long as it makes it possible to not affect my native ntfs-3g built in kernel
Just to clarify that, ntfs-3g is not a kernel module nor is it inbuilt into the kernel, it isn't part of the kernel at all. If you want to use a newer version than your distro provides the proper way is to replace the distro delivered package with a newer on, a method called backporting. Here is info on how that is done on Debian based distros: https://wiki.debian.org/SimpleBackportCreation
 
1 members found this post helpful.
Old 06-12-2015, 09:25 AM   #4
kktsuri
LQ Newbie
 
Registered: Jan 2014
Distribution: Mint
Posts: 22

Original Poster
Rep: Reputation: Disabled
Oh I had no idea, always thought it's integrated in the kernel.

I could even try compile it (although not knowledgeable there), but if it's not part of kernel then, can I just extract the .deb packages manually with dpkg? If they won't run from other locations I can just backup all the files I replace, replace them with new versions, and they'll work? No need to do any kernel integration or anything?

Thanks again.
 
Old 06-12-2015, 09:48 AM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by kktsuri View Post
I could even try compile it (although not knowledgeable there), but if it's not part of kernel then, can I just extract the .deb packages manually with dpkg? If they won't run from other locations I can just backup all the files I replace, replace them with new versions, and they'll work?
Yes, you could do that, but it is not recommended to do it that way, backporting, as per the link above, is.
Quote:
No need to do any kernel integration or anything?
No.
 
1 members found this post helpful.
Old 06-12-2015, 10:48 AM   #6
kktsuri
LQ Newbie
 
Registered: Jan 2014
Distribution: Mint
Posts: 22

Original Poster
Rep: Reputation: Disabled
I will take a look at backporting then and see if I can get hand on it.
 
Old 06-12-2015, 11:11 AM   #7
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
You can build and install the ntfs-3g from source in a custom directory and use that binary for mounting.
 
1 members found this post helpful.
Old 06-12-2015, 11:27 AM   #8
kktsuri
LQ Newbie
 
Registered: Jan 2014
Distribution: Mint
Posts: 22

Original Poster
Rep: Reputation: Disabled
Well, I couldn't find an updated .deb package or PPA, so I went with compiling. It was easier than I thought, I guess because it requires almost no development dependencies (only the basics, which I already have via build-essentials)

It works, thanks alot guys.


I forgot to mention how I solved it with your help. In case anyone else needs it. I just used the --prefix=/tmp/ntfs-3g and --exec-prefix=/tmp/ntfs-3g when using configure, like:

cd to source directory

Code:
./configure --prefix=/tmp/ntfs-3g --exec-prefix=/tmp/ntfs-3g
make
make install
This installed them in /tmp/ntfs-3g. Running /tmp/ntfs-3g/bin/ntfs-3g didn't work as it didn't find the library, so I made a script to run this ntfs-3g for mounting for trim only:

Code:
#!/bin/sh
LD_LIBRARY_PATH=/tmp/ntfs-3g/lib:$LD_LIBRARY_PATH /tmp/ntfs-3g/bin/ntfs-3g "$@"
Of course replace the /tmp/ntfs-3g with where you install it (this is just for demonstration) since my tmp is tmpfs so it won't be wise to keep it there.

I like how I can install libraries anywhere and just point them with LD_LIBRARY_PATH, to keep it from the system

Last edited by kktsuri; 06-12-2015 at 12:34 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ntfs-3g SSD TRIM? qrange Linux - Software 4 07-05-2012 10:00 PM
not getting support of ntfs file system prasanthmrvbm Linux - Newbie 3 11-04-2009 11:01 PM
NTFS File system support under RedHat Linux 5 anoopkjm Linux - General 1 05-09-2009 06:15 PM
Changing file system from NTFS to Linux Ext2 Oesie Linux - Newbie 3 01-16-2005 06:47 PM
NTFS file system support zokter Linux - General 7 10-20-2003 11:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration