Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

What is the equivalent for switching drives in terminal on Linux?

In DOS, I switch between different drives by typing c: , d: , e: and so forth. But it doesn't work that way in Linux.

Could anyone please tell me how to switch between different drives?

  • command-line

LiveWireBT's user avatar

  • 1 yep.. using linux for the first time. hav to learn a lot –  saiy2k Feb 2, 2012 at 6:37
  • Just to clarify as this is a usual misconception causing more trouble in understanding: DOSBox is an emulator, cmd.exe a command-line interpreter for non-DOS based Windows releases and COMMAND.COM a system shell for DOS. While user interaction with these programs and the appearance may be similar, they are not the same. –  LiveWireBT Dec 13, 2014 at 13:19

7 Answers 7

Linux doesn't really have a way to work with "drives", per se, except with system utilities that access partitions; they often need to specify the drive that contains the partition. But if your drives each only have one partition, it doesn't really matter.

Anyway, to access a drive, you actually need to specify the partition in some way, usually by a definition like /dev/sda1 (1st partition on 1st drive) or /dev/sda2 (2nd partition on first drive). Using the Disk Utility or gparted, you can see all the partitions graphically. If you're only using the terminal, I've found that the command "blkid" is handy to list the drives with their UUIDs. I use the form:

Using the terminal, you need to mount a partition to actually use it. This is actually pretty easy to do. In most cases, you would want to use an empty directory as the "mount point"; if the directory is not empty, its contents will be masked and unavailable during the mount. This may be useful in certain circumstances, such as testing or temporarily changing a configuration for some other reason, as it will alleviate the need to rename or delete the current contents.

If you have a directory named /mnt/drive2 (/mnt is commonly used, but it can be in your home directory if you want), and your drive is /dev/sdb, with a single partition, then the simplest command is:

where "type" is the type shown in the blkid command, such as ntfs, ext4, etc.

EDIT: to experiment, don't be afraid to try the mount command. It is only temporary until you reboot (or unmount using the "umount" command). To make it permanent, you need to enter it into /etc/fstab . If you want to do that, you can experiment by creating an entry, then using the command "mount -a" to mount everything in /etc/fstab . If there are errors, it will tell you, and you can correct and repeat until it works.

Marty Fried's user avatar

  • 1 The first partition of the first drive is sda1, there is no sda0 –  enzotib Feb 1, 2012 at 19:06
  • Oops, sorry, you're right. I've gotten so used to using UUIDs that I forgot that. And since I have a lot of partitions, I always have to look them up to see which one to use, so I don't think about it. I'll edit my answer, but make a note of it so your comment won't look out of place. –  Marty Fried Feb 1, 2012 at 19:28
  • For Debian everything is inside mnt directory cd mnt/<your_drive>/<your_directory> . For example cd mnt/d/Github –  Wahab Shah Jan 20, 2022 at 11:28
  • @WahabShah: Well, not everything. Perhaps just drives that are mounted automatically - I don't use Debian, so I'm not sure. But this post never mentioned anything other than /mnt anyway, so your comment doesn't really fit anyway. –  Marty Fried Jan 21, 2022 at 19:13

Ubuntu keeps all additional disks mounted in the /media directory, so use

Zanna's user avatar

  • Like the answer below, the directory is cd /media/$USER/<your drive name> . –  Bobort Sep 13, 2018 at 20:26
  • For Debian everything is inside mnt directory cd mnt/<your_drive>/<your_directory> . For example cd mnt/d/Github –  Wahab Shah Jan 20, 2022 at 11:27

Hard disks (drives, as you call them) contain partitions, and each partition contain a filesystem.

In Linux and Unix there is a main filesystem called root filesystem, and indicated with / . Other filesystems (real or virtual) are mounted on the root filesystem on a mount point , i.e. an empty directory used as a start point for the specific filesystem, in such a way that all files can be reached as descendant of the root directory.

If you type the command mount without option, you would see something like the following:

where you can see that the partition /dev/sda5 (5th partition of the hard disk /dev/sda ) is mounted on / , so that it is the root partition. Furthermore, you see /dev/sda7 , another partition/filesystem, mounted on /media/data , so that cd /media/data effectively correspond to d: in the windows terminology.

There are many other mounted filesystem in this output, as you can see, and are all virtual filesystem, i.e. filesystem not corresponding to a disk partition. And you can see an NFS-mounted filesystem, a virtual filesystem linked to a real filesystem available on another machine through the network (the line of output where you see an IP address in part deliberately obscured by me).

You can see the simplicity of having a single structure to access all your files, and in some cases also remote files.

Related questions:

  • How to access a usb flash drive from the terminal? (How can I mount a flash drive manually?)
  • Why have both /mnt and /media? and How to understand the Ubuntu file system layout?

Community's user avatar

  • 1 Using lsblk may be a bit easier to read and only lists block storage devices (no sysfs, proc, cgroup, etc.). –  LiveWireBT Dec 13, 2014 at 13:06
  • cd ~ to get back to home directory –  Aakash Feb 16, 2017 at 6:14
  • 1 @AakashShah: cd ~ is a short version of cd , that do the same thing. –  enzotib Feb 18, 2017 at 18:05

in the future, if you forget it, just go to the drive with your files manager choose a random folder then right click on a blank area -> properties then see the "location"

muru's user avatar

You can also just browse to the folder on the drive you want and right-click, open in terminal.

hreryrtr's user avatar

Ubuntu can use, from your home directory (eliminate the < and > and replace "yourusername" with your actual username you logged into Linux with , "drive name" with the name of your hard disk).

All mounted disks are in that /media/ yourusername/ directory . If you do not know the drive name, you can always look in your file manager -or- through the terminal (again from your home directory)

You can use the sd# and mnt described; however, I think you were looking for an easy answer.

user272792's user avatar

  • The commands you've provided use absolute paths and are not required to be run from within the user's home directory. –  jkt123 Apr 23, 2014 at 2:30

Actually, for me it's like this:

With New Volume being the name of the external drive. and user being my username.

Don't know why the backward slash, I assume because of the space?

Mookey's user avatar

  • 2 Yes, it's because of the space. –  muru Dec 23, 2015 at 8:01
  • 1 Yes, I would avoid using Spaces in folder names or disk names or even file names. Just use CamelCase. –  Bobort Sep 13, 2018 at 20:27
  • Unless you're in a live business environment: Definitely use spaces in directory names! Force yourself to learn! If the system breaks? FIX IT! Progress is not the territory of cowards. –  John Mar 30, 2021 at 1:39

You must log in to answer this question.

Not the answer you're looking for browse other questions tagged command-line drive ..

  • The Overflow Blog
  • OverflowAI and the holy grail of search
  • Featured on Meta
  • Our Partnership with OpenAI
  • What deliverables would you like to see out of a working group?

Hot Network Questions

  • How to become a witch: Fiction Novel - Girl finds a how-to book about witches at the library
  • Visa Refusal Tourist Stream to Australia Querry
  • Unable to change file ownership through find-exec
  • Compute the degree of a string
  • Clarification needed about my Schengen visa (CZ, DE, SK)
  • What is this "/|\" symbol on the enclosures of various appliances?
  • VGAMs/VGLMs vs Multiple GAMs/GLMs
  • Why is my pepino melon bitter?
  • Counting consecutive units in nested lists
  • Does Dragonskin Armor effect Ranger's Dual Wield?
  • NTSC scan lines used by 8-bit computers
  • Retrosynthesis of 4-ethyl-2,2,5,5-tetramethyl-1,3-dioxane
  • Could ghosts be an airborne species of octopus?
  • Can White still castle?
  • tcsh: Handle spaces in arguments when passing on to another command
  • Why would academics spend funds on an apparently unnecessary publishing fee?
  • How do I create a cylinder with a taper at a specific angle?
  • What are the minimum system requirements to run GW-BASIC?
  • Is a PhD program the stage at which you define and carve out your own research niche?
  • The older, the smarter. Is the wisdom of time a scientifically proven fact or just human prejudices?
  • Why has the Cuban government invested little or nothing on biofuels?
  • Could Jupiter-like planet be able to radiate energy to sustain life on satellite?
  • Standard Enthalpy of Formation of Refrence state(A consequence or assumption) and H+(aq)
  • You can't tell me the US lacks –

how to change drive letter in linux

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

How can I change the hard disk name in Ubuntu?

I have a computer with Ubuntu installed. By default the hard disk name consists of a sequence of numbers and letters, which is not easy to remember nor input into a terminal.

How can I change the hard disk name in Ubuntu? Which file do I need to change?

Oliver Salzburg's user avatar

  • Do you mean the path to the device (/dev/sdb1), UUID (550e8400-e29b-11d4...) or the label/name of a partition? –  Bobby Apr 8, 2010 at 9:11
  • path to device as i understood is correct, nothing special. UUID has different mask, not the name. I mean label/name under "/media" folder. do you understand? –  Vytas P. Apr 8, 2010 at 9:20
  • sorry, i just install gparted and i was wrong, i need to change UUID, because UUID and label/name under /media is same. –  Vytas P. Apr 8, 2010 at 9:28

You must log in to answer this question.

Not the answer you're looking for browse other questions tagged ubuntu ..

  • The Overflow Blog
  • OverflowAI and the holy grail of search
  • Featured on Meta
  • Our Partnership with OpenAI
  • What deliverables would you like to see out of a working group?

Hot Network Questions

  • Image recognition in air to air missiles
  • Did a doctor Helen Zhu warn about a mounting epidemic in the US and receive a gag order?
  • Why did the Amiga 2000 only produce grayscale on its composite output?
  • Are spectral subtypes a logarithmic scale, or a linear one?
  • In what situation would universal full-body protective clothing be preferable to living in sealed habitats?
  • How will hitting the gym trigger the effect of the drug?
  • Anxious about possibly hitting bugs i can't solve and having to cancel my games
  • Understanding the commercial applications of AGPL3
  • How to fix the color regions of this tikz figure?
  • Visa Refusal Tourist Stream to Australia Querry
  • Rename files to random filenames (but not to checksums)
  • Where do I create my first circuit
  • Does suspending judgment require judgment?
  • Can I say "Rolex watches are astronomical", "astronomical" in the sense of "expensive"?
  • Why do cryogenic fuels want an extra pressure tank?
  • Who says understanding physics helps mathematicians? (A reference request) [Take the word "who" literally.]
  • What causes signal distortion in the BJT circuit I designed?
  • Is there a single word (or a short phrase) meaning "to be used both in the UK and in the US"
  • How would time dilate for pioneers travelling to Alpha Centauri Cb?
  • The older, the smarter. Is the wisdom of time a scientifically proven fact or just human prejudices?
  • Why "guilty" or "not guilty"and not "guilty" or "innocent"?
  • Who are these characters fighting Doctor Doom on the Secret Wars #7 (2015) cover?
  • How to create a custom command (control sequence) with special characters in its name
  • What is the latest scientific consensus on the peopling of the Americas?

how to change drive letter in linux

Linux Mint Forums

Welcome to the Linux Mint forums!

Skip to content

  • Unanswered topics
  • Active topics
  • Board index Main Edition Support Beginner Questions

How to change drives (devices)

Post by georgius » Fri Aug 09, 2013 12:37 pm

How to simply change the name of your hard drive in Linux

how to change drive letter in linux

In one of the Linux and Open Source Software oriented forums that I am connected to and follow on a daily basis, I saw a question with respect to a topic that had always been passing me by so far. This person asked the forum members if someone knew how to change the name of a hard drive (via the GUI) in Linux in a simple way. This person had already researched and tried everything himself, but according to him it seemed that something simple as adjusting the name was only possible by re-formatting the to be renamed partition, with of course the result of data loss and thus the need to first backup the data on it. This is not what he wanted. So how can we simply change the name of a partition on your hard drive in Linux so it shows correctly in your file manager?

Strange question?

If you come from a Windows or macOS environment then this seems a strange question, because in there you just click with the right mouse button on the partition or drive and you can adjust the label directly via properties. So I had never considered that under Linux this should be done in a different way.

Because I could not imagine that it was really necessary to have to format the entire partition when renaming a disk partition, I decided to dig a bit deeper in the hope of helping the man on this forum with a somewhat more friendly solution. And there is a more simple solution indeed, but through an unclear road, because of a somewhat crooked naming convention in the Disks utility in Linux distributions. Due to the chosen naming system (“Edit filesystem …”) users may deliberately not look further to rename a drive or partition. But it is actually there.

The solution

It is really simple. In your Linux distribution (in my case at the moment of writing Zorin OS 15, but it works for every distribution as long as you have the Disks application) follow the next simple steps to rename a partition without the hassle of reformatting:

1) Go to your applications. 2) Search for Disks.

how to change drive letter in linux

3) Click on Disks to start the application. 4) Select the hard disk on the left 5) Then select the partition to be renamed to the right under Volumes 6) Click on the little block / stop icon to unmount the partition (Unmount selected partition) 7) Click on the gear icon 8) Select the option “Edit filesystem …”

how to change drive letter in linux

You will now see the partition with the newly created name in your file manager or directly on your desktop. It is that simple!

The question still is why did the developers not name the discussed option somthing like “Change Label” instead of “Edit Filesystem”, as the underlying screen is labeled accordingly. In my opinion a bit strange to label an option with “Edit Filesystem” if you can only rename a label. So it is logical that especially Linux beginners are confused where to rename a partition.

Related Posts

how to change drive letter in linux

Digital Minimalism – How to clean up your digital life in Linux

May 5, 2024 May 5, 2024

how to change drive letter in linux

An introduction to ONLYOFFICE for Linux

April 19, 2024 April 19, 2024

Main image Linux Mint 21.3 Tutorial Series

How to Connect your mobile phone to Linux Mint with KDE Connect – Linux Mint 21.3 edition

March 17, 2024 March 17, 2024

User Avatar

About John Been

Hi there! My name is John Been. At the moment I work as a senior solution engineer for a large financial institution, but in my free time, I am the owner of RealAppUser.com, RealLinuxUser.com, and author of my first book "Linux for the rest of us". I have a broad insight and user experience in everything related to information technology and I believe I can communicate about it with some fun and knowledge and skills.

2 Comments on “How to simply change the name of your hard drive in Linux”

  • Pingback: What Is Sda in Linux [Fact-Checked] - WiseUpIT
  • Pingback: How do I rename my WD external hard drive Mac? - Question Field

Comments are closed.

How-To Geek

How to change a drive letter on windows 10 or windows 11.

You can change your drive letters in Windows 10 and 11 using the Disk Management utility.

Quick Links

What changing a drive letter does, how to change a drive letter, how to fix programs broken by changing a drive letter.

Changing the letter of a drive is easy on Windows 10 and Windows 11, but you should do it as soon as you add the drive to prevent future hassles. Find out how to change a drive letter here.

Windows assigns drive letters alphabetically --- starting with C --- when they're initialized. If you want to change a drive letter, you should do it before you install anything on the drive. Changing a drive letter after programs are installed could break them since there will be references to an installation location that is no longer there.

Windows has gotten pretty smart about updating shortcuts so that programs work after changing a drive letter. Most of your applications' shortcuts will probably be automatically corrected. Unfortunately, Windows isn't as good about updating file associations. You'll have to manually set the default apps associated with files to fix file associations if they were broken by changing the drive letter.

It is possible to change the boot drive letter to something else, but we don't recommend it. Changing C:\ to another letter is likely to result in severe issues, like a PC that cannot boot into Windows at all. Even if it were able to boot, there would be a huge number of programs that would not be able to run.

Technically speaking, while they are commonly called drive letters, each letter actually refers to a partition on a disk. If you have multiple partitions on a single disk, you will need to assign a letter to each partition to make them all accessible. If a disk has just a single partition, it will just have a single letter pointing to that partition. (However, you do not have to assign a letter to each partition. Partitions without drive letters will not appear in File Explorer and elsewhere.)

Changing a drive letter is pretty simple. Click the Start button, type "Disk Management" in the search bar, and then hit Enter.

The program name displayed in the search will not be Disk Management. It will be "Create and format hard disk partitions."

You could also hit Windows+X or right-click the Start button, and then click "Disk Management."

Identify the drive you'd like to change in the Disk Management Window. In this example, we'll change the letter of the D:\ drive to J:\. You can right-click the drive on the text list, or on the menu below. Either works.

Select "Change Drive Letter and Paths" in the right-click menu that appears.

In the window that pops up, click "Change."

Select whatever letter you want from the drop-down menu. Then click "Ok."

Two popups will warn you about changing your drive letter. Click "Yes" on both of them, and then restart your computer.

Once Windows has restarted, the drive letter should be changed.

There are a few ways you can fix a program broken by changing the drive letter.

Fix The Shortcut

If you're lucky, the only thing that is broken is the shortcut. Fix a shortcut by right-clicking the shortcut on your desktop, and then click Properties.

You need to change the target of the shortcut to the new drive letter.

For example, if GIMP was previously installed at " D :\GIMP 2\bin\gimp-2.10.exe," and you changed the D drive to J, change the target of the shortcut to " J :\GIMP 2\bin\gimp-2.10.exe."

Finalize the change by clicking "Apply" and then "Ok."

Reinstall the Program

Reinstalling the program will generate new entries in the registry, so everything on the computer will know where to look for the program. Some installers won't like reinstalling directly over existing files, so you may need to rename or delete the old installation first.

Change the Drive Letter Back

If you changed the drive letter of a drive with a lot of programs installed, it might be easier to change the drive letter back. Changing the drive letter back should automatically fix any programs and file associations that were broken.

Edit the Registry

You can break programs, or even Windows itself, by editing the registry. Be careful, and learn about how to edit the registry before you try it. Make sure you backup the Windows registry first. You should not attempt this method unless you have no other options.

Windows, and a lot of programs, track where programs are installed via the Windows registry. It is possible to manually adjust the registry to fix broken programs. Keep in mind that there could be dozens of registry entries you need to edit. A program like GIMP can have registry entries for the context menu, for the "Open With" menu, for any file associations, and for the location of its executables. Other programs may only have a few entries related to where it is installed.

If you're not deterred, here's how you do it.

First, you need to know where the program was previously installed. In this case, the program was installed to the "D:\GIMP 2" folder, and the executables were found the "D:\GIMP 2\bin" sub-folder. It is now located at "J:\GIMP 2" instead.

We need to update the registry to reflect the change in location. Click the Start button, type "regedit" into the search bar, right-click Regedit, and click "Run as administrator."

In Regedit, hit Ctrl+F to bring up a search window. Type in the old location for the program you're trying to fix --- "D:\GIMP 2" for our example --- then click "Find Next."

Once Regedit has found something with "D:\GIMP 2" as part of a path, it'll show it to you. Here is an example from the GIMP search.

To actually change them, double click the name of the registry entry you want to modify. Then change the drive letter to J, or whatever you chose. If you didn't otherwise move the folder, leave the rest of the path alone. Then click "Ok."

You'll need to repeat this multiple times. To find the next result using your search term, you can hit the F3 key. There will be a popup once you've found all of the entries.

Changing drive letters can be a simple way to customize your PC. Do it before you install anything on the drive, however. You'll prevent any problems before they occur, and probably save yourself quite a bit of troubleshooting.

Tecmint: Linux Howtos, Tutorials & Guides

How to Safely Eject a USB Drive in Linux

When using a USB drive on a Linux system, it’s important to properly unmount and remove the drive to prevent data loss or corruption. Simply unplugging the drive without properly unmounting it can lead to issues.

In this guide, we’ll learn the simple steps and important safety tips for safely ejecting USB drives using the Linux command line.

Identify the USB Drive in Linux

First, you need to identify the device name of your USB drive by running the following lsblk command , which will list all block devices connected to your system.

Check the USB Drive in Linux

The above command displays all the storage devices connected to your system. Look for your USB drive in the list, which is usually labeled as /dev/sdX , where 'X' represents a letter (e.g., /dev/sdb , /dev/sdc , etc.).

In this example, the USB drive is identified as ` /dev/sdc `. Make a note of this label; we’ll need it for the next step.

Unmount the USB Drive in Linux

Next, you need to unmount the USB drive by running the following umount command, specifying the mount point of the USB drive.

Umount USB Drive in Linux

Safely Remove the USB Drive in Linux

After unmounting the drive, you can safely remove it from your system by running the following eject command.

This will power down the USB drive and allow you to safely remove it.

Another way to safely remove a USB drive is to use the ` udisksctl ` command, which is part of the ` udisks ` package, that provides a command-line interface for interacting with storage devices.

Then, power off the drive:

After running these commands, you can safely remove the USB drive.

Safely removing a USB drive in Linux is an important step to prevent data loss or corruption. By following the steps outlined above, you can properly unmount and remove your USB drive using the Linux command line.

Remember, it’s always better to take the extra time to safely remove a drive than to risk losing your data.

Previous article:

Next article:

Photo of author

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Related Posts

Send Mail From Linux Terminal

Mutt – A Command Line Email Client to Send Mails from Terminal

dpkg Command Examples

15 Useful ‘dpkg’ Commands for Debian/Ubuntu Users

Advance Commands for Linux Experts

Sysadmins & DevOps: 20 Must-Know Advanced Linux Commands

Make File and Directory Undeletable in Linux

How to Make File and Directory Undeletable, Even By Root in Linux

Understanding Different Linux Shell Commands

5 Different Types of Shell Commands and Their Usage in Linux

vlock Lock User Terminal in Linux

vlock: The Smart Way to Lock Your Linux Terminal

Got Something to Say? Join the Discussion... Cancel reply

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.

Save my name, email, and website in this browser for the next time I comment.

  • Shell Scripting
  • Docker in Linux
  • Kubernetes in Linux
  • Linux interview question
  • How to Format USB Drives On Linux
  • Google Docs - How to Log In
  • How to Install and Use Git in Google Colab?
  • How to Use Google Docs
  • How to Work Offline in Google Docs
  • How to Assign Tasks in Google Drive
  • How to Install Google Chrome on Kali Linux?
  • How to use Google Fonts in CSS ?
  • What is Google Stack and How to Use it
  • How To Type Other Languages In Google Docs
  • What is Google Sheets API and How to Use it?
  • How to Open web camera in Google Colab?
  • How to install Googler on Ubuntu
  • How to Set Up 'OK Google' on iOS and Android?
  • How to Open a Pdf in Google Docs
  • How To Share a PPT In Google Docs
  • How to Edit a PDF in Google Docs
  • How to get your website on Google
  • How to use Google Fonts in React ?

How to Use Google Drive in Linux

Google Drive is one of the famous cloud storage services provided by Google. Google Drive allows users to store files online and access them from anywhere. Google Drive is available for all major platforms i.e. Windows, MacOS, Linux, and others. In this article, we will learn how to use Google Drive in Linux to store and access our files.

Accessing Google Drive on Linux

Tools to sync google drive, 1. rclone (cli tool), 2. google-drive-ocamlfuse (cli tool), 3. gnome online accounts (gui tool), 4. klo gdrive (gui tool), steps to use google drive, 1. using rclone (cli tool), step 1: install rclone, step 2: configure rclone, step 3: create a new remote, step 4: authenticate google account, step 5: explore rclone, 2. using google-drive-ocamlfuse, step 1: install google-drive-ocamlfuse, step 2: create a new directory, step 3: authenticate google drive, 3. using gnome online accounts (gui tool), step 1: open settings, step 2: sign in with valid credentials, step 3: turn on required accesses, step 4: explore file manager, 4. using klo gdrive (gui tool), step 1: install kio gdrive, step 2: make libreoffice kde compatible, step 3: install dolphin, step 4: explore drive.

Accessing Google Drive on any platform including Linux is very simple. We just need a web browser to navigate Google Drive.

Step 1: Open any Web browser on your Linux computer. For example, let’s open Firefox.

Step 2: On your web browser go to drive.google.com to visit the official website of Google Drive.

Step 3: On the webpage enter your valid email ID and password and you will be logged in.

Entering Login Credentials

Entering Login Credentials

Step 4: Now you can explore the Drive and upload any file or access already uploaded or shared files.

Exploring Drive Contents

Exploring Drive Contents

While we can use Google Drive using just a web browser, we still need a dedicated application for Google Drive for synchronization. For Linux, we have both the Command Line tool and GUI application to sync Google Drive.

Rclone is a command-line program used for managing and synchronizing files across various cloud storage services, including Google Drive. It supports a wide range of operations such as copying, syncing, and moving files, offering extensive configuration options and efficient performance. Rclone is particularly favored for its flexibility and powerful scripting capabilities.

Google-drive-ocamlfuse is a command-line tool that allows users to mount their Google Drive as a file system on Linux. It provides seamless access to Google Drive files, enabling standard file operations like reading, writing, and synchronizing, directly from the terminal. This tool is appreciated for its ease of use and integration with the Linux file system.

GNOME Online Accounts is a GUI tool that integrates online services, including Google Drive, into the GNOME desktop environment. By adding a Google account, users can seamlessly access and manage their Google Drive files directly from the GNOME file manager. This integration offers a user-friendly and convenient way to synchronize and interact with Google Drive on Linux.

Kio GDrive is a GUI tool that integrates Google Drive with the KDE desktop environment. It allows users to access and manage their Google Drive files directly from the Dolphin file manager . Kio GDrive provides a seamless and intuitive way to browse, upload, download, and synchronize Google Drive files within the KDE Plasma desktop.

Open the terminal in your Linux computer and run the following command to install Rclone .

This command will give you superuser access and ask for a password. Once verified, the application will be downloaded and installed.

Installing Rclone

Installing Rclone

After installation is done, it is time to configure Rclone with Google Drive. Run the following command to start the configuration,

Configuring Rclone

Configuring Rclone

Enter “n” for the new remote and give a name for the mount.

Creating New Remote

Creating New Remote

Enter “13” to choose Google Drive and then enter “1” to give full access to Google Drive.

Giving Full Access of Google Drive

Giving Full Access to Google Drive

Leave all other fields as default and you will be taken to the web browser to select your Google Account.

Authenticate Google Account

Authenticate Google Account

Once authentication is done you will be taken back to the Terminal and you will have options to make changes to the drive using CLI.

Exploring Rclone

Exploring Rclone

Now you can quit this config menu and start using Google Drive in Terminal. For example, run the following command to list all the files and directories inside Google Drive.

Create a new directory and add it to Google Drive by running the following command.

Firstly we will install Google-drive-ocamlfuse on the computer. Add a new repository to download the packages required. Then we need to update the system. Once done, we can install the application.

Install Google-drive-ocamlfuse

Install Google-drive-ocamlfuse

Once installed, create a new directory in the system for Google Drive using the following command,

The first command will create a new directory and the second one will map the directory with Google Drive.

Create a new Directory

Create a new Directory

Authenticate the Google Account using which you want to access Google Drive. Just allow all the permissions asked and you are all set to use Google Drive using Google-drive-ocamlfuse this includes view, edit, create, and delete access to Google Drive.

Authenticate Google Drive

Authenticate Google Drive

Open Settings on your Computer with GNOME desktop (Ubuntu Linux comes with GNOME built-in.). In Settings, go to “ Online Accounts” and select “ Google” .

Opening Settings

Opening Settings

Give a valid email and password and accept the terms to continue. You need to provide full access to our Google account to GNOME for better usability.

Sign In with valid credentials

Sign In with valid credentials

Once you give the required permission a box will open with toggles to enable/disable different permissions. For Files keep the toggle at On .

 Turn on Required Accesses

Turn on Required Accesses

Once you have completed all the steps, you should see a network drive in your file manager. This is the Google Drive that you have mapped.

Explore File Manager

Explore File Manager

As you can see it has the same folder that we created earlier.

Unlike GNOME, we need to install KIO GDrive on your computer, before we can use it. Run the following command in the Terminal to install KIO GDrive.

Install KIO GDrive

Install KIO GDrive

KIO GDrive is compatible with KDE-based systems. So we need to make the LibreOffice compatible with KIO. Run the following command to install an additional package.

Make LibreOffice KDE compatible

Make LibreOffice KDE compatible

As KIO GDrive is a KDE-based application, we will also need a Dolphin file manager to use KIO GDrive. Run the following command to install Dolphin.

Install Dolphin

Install Dolphin

Open Dolphin and Select Google Drive from the options given in Network.

Explore Drive

Explore Drive

Follow the same steps given in the previous example to connect your Google Account and that’s it you can use Google Drive as a local directory in your Linux PC as we show in GNOME.

How to Use Google Drive in Linux – FAQs

Can i use google drive on linux without installing any additional software.

Yes, you can access Google Drive on Linux using any web browser. Simply go to drive.google.com, log in with your Google account, and you can manage your files directly from the web interface without needing any additional software.

What is the difference between Rclone and Google-drive-ocamlfuse?

Rclone is a versatile command-line tool that supports various cloud storage services and offers extensive file management capabilities, including copying, syncing, and moving files. Google-drive-ocamlfuse, on the other hand, is specifically designed to mount Google Drive as a file system on Linux, allowing you to interact with your Google Drive files as if they were part of your local file system.

How do I mount my Google Drive on a Linux system using GNOME Online Accounts?

To mount your Google Drive using GNOME Online Accounts: Open the Settings application and navigate to “ Online Accounts. “ Select “ Google ” and sign in with your Google account credentials. Enable the “ Files ” toggle to allow access to Google Drive. Open your file manager, where you will see your Google Drive listed under network drives.

Is it possible to use Google Drive with the KDE desktop environment?

Yes, you can use Google Drive with the KDE desktop environment by installing KIO GDrive. This tool integrates Google Drive with the Dolphin file manager, allowing you to browse, upload, download, and manage your Google Drive files seamlessly within the KDE Plasma desktop.

In conclusion, accessing and managing Google Drive on Linux is straightforward and versatile, with options ranging from web-based access to dedicated command-line and GUI tools. Whether using Rclone, Google-drive-ocamlfuse, GNOME Online Accounts, or Kio GDrive, Linux users have multiple methods to integrate and synchronize their Google Drive files efficiently. These tools cater to different preferences and desktop environments, ensuring a smooth and productive experience for all users.

Please Login to comment...

Similar reads.

author

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

COMMENTS

  1. What is the equivalent for switching drives in terminal on Linux?

    If you have a directory named /mnt/drive2 (/mnt is commonly used, but it can be in your home directory if you want), and your drive is /dev/sdb, with a single partition, then the simplest command is: sudo mount -t type /dev/sdb1 /mnt/drive2. where "type" is the type shown in the blkid command, such as ntfs, ext4, etc.

  2. How can I change the hard disk name in Ubuntu?

    1. In Ubuntu 13.04, you can use the native " e2label " from terminal. Steps: list the disks to see which is the one you want to change: sudo fdisk -l. change the disk name: sudo e2label /dev/sdb1 "mydiskname". Share.

  3. How to Change Linux Partition Label Names on EXT4 / EXT3 ...

    First step is to select the partition whose label is to be changed, which is Partition 1 here, next step is to select gear icon and edit filesystem. Change Linux Partition Label. After this you will be prompted to change the label of selected partition. Set Linux Partition Label Name.

  4. According to which algorithm does Linux assign the hard drive letters?

    Sometimes the drive assignment will change even with the device mounted, and files on the changed drive become inaccessible. I'm running Ubuntu 16.04.4 LTS (Linux 4.4.-128-generic i686). I use sleep mode between daily sessions, and I suspect the drive gets reassigned when waking from sleep mode, although I'm not absolutely sure about this.

  5. terminal

    Install package using. sudo apt-get install mtools. unmount the external drive, Partitions generally need to be unmounted before you can fiddle with them, so unmount the partition of the device you want to change the label for: sudo umount <device>. where device name can be /dev/sdbx, you can find in sudo fdisk -l. Check the current label.

  6. Ubuntu: Change or Assign a Drive Letter to an external hard drive (or

    Ubuntu: Change or Assign a Drive Letter to an external hard drive (or any drive)Helpful? ... Ubuntu: Change or Assign a Drive Letter to an external hard drive (or any drive)Helpful? Please support ...

  7. Hard drive/device partition naming convention in Linux

    See "Naming convention" in the Grub manual if you want more details. /dev/sda, /dev/sdb, etc, are the default names of hard disks (and other similar storage like flash disks of all kinds, but not CD or tape drives) under Linux. The last letter grows in the order in which the disks are detected. You may find /dev/hda, /dev/hdb, etc, on some ...

  8. Assign drive/partition letters in Linux : r/linux4noobs

    Linux doesn't have drive letters. Instead you "mount" your partitions, that is you assign a folder to the partition so that you have the content of your partition under that folder. You can do that on the command line using. sudo mount /dev/sdb1 /some/folder/. Replace /dev/sdb1 with the device for your partition and /some/folder/ with any ...

  9. How to label disk in Linux with blkid

    One way to add a label to a disk partition is with the e2label command. Use the syntax below to add a label to any disk partition of your choosing. $ sudo e2label /dev/sda5 "MY_BACKUP". Another way to add a label is with the tune2fs command. The following syntax would be used to add a label to our /dev/sda5 partition.

  10. linux

    You can create device files with the mknod command, so an. mknod /dev/sda b 8 16; mknod /dev/sdb b 8 0. will (re)create the device files as you need. Dangers are much smaller if you do this in a chroot-ed (containerized) environment, where only your problematic app can see these overridden settings.

  11. How to change directory in Linux terminal

    Table 2: Shell variable for cd command; Variable Description Examples; CDPATH: The search path for the cd command. It is a : separated list of pathnames that refer to directories.The cd command shall use this list in its attempt to change the directory. An empty string in place of a directory pathname represents the current directory. If CDPATH is not set, it shall be treated as if it were an ...

  12. How to I change disk drive in Terminal

    First you have to create the partition table on the disk, partition the disk and finally create the file system. sudo fdisk /dev/sdb. Follow the prompts, create a label (msdos or gpt) Create the partition (one or more) Specify the partition type, Centos favours xfs for example. write and quit.

  13. ubuntu

    Not only that, if a drive drops off the bus and comes back, it'll often get a new letter. Or sometimes when you replace a failed drive (both of these happen because something still has a reference to the old drive, e.g., the "failed" entry in md-raid). There are stable identifiers; use them instead. Your udevadm info output told you what they are:

  14. How to change drives (devices)

    Linux doesn't use drive letters. What we do is mount the filesystems of drives. Mounting a device can be as simple as opening the file manager and clicking on the device. Once mounted, the device's filesystem can be found at /media. So, if I had a disk partition named "Data" and I mounted it, I could navigate to it from the terminal with.

  15. Drive letter for USB device and HDD devices in Linux kernel

    0. One useful investigation starting point code-wise would be function disk_name(), defined in block/partition-generic.c: /*. * disk_name() is used by partition check code and the genhd driver. * It formats the devicename of the indicated disk into. * the supplied buffer (of size at least 32), and returns.

  16. How to simply change the name of your hard drive in Linux

    1) Go to your applications. 2) Search for Disks. 3) Click on Disks to start the application. 4) Select the hard disk on the left. 5) Then select the partition to be renamed to the right under Volumes. 6) Click on the little block / stop icon to unmount the partition (Unmount selected partition) 7) Click on the gear icon.

  17. How to Change a Drive Letter on Windows 10 or Windows 11

    Changing a drive letter is pretty simple. Click the Start button, type "Disk Management" in the search bar, and then hit Enter. The program name displayed in the search will not be Disk Management. It will be "Create and format hard disk partitions." You could also hit Windows+X or right-click the Start button, and then click "Disk Management."

  18. How to move to a different drive or partition?

    Use parted to partition this new virtual disk: # parted /dev/sdb. (parted) mklabel gpt. (parted) mkpart ext2 1 -1. (parted) quit. That takes over the entire virtual disk. This will allow you to use the much simpler resize process above if you run out of disk capacity again in the future.

  19. Guide to Linux rename Command With Examples

    Next, let's remove characters that are not letters, digits, or periods from the filenames: $ rename 's/[^a-zA-Z0-9.]//g' * Let's analyze the regular expression pattern: '[^a-zA-Z0-9.]' - this pattern matches any character that is not a letter (uppercase or lowercase), a digit, or a period // - specifies that any character matched by the [^a-zA-Z0-9.] pattern should be replaced with ...

  20. How to Safely Remove a USB Drive in Linux

    Next, you need to unmount the USB drive by running the following umount command, specifying the mount point of the USB drive. sudo umount /dev/sdc lsblk Umount USB Drive in Linux Safely Remove the USB Drive in Linux. After unmounting the drive, you can safely remove it from your system by running the following eject command. sudo eject /dev/sdc

  21. Change Name of Mounted Hard Drive

    The first word on a line is the device to mount: this is a name like /dev/sdx1, or a uuid like UUID=e7522030-f6e3..., or a label like LABEL=volume. The 2nd word is the directory to use as a mount point (dir must exist). If an entry doesn't exist for your disk, add it using preferable the UUID or LABEL in the first field, and your desired mount ...

  22. How to Use Google Drive in Linux

    Google Drive is one of the famous cloud storage services provided by Google. Google Drive allows users to store files online and access them from anywhere. Google Drive is available for all major platforms i.e. Windows, MacOS, Linux, and others. In this article, we will learn how to use Google Drive in Linux to store and access our files.