Index: uspace/srv/fs/fat/fat_fat.c
===================================================================
--- uspace/srv/fs/fat/fat_fat.c	(revision a429bfb82f5c0b6ebca3b56bcaafc3f798fbe01a)
+++ uspace/srv/fs/fat/fat_fat.c	(revision e17d9864c53f11ebc53e09dd580c296a05be77d4)
@@ -109,9 +109,12 @@
  * @param dev_handle	Device handle of the device with the file.
  * @param firstc	First cluster of the file.
+ * @param lastc		If non-NULL, output argument holding the
+ *			last cluster.
  *
  * @return		Number of blocks allocated to the file.
  */
 uint16_t 
-_fat_blcks_get(dev_handle_t dev_handle, fat_cluster_t firstc)
+_fat_blcks_get(dev_handle_t dev_handle, fat_cluster_t firstc,
+    fat_cluster_t *lastc)
 {
 	block_t *bb;
@@ -131,4 +134,6 @@
 	if (firstc == FAT_CLST_RES0) {
 		/* No space allocated to the file. */
+		if (lastc)
+			*lastc = firstc;
 		return 0;
 	}
@@ -139,4 +144,6 @@
 
 		assert(clst >= FAT_CLST_FIRST);
+		if (lastc)
+			*lastc = clst;		/* remember the last cluster */
 		fsec = (clst * sizeof(fat_cluster_t)) / bps;
 		fidx = clst % (bps / sizeof(fat_cluster_t));
@@ -149,4 +156,6 @@
 	}
 
+	if (lastc)
+		*lastc = clst;
 	return clusters * spc;
 }
@@ -325,4 +334,20 @@
 void fat_append_clusters(fat_node_t *nodep, fat_cluster_t mcl)
 {
+	block_t *bb;
+	fat_cluster_t lcl;
+	uint8_t fatcnt, fatno;
+
+	if (_fat_blcks_get(nodep->idx->dev_handle, nodep->firstc, &lcl) == 0) {
+		nodep->firstc = host2uint16_t_le(mcl);
+		nodep->dirty = true;		/* need to sync node */
+		return;
+	}
+
+	bb = block_get(nodep->idx->dev_handle, BS_BLOCK, BS_SIZE);
+	fatcnt = FAT_BS(bb)->fatcnt;
+	block_put(bb);
+
+	for (fatno = FAT1; fatno < fatcnt; fatno++)
+		fat_mark_cluster(nodep->idx->dev_handle, fatno, lcl, mcl);
 }
 
Index: uspace/srv/fs/fat/fat_fat.h
===================================================================
--- uspace/srv/fs/fat/fat_fat.h	(revision a429bfb82f5c0b6ebca3b56bcaafc3f798fbe01a)
+++ uspace/srv/fs/fat/fat_fat.h	(revision e17d9864c53f11ebc53e09dd580c296a05be77d4)
@@ -62,5 +62,5 @@
     
 extern struct block *_fat_block_get(dev_handle_t, fat_cluster_t, off_t);
-extern uint16_t _fat_blcks_get(dev_handle_t, fat_cluster_t);
+extern uint16_t _fat_blcks_get(dev_handle_t, fat_cluster_t, fat_cluster_t *);
 extern uint16_t fat_bps_get(dev_handle_t);
   
Index: uspace/srv/fs/fat/fat_ops.c
===================================================================
--- uspace/srv/fs/fat/fat_ops.c	(revision a429bfb82f5c0b6ebca3b56bcaafc3f798fbe01a)
+++ uspace/srv/fs/fat/fat_ops.c	(revision e17d9864c53f11ebc53e09dd580c296a05be77d4)
@@ -201,5 +201,5 @@
 		 */
 		nodep->size = bps * _fat_blcks_get(idxp->dev_handle,
-		    uint16_t_le2host(d->firstc));
+		    uint16_t_le2host(d->firstc), NULL);
 	} else {
 		nodep->type = FAT_FILE;
