SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2014-04-02 18:03:47

BruceJohnJennerLawso
#! Member
Registered: 2014-02-23
Posts: 50

Trying to auto-mount my Windows partition

so...

I recently set up a startup script on Crunchbang to automate a few things every time I start my OS. The script runs a handy program that I use as a sort of log, opening a text file & writing it to screen, essentially. Setting this up to work in both Windows and Linux proved tricky, given that Windows cant read from my Linux filesystem, so I had to get the Linux version of the program to look for a specific file inside the windows partition. Naturally, this only works after Ive clicked on the partition in thunar, mounting it that way as "/media/Windows7_OS"

Of course, I would like to be able to insert a quick command into my script that mounts the Windows7 partition automatically for me, but Im having some trouble with the mount command to get it to work. When I run fdisk -l, I get

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     3074047     1536000    7  HPFS/NTFS/exFAT
/dev/sda2         3074048   347588336   172257144+   7  HPFS/NTFS/exFAT
/dev/sda3       592371712   625139711    16384000    7  HPFS/NTFS/exFAT
/dev/sda4       347588606   424679423    38545409    5  Extended
/dev/sda5       387573760   414914559    13670400   83  Linux
/dev/sda6       414916608   424679423     4881408   82  Linux swap / Solaris
/dev/sda7       347588608   387571711    19991552   83  Linux

which looks slightly different from most examples Ive seen so far, specifically, the file system, which most examples of this show as just NTFS

Im not entirely sure what the mount command in question should look like, but I think it would be something like

sudo mount -t ntfs /dev/sda1 /media/

which mounts an ntfs partition at /media/filesystem (or whatever the partition is called in place of "filesystem")

This does not appear to work for me, which makes me wonder if I have the wrong filesystem type passed to the mount command.

The other problem is that I'm not sure what the path to the windows directory will look like once its mounted using the mount command, and whether clicking on the drive icon in Thunar will mount another copy of the filesystem in question alongside the one under a different name.

So basically, what I want to do is try and exactly match whatever command Thunar runs when clicking on the partition name in the window. Perhaps even better, is there any way to pass thunar an argument to get it to do this automatically?

Apologies if Im misunderstanding the way this works.


The computer is mightier than the pen, the sword, and usually the programmer.

My Projects on Github

Offline

Help fund CrunchBang, donate to the project!

#2 2014-04-02 18:07:53

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 4,442

Re: Trying to auto-mount my Windows partition

You should be using ntfs-3g instead

sudo mount -t ntfs-3g /dev/sda1 /media/

Why don't you mount it in fstab?

Last edited by damo (2014-04-02 18:11:04)


Artwork at deviantArt;  Iceweasel Personas;  SLiM #! Themes;  Openbox themes

Online

#3 2014-04-02 18:12:30

BruceJohnJennerLawso
#! Member
Registered: 2014-02-23
Posts: 50

Re: Trying to auto-mount my Windows partition

damo wrote:

You should be using ntfs-3g instead

sudo mount -t ntfs-3g /dev/sda1 /media/

Okay, thanks, I think that works.

But what happens with the script trying to run a sudo command? The user wont be able to enter their root password if the terminal isn't open, will they?

What exactly is fstab?

Last edited by BruceJohnJennerLawso (2014-04-02 18:23:17)


The computer is mightier than the pen, the sword, and usually the programmer.

My Projects on Github

Offline

#4 2014-04-02 18:27:36

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 4,442

Re: Trying to auto-mount my Windows partition

First off, search for fstab info - it is the file which determines how drives get mounted.

Eg Debian wiki

Last edited by damo (2014-04-02 18:30:37)


Artwork at deviantArt;  Iceweasel Personas;  SLiM #! Themes;  Openbox themes

Online

#5 2014-04-02 18:39:46

BruceJohnJennerLawso
#! Member
Registered: 2014-02-23
Posts: 50

Re: Trying to auto-mount my Windows partition

damo wrote:

First off, search for fstab info - it is the file which determines how drives get mounted.

Eg Debian wiki

Ah, thanks now I understand. So Fstab automatically mounts the partitions in its list at startup?


The computer is mightier than the pen, the sword, and usually the programmer.

My Projects on Github

Offline

#6 2014-04-02 20:37:07

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 4,442

Re: Trying to auto-mount my Windows partition

That's right. You can set a drive to be mounted with eg user access, read-write, etc
At any time you can mount all partitions in fstab with

mount -a

Artwork at deviantArt;  Iceweasel Personas;  SLiM #! Themes;  Openbox themes

Online

#7 2014-04-02 21:29:29

BruceJohnJennerLawso
#! Member
Registered: 2014-02-23
Posts: 50

Re: Trying to auto-mount my Windows partition

damo wrote:

That's right. You can set a drive to be mounted with eg user access, read-write, etc
At any time you can mount all partitions in fstab with

mount -a

Perfect, thanks damo smile


The computer is mightier than the pen, the sword, and usually the programmer.

My Projects on Github

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo