0

I have an external hard drive that I formatted with Ubuntu (using the Gnome Disk Utility aka Disks) as an NTFS file system. Most of my computers in the house run Linux but I have a housemate using Windows 7. Usually, this external hard drive is connected to a file server, and files are accessed over the network; however, my file server broke down and I wanted to plug this external drive into my house mate's Windows 7 computer in the meantime so he can still access our media.

The drive is detected fine by Windows and it installs the drivers successfully and the device manager reports the device is working properly but it will not show up in Windows Explorer. After doing some googling and checking out the disk management utility in Windows, I've discovered the problem to be that the external drive has no drive letter assigned to it and that's why Windows can't bring it to the file manager. The usual solution is to use the disk management utility in Windows to assign a drive letter but the option is greyed out (yay Windows!).

I found a way to assign a drive letter through DOS using diskpart but don't have access to a Windows computer atm. I'd like to assign a drive letter to this drive (and a couple of other similar NTFS drives) from one of my Linux machines so that he can just plug in the drive when he gets home and not have to have me there to set it up.

So, unfortunately, all the Ask Ubuntu questions that have a title asking how to change the drive letter of a disk are actually pleas for support and were resolved in other ways... I would actually just like to know how to assign or change the drive letter of a disk. GUI or CLI is fine, however, CLI is preferred. I couldn't find anything in the man pages on the part about it, nor could I find any options in gparted or gnome disk utility. I also couldn't find much by googling, except some people suggesting that it's not even possible to do from a Linux machine because Linux doesn't use drive letters, but I doubt that. Thanks.

Question: How to change or assign a drive letter to disk? Preferably using CLI, but instructions to use a GUI are also acceptable (read above only if you need to know why).

Kulfy
  • 17,696
Ibuntu
  • 795
  • Not much into Windows any more, but may this be a missing disk label? See http://askubuntu.com/questions/276911/how-to-rename-partitions on how to create a label on NTFS from CLI. – Takkat Feb 23 '14 at 21:31
  • No I had tried relabelling the disk. Without a drive letter Windows cannot load disks. There was a CLI tool in windows for adding a drive letter that I Wanted to check to see if it could be done without affecting data on the disk but I forgot and just backed everything up and formatted the disk. Thanks for the comment. – Ibuntu Apr 20 '14 at 06:36

2 Answers2

3

All you need to do is use fdisk (in linux) to change the partition id to 7. In your case the partition id 83 (linux partition) or something else which windows considers the volume as hidden. When the partition id is 7, windows will automatically recognizes the partition volume as NTFS and assigns a drive letter whenever the FDD was recognized. Drive letter is a mount point which is windows specific. In linux some directory, mostly /mnt/dir is used for mount point. Linux can successfully mount NTFS volumes with partition id 7 and hence you will be able to use the partition from both LINUX as well as windows.

0

You have to trust in those some people that suggested you that this thing is not possible to do from a Linux machine.

In Unix like systems, volumes are named and located arbitrarily in a single hierarchical namespace. A drive assignment has the following naming format:

/dev/sd[a-z][a-z][1-15]

Names without a trailing digit refer to the whole disk, while names with a trailing digit refer to a partition of that whole disk. By convention, SCSI disks have a maximum of 16 minor numbers mapped to a single disk. Thus, for each whole disk, there is a maximum of 15 partitions per disk because one minor number is used to describe the entire disk (for example /dev/sda), and the other 15 minor numbers are used to refer to partitions for that disk (for example /dev/sda1, /dev/sda2, etc).

You can run the following command to see how the device files are named for your whole disk /dev/sda:

ls -l /dev/sda*

More about:

Radu Rădeanu
  • 169,590
  • I get that it would have no purpose in Linux, but is there still no piece of software that can make alterations necessary for Windows systems? Theoretically, I could run a Windows partition software through WINE and do it like that,,, but that's just way more work than waiting to do it on a Windows machine. Thanks for the response. – Ibuntu Feb 23 '14 at 22:39