Announcement

Collapse
No announcement yet.

How to use a NTFS-formatted USB drive in Kubuntu

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to use a NTFS-formatted USB drive in Kubuntu

    A Kubuntu Forum user who wishes to remain anonymous, in order to maintain maximum separation between his reputation and certain OS's that come from Redmond, Washington, encouraged me to prepare a demonstration of how to use a NTFS-formatted drive in Kubuntu. I appreciate the lesson, and so I will share it with the unwashed masses who occasionally need to do such things.

    First problem -- I don't own a USB hard drive. So, I took a little 2GB USB thumb drive, and figured out how to format it as NTFS. It took a couple of Google hits to master that trick, but 'twas done.

    With a USB drive formatted as NTFS in hand, the Kubuntu user has only 2 real obstacles in the path of using it to read and write files:

    1. You need to install the package ntfs-3g.
    Code:
     sudo apt-get install ntfs-3g
    2. You need to become a member of the "fuse" group. I will spare you the story of the little nightmare that happened to me when I tried to do that using the "usermod" command. Us CLI-impaired folks would be better advised to open Kmenu>System Settings>User Management, and after selecting "Administrator" mode, with the user highlighted, choose "Modify", then click the "Select" button beside "secondary groups", scroll down to the "fuse" group, and add it to the user.

    OK, now you are almost ready for action! Insert/attach your USB drive into the usb bus, give it a second or two to be recognized, and then open your KMenu>System Settings>Advanced>Disks and Filesystems menu to learn what device ID has been assigned to the drive. You have to know it. Mine was assigned /dev/sde1. More guidance on how to discover the ID of the attached drive is here.

    Make a mount point. My partner in crime suggested "/media/mickey", so that's what I did:
    Code:
    sudo mkdir /media/mickey
    Now, all that is left is to mount our NTFS device, using the ntfs-3g package. Open the konsole, and issue a command like this:

    Code:
    sudo mount -t ntfs-3g /dev/sde1 /media/mickey
    You're done!

    In Konqueror, you will find your device in the "Media" menu, suitably named "Mickey". In the attached screenshot, you will see two images on my USB drive. One is a standard Windows XP sample image, that I saved there after I formatted it as NTFS with Win XP. The other is one that I pasted in from Kubuntu to test it. The screenshot is from Konqueror in Kubuntu Feisty.

    I hope this is helpful. 8)


    P.S. Do not ever forget that ntfs is a journalling file system, and drives running such filesystems need to be unmounted (i.e. "ejected" or "safely removed") before being yanked out of the USB connector, if you don't want data corruption.


    Attached Files

    #2
    Re: How to use a NTFS-formatted USB drive in Kubuntu

    Many thanks, dibl, for clearly addressing an issue that I expect comes up a lot.

    I've just installed Kubuntu 7.04 a couple days ago and am trying to get the NTFS partition on my external USB drive to be readable, which worked fine with Ubuntu 7.04, and writable, which I didn't try with Ubuntu.

    I've installed ntfs-3g, made myself a member of the fuse group, and created a mount point. I've determined what the device ID is.

    When I first tried to mount, it said the filestructure was dirty, so I hooked the disk to my XP system and fixed that. Then I had to do a chkdsk. Now I appear to have the filesystem mounted, but it's not available because of permissions.

    Can I just do a "sudo chmod" at the appropriate place? I recently screwed up an XP partition by not paying enough attention so I'm a little leary of fiddling with an NTFS partition from Linux, given that I haven't seen it work yet...
    Kubuntu #19517 (but of course I am not a number, I am a free man!)

    Comment


      #3
      Re: How to use a NTFS-formatted USB drive in Kubuntu

      Yes, I agree you need to be 100.00% certain that your NTFS drive is functioning correctly in Windows before you attempt any Linux tricks with it.

      I did not observe any permissions problem, when performing all operations as a user.

      If it is ONLY a permissions issue, you should be able to go in, either via
      Code:
      sudo konqueror
      or else through Kmenu>System Settings>Advanced>Disks&Filesystems, and (as Administrator) right-click "properties" for that drive, and then change the permissions to allow your user to read and write.

      Let us know if that takes care of it -- thanks!

      Comment


        #4
        Re: How to use a NTFS-formatted USB drive in Kubuntu

        Hey dibl, thanks again for all your help!

        I'm sure I've set something up wrong, probably bad wrong :-X . I tried Kmenu...Disks&Filesystems, but it seemed that all I could change was owner and mount permission, not actual access permission.

        So I tried "sudo konqueror" and got this kinda stuff. What sort of bonehead setup ploy have I pulled?

        Code:
        X Error: BadDevice, invalid or uninitialized input device 169
         Major opcode: 145
         Minor opcode: 3
         Resource id: 0x0
        Failed to open device
        X Error: BadDevice, invalid or uninitialized input device 169
         Major opcode: 145
         Minor opcode: 3
         Resource id: 0x0
        Failed to open device
        Xlib: connection to ":0.0" refused by server
        Xlib: No protocol specified
        
        kdeinit: Can't connect to the X Server.
        kdeinit: Might not terminate at end of session.
        Xlib: connection to ":0.0" refused by server
        Xlib: No protocol specified
        
        kded: cannot connect to X server :0
        DCOP aborting call from 'anonymous-9392' to 'kded'
        kded: ERROR: Communication problem with kded, it probably crashed.
        konqueror: WARNING: Can't open /root/.kde/share/apps/konqueror/bookmarks.xml
        kio (KIOConnection): ERROR: Could not write data
        kio (KIOConnection): ERROR: Could not write data
        kio (KIOConnection): ERROR: Could not write data
        kio (KIOConnection): ERROR: Could not write data
        kio (KIOConnection): ERROR: Could not write data
        Xlib: connection to ":0.0" refused by server
        Xlib: No protocol specified
        This goes on for a while...
        Kubuntu #19517 (but of course I am not a number, I am a free man!)

        Comment


          #5
          Re: How to use a NTFS-formatted USB drive in Kubuntu

          Yikes!

          Well, the good news is, you can safely disregard all the errors down to the first one that begins "konqueror". All the ones preceding that have to do with the built-in assumption that you require wacom devices in your xorg.conf, and therefore it must be all messed up if you don't actually have such devices on your system (don't ask me -- I don't have 'em either!).

          OK, the one where konqueror won't open is a problem, and it's not apparent to me exactly what the problem with konqueror is. I don't think it is related at all to your USB drive. You can prove that theory by disconnecting the USB drive and trying konqueror again, both in normal user mode, and also as Super User by using the
          Code:
          sudo konqueror
          command. Let us know what happens then.

          Comment


            #6
            Re: How to use a NTFS-formatted USB drive in Kubuntu

            Sorry, I should have been clearer about this---I was a tech writer in another incarnation but now I blog and I've lost a step ---but Konqueror started and ran okay, I just can't access the external drive.

            It occurred to me to check on the file that Konqueror couldn't open, bookmarks.xml. But I can't open /root/.kde, whose permissions are 700. Same permissions as the top level of the NTFS partition---coincidence? Or have I set default permissions somewhere without knowing it?

            Thanks again for your help!
            Kubuntu #19517 (but of course I am not a number, I am a free man!)

            Comment


              #7
              Re: How to use a NTFS-formatted USB drive in Kubuntu

              Meant to say:

              When I "sudo konqueror" and attempt to set protections on /media/myMountPoint, the external disk light flashes like it's doing something, but in the end the protections don't change.

              I expect I've set incorrect default permissions somewhere without realizing it, or something along those lines. I appreciate your help and apologize for expending resources on this...
              Kubuntu #19517 (but of course I am not a number, I am a free man!)

              Comment


                #8
                Re: How to use a NTFS-formatted USB drive in Kubuntu

                Okay, this is embarrassing.

                It may be that I've just downloaded some prerequisite (I recently got Automatix), but I can now read the files on my NTFS partition. There are processes going on that I don't want to interrupt, but I'll test writing as soon as I can.

                What a dork, sorry... :P
                Kubuntu #19517 (but of course I am not a number, I am a free man!)

                Comment


                  #9
                  Re: How to use a NTFS-formatted USB drive in Kubuntu

                  Woops :P , I'm an idiot, but the software works.

                  I'm doing several things at once (configuring Opera, trying to improve fonts, etc.), and in the process I got Automatix and installed a bunch of stuff. Possibly something was already queued to be installed or perhaps I asked for the right thing, but whatever I did installed things that made everything work on the external drive.

                  It doesn't seem to have been permission problems, but rather the lack of some subsidiary package or related piece of software. As far as I can tell, it was downloading related stuff through Automatix that got me going. I didn't go back and fix the permissions, I just downloaded something I needed and the next time I went to Konqueror, bang, I could read the files.

                  And yes, I can write to the NTFS partition too.

                  dibl, many thanks for your kind assistance and sorry for the screwups!
                  Kubuntu #19517 (but of course I am not a number, I am a free man!)

                  Comment


                    #10
                    Re: How to use a NTFS-formatted USB drive in Kubuntu

                    Originally posted by dibl
                    sudo konqueror
                    We are not amused; you know better than that :P
                    Correct code would have been: kdesu konqueror

                    --

                    Let's try to add some understanding to my ranting:

                    Invoked by sudo, the command in question (e.g. to launch an application) will be executed under the root's ID - or will not, as by default root is not allowed to access the display (simplified; skipping technical details) ... To get that solved, you have to use kdesu, thus factually sidestepping the issue - or (re-) establish a full-fledged root account (incl. "X files") ...

                    --

                    Further Reading:

                    - Excerpt From KDE Docs
                    - Super User , Root Revival

                    Comment


                      #11
                      Re: How to use a NTFS-formatted USB drive in Kubuntu

                      Originally posted by UnicornRider
                      Originally posted by dibl
                      sudo konqueror
                      We are not amused; you know better than that :P


                      Oooops, I do! I rarely use Konqueror to do "Super User" work -- I guess it shows! :P

                      Thank you, U.R. -- we don't need to make this any worse, do we?

                      @cdupree -- good job, you helped yourself!

                      Comment


                        #12
                        Re: How to use a NTFS-formatted USB drive in Kubuntu

                        Originally posted by dibl
                        we don't need to make this any worse
                        Of course, we do (mainly me, that is ...)

                        http://www.penguin.ch/dokuwiki/doku....ro#the_x_files

                        Comment


                          #13
                          Re: How to use a NTFS-formatted USB drive in Kubuntu

                          I'm not sure if any of you know this but running Feisty all you have to do to get NTFS automatic read/write support (and NO, I didn't say Automatix) is to do the following:

                          1. Open up Add/Remove programs (input your password when prompted)

                          2. Search for NTFS, it will bring up ntfs-3g, check it and click apply. Close when done.

                          3. Hold down ALT + F2 and type in the box
                          kdesu ntfs-config
                          You'll get a little dialogue window opening. Chose to mount both external and internal or whichever suits your fancy and voila, you're done. It does everything for you.
                          Challenges are what that keeps us from the borderline of boredom in life's journey. Linux user no. 419401 currently running Kubuntu 24.04
                          _______________________________________________
                          Current System: Beelink Mini PC, AMD Ryzen 7 5800H 8 Core(Up to 4.4GHz), 32GB DDR4 RAM 1TB NVME M.2 SSD, SER5 MAX Mini Desktop Computer with TCL BeyondTV5 serving as my monitor. ​

                          Comment


                            #14
                            Re: How to use a NTFS-formatted USB drive in Kubuntu

                            Excellent -- thanks Princey! As usual, Linux provides at least 2 ways to "skin the cat".

                            Comment


                              #15
                              Re: How to use a NTFS-formatted USB drive in Kubuntu

                              Thank you guys. I just stumbled upon your thread and was a beneficiary. You don't know how grateful I am. I, using the beginning tutorial, can't use or understand the terminal. I don't remember exactly why, but I always have a question that needs an answer just prior to using the first examples and am kept from being able to learn with practice. I have desired this for a long time and wasn't even looking for it when you solved my problem. You're just GREAT!

                              Comment

                              Working...
                              X