Feeds:
Posts
Comments

Posts Tagged ‘partitions’

If you’ve attached an external hard drive for backing up your files, or created a new partition for storage, only to find you don’t have the permissions to use it, you’d be understandably frustrated. But it’s actually quite easy to remedy by simply running a command in the terminal in the form of:

sudo chown -R username:username /partition/mount-point

Note that the above isn’t the actual command you’ll be using, as you’ll need to replace each instance of username with your actual username, and also determine your mount-point, which is not the device name (eg: /dev/sdb1).

To find the mount-point, run mount in the terminal, and locate the line that corresponds to the drive or partition in question. If you have never named (or set the label for) it, it will probably look something like:

/dev/sdb1 on /media/bf9a2c45-491a-4778-9d76-47832fe38820

If you have set the label with something descriptive, it should like similar to:

/dev/sdb1 on /media/1Tb Pocket Drive

As you can see, your mount-point will look something like /media/bf9a2c45-491a-4778-9d76-47832fe38820 or /media/1Tb Pocket Drive, so all you need to do now is run a command like one of the following, replacing the relevant info with what is appropriate to you:

sudo chown -R billgates:billgates /media/bf9a2c45-491a-4778-9d76-47832fe38820

sudo chown -R billgates:billgates '/media/1Tb Pocket Drive'

Note that if your custom label contains spaces (e.g. 1Tb Pocket Drive) , you will need to enclose the entire mount-point path in single quotes, but won’t need them if it’s a single word or multiple words joined by hyphens or underscores.

That’s it – you should now be able to do whatever you want with the drive or partition in question, as you’re now the owner.

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

ption]

Advertisements

Read Full Post »

For an introduction to drives, partitions and folders in Ubuntu, check out Differences Between Hard Drives & Media Storage Devices in Ubuntu & Windows.

°ºÒθÓº°¤°ºÒθÓº°¤°ºÒθÓº°

The most visual and informative way to get info about your drives and media storage devices, like the path names and filesystems, is to install GParted. That is the same partition editor on the Ubuntu Live CD, and you can install it with sudo apt-get install gparted in the terminal. It will end up in System > Administration, and will either be called Partition Editor, GParted or Gnome Partition Editor.

To change devices, choose another from the dropdown menu in the top right. You can then right-click the partitions and choose Information to get more info.

Another way is to enter sudo fdisk -l in a terminal. It will give you info like so:

Disk /dev/sda: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2101e331
Device        Boot   Start      End       Blocks                Id      System
/dev/sda1    *             1     45762   367583233+     7     HPFS/NTFS
/dev/sda2            45763   90564   359872065        83    Linux
/dev/sda3            90565   91201    5116702+          5     Extended
/dev/sda5            90565   91201    5116671            82    Linux swap / Solaris

You can also have a look at everything that’s mounted via gedit /etc/mtab (or cat /etc/mtab if you want the output displayed in the terminal). It will give you something similar to:

/dev/sda2 / ext3 rw,relatime,errors=remount-ro 0 0
proc /proc proc rw 0 0
none /sys sysfs rw,noexec,nosuid,nodev 0 0
none /sys/fs/fuse/connections fusectl rw 0 0
none /sys/kernel/debug debugfs rw 0 0
none /sys/kernel/security securityfs rw 0 0
udev /dev tmpfs rw,mode=0755 0 0
none /dev/pts devpts rw,noexec,nosuid,gid=5,mode=0620 0 0
none /dev/shm tmpfs rw,nosuid,nodev 0 0
none /var/run tmpfs rw,nosuid,mode=0755 0 0
none /var/lock tmpfs rw,noexec,nosuid,nodev 0 0
none /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0
/dev/sda1 /media/Windows-XP-x64 fuseblk rw,nosuid,nodev,allow_other,blksize=4096 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0

Or you can use sudo blkid (or sudo blkid -c /dev/null) if you just want your drives and partitions listed:

/dev/sda1: UUID=”1D3688CD689CA81D” LABEL=”Windows Drive” TYPE=”ntfs”
/dev/sda2: UUID=”daf56d80-15b5-4314-9672-fd91d12a3bd6″ SEC_TYPE=”ext2″ TYPE=”ext3″
/dev/sda5: UUID=”241939b6-9c32-4cb8-b644-0455c4a5460f” TYPE=”swap”

If you’re just after the unique UUID of a partition, you can also use ls -l /dev/disk/by-uuid:

total 0
lrwxrwxrwx 1 root root 10 2009-12-18 11:10 1D3688CD689CA81D -> ../../sda1
lrwxrwxrwx 1 root root 10 2009-12-18 11:10 241939b6-9c32-4cb8-b644-0455c4a5460f -> ../../sda5
lrwxrwxrwx 1 root root 10 2009-12-18 11:10 daf56d80-15b5-4314-9672-fd91d12a3bd6 -> ../../sda2

You can also find out mount points and drive/partition usage info with df -h:

Filesystem Size Used Avail Use% Mounted on
/dev/sda2 338G 309G 12G 97% /
udev 2.0G 400K 2.0G 1% /dev
none 2.0G 1.7M 2.0G 1% /dev/shm
none 2.0G 216K 2.0G 1% /var/run
none 2.0G 0 2.0G 0% /var/lock
none 2.0G 0 2.0G 0% /lib/init/rw
/dev/sda1 351G 343G 8.4G 98% /media/Windows-XP-x64

Or if you want device paths, mount points and options, especially if you just want to find the device name and mount point of your CD/DVD drive, you can use mount|grep ^'/dev':

/dev/sda2 on / type ext3 (rw,relatime,errors=remount-ro)
/dev/sda1 on /media/Windows-XP-x64 type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/sr0 on /media/cdrom0 type iso9660 (ro,nosuid,nodev,user=ozzman)

As you can see, there are many ways to get technical info about your devices and partitions in Ubuntu. If you’d like to see what files and folders are taking up the most space, check out Filelight for disk usage analysis.

°ºÒθÓº°¤°ºÒθÓº°¤°ºÒθÓº°

How to Find the Block Device File Name of a Disc Drive

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »