Find the answer to your Linux question:
Results 1 to 4 of 4
I wanted to securely delete all files from my usb device, so I did: # srm -d -r -v /media/usbdisk/.* /media/usbdisk/* I discovered that it also deleted everything in /media ...
  1. #1
    Just Joined!
    Join Date
    Dec 2007
    Posts
    4

    Help auto mounting cdrom in GNOME

    I wanted to securely delete all files from my usb device, so I did:

    # srm -d -r -v /media/usbdisk/.* /media/usbdisk/*

    I discovered that it also deleted everything in /media
    I know stupid of me to be root. However, my problem was to get my cdrom working again. So after a while, I "fixed" it. Then I discovered that Gnome no longer is able to view my cdrom. After experimenting, I discovered that the user valerij (myself) is unable to view it however:

    $ groups
    valerij dialout cdrom floppy audio video plugdev netdev powerdev

    $ mount
    /dev/hda on /media/cdrom0 type iso9660 (ro,noexec,nosuid,nodev,user=valerij)

    $ umount /media/cdrom0

    $ mount /media/cdrom0
    mount mount: block device /dev/hda is write-protected, mounting read-only

    $ mount
    /dev/hda on /media/cdrom0 type iso9660 (ro,noexec,nosuid,nodev,user=valerij)

    $ cd /cdrom
    bash: cd: /cdrom: Permission denied

    $ cd /media/cdrom
    bash: cd: /media/cdrom: Permission denied

    $ cd /media/cdrom0
    bash: cd: /media/cdrom0: Permission denied

    # cd /media/cdrom

    # ls
    ??? Alexi Laiho - Special Guitar Lecture.avi Ozzy Osbourne
    ???? ?????????? - ??????.avi Queen - The Show Must Go On.mpg
    ?????? LOTR Scorpions
    ??????? Metallica Shitparad___gruppa_Kuvalda.avi
    ???????? ?????? M+M_Video.wmv Sting - Shape of my heart.mpg
    ???????? ????????? ?????? ?????? - ??????? ?????.mpg Within Temptation
    ????????? 13.avi ?????? ''??????''.mpg
    ???? (?????????-?????? 5-0).avi Nightwish

    # ls /media/ -h -l -a
    total 18K
    drwx------ 5 root root 4.0K 2007-12-24 23:40 .
    drwxr-xr-x 22 root root 4.0K 2007-12-24 23:40 ..
    lrwxrwxrwx 1 root root 7 2007-12-24 23:40 cdrom -> cdrom0/
    dr-xr-xr-x 1 root root 2.0K 2007-05-29 22:42 cdrom0
    drwxr-xr-x 2 root root 4.0K 2007-12-24 23:33 Debian 4.0 r0 i386 Bin-1
    ---xr-s--T 1 root root 0 2007-12-24 22:00 .hal-mtab-lock
    drwxr-xr-x 2 root root 4.0K 2007-12-24 00:55 usbdisk

    # ls / -h -l -a
    total 104K
    drwxr-xr-x 22 root root 4.0K 2007-12-24 23:40 .
    drwxr-xr-x 22 root root 4.0K 2007-12-24 23:40 ..
    drwxr-xr-x 2 root root 4.0K 2007-12-20 01:47 bin
    drwxr-xr-x 3 root root 4.0K 2007-12-20 01:49 boot
    lrwxrwxrwx 1 root root 12 2007-12-24 23:40 cdrom -> /media/cdrom
    drwxr-xr-x 15 root root 4.3K 2007-12-24 23:44 dev
    drwxr-xr-x 125 root root 12K 2007-12-24 23:57 etc
    drwxr-xr-x 3 root root 4.0K 2007-12-20 01:35 home
    drwxr-xr-x 2 root root 4.0K 2007-12-20 01:23 initrd
    lrwxrwxrwx 1 root root 28 2007-12-20 01:49 initrd.img -> boot/initrd.img-2.6.18-5-686
    lrwxrwxrwx 1 root root 28 2007-12-20 01:24 initrd.img.old -> boot/initrd.img- 2.6.18-4-686
    drwxr-xr-x 15 root root 12K 2007-12-20 01:47 lib
    drwx------ 2 root root 16K 2007-12-20 01:21 lost+found
    drwx------ 5 root root 4.0K 2007-12-24 23:40 media
    drwxr-xr-x 2 root root 4.0K 2006-10-28 17:06 mnt
    drwxr-xr-x 3 root root 4.0K 2007-12-20 22:12 opt
    dr-xr-xr-x 128 root root 0 2007-12-24 23:44 proc
    drwxr-xr-x 13 root root 4.0K 2007-12-24 23:50 root
    drwxr-xr-x 2 root root 4.0K 2007-12-20 01:47 sbin
    drwxr-xr-x 2 root root 4.0K 2007-03-08 00:56 selinux
    drwxr-xr-x 2 root root 4.0K 2007-12-20 01:23 srv
    drwxr-xr-x 11 root root 0 2007-12-24 23:44 sys
    drwxrwxrwt 12 root root 4.0K 2007-12-24 23:53 tmp
    drwxr-xr-x 12 root root 4.0K 2007-12-22 01:09 usr
    drwxr-xr-x 15 root root 4.0K 2007-12-24 01:57 var
    lrwxrwxrwx 1 root root 25 2007-12-20 01:49 vmlinuz -> boot/vmlinuz-2.6.18-5-686
    lrwxrwxrwx 1 root root 25 2007-12-20 01:24 vmlinuz.old -> boot/vmlinuz-2.6.18-4-686

    # cat /etc/fstab
    # /etc/fstab: static file system information.
    #
    # <file system> <mount point> <type> <options> <dump> <pass>
    proc /proc proc defaults 0 0
    /dev/sda3 / ext3 defaults,errors=remount-ro 0 1
    /dev/sda4 none swap sw 0 0
    /dev/hda /media/cdrom0 udf,iso9660 user,noauto 0 0

  2. #2
    Linux Newbie Tutku's Avatar
    Join Date
    Jul 2007
    Location
    Izmir / Turkey
    Posts
    167
    have you ever installed hal and dbus? these packages detect and automount your hardware like usb or dvd/cd

  3. #3
    Just Joined!
    Join Date
    Dec 2007
    Posts
    4
    You see, everything was working as it should be, until I wiped /media clean. Yes hal; and dbus are installed. The problem is that I do not know how to restore the /media folder to the original state (I have tried everything, and recreated the folders as stated in debian doc pages (as can be seen from my ls command)).

  4. #4
    Just Joined!
    Join Date
    Dec 2007
    Posts
    4
    Silly me. I have just noticed:

    drwx------ 5 root root 4.0K 2007-12-24 23:40 media

    How should I reset it?

    # chmod a+rwx /media

    or something less privileged?

    Thanks

Posting Permissions

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