SEARCH

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

You are not logged in.

#1 2014-05-14 21:11:10

rmcellig
#! Die Hard
From: Ottawa, Canada
Registered: 2012-11-15
Posts: 624
Website

Deleting a mount point

I have an external USB drive that seems to be mounted in two places:

/media/mainserver (I want to delete this one)

/media/randy/mainserver (I want to keep this one)

I want to make sure I am doing this right. Thanks!


fstab:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda7 during installation
UUID=a4500c2b-97c4-4808-b9da-d192ca364890 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=15beb1f5-d8aa-463a-ada2-7a125f0839a6 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
UUID=6d6af89d-d4b5-4a1b-9411-2a38ef891a2b /media/randy/mainserver ext4 errors=remount-ro 0 1

blkid:

randy@crunch2000:~$ sudo blkid
[sudo] password for randy: 
/dev/sda6: UUID="a4500c2b-97c4-4808-b9da-d192ca364890" TYPE="ext4" LABEL="crunchbang" 
/dev/sda5: UUID="a52c7190-ecdd-462d-97be-882c1dbcd43c" TYPE="swap" 
/dev/sda7: UUID="4d8db7a5-1c59-4a35-86a3-0f506d694988" TYPE="ext4" LABEL="debian" 
/dev/sda8: UUID="a74b33e2-83a6-45f0-9006-ea1659ee3cc3" TYPE="ext4" LABEL="hd" 
/dev/sda9: UUID="6df16a1f-a4ec-4f56-b6b4-63be11a6cb98" TYPE="ext4" LABEL="manjaro_openbox" 
/dev/sda10: UUID="bb25a925-ec15-462b-91ce-62d4c1146550" TYPE="ext4" 
/dev/sdb1: LABEL="mma" UUID="4e3b7154-8f7a-4e41-a88c-216e9966dfbf" TYPE="ext4" 
/dev/sdc1: LABEL="mainserver" UUID="6d6af89d-d4b5-4a1b-9411-2a38ef891a2b" TYPE="ext4" 
/dev/sdd1: LABEL="music" UUID="ffc6e1ce-4a31-4cc9-b135-8ac9b2a66e9f" TYPE="ext4" 
randy@crunch2000:~$ sudo blkid
/dev/sda6: UUID="a4500c2b-97c4-4808-b9da-d192ca364890" TYPE="ext4" LABEL="crunchbang" 
/dev/sda5: UUID="a52c7190-ecdd-462d-97be-882c1dbcd43c" TYPE="swap" 
/dev/sda7: UUID="4d8db7a5-1c59-4a35-86a3-0f506d694988" TYPE="ext4" LABEL="debian" 
/dev/sda8: UUID="a74b33e2-83a6-45f0-9006-ea1659ee3cc3" TYPE="ext4" LABEL="hd" 
/dev/sda9: UUID="6df16a1f-a4ec-4f56-b6b4-63be11a6cb98" TYPE="ext4" LABEL="manjaro_openbox" 
/dev/sda10: UUID="bb25a925-ec15-462b-91ce-62d4c1146550" TYPE="ext4" 
/dev/sdb1: LABEL="mma" UUID="4e3b7154-8f7a-4e41-a88c-216e9966dfbf" TYPE="ext4" 
/dev/sdc1: LABEL="mainserver" UUID="6d6af89d-d4b5-4a1b-9411-2a38ef891a2b" TYPE="ext4" 
/dev/sdd1: LABEL="music" UUID="ffc6e1ce-4a31-4cc9-b135-8ac9b2a66e9f" TYPE="ext4" 
randy@crunch2000:~$ 

Cheers Randy
www.mcran.com - my web site
www.chuo.fm - My radio show Sundays  noon-2pm EST or 89.1 fM

Offline

Be excellent to each other!

#2 2014-05-14 21:27:05

ratcheer
#! Junkie
From: central Alabama
Registered: 2013-07-23
Posts: 338

Re: Deleting a mount point

cd to any directory that is not under the mount point. umount the filesystem. Then, delete the mount point directory.

However, if some automated process is doing this, it might come back.

Tim

Offline

#3 2014-05-14 21:37:00

rmcellig
#! Die Hard
From: Ottawa, Canada
Registered: 2012-11-15
Posts: 624
Website

Re: Deleting a mount point

Thanks ratcheer. What I did was comment out the entry I had in my fstab file. Now it mounts to /media/mainserver when I restart the machine. I have several rsync entries that point to /media/randy/mainserver. I guess I can change them to /media/mainserver instead.

I don't think I have anything pointing to /media/mainserver, but I can live with redoing the rsync destinations if need be. I'll keep playing around with it as well as this is one of my laptops that I use for learning linux. Pretty fun actually smile

When I look at my fstab file, I don't see an entry for /media/mainserver

If I decide to delete the /media/mainserver mount point, I think I will have to do it recursively because there are directories and sub-directories in that mountpoint.


Cheers Randy
www.mcran.com - my web site
www.chuo.fm - My radio show Sundays  noon-2pm EST or 89.1 fM

Offline

#4 2014-05-15 05:53:46

WuFu
#! Member
Registered: 2013-05-20
Posts: 96

Re: Deleting a mount point

Are you sure it's getting mounted twice? I never saw that kind of thing as possible. Can you post the output of "mount" and then "cd" into /media and post the output of "ls -lha"? I think /media/mainserver may be a symlink.

Offline

#5 2014-05-15 10:38:52

rmcellig
#! Die Hard
From: Ottawa, Canada
Registered: 2012-11-15
Posts: 624
Website

Re: Deleting a mount point

randy@crunch2000:/media$ ls -lha
total 28K
drwxr-xr-x  7 root root 4.0K May 14 17:27 .
drwxr-xr-x 25 root root 4.0K Apr  8 12:22 ..
lrwxrwxrwx  1 root root    6 Jan  8 18:51 cdrom -> cdrom0
drwxr-xr-x  2 root root 4.0K Jan  8 18:51 cdrom0
drwxr-xr-x  3 root root 4.0K May 14 12:20 mainserver
drwxrwxrwx 11 root root 4.0K May 14 18:41 mainserver_
drwxrwxrwt  2 root root 4.0K Feb  8 16:21 nomachine
drwxr-xr-x  3 root root 4.0K May 12 07:26 randy
randy@crunch2000:/media$ 
randy@crunch2000:/media$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=217353,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=298464k,mode=755)
/dev/disk/by-uuid/a4500c2b-97c4-4808-b9da-d192ca364890 on / type ext4 (rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=596920k)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
gvfs-fuse-daemon on /home/randy/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
/dev/sdd1 on /media/mainserver_ type ext4 (rw,nosuid,nodev,relatime,user_xattr,barrier=1,data=ordered,uhelper=udisks)
gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,relatime,user_id=0,group_id=0)
randy@crunch2000:/media$

Last edited by rmcellig (2014-05-15 10:39:38)


Cheers Randy
www.mcran.com - my web site
www.chuo.fm - My radio show Sundays  noon-2pm EST or 89.1 fM

Offline

#6 2014-05-15 13:53:00

WuFu
#! Member
Registered: 2013-05-20
Posts: 96

Re: Deleting a mount point

Did you change your /etc/fstab or unmount the partition since you did that? I do not see /dev/sdc1 mounted anywhere on your last post. The only thing I can get from that is that /media/mainserver is not a symlink.

EDIT: Sorry, seems that yesterday I was too sleepy or distracted and completely misread everything. You commented the fstab entry and we're talking about and external USB drive. That being the case, /media/mainserver would be the default mainpoint for the automatic mounting of new drives, but I thought the automounting would give priority to /etc/fstab entries and only mount the drive there. I'll give it a try later, and sorry for misrading and misleading you smile

Last edited by WuFu (2014-05-15 13:56:37)

Offline

#7 2014-05-15 15:44:29

rmcellig
#! Die Hard
From: Ottawa, Canada
Registered: 2012-11-15
Posts: 624
Website

Re: Deleting a mount point

Hi Wufu!

No problem at all because sometimes I'm in your situation. Half asleep trying to get through something in Crunchbang and totally screwing things up. I love it! smile

I realize that I have a problem with my mount point. The fun lies in how you deal with the issue and learning from it. Let me know what you come up with.

I also want to mention that I have several rsync entries in cron that sync my lps folder with the lps folder on the mainserver usb drive.

Here is an example of one of them:

rsync -a  /media/masterlps/lps/C/ randy@192.168.2.13:/media/mainserver_/lps/C

Cheers Randy
www.mcran.com - my web site
www.chuo.fm - My radio show Sundays  noon-2pm EST or 89.1 fM

Offline

#8 2014-05-16 21:45:46

WuFu
#! Member
Registered: 2013-05-20
Posts: 96

Re: Deleting a mount point

The test results are here already, Sir! smile

I modified my /etc/fstab to add the UUID of an external drive. The final line ended up like this

UUID=851d5640-fa94-42c7-b0a4-45d0bb077b4b /media/test1/testmountpoint ext4 user 0 0

As soon as I connect the USB drive, the partition gets mounted in the mountpoint specified in /etc/fstab and nowhere else.

$ ls -lha /media
total 20K
drwxr-xr-x  5 root root 4.0K May 16 23:33 .
drwxr-xr-x 24 root root 4.0K May 16 23:18 ..
drwxr-xr-x  2 root root 4.0K Feb  9 04:11 cdrom
drwxr-xr-x  3 root root 4.0K May 16 23:33 test1
lrwxrwxrwx  1 root root    4 Feb  9 04:07 usb -> usb0
drwxr-xr-x  2 root root 4.0K Feb  9 04:07 usb0

$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=215155,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=373832k,mode=755)
/dev/disk/by-uuid/dd0899f2-4124-4db5-9413-53e04eadf259 on / type ext4 (rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=2258460k)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
gvfs-fuse-daemon on /home/wf/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
/dev/sdb1 on /media/test1/testmountpoint type ext4 (rw,nosuid,nodev,noexec,relatime,user_xattr,barrier=1,data=ordered,user=wf)

/media/test1/testmountpoint was owned by root when I created it, but I haven't tried if it matters. The only important thing is having the "user" option in your mountoptions section of /etc/fstab. Your line, based on your /etc/fstab, would look like this

UUID=6d6af89d-d4b5-4a1b-9411-2a38ef891a2b /media/randy/mainserver ext4 errors=remount-ro,user 0 1

EDIT: Forgot to edit your line hmm

Last edited by WuFu (2014-05-16 21:47:14)

Offline

#9 2014-05-16 22:53:05

rmcellig
#! Die Hard
From: Ottawa, Canada
Registered: 2012-11-15
Posts: 624
Website

Re: Deleting a mount point

Hey thanks for that post!! Really appreciate it!! Now I will give it a go and see what happens. smile


Cheers Randy
www.mcran.com - my web site
www.chuo.fm - My radio show Sundays  noon-2pm EST or 89.1 fM

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.
Server: acrobat

Debian Logo