diff --git a/sources/rb-removable-media-source.c b/sources/rb-removable-media-source.c
index d004fa3..cf895fe 100644
--- a/sources/rb-removable-media-source.c
+++ b/sources/rb-removable-media-source.c
@@ -316,6 +316,26 @@ _track_added_cb (RhythmDBEntry *entry, const char *uri, GError *error, struct _T
 	g_free (data->mimetype);
 	g_free (data);
 }
+/* from plugins/ipod/ipod-helpers.c */
+
+static guint64 get_fs_property (GFile *file, const char *attr)
+{
+        GFileInfo *info;
+        guint64 value;
+
+        info = g_file_query_filesystem_info (file, attr, NULL, NULL);
+        if (info == NULL) {
+                return 0;
+        }
+        if (!g_file_info_has_attribute (info, attr)) {
+                g_object_unref (G_OBJECT (info));
+                return 0;
+        }
+        value = g_file_info_get_attribute_uint64 (info, attr);
+        g_object_unref (G_OBJECT (info));
+
+        return value;
+}
 
 static void
 impl_paste (RBSource *source, GList *entries)
@@ -327,6 +347,35 @@ impl_paste (RBSource *source, GList *entries)
 	RBEncoder *encoder;
 
 	g_object_get (source, "shell", &shell, NULL);
+
+	/* Check remaining space on the destination device */
+	guint64 size = 0;
+	for (l = entries; l != NULL; l = l->next){
+		RhythmDBEntry *entry;
+		RhythmDBEntryType entry_type;		
+		entry = (RhythmDBEntry *)l->data;
+		entry_type = rhythmdb_entry_get_entry_type (entry);
+		
+		if (entry_type->category == RHYTHMDB_ENTRY_NORMAL)
+			size+= rhythmdb_entry_get_uint64 (entry, RHYTHMDB_PROP_FILE_SIZE);
+
+		g_boxed_free (RHYTHMDB_TYPE_ENTRY_TYPE, entry_type);
+	};
+	RBRemovableMediaSourcePrivate *priv;
+	priv = REMOVABLE_MEDIA_SOURCE_GET_PRIVATE(source);
+	GFile * root = g_mount_get_root(priv->mount);
+	guint64 dest_size = get_fs_property (root, G_FILE_ATTRIBUTE_FILESYSTEM_FREE);
+	g_object_unref(root);
+	
+	if (size > dest_size){
+		char * mount_name = g_mount_get_name(priv->mount);
+		rb_error_dialog (NULL, _("Error transferring tracks"), _("Not enough space in %s"), mount_name);
+		g_free(mount_name);
+		g_object_unref(root);
+		return;
+	}
+
+
 	g_object_get (shell,
 		      "removable-media-manager", &rm_mgr,
 		      NULL);
