Tag Info

Hot answers tagged

8

fdisk -l can just list the filesystems it has the permission to read on. See my test with strace: user@host:~/test$ strace -e open /sbin/fdisk -l ... open("/proc/partitions", O_RDONLY) = 3 open("/dev/sda", O_RDONLY) = -1 EACCES (Permission denied) open("/dev/sda1", O_RDONLY) = -1 EACCES (Permission denied) open("/dev/sda2", ...


7

This is Debian Bug #631504 (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=631504). As is also mentioned there, the entry in fstab for /media/usb0 should not be there. It prevents Gnome from mounting the USB drive automatically and with the right permissions. This line (or lines, I had two of them, one for /media/usb0 and one for /media/usb1) should be ...


7

@chaos and @Braiam have provided good answers on why you aren't getting the behavior you are looking for from fdisk when running as a non-root user. The simple fact is that allowing regular users to read disks directly would allow bypassing file permissions by simply reading the disk data directly, which could be a major problem and certainly would make file ...


6

It is 'safe' to remove an external drive when it is unmounted. The reason it might not be safe simply if programs aren't using it is that the Linux kernel does write caching. Meaning that when a program has written to disk, that data might not physically be on the disk, it could still be in memory (unless the program uses fsync or fdatasync). Linux does ...


6

You can use rm to remove the folder on your external hard drive. The full Terminal command looks like this rm -r /Volumes/$drivename/$folder Replace $drivename with the name of your external hard drive. Replace $folder with the name of your folder. If you don't know the name of your external hard drive you can look it up with ls /Volumes


6

There is a vendor independent SAT (SCSI/ATA transfer) standard, but AFAIK this is not widely supported on (cheaper) bridges. There are several vendor specific ATA pass-through commands that you can select with smartctl with the -d option: -d TYPE, --device=TYPE Specify device type to one of: ata, scsi, sat[,N][+TYPE], usbcypress[,X], ...


6

SMART over USB is generally either not possible, or is done with (bridge) vendor-specific commands, so there's no one way to get things done. smartctl knows about a few specific bridge chips. Check the manpage for a list. This is horrible, but the only 100% reliable way to access SMART on a disk is to unplug it from the bridge and stick it on a proper host ...


5

After cycling around /sys for a while, I found this solution: # echo /sys/class/enclosure/*/*/device/block/sdaa /sys/class/enclosure/2:0:35:0/Slot 15/device/block/sdaa # echo 1 > '/sys/class/enclosure/2:0:35:0/Slot 15/locate' Or: # echo 1 > /sys/class/enclosure/*/*/device/block/sdaa/../../enclosure*/locate To blink all detected devices: ...


5

There is a special option in rsync: --remove-source-files This tells rsync to remove from the sending side the files (meaning non-directories) that are a part of the transfer and have been successfully duplicated on the receiving side. Note that you should only use this option on source files that ...


5

If your objective is to find out the device name of the external drive you just connected, the easiest ways is to run dmesg | tail -20 or so right after connecting it: $ dmesg | tail -20 [ 5610.869053] usb 2-1.4: New USB device strings: Mfr=10, Product=11, SerialNumber=5 [ 5610.869058] usb 2-1.4: Product: Iomega Select HDD [ 5610.869062] usb 2-1.4: ...


4

Most probably the filesystem of your external hard drive does not manage or accept change of permissions. If the filesystem were ext3, ext4, UFS, ZFS or any kind of Unix filesystem you will not have any kind of problems but I guess you are mounting an NTFS or even FAT32 disk. You can check it out with the 'mount' command.


4

What file system is on your external drive? Are you sure it supports concepts like owner, permissions and symbolic links? FAT32, for example, doesn't support these things, so you won't be able to use utilities like chmod, and Windows "shortcuts" are not the same as UNIX symlinks.


4

There isn't an appropriate value of -d. The problem is that you're using a SATA↔USB mass storage bridge, and USB mass storage doesn't have a standard way to request ATA/SATA SMART data. So instead the controller has either no way or some vendor-specific way to get the data. smartctl knows a few of these; examples include usbjmicron and usbsubplus. So, if ...


4

You need to comment out the DEVICESCAN line, and put in lines for individual devices. Mine, for example, looks like this: /dev/sda -d removable -n standby,8 -S on -o on -a \ -m root -M exec /usr/share/smartmontools/smartd-runner \ -r 194 -R 5 -R 183 -R 187 -s L/../../6/01 /dev/sdb -d removable -n standby,8 -S on -o on -a \ -m root ...


4

You can configure the power management with hdparm -B $value /dev/sdx Put that e.g. in /etc/init.d/boot.local Quoting the man page: A low value means aggressive power management and a high value means better performance. Possible settings range from values 1 through 127 (which permit spin-down), and values 128 through 254 (which do not permit ...


4

This is because super user or root has complete permissions to probe all devices while the users doesn't have such privileges by default. Whenever it tries it fails hence not listing the details. Some groups may have such privilege too which you can add yourself.


4

You need to run shred on the device, not on the mount point. Type mount and get the device name (e.g. /dev/sdb1, likely it will be /dev/sdXY where X is a letter and Y is a number), then unmount it (run umount /your/device) and run shred /your/device.


4

That's the problem with multi-user systems, especially if you have more than one of them. ;) There's no really nice way to do what you want. Approaches coming to mind would be having the same UID for your account on every machine you're using your external drive (actually not feasible, since most probably not all of the machines are under your control) ...


3

I think your next steps depend on how valuable the data on the drive is. If its fairly valuable, your next step should be to stop attempting recovery and instead contact a data recovery firm. Hopefully it's just the electronics on the PCB failing, in which case they ought to be able to do a full recovery relatively inexpensively. If you're not going to do ...


3

It looks like you either made a backup with a different user, or that the permissions now assigned to the drive are different. First you should note the result of: mount | grep USB500 (and probably extend your question with that) After that can mount the drive read only by doing: sudo mount -o remount,ro /media/dave/USB500 and get a listing of what is ...


3

There are several possible causes and things that you might do. The dmesg excerpt suggests a few things: The kernel tries several times to access the device. It seems that each time it does not finish for some reason. There are notices saying not ready after error recovery which indicate that the drive either failed to undergo filesystem checks (although ...


3

You could try an alternate approach, which is to recognize your device at the udev level and use /dev/mybook-partition in /etc/fstab. Put something like the following in /etc/udev/rules.d/dwilliams.rules: KERNEL=="sd*", PROGRAM=="/sbin/blkid %N", RESULT=="C252-9CA3", SYMLINK+="mybook-partition" The section on Auto mounting USB devices in the Arch wiki for ...


3

USB drives have a chipset that converts USB mass-storage-device commands to IDE or SATA commands, which the drive then receives. Cheap chipsets (which are the majority, I imagine) don't pass on commands correctly to the drive that aren't directly related to reading or writing data from the drive. You are kind of at the mercy of that hardware with USB ...


3

It is quite unusual to format a filesystem on a hard disk without a partition table. It appears that you did in fact, have a partition table before, and the partition started at sector 2048, which is the usual starting location for the first partition on a disk these days. If you run fdisk and use the u command to change its units to sectors, then create a ...


3

Whether you may encounter permission problems with external media depends on whether all your machines share the same password and group database (the username-UID and group-GID mappings). Ownership on an ext4 filesystem is stored as UID and GID numbers. A more appropriate but somewhat experimental filesystem you could try is UDF. It has the benefit of ...


3

If I'm moving data on the SAME drive but a different partition, shouldn't it be fast? I assumed the move would be a fat table change... No, because a FAT is part of a file system, and each partition contains one filesystem. So if you move data to a different filesystem, the operating system cannot simply rearrange things in a fat table -- there are two ...


2

Problem solved. It seemed partition table was corrupted. As psusi's comment: Then yes, you had a partition on the disk before starting at the usual location of sector 2048. Recreate the partition and everything should be fine. I didn't know how to re-create the partition. so I did this and problem solved (data are there and disk mounts again ...


2

Ae you sure you shouldn't be using /dev/sdb1 rather than /dev/sdb? (this should be a comment but although I've used Linux since about 1995, I've only just discovered this site!)


2

You could also write a udev-rule, which allows you to point what to do when disk connected: # cat /etc/udev/rules.d/99-usb-mount.rules SUBSYSTEM=="usb", ACTION=="add", ENV{ID_SERIAL_SHORT}=="XXXXXXXXXX", RUN+="/path/to/script1.sh" SUBSYSTEM=="usb", ACTION=="remove", ENV{ID_SERIAL_SHORT}=="XXXXXXXXXX", RUN+="/path/to/script2.sh" You can automate backup on ...


2

You have to unmount it before disconnecting it. Some interfaces will use the term "eject", which should do the same thing. How much damage is done if you disconnect without unmouting/ejecting depends on the filesystem, hardware, and caches in use. The effect is basically the same as losing power, which means most file systems are designed to recover from ...



Only top voted, non community-wiki answers of a minimum length are eligible