Posts Tagged ‘partition’

get the UUID of a partition

July 30, 2015 2 comments

You want to figure out the UUID of a partition. For instance, you want to mount a partition upon boot and thus you want to add it to your /etc/fstab.


$ sudo blkid

The blkid program … can determine the type of content (e.g. filesystem or swap) that a block device holds, and also the attributes (tokens, NAME=value pairs) from the content metadata (e.g. LABEL or UUID fields).” (source: man)

Update (20150803)
As msx pointed out in the comments, you can also write “lsblk -f“, which doesn’t require sudo rights at all.


Categories: bash Tags: , , ,

Ext4 file system is mounted as read-only

On my external HDD I created a new ext4 partition. When I mounted it, it was in read-only mode. What’s going on?


sudo chown -R username:username /place-to-mount

Ref.: ubuntu forum

Categories: ubuntu Tags: , , , ,

Create a new partition from an NTFS partition

February 13, 2011 Leave a comment


On my laptops, I ran out of space under Ubuntu; the root partitions got full. The two cases were a bit different:

  1. On the first machine, I had a large NTFS partition where I stored multimedia stuff (movies, MP3s).
  2. On the second machine I had an NTFS partition with Windows 7 on it.

Before you read on, I want to warn you that resizing partitions may lead to complete data loss. It’s always a good idea to make some backups before doing anything risky. I take no responsibility if something goes wrong!

Goal: I wanted to cut off a piece from the end of the NTFS partition and create a new ext3 (or ext4) partition. For this, we need to resize the NTFS partition.

Let’s see the two cases:

  1. Resizing an NTFS partition with no Windows on it. Use Defraggler to defrag the partition. If everything goes well, the end of the partition will be empty. If this is not the case, run Defraggler once again. You can also run Windows’ own defrag utility. If the end of the partition is free, you can use gparted to resize the partition.
  2. Resizing an NTFS partition with Windows on it. Follow the instructions of the first step concerning the defragmentation. However, it can happen that you will have lots of free space at the end, but at the very end you’ll have some unmovable blocks, e.g. page file. Windows’ Disk Management can also shrink a partition, but in my case it didn’t work, I guess because of these unmovable elements. So I took the risk and resized the partition under Ubuntu with gparted. After reboot, everything was OK.

After resizing, when you reboot Windows for the first time, be prepared that it will check your disks. It’s normal, Windows noticed that the NTFS partition changed, it’s just doing its job.

Categories: ubuntu, windows Tags: , , ,

Get more space on your root partition

February 13, 2011 Leave a comment


I ran out of space on my root partition. I removed lots of stuff, but it was just a temporary fix.


First, run Disk Usage Analyzer (under Applications -> Accessories) to see what occupies much disk space [more info here]. Try to remove the unnecessary things.

As I needed more free space on my root partition, here is what I did:

  • I had a large NTFS partition that I resized with gparted and cut off a 10 GB partition from its end. [more info here]
  • The newly created partition was formatted on ext3 and added to /etc/fstab. [more info here]
  • I ran Disk Usage Analyzer again to see what to move to the new partition. I moved the following directories and just left a symbolic link on the root partition:
    • /usr/share/doc (use cp -pr ... as root to copy the directory with permissions)
    • ~/.cache
    • ~/Dropbox
    • ~/.dropbox
    • ~/.dropbox-dist
    • ~/.dropbox-dist-new
    • ~/dwhelper
    • ~/.mozilla
    • ~/.netbeans
    • ~/.thumbnails
    • ~/.wine
    • etc.
Categories: ubuntu Tags: , ,

Open Disk Management in Windows 7

February 13, 2011 Leave a comment


You want to use Windows 7’s Disk Management utility to edit your partitions but you don’t find it. Where the hell is it?


Click on Start and in the search field type in the following: diskmgmt.msc, then press Enter. Disk Management will start.

Or, open a DOS shell and launch diskmgmt.msc.


Create a folder on your desktop called System, and place a shortcut on diskmgmt.msc in it. This way Disk Management will be easily accessible.