2011年5月26日 星期四

Gnu Parted

parted /dev/sdb

print
rm XXX
mklabel gpt
mkpart primary 1MB 3TB
print
mkfs.ext4 /dev/sdb1
# Reduce Reserved Space from 5% to 1%
tune2fs -m 1 /dev/sdb1


Ubuntu, formatting a 3TB drive
http://amaras-tech.co.uk/article/158/Ubuntu,_formatting_a_3TB_drive

[wiki] GNU Parted
http://en.wikipedia.org/wiki/GNU_Parted

http://ftp.gnu.org/gnu/parted/
parted-2.4.tar.xz
http://ftp.gnu.org/gnu/parted/parted-2.4.tar.xz


Build error with my uclibc toolchain, while no issue with glibc toolchain.
  CC       canonicalize-lgpl.lo
canonicalize-lgpl.c:71:1: error: "__set_errno" redefined
In file included from canonicalize-lgpl.c:40:
/arm-linux-le-uclibc-gcc-4.3.3-2010.05/usr/include/errno.h:63:1: error: this is the location of the previous definition
make[8]: *** [canonicalize-lgpl.lo] Error 1

FIX:
diff --git a/apps-pool/parted-2.4/lib/canonicalize-lgpl.c b/apps-pool/parted-2.4/lib/canonicalize-lgpl.c
index 1574ec1..e058d8f 100644
--- a/apps-pool/parted-2.4/lib/canonicalize-lgpl.c
+++ b/apps-pool/parted-2.4/lib/canonicalize-lgpl.c
@@ -68,7 +68,9 @@
# define __getcwd(buf, max) getwd (buf)
# endif
# define __readlink readlink
+#ifndef __set_errno
# define __set_errno(e) errno = (e)
+#endif
# ifndef MAXSYMLINKS
# ifdef SYMLOOP_MAX
# define MAXSYMLINKS SYMLOOP_MAX