Results 1 to 4 of 4

Thread: Prevent a Partition from Mounting on Ext. HDD?

  1. #1
    Join Date
    Aug 2006
    Location
    Rexburg, ID
    Beans
    342
    Distro
    Hardy Heron (Ubuntu Development)

    Question Prevent a Partition from Mounting on Ext. HDD?

    Hello,

    I was hoping that there was a way prevent a partition on an Ext. HDD from mounting. Basically, I have parted this HDD two ways: one with NTFS and the other with Ext3. I don't want the first partition (the NTFS) to mount while in Linux. This way, I don't have to unmount two different drives for the same one HDD. Is there a way?

    Thanks in advance,

    Derek

    PS. My next question is going to be can I rename the drives? So, "My HDD" instead of "disk-1" or "disk-2"?

  2. #2
    Join Date
    Dec 2006
    Beans
    485
    Distro
    Hardy Heron (Ubuntu Development)

    Re: Prevent a Partition from Mounting on Ext. HDD?

    Well, do you not want them to mount on start up? that can be done by removing the partition's entry in /etc/fstab.

    You could still manually mount the partition if you choose, but it wouldn't mount automatically.

    As far as renaming goes, you could rename the volume label easily enough, but not the /dev/ entry as far as I know. Here is a link:

    https://help.ubuntu.com/community/RenameUSBDrive

    Hope it helps!

    Russo
    Macbook Pro C2D
    Ubuntu 8.04

  3. #3
    Join Date
    Aug 2006
    Location
    Rexburg, ID
    Beans
    342
    Distro
    Hardy Heron (Ubuntu Development)

    Re: Prevent a Partition from Mounting on Ext. HDD?

    Thanks very much. The renaming part helped out a lot.

    I'm still trying to figure out how NOT to mount the first partition of my Ext. HDD when I plug it in via USB. It's not in the fstab file to edit.

  4. #4
    Join Date
    Jul 2005
    Beans
    38

    Re: Prevent a Partition from Mounting on Ext. HDD?

    I know this is a quite old thread, but I was searching on google for the same problem and this is one of the first results.. so i think this is a good place to share a solution that i've just found... (maybe it's not useful anymore for SendDerek but could be useful for others!)

    1. plug your ext drive and check the UUID and the type of the partition that you don't want to be automatically mounted (/dev/sdb2 in this example)
      Code:
      $ sudo blkid
      /dev/sda1: UUID="699a99b8-aab2-4701-a0f4-bb0fd9ec6dc9" TYPE="ext4" 
      /dev/sda2: LABEL="swap" UUID="b6740a9a-f897-4f25-a73e-b1d12f0af64e" TYPE="swap" 
      /dev/sda3: UUID="f51a03d8-da8a-4e09-b793-1d15eed69da5" TYPE="ext4" 
      /dev/sdb1: LABEL="'M-]hM-(^X" UUID="2BC7-51A4" TYPE="vfat" 
      /dev/sdb2: UUID="57f8f4bc-abf4-0000-675f-946fc0f9f25b" TYPE="ext4"
    2. edit /etc/fstab (sudo gedit /etc/fstab) and append this at the end of the file. Replace the UUID and the TYPE according to the value you got in previous step.
      Code:
      # Prevent mounting specific partition on external hd
      UUID=57f8f4bc-abf4-0000-675f-946fc0f9f25b none ext4 ro,noauto
    3. reboot
    4. enjoy

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •