You are not logged in.
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 Linuxwhich 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.
Offline
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
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)
Offline
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
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?
Offline
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 -aArtwork at deviantArt; Iceweasel Personas; SLiM #! Themes; Openbox themes
Online
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 withmount -a
Perfect, thanks damo 
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.